From 87dc82a4ac45fe580cf52d180b86aa9b3024e951 Mon Sep 17 00:00:00 2001 From: webchick <webchick@24967.no-reply.drupal.org> Date: Wed, 27 Jun 2012 13:43:49 -0700 Subject: [PATCH] Issue #1424924 by Rob Loach: Added Use Composer for updating Symfony components (without removing Symfony code from repo). --- core/composer.json | 13 + core/composer.lock | 45 + core/includes/bootstrap.inc | 18 +- core/vendor/.gitignore | 3 + .../Component/HttpFoundation/ServerBag.php | 48 - .../Handler/MemcacheSessionHandler.php | 142 --- .../Handler/MemcachedSessionHandler.php | 130 --- .../Handler/NativeFileSessionHandler.php | 41 - .../Handler/NativeMemcacheSessionHandler.php | 68 -- .../Handler/NativeMemcachedSessionHandler.php | 67 -- .../Handler/NativeRedisSessionHandler.php | 43 - .../Storage/Handler/NativeSessionHandler.php | 24 - .../Handler/NativeSqliteSessionHandler.php | 58 - .../HttpFoundation/Tests/ServerBagTest.php | 52 - .../Handler/MemcacheSessionHandlerTest.php | 126 -- .../Handler/MemcachedSessionHandlerTest.php | 87 -- .../Handler/NativeFileSessionHandlerTest.php | 49 - .../NativeMemcacheSessionHandlerTest.php | 45 - .../NativeMemcachedSessionHandlerTest.php | 49 - .../Handler/NativeRedisSessionHandlerTest.php | 43 - .../NativeSqliteSessionHandlerTest.php | 47 - .../Profiler/MemcacheProfilerStorageTest.php | 67 -- .../Component/HttpKernel/Tests/bootstrap.php | 37 - .../Component/Routing/Tests/bootstrap.php | 35 - core/vendor/autoload.php | 25 + core/vendor/composer/ClassLoader.php | 205 ++++ core/vendor/composer/autoload_classmap.php | 9 + core/vendor/composer/autoload_namespaces.php | 17 + core/vendor/composer/installed.json | 402 +++++++ .../Symfony/Component/ClassLoader/.gitignore | 2 + .../Component/ClassLoader/ApcClassLoader.php | 5 +- .../ClassLoader/ApcUniversalClassLoader.php | 2 + .../Component/ClassLoader/CHANGELOG.md | 15 + .../ClassLoader/ClassCollectionLoader.php | 5 +- .../Component/ClassLoader/ClassLoader.php | 26 +- .../ClassLoader/ClassMapGenerator.php | 2 +- .../ClassLoader/DebugClassLoader.php | 1 + .../ClassLoader/DebugUniversalClassLoader.php | 0 .../Symfony/Component/ClassLoader/LICENSE | 0 .../Component/ClassLoader/MapClassLoader.php | 0 .../Symfony/Component/ClassLoader/README.md | 7 +- .../Tests/ApcUniversalClassLoaderTest.php | 0 .../Tests/ClassCollectionLoaderTest.php | 2 +- .../ClassLoader/Tests/ClassLoaderTest.php | 0 .../Tests/ClassMapGeneratorTest.php | 0 .../Tests/Fixtures/Apc/Namespaced/Bar.php | 0 .../Tests/Fixtures/Apc/Namespaced/Baz.php | 0 .../Tests/Fixtures/Apc/Namespaced/Foo.php | 0 .../Tests/Fixtures/Apc/Namespaced/FooBar.php | 0 .../Tests/Fixtures/Apc/Pearlike/Bar.php | 0 .../Tests/Fixtures/Apc/Pearlike/Baz.php | 0 .../Tests/Fixtures/Apc/Pearlike/Foo.php | 0 .../alpha/Apc/ApcPrefixCollision/A/Bar.php | 0 .../alpha/Apc/ApcPrefixCollision/A/Foo.php | 0 .../alpha/Apc/NamespaceCollision/A/Bar.php | 0 .../alpha/Apc/NamespaceCollision/A/Foo.php | 0 .../beta/Apc/ApcPrefixCollision/A/B/Bar.php | 0 .../beta/Apc/ApcPrefixCollision/A/B/Foo.php | 0 .../beta/Apc/NamespaceCollision/A/B/Bar.php | 0 .../beta/Apc/NamespaceCollision/A/B/Foo.php | 0 .../Apc/fallback/Apc/Pearlike/FooBar.php | 0 .../Apc/fallback/Namespaced/FooBar.php | 0 .../Tests/Fixtures/Namespaced/Bar.php | 0 .../Tests/Fixtures/Namespaced/Baz.php | 0 .../Tests/Fixtures/Namespaced/Foo.php | 0 .../Tests/Fixtures/Namespaced2/Bar.php | 0 .../Tests/Fixtures/Namespaced2/Baz.php | 0 .../Tests/Fixtures/Namespaced2/Foo.php | 0 .../Tests/Fixtures/Pearlike/Bar.php | 0 .../Tests/Fixtures/Pearlike/Baz.php | 0 .../Tests/Fixtures/Pearlike/Foo.php | 0 .../Tests/Fixtures/Pearlike2/Bar.php | 0 .../Tests/Fixtures/Pearlike2/Baz.php | 0 .../Tests/Fixtures/Pearlike2/Foo.php | 0 .../alpha/NamespaceCollision/A/Bar.php | 0 .../alpha/NamespaceCollision/A/Foo.php | 0 .../alpha/NamespaceCollision/C/Bar.php | 0 .../alpha/NamespaceCollision/C/Foo.php | 0 .../Fixtures/alpha/PrefixCollision/A/Bar.php | 0 .../Fixtures/alpha/PrefixCollision/A/Foo.php | 0 .../Fixtures/alpha/PrefixCollision/C/Bar.php | 0 .../Fixtures/alpha/PrefixCollision/C/Foo.php | 0 .../beta/NamespaceCollision/A/B/Bar.php | 0 .../beta/NamespaceCollision/A/B/Foo.php | 0 .../beta/NamespaceCollision/C/B/Bar.php | 0 .../beta/NamespaceCollision/C/B/Foo.php | 0 .../Fixtures/beta/PrefixCollision/A/B/Bar.php | 0 .../Fixtures/beta/PrefixCollision/A/B/Foo.php | 0 .../Fixtures/beta/PrefixCollision/C/B/Bar.php | 0 .../Fixtures/beta/PrefixCollision/C/B/Foo.php | 0 .../Tests/Fixtures/classmap/SomeClass.php | 0 .../Tests/Fixtures/classmap/SomeInterface.php | 0 .../Tests/Fixtures/classmap/SomeParent.php | 0 .../Tests/Fixtures/classmap/multipleNs.php | 0 .../Tests/Fixtures/classmap/notAClass.php | 0 .../Tests/Fixtures/classmap/notPhpFile.md | 0 .../classmap/sameNsMultipleClasses.php | 0 .../Fixtures/fallback/Namespaced/FooBar.php | 0 .../Fixtures/fallback/Namespaced2/FooBar.php | 0 .../Fixtures/fallback/Pearlike/FooBar.php | 0 .../Fixtures/fallback/Pearlike2/FooBar.php | 0 .../Tests/Fixtures/includepath/Foo.php | 0 .../Tests/UniversalClassLoaderTest.php | 0 .../Component/ClassLoader/Tests/bootstrap.php | 14 +- .../ClassLoader/UniversalClassLoader.php | 6 +- .../ClassLoader/XcacheClassLoader.php | 6 +- .../Component/ClassLoader/composer.json | 5 +- .../Component/ClassLoader/phpunit.xml.dist | 1 + .../Component/DependencyInjection/.gitignore | 2 + .../Component/DependencyInjection/Alias.php | 2 +- .../DependencyInjection/CHANGELOG.md | 12 + .../Compiler/AnalyzeServiceReferencesPass.php | 3 + .../Compiler/CheckCircularReferencesPass.php | 0 .../Compiler/CheckDefinitionValidityPass.php | 0 ...xceptionOnInvalidReferenceBehaviorPass.php | 0 .../Compiler/CheckReferenceValidityPass.php | 0 .../DependencyInjection/Compiler/Compiler.php | 0 .../Compiler/CompilerPassInterface.php | 0 .../Compiler/InlineServiceDefinitionsPass.php | 0 .../Compiler/LoggingFormatter.php | 0 .../MergeExtensionConfigurationPass.php | 0 .../Compiler/PassConfig.php | 2 +- .../RemoveAbstractDefinitionsPass.php | 0 .../Compiler/RemovePrivateAliasesPass.php | 0 .../Compiler/RemoveUnusedDefinitionsPass.php | 0 .../Compiler/RepeatablePassInterface.php | 0 .../Compiler/RepeatedPass.php | 0 .../ReplaceAliasByActualDefinitionPass.php | 8 +- .../ResolveDefinitionTemplatesPass.php | 0 .../Compiler/ResolveInvalidReferencesPass.php | 2 +- .../ResolveParameterPlaceHoldersPass.php | 0 .../ResolveReferencesToAliasesPass.php | 0 .../Compiler/ServiceReferenceGraph.php | 0 .../Compiler/ServiceReferenceGraphEdge.php | 2 +- .../Compiler/ServiceReferenceGraphNode.php | 4 +- .../DependencyInjection/Container.php | 16 +- .../DependencyInjection/ContainerAware.php | 2 +- .../ContainerAwareInterface.php | 0 .../DependencyInjection/ContainerBuilder.php | 30 +- .../ContainerInterface.php | 10 +- .../DependencyInjection/Definition.php | 34 +- .../DefinitionDecorator.php | 2 +- .../DependencyInjection/Dumper/Dumper.php | 0 .../Dumper/DumperInterface.php | 2 +- .../Dumper/GraphvizDumper.php | 8 +- .../DependencyInjection/Dumper/PhpDumper.php | 41 +- .../DependencyInjection/Dumper/XmlDumper.php | 10 +- .../DependencyInjection/Dumper/YamlDumper.php | 37 +- .../Exception/BadMethodCallException.php | 0 .../Exception/ExceptionInterface.php | 0 .../Exception/InactiveScopeException.php | 0 .../Exception/InvalidArgumentException.php | 0 .../Exception/LogicException.php | 0 .../Exception/OutOfBoundsException.php | 0 .../ParameterCircularReferenceException.php | 0 .../Exception/ParameterNotFoundException.php | 0 .../Exception/RuntimeException.php | 0 .../ScopeCrossingInjectionException.php | 0 .../ScopeWideningInjectionException.php | 0 .../ServiceCircularReferenceException.php | 0 .../Exception/ServiceNotFoundException.php | 0 .../ConfigurationExtensionInterface.php | 2 +- .../Extension/ExtensionInterface.php | 0 .../IntrospectableContainerInterface.php | 6 +- .../Component/DependencyInjection/LICENSE | 0 .../Loader/ClosureLoader.php | 4 +- .../DependencyInjection/Loader/FileLoader.php | 0 .../Loader/IniFileLoader.php | 4 +- .../Loader/PhpFileLoader.php | 0 .../Loader/XmlFileLoader.php | 56 +- .../Loader/YamlFileLoader.php | 8 +- .../schema/dic/services/services-1.0.xsd | 3 + .../DependencyInjection/Parameter.php | 0 .../ParameterBag/FrozenParameterBag.php | 0 .../ParameterBag/ParameterBag.php | 16 +- .../ParameterBag/ParameterBagInterface.php | 4 +- .../Component/DependencyInjection/README.md | 12 +- .../DependencyInjection/Reference.php | 0 .../Component/DependencyInjection/Scope.php | 0 .../DependencyInjection/ScopeInterface.php | 0 .../DependencyInjection/SimpleXMLElement.php | 0 .../TaggedContainerInterface.php | 0 .../AnalyzeServiceReferencesPassTest.php | 9 +- .../CheckCircularReferencesPassTest.php | 0 .../CheckDefinitionValidityPassTest.php | 0 ...tionOnInvalidReferenceBehaviorPassTest.php | 0 .../CheckReferenceValidityPassTest.php | 0 .../InlineServiceDefinitionsPassTest.php | 0 .../Tests/Compiler/IntegrationTest.php | 0 .../RemoveUnusedDefinitionsPassTest.php | 0 ...ReplaceAliasByActualDefinitionPassTest.php | 0 .../ResolveDefinitionTemplatesPassTest.php | 0 .../ResolveInvalidReferencesPassTest.php | 0 .../ResolveReferencesToAliasesPassTest.php | 0 .../Tests/ContainerBuilderTest.php | 0 .../Tests/ContainerTest.php | 0 .../Tests/CrossCheckTest.php | 0 .../Tests/DefinitionDecoratorTest.php | 0 .../Tests/DefinitionTest.php | 0 .../Tests/Dumper/GraphvizDumperTest.php | 0 .../Tests/Dumper/PhpDumperTest.php | 0 .../Tests/Dumper/XmlDumperTest.php | 0 .../Tests/Dumper/YamlDumperTest.php | 0 .../Tests/Fixtures/containers/container10.php | 0 .../Tests/Fixtures/containers/container11.php | 0 .../Tests/Fixtures/containers/container12.php | 0 .../Tests/Fixtures/containers/container8.php | 0 .../Tests/Fixtures/containers/container9.php | 0 .../Tests/Fixtures/containers/interfaces1.php | 0 .../Tests/Fixtures/containers/interfaces2.php | 0 .../Tests/Fixtures/graphviz/services1.dot | 0 .../Tests/Fixtures/graphviz/services10-1.dot | 0 .../Tests/Fixtures/graphviz/services10.dot | 0 .../Tests/Fixtures/graphviz/services9.dot | 0 .../Fixtures/includes/ProjectExtension.php | 0 .../includes/ProjectWithXsdExtension.php | 0 .../ProjectWithXsdExtensionInPhar.phar | 0 .../Tests/Fixtures/includes/classes.php | 0 .../Tests/Fixtures/includes/createphar.php | 0 .../Tests/Fixtures/includes/foo.php | 0 .../Fixtures/includes/schema/project-1.0.xsd | 0 .../Tests/Fixtures/ini/nonvalid.ini | 0 .../Tests/Fixtures/ini/parameters.ini | 0 .../Tests/Fixtures/ini/parameters1.ini | 0 .../Tests/Fixtures/ini/parameters2.ini | 0 .../Tests/Fixtures/php/services1.php | 0 .../Tests/Fixtures/php/services10.php | 0 .../Tests/Fixtures/php/services8.php | 0 .../Tests/Fixtures/php/services9.php | 1 + .../Tests/Fixtures/php/simple.php | 0 .../Fixtures/xml/extension1/services.xml | 0 .../Fixtures/xml/extension2/services.xml | 0 .../Fixtures/xml/extensions/services1.xml | 0 .../Fixtures/xml/extensions/services2.xml | 0 .../Fixtures/xml/extensions/services3.xml | 0 .../Fixtures/xml/extensions/services4.xml | 0 .../Fixtures/xml/extensions/services5.xml | 0 .../Fixtures/xml/extensions/services6.xml | 0 .../Fixtures/xml/extensions/services7.xml | 0 .../Tests/Fixtures/xml/nonvalid.xml | 0 .../Tests/Fixtures/xml/services1.xml | 0 .../Tests/Fixtures/xml/services13.xml | 0 .../Tests/Fixtures/xml/services2.xml | 0 .../Tests/Fixtures/xml/services3.xml | 0 .../Tests/Fixtures/xml/services4.xml | 0 .../Fixtures/xml/services4_bad_import.xml | 0 .../Tests/Fixtures/xml/services5.xml | 3 + .../Tests/Fixtures/xml/services6.xml | 0 .../Tests/Fixtures/xml/services7.xml | 0 .../Tests/Fixtures/xml/services8.xml | 0 .../Tests/Fixtures/xml/services9.xml | 0 .../Tests/Fixtures/yaml/badtag1.yml | 0 .../Tests/Fixtures/yaml/badtag2.yml | 0 .../Tests/Fixtures/yaml/badtag3.yml | 0 .../Tests/Fixtures/yaml/nonvalid1.yml | 0 .../Tests/Fixtures/yaml/nonvalid2.yml | 0 .../Tests/Fixtures/yaml/services1.yml | 0 .../Tests/Fixtures/yaml/services10.yml | 0 .../Tests/Fixtures/yaml/services11.yml | 0 .../Tests/Fixtures/yaml/services13.yml | 0 .../Tests/Fixtures/yaml/services2.yml | 0 .../Tests/Fixtures/yaml/services3.yml | 0 .../Tests/Fixtures/yaml/services4.yml | 0 .../Fixtures/yaml/services4_bad_import.yml | 0 .../Tests/Fixtures/yaml/services6.yml | 0 .../Tests/Fixtures/yaml/services7.yml | 0 .../Tests/Fixtures/yaml/services8.yml | 0 .../Tests/Fixtures/yaml/services9.yml | 4 +- .../Tests/Loader/ClosureLoaderTest.php | 3 +- .../Tests/Loader/IniFileLoaderTest.php | 0 .../Tests/Loader/PhpFileLoaderTest.php | 0 .../Tests/Loader/XmlFileLoaderTest.php | 13 +- .../Tests/Loader/YamlFileLoaderTest.php | 0 .../ParameterBag/FrozenParameterBagTest.php | 0 .../Tests/ParameterBag/ParameterBagTest.php | 13 + .../Tests/ParameterTest.php | 0 .../Tests/ReferenceTest.php | 0 .../DependencyInjection/Tests/bootstrap.php | 15 +- .../DependencyInjection/Variable.php | 0 .../DependencyInjection/composer.json | 6 +- .../DependencyInjection/phpunit.xml.dist | 1 + .../Component/EventDispatcher/.gitignore | 2 + .../Component/EventDispatcher/CHANGELOG.md | 16 + .../ContainerAwareEventDispatcher.php | 8 +- .../TraceableEventDispatcherInterface.php | 0 .../Component/EventDispatcher/Event.php | 0 .../EventDispatcher/EventDispatcher.php | 4 +- .../EventDispatcherInterface.php | 2 +- .../EventSubscriberInterface.php | 0 .../EventDispatcher/GenericEvent.php | 4 +- .../Symfony/Component/EventDispatcher/LICENSE | 0 .../Component/EventDispatcher/README.md | 8 +- .../ContainerAwareEventDispatcherTest.php | 3 +- .../Tests/EventDispatcherTest.php | 0 .../EventDispatcher/Tests/EventTest.php | 0 .../Tests/GenericEventTest.php | 0 .../Tests/UnmodifiableEventDispatcherTest.php | 106 ++ .../EventDispatcher/Tests/bootstrap.php | 15 +- .../UnmodifiableEventDispatcher.php | 92 ++ .../Component/EventDispatcher/composer.json | 5 +- .../EventDispatcher/phpunit.xml.dist | 1 + .../HttpFoundation/ApacheRequest.php | 0 .../Component/HttpFoundation/CHANGELOG.md | 73 ++ .../Component/HttpFoundation/Cookie.php | 14 +- .../File/Exception/AccessDeniedException.php | 4 +- .../File/Exception/FileException.php | 2 +- .../File/Exception/FileNotFoundException.php | 4 +- .../Exception/UnexpectedTypeException.php | 0 .../File/Exception/UploadException.php | 2 +- .../Component/HttpFoundation/File/File.php | 4 +- .../File/MimeType/ExtensionGuesser.php | 2 +- .../MimeType/ExtensionGuesserInterface.php | 2 +- .../MimeType/FileBinaryMimeTypeGuesser.php | 2 +- .../File/MimeType/FileinfoMimeTypeGuesser.php | 2 +- .../MimeType/MimeTypeExtensionGuesser.php | 0 .../File/MimeType/MimeTypeGuesser.php | 4 +- .../MimeType/MimeTypeGuesserInterface.php | 4 +- .../HttpFoundation/File/UploadedFile.php | 2 +- .../Component/HttpFoundation/FileBag.php | 4 +- .../Component/HttpFoundation/HeaderBag.php | 4 +- .../Component/HttpFoundation/JsonResponse.php | 16 +- .../Symfony/Component/HttpFoundation/LICENSE | 0 .../Component/HttpFoundation/ParameterBag.php | 10 +- .../Component/HttpFoundation/README.md | 2 +- .../HttpFoundation/RedirectResponse.php | 0 .../Component/HttpFoundation/Request.php | 37 +- .../HttpFoundation/RequestMatcher.php | 0 .../RequestMatcherInterface.php | 2 +- .../stubs/SessionHandlerInterface.php | 2 +- .../Component/HttpFoundation/Response.php | 34 +- .../HttpFoundation/ResponseHeaderBag.php | 0 .../Component/HttpFoundation/ServerBag.php | 82 ++ .../Session/Attribute/AttributeBag.php | 0 .../Attribute/AttributeBagInterface.php | 0 .../Attribute/NamespacedAttributeBag.php | 0 .../Session/Flash/AutoExpireFlashBag.php | 0 .../HttpFoundation/Session/Flash/FlashBag.php | 0 .../Session/Flash/FlashBagInterface.php | 2 +- .../HttpFoundation/Session/Session.php | 12 +- .../Session/SessionBagInterface.php | 0 .../Session/SessionInterface.php | 6 +- .../Storage/Handler/FileSessionHandler.php | 115 ++ .../Handler/MemcacheSessionHandler.php | 109 ++ .../Handler/MemcachedSessionHandler.php | 116 ++ .../Storage/Handler/MongoDbSessionHandler.php | 145 +++ .../Storage/Handler/NullSessionHandler.php | 2 +- .../Storage/Handler/PdoSessionHandler.php | 86 +- .../Session/Storage/MetadataBag.php | 0 .../Storage/MockArraySessionStorage.php | 2 +- .../Storage/MockFileSessionStorage.php | 54 +- .../Session/Storage/NativeSessionStorage.php | 4 +- .../Session/Storage/Proxy/AbstractProxy.php | 0 .../Session/Storage/Proxy/NativeProxy.php | 0 .../Storage/Proxy/SessionHandlerProxy.php | 0 .../Storage/SessionStorageInterface.php | 2 +- .../HttpFoundation/StreamedResponse.php | 0 .../Tests/ApacheRequestTest.php | 0 .../HttpFoundation/Tests/CookieTest.php | 0 .../HttpFoundation/Tests/File/FileTest.php | 0 .../Tests/File/Fixtures/.unknownextension | 0 .../Tests/File/Fixtures/directory/.empty | 0 .../HttpFoundation/Tests/File/Fixtures/test | Bin .../Tests/File/Fixtures/test.gif | 0 .../Tests/File/MimeType/MimeTypeTest.php | 4 +- .../Tests/File/UploadedFileTest.php | 0 .../HttpFoundation/Tests/FileBagTest.php | 16 +- .../HttpFoundation/Tests/HeaderBagTest.php | 0 .../HttpFoundation/Tests/JsonResponseTest.php | 7 + .../HttpFoundation/Tests/ParameterBagTest.php | 0 .../Tests/RedirectResponseTest.php | 0 .../Tests/RequestMatcherTest.php | 0 .../HttpFoundation/Tests/RequestTest.php | 4 +- .../Tests/ResponseHeaderBagTest.php | 0 .../HttpFoundation/Tests/ResponseTest.php | 10 +- .../HttpFoundation/Tests/ServerBagTest.php | 101 ++ .../Session/Attribute/AttributeBagTest.php | 0 .../Attribute/NamespacedAttributeBagTest.php | 0 .../Session/Flash/AutoExpireFlashBagTest.php | 0 .../Tests/Session/Flash/FlashBagTest.php | 0 .../Tests/Session/SessionTest.php | 15 + .../Handler/FileSessionHandlerTest.php | 106 ++ .../Handler/MemcacheSessionHandlerTest.php | 124 ++ .../Handler/MemcachedSessionHandlerTest.php | 119 ++ .../Handler/MongoDbSessionHandlerTest.php | 99 ++ .../Handler/NullSessionHandlerTest.php | 0 .../Storage/Handler/PdoSessionHandlerTest.php | 0 .../Tests/Session/Storage/MetadataBagTest.php | 0 .../Storage/MockArraySessionStorageTest.php | 0 .../Storage/MockFileSessionStorageTest.php | 16 +- .../Storage/NativeSessionStorageTest.php | 3 +- .../Storage/Proxy/AbstractProxyTest.php | 0 .../Session/Storage/Proxy/NativeProxyTest.php | 0 .../Storage/Proxy/SessionHandlerProxyTest.php | 0 .../Tests/StreamedResponseTest.php | 8 + .../HttpFoundation/Tests/bootstrap.php | 0 .../Component/HttpFoundation/composer.json | 2 +- .../Component/HttpFoundation/phpunit.xml.dist | 1 + .../Symfony/Component/HttpKernel/.gitignore | 2 + .../Component/HttpKernel/Bundle/Bundle.php | 0 .../HttpKernel/Bundle/BundleInterface.php | 4 +- .../Symfony/Component/HttpKernel/CHANGELOG.md | 19 + .../CacheClearer/CacheClearerInterface.php | 0 .../CacheClearer/ChainCacheClearer.php | 0 .../HttpKernel/CacheWarmer/CacheWarmer.php | 2 +- .../CacheWarmer/CacheWarmerAggregate.php | 0 .../CacheWarmer/CacheWarmerInterface.php | 0 .../CacheWarmer/WarmableInterface.php | 0 .../Symfony/Component/HttpKernel/Client.php | 2 +- .../HttpKernel/Config/FileLocator.php | 2 +- .../Controller/ControllerResolver.php | 6 +- .../ControllerResolverInterface.php | 0 .../DataCollector/ConfigDataCollector.php | 0 .../DataCollector/DataCollector.php | 1 - .../DataCollector/DataCollectorInterface.php | 1 - .../DataCollector/EventDataCollector.php | 0 .../DataCollector/ExceptionDataCollector.php | 0 .../DataCollector/LoggerDataCollector.php | 0 .../DataCollector/MemoryDataCollector.php | 0 .../DataCollector/RequestDataCollector.php | 14 + .../DataCollector/TimeDataCollector.php | 0 ...ContainerAwareTraceableEventDispatcher.php | 0 .../HttpKernel/Debug/ErrorHandler.php | 2 + .../HttpKernel/Debug/ExceptionHandler.php | 0 .../Component/HttpKernel/Debug/Stopwatch.php | 0 .../HttpKernel/Debug/StopwatchEvent.php | 4 +- .../AddClassesToCachePass.php | 0 .../ConfigurableExtension.php | 2 +- .../DependencyInjection/Extension.php | 0 .../MergeExtensionConfigurationPass.php | 0 .../Event/FilterControllerEvent.php | 2 +- .../HttpKernel/Event/FilterResponseEvent.php | 2 +- .../HttpKernel/Event/GetResponseEvent.php | 2 +- .../GetResponseForControllerResultEvent.php | 2 +- .../Event/GetResponseForExceptionEvent.php | 4 +- .../HttpKernel/Event/KernelEvent.php | 2 +- .../HttpKernel/Event/PostResponseEvent.php | 0 .../HttpKernel/EventListener/EsiListener.php | 0 .../EventListener/ExceptionListener.php | 0 .../EventListener/LocaleListener.php | 4 +- .../EventListener/ProfilerListener.php | 0 .../EventListener/ResponseListener.php | 0 .../EventListener/RouterListener.php | 20 +- .../StreamedResponseListener.php | 0 .../Exception/AccessDeniedHttpException.php | 0 .../HttpKernel/Exception/FlattenException.php | 0 .../HttpKernel/Exception/HttpException.php | 0 .../Exception/HttpExceptionInterface.php | 0 .../MethodNotAllowedHttpException.php | 8 +- .../Exception/NotFoundHttpException.php | 0 .../Component/HttpKernel/HttpCache/Esi.php | 0 .../HttpCache/EsiResponseCacheStrategy.php | 0 .../EsiResponseCacheStrategyInterface.php | 0 .../HttpKernel/HttpCache/HttpCache.php | 4 +- .../Component/HttpKernel/HttpCache/Store.php | 6 +- .../HttpKernel/HttpCache/StoreInterface.php | 0 .../Component/HttpKernel/HttpKernel.php | 12 +- .../HttpKernel/HttpKernelInterface.php | 6 +- .../Symfony/Component/HttpKernel/Kernel.php | 13 +- .../Component/HttpKernel/KernelEvents.php | 2 +- .../Component/HttpKernel/KernelInterface.php | 0 .../Symfony/Component/HttpKernel/LICENSE | 0 .../HttpKernel/Log/DebugLoggerInterface.php | 0 .../HttpKernel/Log/LoggerInterface.php | 0 .../Component/HttpKernel/Log/NullLogger.php | 0 .../Profiler/BaseMemcacheProfilerStorage.php | 35 +- .../Profiler/FileProfilerStorage.php | 0 .../Profiler/MemcacheProfilerStorage.php | 14 +- .../Profiler/MemcachedProfilerStorage.php | 14 +- .../Profiler/MongoDbProfilerStorage.php | 0 .../Profiler/MysqlProfilerStorage.php | 0 .../Profiler/PdoProfilerStorage.php | 27 +- .../Component/HttpKernel/Profiler/Profile.php | 0 .../HttpKernel/Profiler/Profiler.php | 0 .../Profiler/ProfilerStorageInterface.php | 0 .../Profiler/RedisProfilerStorage.php | 45 +- .../Profiler/SqliteProfilerStorage.php | 0 .../Symfony/Component/HttpKernel/README.md | 19 +- .../HttpKernel/TerminableInterface.php | 0 .../HttpKernel/Tests/Bundle/BundleTest.php | 4 + .../CacheClearer/ChainCacheClearerTest.php | 0 .../CacheWarmer/CacheWarmerAggregateTest.php | 0 .../Tests/CacheWarmer/CacheWarmerTest.php | 0 .../Component/HttpKernel/Tests/ClientTest.php | 0 .../Controller/ControllerResolverTest.php | 0 .../DataCollector/ConfigDataCollectorTest.php | 0 .../DataCollector/EventDataCollectorTest.php | 0 .../ExceptionDataCollectorTest.php | 0 .../DataCollector/LoggerDataCollectorTest.php | 0 .../DataCollector/MemoryDataCollectorTest.php | 0 .../RequestDataCollectorTest.php | 0 ...ainerAwareTraceableEventDispatcherTest.php | 0 .../Tests/Debug/ErrorHandlerTest.php | 0 .../Tests/Debug/ExceptionHandlerTest.php | 0 .../Tests/Debug/StopwatchEventTest.php | 0 .../HttpKernel/Tests/Debug/StopwatchTest.php | 0 .../MergeExtensionConfigurationPassTest.php | 0 .../Tests/EventListener/EsiListenerTest.php | 0 .../EventListener/ExceptionListenerTest.php | 4 +- .../EventListener/LocaleListenerTest.php | 0 .../EventListener/ResponseListenerTest.php | 0 .../EventListener/RouterListenerTest.php | 29 + .../Tests/Exception/FlattenExceptionTest.php | 0 .../Fixtures/BaseBundle/Resources/foo.txt | 0 .../Fixtures/BaseBundle/Resources/hide.txt | 0 .../Fixtures/Bundle1Bundle/Resources/foo.txt | 0 .../Tests/Fixtures/Bundle1Bundle/bar.txt | 0 .../Tests/Fixtures/Bundle1Bundle/foo.txt | 0 .../Tests/Fixtures/Bundle2Bundle/foo.txt | 0 .../Fixtures/ChildBundle/Resources/foo.txt | 0 .../Fixtures/ChildBundle/Resources/hide.txt | 0 .../ExtensionAbsentBundle.php | 0 .../ExtensionLoadedExtension.php | 0 .../ExtensionLoadedBundle.php | 0 .../Command/FooCommand.php | 0 .../ExtensionPresentExtension.php | 0 .../ExtensionPresentBundle.php | 0 .../Tests/Fixtures/FooBarBundle.php | 0 .../Tests/Fixtures/KernelForTest.php | 0 .../Fixtures/Resources/BaseBundle/hide.txt | 0 .../Fixtures/Resources/Bundle1Bundle/foo.txt | 0 .../Fixtures/Resources/ChildBundle/foo.txt | 0 .../Fixtures/Resources/FooBundle/foo.txt | 0 .../HttpKernel/Tests/Fixtures/TestClient.php | 2 +- .../Tests/Fixtures/TestEventDispatcher.php | 0 .../HttpKernel/Tests/HttpCache/EsiTest.php | 0 .../Tests/HttpCache/HttpCacheTest.php | 45 +- .../Tests/HttpCache/HttpCacheTestCase.php | 3 +- .../HttpKernel/Tests/HttpCache/StoreTest.php | 0 .../Tests/HttpCache/TestHttpKernel.php | 0 .../HttpCache/TestMultipleHttpKernel.php | 0 .../HttpKernel/Tests/HttpKernelTest.php | 12 +- .../Component/HttpKernel/Tests/KernelTest.php | 8 +- .../Component/HttpKernel/Tests/Logger.php | 0 .../Profiler/AbstractProfilerStorageTest.php | 0 .../Profiler/FileProfilerStorageTest.php | 0 .../Profiler/MemcacheProfilerStorageTest.php | 49 + .../Profiler/MemcachedProfilerStorageTest.php | 34 +- .../Tests/Profiler/Mock/MemcacheMock.php | 260 +++++ .../Tests/Profiler/Mock/MemcachedMock.php | 225 ++++ .../Tests/Profiler/Mock/RedisMock.php | 241 ++++ .../Profiler/MongoDbProfilerStorageTest.php | 2 +- .../Tests/Profiler/ProfilerTest.php | 0 .../Profiler/RedisProfilerStorageTest.php | 25 +- .../Profiler/SqliteProfilerStorageTest.php | 0 .../HttpKernel/Tests/TestHttpKernel.php | 0 .../Component/HttpKernel/Tests/bootstrap.php | 22 + .../Component/HttpKernel/composer.json | 16 +- .../Component/HttpKernel/phpunit.xml.dist | 2 +- .../Symfony/Component/Routing/.gitignore | 2 + .../Component/Routing/Annotation/Route.php | 0 .../Symfony/Component/Routing/CHANGELOG.md | 26 + .../Component/Routing/CompiledRoute.php | 0 .../Routing/Exception/ExceptionInterface.php | 0 .../Exception/InvalidParameterException.php | 0 .../Exception/MethodNotAllowedException.php | 0 .../MissingMandatoryParametersException.php | 0 .../Exception/ResourceNotFoundException.php | 0 .../Exception/RouteNotFoundException.php | 0 .../Generator/Dumper/GeneratorDumper.php | 3 + .../Dumper/GeneratorDumperInterface.php | 12 +- .../Generator/Dumper/PhpGeneratorDumper.php | 6 +- .../Routing/Generator/UrlGenerator.php | 54 +- .../Generator/UrlGeneratorInterface.php | 0 .../Symfony/Component/Routing/LICENSE | 0 .../Routing/Loader/AnnotationClassLoader.php | 20 +- .../Loader/AnnotationDirectoryLoader.php | 7 +- .../Routing/Loader/AnnotationFileLoader.php | 7 +- .../Routing/Loader/ClosureLoader.php | 7 +- .../Routing/Loader/PhpFileLoader.php | 7 +- .../Routing/Loader/XmlFileLoader.php | 11 +- .../Routing/Loader/YamlFileLoader.php | 9 +- .../Loader/schema/routing/routing-1.0.xsd | 0 .../Routing/Matcher/ApacheUrlMatcher.php | 0 .../Matcher/Dumper/ApacheMatcherDumper.php | 2 +- .../Routing/Matcher/Dumper/MatcherDumper.php | 4 +- .../Matcher/Dumper/MatcherDumperInterface.php | 14 +- .../Matcher/Dumper/PhpMatcherDumper.php | 8 +- .../Matcher/RedirectableUrlMatcher.php | 4 +- .../RedirectableUrlMatcherInterface.php | 6 +- .../Matcher/RequestMatcherInterface.php | 40 + .../Routing/Matcher/TraceableUrlMatcher.php | 0 .../Component/Routing/Matcher/UrlMatcher.php | 31 +- .../Routing/Matcher/UrlMatcherInterface.php | 2 +- .../Symfony/Component/Routing/README.md | 9 +- .../Component/Routing/RequestContext.php | 2 +- .../Routing/RequestContextAwareInterface.php | 0 .../Symfony/Component/Routing/Route.php | 10 +- .../Component/Routing/RouteCollection.php | 0 .../Component/Routing/RouteCompiler.php | 24 +- .../Routing/RouteCompilerInterface.php | 0 .../Symfony/Component/Routing/Router.php | 60 +- .../Component/Routing/RouterInterface.php | 0 .../Routing/Tests/Annotation/RouteTest.php | 0 .../Routing/Tests/CompiledRouteTest.php | 0 .../AnnotatedClasses/AbstractClass.php | 0 .../Fixtures/AnnotatedClasses/FooClass.php | 0 .../Tests/Fixtures/CustomXmlFileLoader.php | 0 .../Tests/Fixtures/RedirectableUrlMatcher.php | 0 .../Routing/Tests/Fixtures/annotated.php | 0 .../Tests/Fixtures/dumper/url_matcher1.apache | 22 +- .../Tests/Fixtures/dumper/url_matcher1.php | 50 +- .../Tests/Fixtures/dumper/url_matcher2.apache | 0 .../Tests/Fixtures/dumper/url_matcher2.php | 55 +- .../Tests/Fixtures/dumper/url_matcher3.php | 3 +- .../Routing/Tests/Fixtures/empty.yml | 0 .../Component/Routing/Tests/Fixtures/foo.xml | 0 .../Component/Routing/Tests/Fixtures/foo1.xml | 0 .../Routing/Tests/Fixtures/incomplete.yml | 0 .../Routing/Tests/Fixtures/nonvalid.xml | 0 .../Routing/Tests/Fixtures/nonvalid.yml | 0 .../Routing/Tests/Fixtures/nonvalidkeys.yml | 0 .../Routing/Tests/Fixtures/nonvalidnode.xml | 0 .../Routing/Tests/Fixtures/nonvalidroute.xml | 0 .../Routing/Tests/Fixtures/validpattern.php | 0 .../Routing/Tests/Fixtures/validpattern.xml | 0 .../Routing/Tests/Fixtures/validpattern.yml | 0 .../Routing/Tests/Fixtures/validresource.xml | 0 .../Routing/Tests/Fixtures/validresource.yml | 0 .../Dumper/PhpGeneratorDumperTest.php | 4 +- .../Tests/Generator/UrlGeneratorTest.php | 27 +- .../Loader/AbstractAnnotationLoaderTest.php | 0 .../Loader/AnnotationClassLoaderTest.php | 0 .../Loader/AnnotationDirectoryLoaderTest.php | 0 .../Tests/Loader/AnnotationFileLoaderTest.php | 0 .../Tests/Loader/ClosureLoaderTest.php | 3 +- .../Tests/Loader/PhpFileLoaderTest.php | 0 .../Tests/Loader/XmlFileLoaderTest.php | 0 .../Tests/Loader/YamlFileLoaderTest.php | 0 .../Tests/Matcher/ApacheUrlMatcherTest.php | 4 +- .../Dumper/ApacheMatcherDumperTest.php | 0 .../Matcher/Dumper/PhpMatcherDumperTest.php | 4 +- .../Matcher/RedirectableUrlMatcherTest.php | 0 .../Tests/Matcher/TraceableUrlMatcherTest.php | 0 .../Routing/Tests/Matcher/UrlMatcherTest.php | 45 +- .../Routing/Tests/RouteCollectionTest.php | 0 .../Routing/Tests/RouteCompilerTest.php | 55 +- .../Component/Routing/Tests/RouteTest.php | 0 .../Component/Routing/Tests/bootstrap.php | 22 + .../Symfony/Component/Routing/composer.json | 11 +- .../Component/Routing/phpunit.xml.dist | 2 +- .../yaml}/Symfony/Component/Yaml/CHANGELOG.md | 0 .../yaml}/Symfony/Component/Yaml/Dumper.php | 6 +- .../yaml}/Symfony/Component/Yaml/Escaper.php | 0 .../Yaml/Exception/DumpException.php | 0 .../Yaml/Exception/ExceptionInterface.php | 0 .../Yaml/Exception/ParseException.php | 0 .../yaml}/Symfony/Component/Yaml/Inline.php | 32 +- .../yaml}/Symfony/Component/Yaml/LICENSE | 0 .../yaml}/Symfony/Component/Yaml/Parser.php | 69 +- .../yaml}/Symfony/Component/Yaml/README.md | 0 .../Component/Yaml/Tests/DumperTest.php | 0 .../Yaml/Tests/Fixtures/YtsAnchorAlias.yml | 0 .../Yaml/Tests/Fixtures/YtsBasicTests.yml | 0 .../Yaml/Tests/Fixtures/YtsBlockMapping.yml | 0 .../Tests/Fixtures/YtsDocumentSeparator.yml | 0 .../Yaml/Tests/Fixtures/YtsErrorTests.yml | 0 .../Tests/Fixtures/YtsFlowCollections.yml | 0 .../Yaml/Tests/Fixtures/YtsFoldedScalars.yml | 0 .../Tests/Fixtures/YtsNullsAndEmpties.yml | 0 .../Fixtures/YtsSpecificationExamples.yml | 0 .../Yaml/Tests/Fixtures/YtsTypeTransfers.yml | 0 .../Yaml/Tests/Fixtures/escapedCharacters.yml | 0 .../Component/Yaml/Tests/Fixtures/index.yml | 1 + .../Yaml/Tests/Fixtures/sfComments.yml | 0 .../Yaml/Tests/Fixtures/sfCompact.yml | 0 .../Yaml/Tests/Fixtures/sfMergeKey.yml | 0 .../Yaml/Tests/Fixtures/sfObjects.yml | 0 .../Yaml/Tests/Fixtures/sfQuotes.yml | 0 .../Component/Yaml/Tests/Fixtures/sfTests.yml | 0 .../Tests/Fixtures/unindentedCollections.yml | 62 + .../Component/Yaml/Tests/InlineTest.php | 39 + .../Component/Yaml/Tests/ParserTest.php | 20 + .../Component/Yaml/Tests/bootstrap.php | 0 .../Symfony/Component/Yaml/Unescaper.php | 6 +- .../yaml}/Symfony/Component/Yaml/Yaml.php | 2 +- .../Symfony/Component/Yaml/composer.json | 2 +- .../Symfony/Component/Yaml/phpunit.xml.dist | 0 core/vendor/twig/twig/.travis.yml | 14 + core/vendor/{Twig => twig/twig}/AUTHORS | 0 core/vendor/twig/twig/CHANGELOG | 520 +++++++++ core/vendor/{Twig => twig/twig}/LICENSE | 0 core/vendor/twig/twig/README.markdown | 17 + .../twig/twig/bin/create_pear_package.php | 42 + core/vendor/twig/twig/composer.json | 31 + core/vendor/twig/twig/doc/advanced.rst | 833 ++++++++++++++ core/vendor/twig/twig/doc/api.rst | 487 ++++++++ .../vendor/twig/twig/doc/coding_standards.rst | 101 ++ core/vendor/twig/twig/doc/filters/abs.rst | 18 + .../twig/twig/doc/filters/capitalize.rst | 11 + .../twig/doc/filters/convert_encoding.rst | 22 + core/vendor/twig/twig/doc/filters/date.rst | 65 ++ core/vendor/twig/twig/doc/filters/default.rst | 28 + core/vendor/twig/twig/doc/filters/escape.rst | 39 + core/vendor/twig/twig/doc/filters/format.rst | 16 + core/vendor/twig/twig/doc/filters/index.rst | 30 + core/vendor/twig/twig/doc/filters/join.rst | 18 + .../twig/twig/doc/filters/json_encode.rst | 14 + core/vendor/twig/twig/doc/filters/keys.rst | 11 + core/vendor/twig/twig/doc/filters/length.rst | 12 + core/vendor/twig/twig/doc/filters/lower.rst | 10 + core/vendor/twig/twig/doc/filters/merge.rst | 41 + core/vendor/twig/twig/doc/filters/nl2br.rst | 22 + .../twig/twig/doc/filters/number_format.rst | 38 + core/vendor/twig/twig/doc/filters/raw.rst | 12 + core/vendor/twig/twig/doc/filters/replace.rst | 14 + core/vendor/twig/twig/doc/filters/reverse.rst | 23 + core/vendor/twig/twig/doc/filters/slice.rst | 57 + core/vendor/twig/twig/doc/filters/sort.rst | 17 + .../twig/twig/doc/filters/striptags.rst | 15 + core/vendor/twig/twig/doc/filters/title.rst | 11 + core/vendor/twig/twig/doc/filters/trim.rst | 24 + core/vendor/twig/twig/doc/filters/upper.rst | 10 + .../twig/twig/doc/filters/url_encode.rst | 14 + .../twig/twig/doc/functions/attribute.rst | 18 + core/vendor/twig/twig/doc/functions/block.rst | 15 + .../twig/twig/doc/functions/constant.rst | 9 + core/vendor/twig/twig/doc/functions/cycle.rst | 20 + core/vendor/twig/twig/doc/functions/date.rst | 46 + core/vendor/twig/twig/doc/functions/dump.rst | 64 + core/vendor/twig/twig/doc/functions/index.rst | 15 + .../vendor/twig/twig/doc/functions/parent.rst | 20 + .../vendor/twig/twig/doc/functions/random.rst | 24 + core/vendor/twig/twig/doc/functions/range.rst | 38 + core/vendor/twig/twig/doc/index.rst | 17 + core/vendor/twig/twig/doc/internals.rst | 140 +++ core/vendor/twig/twig/doc/intro.rst | 160 +++ core/vendor/twig/twig/doc/recipes.rst | 362 ++++++ core/vendor/twig/twig/doc/tags/autoescape.rst | 71 ++ core/vendor/twig/twig/doc/tags/block.rst | 11 + core/vendor/twig/twig/doc/tags/do.rst | 12 + core/vendor/twig/twig/doc/tags/embed.rst | 178 +++ core/vendor/twig/twig/doc/tags/extends.rst | 187 +++ core/vendor/twig/twig/doc/tags/filter.rst | 21 + core/vendor/twig/twig/doc/tags/flush.rst | 17 + core/vendor/twig/twig/doc/tags/for.rst | 157 +++ core/vendor/twig/twig/doc/tags/from.rst | 8 + core/vendor/twig/twig/doc/tags/if.rst | 43 + core/vendor/twig/twig/doc/tags/import.rst | 79 ++ core/vendor/twig/twig/doc/tags/include.rst | 86 ++ core/vendor/twig/twig/doc/tags/index.rst | 24 + core/vendor/twig/twig/doc/tags/macro.rst | 91 ++ core/vendor/twig/twig/doc/tags/raw.rst | 16 + core/vendor/twig/twig/doc/tags/sandbox.rst | 30 + core/vendor/twig/twig/doc/tags/set.rst | 32 + core/vendor/twig/twig/doc/tags/spaceless.rst | 37 + core/vendor/twig/twig/doc/tags/use.rst | 123 ++ core/vendor/twig/twig/doc/templates.rst | 727 ++++++++++++ core/vendor/twig/twig/doc/tests/constant.rst | 11 + core/vendor/twig/twig/doc/tests/defined.rst | 30 + .../twig/twig/doc/tests/divisibleby.rst | 10 + core/vendor/twig/twig/doc/tests/empty.rst | 11 + core/vendor/twig/twig/doc/tests/even.rst | 10 + core/vendor/twig/twig/doc/tests/index.rst | 15 + core/vendor/twig/twig/doc/tests/iterable.rst | 19 + core/vendor/twig/twig/doc/tests/null.rst | 12 + core/vendor/twig/twig/doc/tests/odd.rst | 10 + core/vendor/twig/twig/doc/tests/sameas.rst | 11 + core/vendor/twig/twig/ext/twig/.gitignore | 30 + core/vendor/twig/twig/ext/twig/LICENSE | 22 + core/vendor/twig/twig/ext/twig/config.m4 | 8 + core/vendor/twig/twig/ext/twig/config.w32 | 8 + core/vendor/twig/twig/ext/twig/php_twig.h | 49 + core/vendor/twig/twig/ext/twig/twig.c | 1025 +++++++++++++++++ .../{ => twig/twig/lib}/Twig/Autoloader.php | 2 - .../{ => twig/twig/lib}/Twig/Compiler.php | 12 +- .../twig/lib}/Twig/CompilerInterface.php | 0 .../{ => twig/twig/lib}/Twig/Environment.php | 4 +- .../vendor/{ => twig/twig/lib}/Twig/Error.php | 0 .../{ => twig/twig/lib}/Twig/Error/Loader.php | 0 .../twig/lib}/Twig/Error/Runtime.php | 0 .../{ => twig/twig/lib}/Twig/Error/Syntax.php | 0 .../twig/lib}/Twig/ExpressionParser.php | 0 .../{ => twig/twig/lib}/Twig/Extension.php | 0 .../twig/lib}/Twig/Extension/Core.php | 0 .../twig/lib}/Twig/Extension/Debug.php | 0 .../twig/lib}/Twig/Extension/Escaper.php | 4 +- .../twig/lib}/Twig/Extension/Optimizer.php | 0 .../twig/lib}/Twig/Extension/Sandbox.php | 0 .../twig/lib}/Twig/ExtensionInterface.php | 0 .../{ => twig/twig/lib}/Twig/Filter.php | 0 .../twig/lib}/Twig/Filter/Function.php | 0 .../twig/lib}/Twig/Filter/Method.php | 0 .../{ => twig/twig/lib}/Twig/Filter/Node.php | 0 .../twig/lib}/Twig/FilterInterface.php | 0 .../{ => twig/twig/lib}/Twig/Function.php | 0 .../twig/lib}/Twig/Function/Function.php | 0 .../twig/lib}/Twig/Function/Method.php | 0 .../twig/lib}/Twig/Function/Node.php | 0 .../twig/lib}/Twig/FunctionInterface.php | 0 .../vendor/{ => twig/twig/lib}/Twig/Lexer.php | 0 .../twig/lib}/Twig/LexerInterface.php | 0 .../{ => twig/twig/lib}/Twig/Loader/Array.php | 0 .../{ => twig/twig/lib}/Twig/Loader/Chain.php | 0 .../twig/lib}/Twig/Loader/Filesystem.php | 2 +- .../twig/lib}/Twig/Loader/String.php | 0 .../twig/lib}/Twig/LoaderInterface.php | 0 .../{ => twig/twig/lib}/Twig/Markup.php | 0 core/vendor/{ => twig/twig/lib}/Twig/Node.php | 0 .../twig/lib}/Twig/Node/AutoEscape.php | 0 .../{ => twig/twig/lib}/Twig/Node/Block.php | 0 .../twig/lib}/Twig/Node/BlockReference.php | 0 .../{ => twig/twig/lib}/Twig/Node/Body.php | 0 .../{ => twig/twig/lib}/Twig/Node/Do.php | 0 .../{ => twig/twig/lib}/Twig/Node/Embed.php | 0 .../twig/lib}/Twig/Node/Expression.php | 0 .../twig/lib}/Twig/Node/Expression/Array.php | 0 .../lib}/Twig/Node/Expression/AssignName.php | 0 .../twig/lib}/Twig/Node/Expression/Binary.php | 0 .../lib}/Twig/Node/Expression/Binary/Add.php | 0 .../lib}/Twig/Node/Expression/Binary/And.php | 0 .../Node/Expression/Binary/BitwiseAnd.php | 0 .../Twig/Node/Expression/Binary/BitwiseOr.php | 0 .../Node/Expression/Binary/BitwiseXor.php | 0 .../Twig/Node/Expression/Binary/Concat.php | 0 .../lib}/Twig/Node/Expression/Binary/Div.php | 0 .../Twig/Node/Expression/Binary/Equal.php | 0 .../Twig/Node/Expression/Binary/FloorDiv.php | 0 .../Twig/Node/Expression/Binary/Greater.php | 0 .../Node/Expression/Binary/GreaterEqual.php | 0 .../lib}/Twig/Node/Expression/Binary/In.php | 0 .../lib}/Twig/Node/Expression/Binary/Less.php | 0 .../Twig/Node/Expression/Binary/LessEqual.php | 0 .../lib}/Twig/Node/Expression/Binary/Mod.php | 0 .../lib}/Twig/Node/Expression/Binary/Mul.php | 0 .../Twig/Node/Expression/Binary/NotEqual.php | 0 .../Twig/Node/Expression/Binary/NotIn.php | 0 .../lib}/Twig/Node/Expression/Binary/Or.php | 0 .../Twig/Node/Expression/Binary/Power.php | 0 .../Twig/Node/Expression/Binary/Range.php | 0 .../lib}/Twig/Node/Expression/Binary/Sub.php | 0 .../Twig/Node/Expression/BlockReference.php | 0 .../lib}/Twig/Node/Expression/Conditional.php | 0 .../lib}/Twig/Node/Expression/Constant.php | 0 .../Node/Expression/ExtensionReference.php | 0 .../twig/lib}/Twig/Node/Expression/Filter.php | 0 .../Twig/Node/Expression/Filter/Default.php | 0 .../lib}/Twig/Node/Expression/Function.php | 0 .../lib}/Twig/Node/Expression/GetAttr.php | 0 .../lib}/Twig/Node/Expression/MethodCall.php | 0 .../twig/lib}/Twig/Node/Expression/Name.php | 0 .../twig/lib}/Twig/Node/Expression/Parent.php | 0 .../lib}/Twig/Node/Expression/TempName.php | 0 .../twig/lib}/Twig/Node/Expression/Test.php | 0 .../Twig/Node/Expression/Test/Constant.php | 0 .../Twig/Node/Expression/Test/Defined.php | 0 .../Twig/Node/Expression/Test/Divisibleby.php | 0 .../lib}/Twig/Node/Expression/Test/Even.php | 0 .../lib}/Twig/Node/Expression/Test/Null.php | 0 .../lib}/Twig/Node/Expression/Test/Odd.php | 0 .../lib}/Twig/Node/Expression/Test/Sameas.php | 0 .../twig/lib}/Twig/Node/Expression/Unary.php | 0 .../lib}/Twig/Node/Expression/Unary/Neg.php | 0 .../lib}/Twig/Node/Expression/Unary/Not.php | 0 .../lib}/Twig/Node/Expression/Unary/Pos.php | 0 .../{ => twig/twig/lib}/Twig/Node/Flush.php | 0 .../{ => twig/twig/lib}/Twig/Node/For.php | 0 .../{ => twig/twig/lib}/Twig/Node/ForLoop.php | 0 .../{ => twig/twig/lib}/Twig/Node/If.php | 0 .../{ => twig/twig/lib}/Twig/Node/Import.php | 0 .../{ => twig/twig/lib}/Twig/Node/Include.php | 0 .../{ => twig/twig/lib}/Twig/Node/Macro.php | 0 .../{ => twig/twig/lib}/Twig/Node/Module.php | 0 .../{ => twig/twig/lib}/Twig/Node/Print.php | 0 .../{ => twig/twig/lib}/Twig/Node/Sandbox.php | 0 .../twig/lib}/Twig/Node/SandboxedModule.php | 0 .../twig/lib}/Twig/Node/SandboxedPrint.php | 0 .../{ => twig/twig/lib}/Twig/Node/Set.php | 0 .../{ => twig/twig/lib}/Twig/Node/SetTemp.php | 0 .../twig/lib}/Twig/Node/Spaceless.php | 0 .../{ => twig/twig/lib}/Twig/Node/Text.php | 0 .../twig/lib}/Twig/NodeInterface.php | 0 .../twig/lib}/Twig/NodeOutputInterface.php | 0 .../twig/lib}/Twig/NodeTraverser.php | 0 .../twig/lib}/Twig/NodeVisitor/Escaper.php | 0 .../twig/lib}/Twig/NodeVisitor/Optimizer.php | 0 .../lib}/Twig/NodeVisitor/SafeAnalysis.php | 0 .../twig/lib}/Twig/NodeVisitor/Sandbox.php | 0 .../twig/lib}/Twig/NodeVisitorInterface.php | 0 .../{ => twig/twig/lib}/Twig/Parser.php | 0 .../twig/lib}/Twig/ParserInterface.php | 0 .../twig/lib}/Twig/Sandbox/SecurityError.php | 0 .../twig/lib}/Twig/Sandbox/SecurityPolicy.php | 0 .../Twig/Sandbox/SecurityPolicyInterface.php | 0 .../{ => twig/twig/lib}/Twig/Template.php | 0 .../twig/lib}/Twig/TemplateInterface.php | 0 .../twig/lib}/Twig/Test/Function.php | 0 .../{ => twig/twig/lib}/Twig/Test/Method.php | 0 .../{ => twig/twig/lib}/Twig/Test/Node.php | 0 .../twig/lib}/Twig/TestInterface.php | 0 .../vendor/{ => twig/twig/lib}/Twig/Token.php | 0 .../{ => twig/twig/lib}/Twig/TokenParser.php | 0 .../twig/lib}/Twig/TokenParser/AutoEscape.php | 0 .../twig/lib}/Twig/TokenParser/Block.php | 0 .../twig/lib}/Twig/TokenParser/Do.php | 0 .../twig/lib}/Twig/TokenParser/Embed.php | 0 .../twig/lib}/Twig/TokenParser/Extends.php | 0 .../twig/lib}/Twig/TokenParser/Filter.php | 0 .../twig/lib}/Twig/TokenParser/Flush.php | 0 .../twig/lib}/Twig/TokenParser/For.php | 0 .../twig/lib}/Twig/TokenParser/From.php | 0 .../twig/lib}/Twig/TokenParser/If.php | 0 .../twig/lib}/Twig/TokenParser/Import.php | 0 .../twig/lib}/Twig/TokenParser/Include.php | 0 .../twig/lib}/Twig/TokenParser/Macro.php | 0 .../twig/lib}/Twig/TokenParser/Sandbox.php | 0 .../twig/lib}/Twig/TokenParser/Set.php | 0 .../twig/lib}/Twig/TokenParser/Spaceless.php | 0 .../twig/lib}/Twig/TokenParser/Use.php | 0 .../twig/lib}/Twig/TokenParserBroker.php | 0 .../lib}/Twig/TokenParserBrokerInterface.php | 0 .../twig/lib}/Twig/TokenParserInterface.php | 0 .../{ => twig/twig/lib}/Twig/TokenStream.php | 0 core/vendor/twig/twig/package.xml.tpl | 64 + core/vendor/twig/twig/phpunit.xml.dist | 25 + .../twig/test/Twig/Tests/AutoloaderTest.php | 21 + .../twig/test/Twig/Tests/CompilerTest.php | 33 + .../twig/test/Twig/Tests/EnvironmentTest.php | 35 + .../twig/twig/test/Twig/Tests/ErrorTest.php | 100 ++ .../test/Twig/Tests/ExpressionParserTest.php | 217 ++++ .../test/Twig/Tests/Extension/CoreTest.php | 115 ++ .../test/Twig/Tests/Extension/SandboxTest.php | 209 ++++ .../twig/test/Twig/Tests/FileCachingTest.php | 70 ++ .../Fixtures/exceptions/unclosed_tag.test | 20 + .../Tests/Fixtures/expressions/array.test | 61 + .../Fixtures/expressions/array_call.test | 14 + .../Tests/Fixtures/expressions/binary.test | 46 + .../Tests/Fixtures/expressions/bitwise.test | 12 + .../Fixtures/expressions/comparison.test | 14 + .../Tests/Fixtures/expressions/dotdot.test | 20 + .../Tests/Fixtures/expressions/grouping.test | 8 + .../Tests/Fixtures/expressions/literals.test | 22 + .../Fixtures/expressions/magic_call.test | 27 + .../Fixtures/expressions/method_call.test | 28 + .../Tests/Fixtures/expressions/postfix.test | 21 + .../Tests/Fixtures/expressions/strings.test | 10 + .../expressions/ternary_operator.test | 18 + .../Tests/Fixtures/expressions/unary.test | 12 + .../expressions/unary_precedence.test | 14 + .../test/Twig/Tests/Fixtures/filters/abs.test | 30 + .../Fixtures/filters/convert_encoding.test | 10 + .../Twig/Tests/Fixtures/filters/date.test | 56 + .../Fixtures/filters/date_default_format.test | 14 + .../filters/date_default_format_interval.test | 16 + .../Tests/Fixtures/filters/date_interval.test | 16 + .../Twig/Tests/Fixtures/filters/default.test | 150 +++ .../Fixtures/filters/dynamic_filter.test | 10 + .../Twig/Tests/Fixtures/filters/escape.test | 8 + .../filters/escape_non_supported_charset.test | 8 + .../Tests/Fixtures/filters/force_escape.test | 18 + .../Twig/Tests/Fixtures/filters/format.test | 8 + .../Twig/Tests/Fixtures/filters/join.test | 12 + .../Tests/Fixtures/filters/json_encode.test | 12 + .../Twig/Tests/Fixtures/filters/length.test | 14 + .../Tests/Fixtures/filters/length_utf8.test | 12 + .../Twig/Tests/Fixtures/filters/merge.test | 14 + .../Twig/Tests/Fixtures/filters/nl2br.test | 14 + .../Tests/Fixtures/filters/number_format.test | 18 + .../filters/number_format_default.test | 21 + .../Twig/Tests/Fixtures/filters/replace.test | 8 + .../Twig/Tests/Fixtures/filters/reverse.test | 12 + .../Twig/Tests/Fixtures/filters/slice.test | 40 + .../Twig/Tests/Fixtures/filters/sort.test | 10 + .../Tests/Fixtures/filters/special_chars.test | 8 + .../Twig/Tests/Fixtures/filters/trim.test | 12 + .../Tests/Fixtures/functions/attribute.test | 12 + .../Twig/Tests/Fixtures/functions/block.test | 12 + .../Tests/Fixtures/functions/constant.test | 12 + .../Twig/Tests/Fixtures/functions/cycle.test | 16 + .../Twig/Tests/Fixtures/functions/date.test | 25 + .../Twig/Tests/Fixtures/functions/dump.test | 14 + .../Tests/Fixtures/functions/dump_array.test | 19 + .../Fixtures/functions/dynamic_function.test | 10 + .../Fixtures/functions/special_chars.test | 8 + .../Twig/Tests/Fixtures/macros/simple.test | 22 + .../Tests/Fixtures/macros/with_filters.test | 14 + .../Fixtures/regression/empty_token.test | 8 + .../regression/simple_xml_element.test | 17 + .../regression/strings_like_numbers.test | 8 + .../Tests/Fixtures/tags/autoescape/basic.test | 26 + .../Fixtures/tags/autoescape/blocks.test | 12 + .../tags/autoescape/double_escaping.test | 10 + .../Fixtures/tags/autoescape/functions.test | 83 ++ .../Fixtures/tags/autoescape/literal.test | 45 + .../Fixtures/tags/autoescape/nested.test | 26 + .../Fixtures/tags/autoescape/objects.test | 26 + .../Tests/Fixtures/tags/autoescape/raw.test | 10 + .../Fixtures/tags/autoescape/strategy.test | 17 + .../Tests/Fixtures/tags/autoescape/type.test | 69 ++ .../tags/autoescape/with_filters.test | 131 +++ .../autoescape/with_filters_arguments.test | 23 + .../autoescape/with_pre_escape_filters.test | 68 ++ .../with_preserves_safety_filters.test | 50 + .../Twig/Tests/Fixtures/tags/block/basic.test | 11 + .../tags/block/block_unique_name.test | 11 + .../Fixtures/tags/block/special_chars.test | 10 + .../Twig/Tests/Fixtures/tags/embed/basic.test | 35 + .../Tests/Fixtures/tags/embed/multiple.test | 50 + .../Fixtures/tags/embed/with_extends.test | 57 + .../Tests/Fixtures/tags/filter/basic.test | 10 + .../Fixtures/tags/filter/json_encode.test | 8 + .../Tests/Fixtures/tags/filter/multiple.test | 10 + .../Tests/Fixtures/tags/filter/nested.test | 16 + .../Fixtures/tags/filter/with_for_tag.test | 13 + .../Fixtures/tags/filter/with_if_tag.test | 29 + .../Tests/Fixtures/tags/for/condition.test | 14 + .../Twig/Tests/Fixtures/tags/for/context.test | 18 + .../Twig/Tests/Fixtures/tags/for/else.test | 23 + .../Fixtures/tags/for/inner_variables.test | 17 + .../Twig/Tests/Fixtures/tags/for/keys.test | 11 + .../Fixtures/tags/for/keys_and_values.test | 11 + .../Tests/Fixtures/tags/for/loop_context.test | 19 + .../Fixtures/tags/for/loop_context_local.test | 10 + .../Tests/Fixtures/tags/for/nested_else.test | 17 + .../Twig/Tests/Fixtures/tags/for/objects.test | 43 + .../Fixtures/tags/for/objects_countable.test | 47 + .../Tests/Fixtures/tags/for/recursive.test | 18 + .../Twig/Tests/Fixtures/tags/for/values.test | 11 + .../test/Twig/Tests/Fixtures/tags/from.test | 14 + .../Twig/Tests/Fixtures/tags/if/basic.test | 22 + .../Tests/Fixtures/tags/if/expression.test | 22 + .../Tests/Fixtures/tags/include/basic.test | 16 + .../Fixtures/tags/include/expression.test | 16 + .../Fixtures/tags/include/ignore_missing.test | 10 + .../Tests/Fixtures/tags/include/only.test | 16 + .../tags/include/template_instance.test | 10 + .../tags/include/templates_as_array.test | 12 + .../Fixtures/tags/include/with_variables.test | 12 + .../Fixtures/tags/inheritance/basic.test | 14 + .../tags/inheritance/conditional.test | 14 + .../Fixtures/tags/inheritance/dynamic.test | 14 + .../Fixtures/tags/inheritance/empty.test | 10 + .../tags/inheritance/extends_as_array.test | 12 + .../Fixtures/tags/inheritance/multiple.test | 12 + .../tags/inheritance/nested_blocks.test | 22 + .../nested_blocks_parent_only.test | 15 + .../tags/inheritance/nested_inheritance.test | 16 + .../Fixtures/tags/inheritance/parent.test | 12 + .../tags/inheritance/parent_change.test | 16 + .../tags/inheritance/parent_in_a_block.test | 8 + .../tags/inheritance/parent_isolation.test | 20 + .../tags/inheritance/parent_nested.test | 28 + .../inheritance/parent_without_extends.test | 8 + .../parent_without_extends_but_traits.test | 14 + .../tags/inheritance/template_instance.test | 14 + .../Tests/Fixtures/tags/inheritance/use.test | 44 + .../Twig/Tests/Fixtures/tags/macro/basic.test | 15 + .../Fixtures/tags/macro/endmacro_name.test | 14 + .../Tests/Fixtures/tags/macro/external.test | 17 + .../Twig/Tests/Fixtures/tags/macro/from.test | 18 + .../Tests/Fixtures/tags/macro/global.test | 14 + .../Fixtures/tags/macro/self_import.test | 17 + .../Fixtures/tags/macro/special_chars.test | 12 + .../Twig/Tests/Fixtures/tags/raw/basic.test | 10 + .../Fixtures/tags/raw/whitespace_control.test | 56 + .../Fixtures/tags/sandbox/not_valid1.test | 11 + .../Fixtures/tags/sandbox/not_valid2.test | 14 + .../Tests/Fixtures/tags/sandbox/simple.test | 22 + .../Twig/Tests/Fixtures/tags/set/basic.test | 20 + .../Fixtures/tags/set/capture-empty.test | 9 + .../Twig/Tests/Fixtures/tags/set/capture.test | 10 + .../Tests/Fixtures/tags/set/expression.test | 12 + .../Tests/Fixtures/tags/spaceless/simple.test | 12 + .../Tests/Fixtures/tags/special_chars.test | 8 + .../Twig/Tests/Fixtures/tags/trim_block.test | 74 ++ .../Twig/Tests/Fixtures/tags/use/aliases.test | 12 + .../Twig/Tests/Fixtures/tags/use/basic.test | 12 + .../Twig/Tests/Fixtures/tags/use/deep.test | 22 + .../Tests/Fixtures/tags/use/deep_empty.test | 10 + .../Tests/Fixtures/tags/use/multiple.test | 21 + .../Fixtures/tags/use/multiple_aliases.test | 23 + .../test/Twig/Tests/Fixtures/tests/array.test | 24 + .../Twig/Tests/Fixtures/tests/constant.test | 12 + .../Twig/Tests/Fixtures/tests/defined.test | 108 ++ .../test/Twig/Tests/Fixtures/tests/empty.test | 45 + .../test/Twig/Tests/Fixtures/tests/even.test | 14 + .../test/Twig/Tests/Fixtures/tests/in.test | 48 + .../Twig/Tests/Fixtures/tests/iterable.test | 19 + .../test/Twig/Tests/Fixtures/tests/odd.test | 10 + .../twig/twig/test/Twig/Tests/LexerTest.php | 249 ++++ .../twig/test/Twig/Tests/Loader/ArrayTest.php | 97 ++ .../twig/test/Twig/Tests/Loader/ChainTest.php | 63 + .../test/Twig/Tests/Loader/FilesystemTest.php | 52 + .../test/Twig/Tests/Node/AutoEscapeTest.php | 46 + .../Twig/Tests/Node/BlockReferenceTest.php | 41 + .../twig/test/Twig/Tests/Node/BlockTest.php | 52 + .../twig/twig/test/Twig/Tests/Node/DoTest.php | 46 + .../Twig/Tests/Node/Expression/ArrayTest.php | 51 + .../Tests/Node/Expression/AssignNameTest.php | 43 + .../Tests/Node/Expression/Binary/AddTest.php | 49 + .../Tests/Node/Expression/Binary/AndTest.php | 49 + .../Node/Expression/Binary/ConcatTest.php | 49 + .../Tests/Node/Expression/Binary/DivTest.php | 49 + .../Node/Expression/Binary/FloorDivTest.php | 49 + .../Tests/Node/Expression/Binary/ModTest.php | 49 + .../Tests/Node/Expression/Binary/MulTest.php | 49 + .../Tests/Node/Expression/Binary/OrTest.php | 49 + .../Tests/Node/Expression/Binary/SubTest.php | 49 + .../Tests/Node/Expression/ConditionalTest.php | 52 + .../Tests/Node/Expression/ConstantTest.php | 44 + .../Twig/Tests/Node/Expression/FilterTest.php | 85 ++ .../Tests/Node/Expression/FunctionTest.php | 90 ++ .../Tests/Node/Expression/GetAttrTest.php | 64 + .../Twig/Tests/Node/Expression/NameTest.php | 51 + .../Twig/Tests/Node/Expression/ParentTest.php | 42 + .../Twig/Tests/Node/Expression/TestTest.php | 67 ++ .../Tests/Node/Expression/Unary/NegTest.php | 46 + .../Tests/Node/Expression/Unary/NotTest.php | 46 + .../Tests/Node/Expression/Unary/PosTest.php | 46 + .../twig/test/Twig/Tests/Node/ForTest.php | 201 ++++ .../twig/twig/test/Twig/Tests/Node/IfTest.php | 99 ++ .../twig/test/Twig/Tests/Node/ImportTest.php | 50 + .../twig/test/Twig/Tests/Node/IncludeTest.php | 84 ++ .../twig/test/Twig/Tests/Node/MacroTest.php | 70 ++ .../twig/test/Twig/Tests/Node/ModuleTest.php | 196 ++++ .../twig/test/Twig/Tests/Node/PrintTest.php | 43 + .../twig/test/Twig/Tests/Node/SandboxTest.php | 57 + .../Twig/Tests/Node/SandboxedModuleTest.php | 172 +++ .../Twig/Tests/Node/SandboxedPrintTest.php | 46 + .../twig/test/Twig/Tests/Node/SetTest.php | 73 ++ .../test/Twig/Tests/Node/SpacelessTest.php | 50 + .../twig/test/Twig/Tests/Node/TestCase.php | 58 + .../twig/test/Twig/Tests/Node/TextTest.php | 42 + .../Twig/Tests/NodeVisitor/OptimizerTest.php | 118 ++ .../twig/twig/test/Twig/Tests/ParserTest.php | 160 +++ .../twig/test/Twig/Tests/TemplateTest.php | 377 ++++++ .../twig/test/Twig/Tests/TokenStreamTest.php | 41 + .../twig/test/Twig/Tests/integrationTest.php | 322 ++++++ core/vendor/twig/twig/test/bootstrap.php | 13 + 1128 files changed, 19661 insertions(+), 2148 deletions(-) create mode 100644 core/composer.json create mode 100644 core/composer.lock create mode 100644 core/vendor/.gitignore delete mode 100644 core/vendor/Symfony/Component/HttpFoundation/ServerBag.php delete mode 100644 core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php delete mode 100644 core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php delete mode 100644 core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php delete mode 100644 core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeMemcacheSessionHandler.php delete mode 100644 core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeMemcachedSessionHandler.php delete mode 100644 core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeRedisSessionHandler.php delete mode 100644 core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php delete mode 100644 core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSqliteSessionHandler.php delete mode 100644 core/vendor/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php delete mode 100644 core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php delete mode 100644 core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php delete mode 100644 core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php delete mode 100644 core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeMemcacheSessionHandlerTest.php delete mode 100644 core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeMemcachedSessionHandlerTest.php delete mode 100644 core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeRedisSessionHandlerTest.php delete mode 100644 core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeSqliteSessionHandlerTest.php delete mode 100644 core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/MemcacheProfilerStorageTest.php delete mode 100644 core/vendor/Symfony/Component/HttpKernel/Tests/bootstrap.php delete mode 100644 core/vendor/Symfony/Component/Routing/Tests/bootstrap.php create mode 100644 core/vendor/autoload.php create mode 100644 core/vendor/composer/ClassLoader.php create mode 100644 core/vendor/composer/autoload_classmap.php create mode 100644 core/vendor/composer/autoload_namespaces.php create mode 100644 core/vendor/composer/installed.json create mode 100644 core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/.gitignore rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/ApcClassLoader.php (95%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php (98%) create mode 100644 core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/CHANGELOG.md rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/ClassCollectionLoader.php (98%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/ClassLoader.php (89%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/ClassMapGenerator.php (98%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/DebugClassLoader.php (99%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/LICENSE (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/MapClassLoader.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/README.md (93%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/ApcUniversalClassLoaderTest.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php (98%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/ClassLoaderTest.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Bar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Baz.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/FooBar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Bar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Baz.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/ApcPrefixCollision/A/Bar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/ApcPrefixCollision/A/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Bar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Bar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Bar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/fallback/Apc/Pearlike/FooBar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/fallback/Namespaced/FooBar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Bar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Baz.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Bar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Baz.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike/Bar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike/Baz.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike2/Bar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike2/Baz.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike2/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/A/Bar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/A/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/C/Bar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/C/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/A/Bar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/A/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/C/Bar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/C/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/A/B/Bar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/A/B/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/C/B/Bar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/C/B/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/A/B/Bar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/A/B/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/C/B/Bar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/C/B/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeClass.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeInterface.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeParent.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/multipleNs.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/notAClass.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/notPhpFile.md (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/sameNsMultipleClasses.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Namespaced/FooBar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Namespaced2/FooBar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Pearlike/FooBar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Pearlike2/FooBar.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/Fixtures/includepath/Foo.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/UniversalClassLoaderTest.php (100%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/Tests/bootstrap.php (58%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/UniversalClassLoader.php (97%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/XcacheClassLoader.php (95%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/composer.json (88%) rename core/vendor/{ => symfony/class-loader}/Symfony/Component/ClassLoader/phpunit.xml.dist (94%) create mode 100644 core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/.gitignore rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Alias.php (96%) create mode 100644 core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/CHANGELOG.md rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php (96%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/Compiler.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/PassConfig.php (99%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/RemoveUnusedDefinitionsPass.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/RepeatablePassInterface.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php (92%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php (98%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php (96%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php (96%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Container.php (96%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/ContainerAware.php (92%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/ContainerAwareInterface.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/ContainerBuilder.php (96%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/ContainerInterface.php (91%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Definition.php (93%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/DefinitionDecorator.php (99%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Dumper/Dumper.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php (92%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php (97%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php (98%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php (98%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php (85%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Exception/BadMethodCallException.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Exception/ExceptionInterface.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Exception/InactiveScopeException.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Exception/LogicException.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Exception/OutOfBoundsException.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Exception/RuntimeException.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Exception/ScopeCrossingInjectionException.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Exception/ScopeWideningInjectionException.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php (90%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php (98%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/LICENSE (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php (94%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Loader/FileLoader.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php (94%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php (92%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php (98%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd (98%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Parameter.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php (96%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php (95%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/README.md (84%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Reference.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Scope.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/ScopeInterface.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/SimpleXMLElement.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/TaggedContainerInterface.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php (91%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Compiler/CheckCircularReferencesPassTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Compiler/CheckExceptionOnInvalidReferenceBehaviorPassTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Compiler/CheckReferenceValidityPassTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInvalidReferencesPassTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/ContainerTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/DefinitionDecoratorTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Dumper/GraphvizDumperTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Dumper/XmlDumperTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container10.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container11.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container12.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container8.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces1.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces2.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services1.dot (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10-1.dot (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10.dot (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services9.dot (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtension.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtensionInPhar.phar (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/foo.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/schema/project-1.0.xsd (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/nonvalid.ini (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters.ini (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters1.ini (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters2.ini (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php (99%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/php/simple.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension1/services.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension2/services.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services1.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services2.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services3.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services4.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services5.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services6.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services7.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/nonvalid.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services1.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services13.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services2.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services3.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4_bad_import.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services5.xml (85%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services7.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services8.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag1.yml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag2.yml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag3.yml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid1.yml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid2.yml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services1.yml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services10.yml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services11.yml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services13.yml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services2.yml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services3.yml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4.yml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4_bad_import.yml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services7.yml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services8.yml (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml (97%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php (96%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php (96%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php (96%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/ParameterTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/ReferenceTest.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Tests/bootstrap.php (56%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/Variable.php (100%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/composer.json (87%) rename core/vendor/{ => symfony/dependency-injection}/Symfony/Component/DependencyInjection/phpunit.xml.dist (94%) create mode 100644 core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/.gitignore create mode 100644 core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/CHANGELOG.md rename core/vendor/{ => symfony/event-dispatcher}/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php (95%) rename core/vendor/{ => symfony/event-dispatcher}/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcherInterface.php (100%) rename core/vendor/{ => symfony/event-dispatcher}/Symfony/Component/EventDispatcher/Event.php (100%) rename core/vendor/{ => symfony/event-dispatcher}/Symfony/Component/EventDispatcher/EventDispatcher.php (96%) rename core/vendor/{ => symfony/event-dispatcher}/Symfony/Component/EventDispatcher/EventDispatcherInterface.php (97%) rename core/vendor/{ => symfony/event-dispatcher}/Symfony/Component/EventDispatcher/EventSubscriberInterface.php (100%) rename core/vendor/{ => symfony/event-dispatcher}/Symfony/Component/EventDispatcher/GenericEvent.php (96%) rename core/vendor/{ => symfony/event-dispatcher}/Symfony/Component/EventDispatcher/LICENSE (100%) rename core/vendor/{ => symfony/event-dispatcher}/Symfony/Component/EventDispatcher/README.md (68%) rename core/vendor/{ => symfony/event-dispatcher}/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php (99%) rename core/vendor/{ => symfony/event-dispatcher}/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php (100%) rename core/vendor/{ => symfony/event-dispatcher}/Symfony/Component/EventDispatcher/Tests/EventTest.php (100%) rename core/vendor/{ => symfony/event-dispatcher}/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php (100%) create mode 100644 core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/UnmodifiableEventDispatcherTest.php rename core/vendor/{ => symfony/event-dispatcher}/Symfony/Component/EventDispatcher/Tests/bootstrap.php (53%) create mode 100644 core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/UnmodifiableEventDispatcher.php rename core/vendor/{ => symfony/event-dispatcher}/Symfony/Component/EventDispatcher/composer.json (89%) rename core/vendor/{ => symfony/event-dispatcher}/Symfony/Component/EventDispatcher/phpunit.xml.dist (94%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/ApacheRequest.php (100%) create mode 100644 core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/CHANGELOG.md rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Cookie.php (85%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/File/Exception/AccessDeniedException.php (83%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/File/Exception/FileException.php (87%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/File/Exception/FileNotFoundException.php (81%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/File/Exception/UnexpectedTypeException.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/File/Exception/UploadException.php (87%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/File/File.php (97%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesser.php (98%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesserInterface.php (92%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php (97%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php (95%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php (96%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesserInterface.php (86%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/File/UploadedFile.php (98%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/FileBag.php (97%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/HeaderBag.php (98%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/JsonResponse.php (79%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/LICENSE (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/ParameterBag.php (94%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/README.md (96%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/RedirectResponse.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Request.php (97%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/RequestMatcher.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/RequestMatcherInterface.php (91%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Resources/stubs/SessionHandlerInterface.php (97%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Response.php (95%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/ResponseHeaderBag.php (100%) create mode 100644 core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ServerBag.php rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php (97%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/Session.php (96%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/SessionBagInterface.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/SessionInterface.php (96%) create mode 100644 core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/FileSessionHandler.php create mode 100644 core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php create mode 100644 core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php create mode 100644 core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php (92%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php (65%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php (99%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php (62%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php (98%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php (98%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/StreamedResponse.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/CookieTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/File/FileTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/File/Fixtures/.unknownextension (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/File/Fixtures/directory/.empty (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/File/Fixtures/test (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/File/Fixtures/test.gif (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/File/MimeType/MimeTypeTest.php (98%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/FileBagTest.php (91%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/HeaderBagTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php (94%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/RequestTest.php (99%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/ResponseTest.php (98%) create mode 100644 core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/Session/Attribute/AttributeBagTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/Session/Flash/AutoExpireFlashBagTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php (92%) create mode 100644 core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/FileSessionHandlerTest.php create mode 100644 core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php create mode 100644 core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php create mode 100644 core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/Session/Storage/MetadataBagTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php (92%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php (96%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/NativeProxyTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/StreamedResponseTest.php (93%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/Tests/bootstrap.php (100%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/composer.json (97%) rename core/vendor/{ => symfony/http-foundation}/Symfony/Component/HttpFoundation/phpunit.xml.dist (94%) create mode 100644 core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/.gitignore rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Bundle/Bundle.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Bundle/BundleInterface.php (90%) create mode 100644 core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CHANGELOG.md rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/CacheClearer/CacheClearerInterface.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/CacheClearer/ChainCacheClearer.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmer.php (94%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerInterface.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/CacheWarmer/WarmableInterface.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Client.php (99%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Config/FileLocator.php (93%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Controller/ControllerResolver.php (96%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/DataCollector/DataCollector.php (93%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php (95%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php (90%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Debug/ContainerAwareTraceableEventDispatcher.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Debug/ErrorHandler.php (95%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Debug/Stopwatch.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php (97%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php (96%) mode change 100755 => 100644 rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/DependencyInjection/Extension.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php (97%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Event/FilterResponseEvent.php (96%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Event/GetResponseEvent.php (96%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php (95%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Event/GetResponseForExceptionEvent.php (93%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Event/KernelEvent.php (97%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Event/PostResponseEvent.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/EventListener/EsiListener.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/EventListener/LocaleListener.php (91%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/EventListener/ResponseListener.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/EventListener/RouterListener.php (77%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Exception/AccessDeniedHttpException.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Exception/FlattenException.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Exception/HttpException.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Exception/HttpExceptionInterface.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Exception/MethodNotAllowedHttpException.php (73%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Exception/NotFoundHttpException.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/HttpCache/Esi.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategyInterface.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/HttpCache/HttpCache.php (99%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/HttpCache/Store.php (98%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/HttpCache/StoreInterface.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/HttpKernel.php (95%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/HttpKernelInterface.php (87%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Kernel.php (98%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/KernelEvents.php (97%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/KernelInterface.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/LICENSE (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Log/DebugLoggerInterface.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Log/LoggerInterface.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Log/NullLogger.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php (89%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php (89%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php (88%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Profiler/MysqlProfilerStorage.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php (90%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Profiler/Profile.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Profiler/Profiler.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php (86%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/README.md (79%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/TerminableInterface.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php (88%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/CacheClearer/ChainCacheClearerTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerAggregateTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/ClientTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/DataCollector/EventDataCollectorTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Debug/ContainerAwareTraceableEventDispatcherTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Debug/ErrorHandlerTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Debug/ExceptionHandlerTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Debug/StopwatchEventTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Debug/StopwatchTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php (98%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php (72%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Exception/FlattenExceptionTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/BaseBundle/Resources/foo.txt (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/BaseBundle/Resources/hide.txt (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/Resources/foo.txt (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/bar.txt (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/foo.txt (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle2Bundle/foo.txt (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/ChildBundle/Resources/foo.txt (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/ChildBundle/Resources/hide.txt (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionAbsentBundle/ExtensionAbsentBundle.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionLoadedBundle/DependencyInjection/ExtensionLoadedExtension.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionLoadedBundle/ExtensionLoadedBundle.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/Command/FooCommand.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/DependencyInjection/ExtensionPresentExtension.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/ExtensionPresentBundle.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/FooBarBundle.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/BaseBundle/hide.txt (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/Bundle1Bundle/foo.txt (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/ChildBundle/foo.txt (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/FooBundle/foo.txt (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/TestClient.php (90%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Fixtures/TestEventDispatcher.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php (98%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php (98%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/HttpCache/TestHttpKernel.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php (99%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/KernelTest.php (98%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Logger.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Profiler/AbstractProfilerStorageTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Profiler/FileProfilerStorageTest.php (100%) create mode 100644 core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/MemcacheProfilerStorageTest.php rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Profiler/MemcachedProfilerStorageTest.php (53%) create mode 100644 core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcacheMock.php create mode 100644 core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcachedMock.php create mode 100644 core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php (96%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Profiler/ProfilerTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Profiler/RedisProfilerStorageTest.php (56%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/Profiler/SqliteProfilerStorageTest.php (100%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/Tests/TestHttpKernel.php (100%) create mode 100644 core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/bootstrap.php rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/composer.json (68%) rename core/vendor/{ => symfony/http-kernel}/Symfony/Component/HttpKernel/phpunit.xml.dist (93%) create mode 100644 core/vendor/symfony/routing/Symfony/Component/Routing/.gitignore rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Annotation/Route.php (100%) create mode 100644 core/vendor/symfony/routing/Symfony/Component/Routing/CHANGELOG.md rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/CompiledRoute.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Exception/ExceptionInterface.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Exception/InvalidParameterException.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Exception/MethodNotAllowedException.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Exception/MissingMandatoryParametersException.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Exception/ResourceNotFoundException.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Exception/RouteNotFoundException.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Generator/Dumper/GeneratorDumper.php (95%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Generator/Dumper/GeneratorDumperInterface.php (72%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php (93%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Generator/UrlGenerator.php (78%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Generator/UrlGeneratorInterface.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/LICENSE (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Loader/AnnotationClassLoader.php (89%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php (89%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Loader/AnnotationFileLoader.php (93%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Loader/ClosureLoader.php (79%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Loader/PhpFileLoader.php (84%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Loader/XmlFileLoader.php (94%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Loader/YamlFileLoader.php (93%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Matcher/ApacheUrlMatcher.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php (99%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Matcher/Dumper/MatcherDumper.php (89%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Matcher/Dumper/MatcherDumperInterface.php (67%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php (99%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php (96%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Matcher/RedirectableUrlMatcherInterface.php (77%) create mode 100644 core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RequestMatcherInterface.php rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Matcher/TraceableUrlMatcher.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Matcher/UrlMatcher.php (89%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Matcher/UrlMatcherInterface.php (92%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/README.md (78%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/RequestContext.php (99%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/RequestContextAwareInterface.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Route.php (96%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/RouteCollection.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/RouteCompiler.php (84%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/RouteCompilerInterface.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Router.php (81%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/RouterInterface.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Annotation/RouteTest.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/CompiledRouteTest.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/AnnotatedClasses/AbstractClass.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/AnnotatedClasses/FooClass.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/CustomXmlFileLoader.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/RedirectableUrlMatcher.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/annotated.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.apache (79%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php (85%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.apache (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php (87%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php (92%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/empty.yml (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/foo.xml (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/foo1.xml (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/incomplete.yml (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/nonvalid.xml (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/nonvalid.yml (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/nonvalidkeys.yml (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/nonvalidnode.xml (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/nonvalidroute.xml (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/validpattern.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/validpattern.xml (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/validpattern.yml (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/validresource.xml (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Fixtures/validresource.yml (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php (97%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php (87%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Loader/AbstractAnnotationLoaderTest.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Loader/AnnotationDirectoryLoaderTest.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Loader/AnnotationFileLoaderTest.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Loader/ClosureLoaderTest.php (96%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Loader/YamlFileLoaderTest.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Matcher/ApacheUrlMatcherTest.php (95%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Matcher/Dumper/ApacheMatcherDumperTest.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php (97%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Matcher/RedirectableUrlMatcherTest.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Matcher/TraceableUrlMatcherTest.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php (89%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/RouteCollectionTest.php (100%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/RouteCompilerTest.php (59%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/Tests/RouteTest.php (100%) create mode 100644 core/vendor/symfony/routing/Symfony/Component/Routing/Tests/bootstrap.php rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/composer.json (71%) rename core/vendor/{ => symfony/routing}/Symfony/Component/Routing/phpunit.xml.dist (93%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/CHANGELOG.md (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Dumper.php (87%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Escaper.php (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Exception/DumpException.php (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Exception/ExceptionInterface.php (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Exception/ParseException.php (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Inline.php (92%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/LICENSE (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Parser.php (89%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/README.md (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/DumperTest.php (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/Fixtures/YtsAnchorAlias.yml (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/Fixtures/YtsBasicTests.yml (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/Fixtures/YtsBlockMapping.yml (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/Fixtures/YtsDocumentSeparator.yml (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/Fixtures/YtsErrorTests.yml (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/Fixtures/YtsFlowCollections.yml (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/Fixtures/YtsFoldedScalars.yml (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/Fixtures/YtsNullsAndEmpties.yml (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/Fixtures/YtsTypeTransfers.yml (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/Fixtures/escapedCharacters.yml (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/Fixtures/index.yml (92%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/Fixtures/sfComments.yml (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/Fixtures/sfCompact.yml (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/Fixtures/sfMergeKey.yml (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/Fixtures/sfObjects.yml (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/Fixtures/sfQuotes.yml (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/Fixtures/sfTests.yml (100%) create mode 100644 core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/unindentedCollections.yml rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/InlineTest.php (82%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/ParserTest.php (93%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Tests/bootstrap.php (100%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Unescaper.php (97%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/Yaml.php (98%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/composer.json (96%) rename core/vendor/{ => symfony/yaml}/Symfony/Component/Yaml/phpunit.xml.dist (100%) create mode 100644 core/vendor/twig/twig/.travis.yml rename core/vendor/{Twig => twig/twig}/AUTHORS (100%) create mode 100644 core/vendor/twig/twig/CHANGELOG rename core/vendor/{Twig => twig/twig}/LICENSE (100%) create mode 100644 core/vendor/twig/twig/README.markdown create mode 100644 core/vendor/twig/twig/bin/create_pear_package.php create mode 100644 core/vendor/twig/twig/composer.json create mode 100644 core/vendor/twig/twig/doc/advanced.rst create mode 100644 core/vendor/twig/twig/doc/api.rst create mode 100644 core/vendor/twig/twig/doc/coding_standards.rst create mode 100644 core/vendor/twig/twig/doc/filters/abs.rst create mode 100644 core/vendor/twig/twig/doc/filters/capitalize.rst create mode 100644 core/vendor/twig/twig/doc/filters/convert_encoding.rst create mode 100644 core/vendor/twig/twig/doc/filters/date.rst create mode 100644 core/vendor/twig/twig/doc/filters/default.rst create mode 100644 core/vendor/twig/twig/doc/filters/escape.rst create mode 100644 core/vendor/twig/twig/doc/filters/format.rst create mode 100644 core/vendor/twig/twig/doc/filters/index.rst create mode 100644 core/vendor/twig/twig/doc/filters/join.rst create mode 100644 core/vendor/twig/twig/doc/filters/json_encode.rst create mode 100644 core/vendor/twig/twig/doc/filters/keys.rst create mode 100644 core/vendor/twig/twig/doc/filters/length.rst create mode 100644 core/vendor/twig/twig/doc/filters/lower.rst create mode 100644 core/vendor/twig/twig/doc/filters/merge.rst create mode 100644 core/vendor/twig/twig/doc/filters/nl2br.rst create mode 100644 core/vendor/twig/twig/doc/filters/number_format.rst create mode 100644 core/vendor/twig/twig/doc/filters/raw.rst create mode 100644 core/vendor/twig/twig/doc/filters/replace.rst create mode 100644 core/vendor/twig/twig/doc/filters/reverse.rst create mode 100644 core/vendor/twig/twig/doc/filters/slice.rst create mode 100644 core/vendor/twig/twig/doc/filters/sort.rst create mode 100644 core/vendor/twig/twig/doc/filters/striptags.rst create mode 100644 core/vendor/twig/twig/doc/filters/title.rst create mode 100644 core/vendor/twig/twig/doc/filters/trim.rst create mode 100644 core/vendor/twig/twig/doc/filters/upper.rst create mode 100644 core/vendor/twig/twig/doc/filters/url_encode.rst create mode 100644 core/vendor/twig/twig/doc/functions/attribute.rst create mode 100644 core/vendor/twig/twig/doc/functions/block.rst create mode 100644 core/vendor/twig/twig/doc/functions/constant.rst create mode 100644 core/vendor/twig/twig/doc/functions/cycle.rst create mode 100644 core/vendor/twig/twig/doc/functions/date.rst create mode 100644 core/vendor/twig/twig/doc/functions/dump.rst create mode 100644 core/vendor/twig/twig/doc/functions/index.rst create mode 100644 core/vendor/twig/twig/doc/functions/parent.rst create mode 100644 core/vendor/twig/twig/doc/functions/random.rst create mode 100644 core/vendor/twig/twig/doc/functions/range.rst create mode 100644 core/vendor/twig/twig/doc/index.rst create mode 100644 core/vendor/twig/twig/doc/internals.rst create mode 100644 core/vendor/twig/twig/doc/intro.rst create mode 100644 core/vendor/twig/twig/doc/recipes.rst create mode 100644 core/vendor/twig/twig/doc/tags/autoescape.rst create mode 100644 core/vendor/twig/twig/doc/tags/block.rst create mode 100644 core/vendor/twig/twig/doc/tags/do.rst create mode 100644 core/vendor/twig/twig/doc/tags/embed.rst create mode 100644 core/vendor/twig/twig/doc/tags/extends.rst create mode 100644 core/vendor/twig/twig/doc/tags/filter.rst create mode 100644 core/vendor/twig/twig/doc/tags/flush.rst create mode 100644 core/vendor/twig/twig/doc/tags/for.rst create mode 100644 core/vendor/twig/twig/doc/tags/from.rst create mode 100644 core/vendor/twig/twig/doc/tags/if.rst create mode 100644 core/vendor/twig/twig/doc/tags/import.rst create mode 100644 core/vendor/twig/twig/doc/tags/include.rst create mode 100644 core/vendor/twig/twig/doc/tags/index.rst create mode 100644 core/vendor/twig/twig/doc/tags/macro.rst create mode 100644 core/vendor/twig/twig/doc/tags/raw.rst create mode 100644 core/vendor/twig/twig/doc/tags/sandbox.rst create mode 100644 core/vendor/twig/twig/doc/tags/set.rst create mode 100644 core/vendor/twig/twig/doc/tags/spaceless.rst create mode 100644 core/vendor/twig/twig/doc/tags/use.rst create mode 100644 core/vendor/twig/twig/doc/templates.rst create mode 100644 core/vendor/twig/twig/doc/tests/constant.rst create mode 100644 core/vendor/twig/twig/doc/tests/defined.rst create mode 100644 core/vendor/twig/twig/doc/tests/divisibleby.rst create mode 100644 core/vendor/twig/twig/doc/tests/empty.rst create mode 100644 core/vendor/twig/twig/doc/tests/even.rst create mode 100644 core/vendor/twig/twig/doc/tests/index.rst create mode 100644 core/vendor/twig/twig/doc/tests/iterable.rst create mode 100644 core/vendor/twig/twig/doc/tests/null.rst create mode 100644 core/vendor/twig/twig/doc/tests/odd.rst create mode 100644 core/vendor/twig/twig/doc/tests/sameas.rst create mode 100644 core/vendor/twig/twig/ext/twig/.gitignore create mode 100644 core/vendor/twig/twig/ext/twig/LICENSE create mode 100644 core/vendor/twig/twig/ext/twig/config.m4 create mode 100644 core/vendor/twig/twig/ext/twig/config.w32 create mode 100644 core/vendor/twig/twig/ext/twig/php_twig.h create mode 100644 core/vendor/twig/twig/ext/twig/twig.c rename core/vendor/{ => twig/twig/lib}/Twig/Autoloader.php (93%) rename core/vendor/{ => twig/twig/lib}/Twig/Compiler.php (95%) rename core/vendor/{ => twig/twig/lib}/Twig/CompilerInterface.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Environment.php (99%) rename core/vendor/{ => twig/twig/lib}/Twig/Error.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Error/Loader.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Error/Runtime.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Error/Syntax.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/ExpressionParser.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Extension.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Extension/Core.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Extension/Debug.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Extension/Escaper.php (91%) rename core/vendor/{ => twig/twig/lib}/Twig/Extension/Optimizer.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Extension/Sandbox.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/ExtensionInterface.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Filter.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Filter/Function.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Filter/Method.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Filter/Node.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/FilterInterface.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Function.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Function/Function.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Function/Method.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Function/Node.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/FunctionInterface.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Lexer.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/LexerInterface.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Loader/Array.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Loader/Chain.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Loader/Filesystem.php (98%) rename core/vendor/{ => twig/twig/lib}/Twig/Loader/String.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/LoaderInterface.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Markup.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/AutoEscape.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Block.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/BlockReference.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Body.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Do.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Embed.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Array.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/AssignName.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/Add.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/And.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/BitwiseAnd.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/BitwiseOr.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/BitwiseXor.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/Concat.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/Div.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/Equal.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/FloorDiv.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/Greater.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/GreaterEqual.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/In.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/Less.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/LessEqual.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/Mod.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/Mul.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/NotEqual.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/NotIn.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/Or.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/Power.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/Range.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Binary/Sub.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/BlockReference.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Conditional.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Constant.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/ExtensionReference.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Filter.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Filter/Default.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Function.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/GetAttr.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/MethodCall.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Name.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Parent.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/TempName.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Test.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Test/Constant.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Test/Defined.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Test/Divisibleby.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Test/Even.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Test/Null.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Test/Odd.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Test/Sameas.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Unary.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Unary/Neg.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Unary/Not.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Expression/Unary/Pos.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Flush.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/For.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/ForLoop.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/If.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Import.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Include.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Macro.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Module.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Print.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Sandbox.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/SandboxedModule.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/SandboxedPrint.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Set.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/SetTemp.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Spaceless.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Node/Text.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/NodeInterface.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/NodeOutputInterface.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/NodeTraverser.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/NodeVisitor/Escaper.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/NodeVisitor/Optimizer.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/NodeVisitor/SafeAnalysis.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/NodeVisitor/Sandbox.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/NodeVisitorInterface.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Parser.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/ParserInterface.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Sandbox/SecurityError.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Sandbox/SecurityPolicy.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Sandbox/SecurityPolicyInterface.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Template.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TemplateInterface.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Test/Function.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Test/Method.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Test/Node.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TestInterface.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/Token.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParser.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParser/AutoEscape.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParser/Block.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParser/Do.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParser/Embed.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParser/Extends.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParser/Filter.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParser/Flush.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParser/For.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParser/From.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParser/If.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParser/Import.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParser/Include.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParser/Macro.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParser/Sandbox.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParser/Set.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParser/Spaceless.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParser/Use.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParserBroker.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParserBrokerInterface.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenParserInterface.php (100%) rename core/vendor/{ => twig/twig/lib}/Twig/TokenStream.php (100%) create mode 100644 core/vendor/twig/twig/package.xml.tpl create mode 100644 core/vendor/twig/twig/phpunit.xml.dist create mode 100644 core/vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/CompilerTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/ErrorTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/only.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/template_instance.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/templates_as_array.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/with_variables.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/basic.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_in_a_block.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/trim_block.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test create mode 100644 core/vendor/twig/twig/test/Twig/Tests/LexerTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/DoTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/SandboxedModuleTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/SandboxedPrintTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/TestCase.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/ParserTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/TemplateTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php create mode 100644 core/vendor/twig/twig/test/Twig/Tests/integrationTest.php create mode 100644 core/vendor/twig/twig/test/bootstrap.php diff --git a/core/composer.json b/core/composer.json new file mode 100644 index 000000000000..64928b1191f9 --- /dev/null +++ b/core/composer.json @@ -0,0 +1,13 @@ +{ + "require": { + "symfony/class-loader": "2.1.*", + "symfony/dependency-injection": "2.1.*", + "symfony/event-dispatcher": "2.1.*", + "symfony/http-foundation": "2.1.*", + "symfony/http-kernel": "2.1.*", + "symfony/routing": "2.1.*", + "symfony/yaml": "2.1.*", + "twig/twig": "1.8.*" + }, + "minimum-stability": "beta" +} diff --git a/core/composer.lock b/core/composer.lock new file mode 100644 index 000000000000..c861d34a9042 --- /dev/null +++ b/core/composer.lock @@ -0,0 +1,45 @@ +{ + "hash": "ec77094fc475b57afb7a27f63983ead1", + "packages": [ + { + "package": "symfony/class-loader", + "version": "v2.1.0-BETA1" + }, + { + "package": "symfony/dependency-injection", + "version": "v2.1.0-BETA1" + }, + { + "package": "symfony/event-dispatcher", + "version": "v2.1.0-BETA1" + }, + { + "package": "symfony/http-foundation", + "version": "v2.1.0-BETA1" + }, + { + "package": "symfony/http-kernel", + "version": "v2.1.0-BETA1" + }, + { + "package": "symfony/routing", + "version": "v2.1.0-BETA1" + }, + { + "package": "symfony/yaml", + "version": "v2.1.0-BETA1" + }, + { + "package": "twig/twig", + "version": "v1.8.3" + } + ], + "packages-dev": null, + "aliases": [ + + ], + "minimum-stability": "beta", + "stability-flags": [ + + ] +} diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index fa1335b8f6d0..f3aeab47fa7b 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -2994,13 +2994,13 @@ function drupal_classloader() { if (!isset($loader)) { // Include the Symfony ClassLoader for loading PSR-0-compatible classes. - require_once DRUPAL_ROOT . '/core/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php'; + require_once DRUPAL_ROOT . '/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php'; // @todo Use a cleaner way than variable_get() to switch autoloaders. switch (variable_get('autoloader_mode', 'default')) { case 'apc': if (function_exists('apc_store')) { - require_once DRUPAL_ROOT . '/core/vendor/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php'; + require_once DRUPAL_ROOT . '/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php'; $loader = new ApcUniversalClassLoader('drupal.' . $GLOBALS['drupal_hash_salt']); break; } @@ -3015,13 +3015,19 @@ function drupal_classloader() { // Register explicit PSR-0 vendor namespaces. $loader->registerNamespaces(array( - // All Symfony-borrowed code lives in /core/vendor/Symfony. - 'Symfony' => DRUPAL_ROOT . '/core/vendor', + // All Symfony-borrowed code lives in /core/vendor/symfony. + 'Symfony\Component\ClassLoader' => DRUPAL_ROOT . '/core/vendor/symfony/class-loader', + 'Symfony\Component\DependencyInjection' => DRUPAL_ROOT . '/core/vendor/symfony/dependency-injection', + 'Symfony\Component\EventDispatcher' => DRUPAL_ROOT . '/core/vendor/symfony/event-dispatcher', + 'Symfony\Component\HttpFoundation' => DRUPAL_ROOT . '/core/vendor/symfony/http-foundation', + 'Symfony\Component\HttpKernel' => DRUPAL_ROOT . '/core/vendor/symfony/http-kernel', + 'Symfony\Component\Routing' => DRUPAL_ROOT . '/core/vendor/symfony/routing', + 'Symfony\Component\Yaml' => DRUPAL_ROOT . '/core/vendor/symfony/yaml', )); // Register PEAR-style vendor namespaces. $loader->registerPrefixes(array( - // All Twig-borrowed code lives in /core/vendor/Twig. - 'Twig' => DRUPAL_ROOT . '/core/vendor', + // All Twig-borrowed code lives in /core/vendor/twig. + 'Twig' => DRUPAL_ROOT . '/core/vendor/twig/twig/lib', )); // Register the Drupal namespace for classes in core as a fallback. // This allows to register additional namespaces within the Drupal namespace diff --git a/core/vendor/.gitignore b/core/vendor/.gitignore new file mode 100644 index 000000000000..eacfa776e87e --- /dev/null +++ b/core/vendor/.gitignore @@ -0,0 +1,3 @@ +# SimpleTest breaks with the following files, so avoid adding them. +symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php +symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/php5.4/traits.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/ServerBag.php b/core/vendor/Symfony/Component/HttpFoundation/ServerBag.php deleted file mode 100644 index 6a077f4b8d26..000000000000 --- a/core/vendor/Symfony/Component/HttpFoundation/ServerBag.php +++ /dev/null @@ -1,48 +0,0 @@ -<?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. - */ - -namespace Symfony\Component\HttpFoundation; - -/** - * ServerBag is a container for HTTP headers from the $_SERVER variable. - * - * @author Fabien Potencier <fabien@symfony.com> - * @author Bulat Shakirzyanov <mallluhuct@gmail.com> - */ -class ServerBag extends ParameterBag -{ - /** - * Gets the HTTP headers. - * - * @return string - */ - public function getHeaders() - { - $headers = array(); - foreach ($this->parameters as $key => $value) { - if (0 === strpos($key, 'HTTP_')) { - $headers[substr($key, 5)] = $value; - } - // CONTENT_* are not prefixed with HTTP_ - elseif (in_array($key, array('CONTENT_LENGTH', 'CONTENT_MD5', 'CONTENT_TYPE'))) { - $headers[$key] = $value; - } - } - - // PHP_AUTH_USER/PHP_AUTH_PW - if (isset($this->parameters['PHP_AUTH_USER'])) { - $pass = isset($this->parameters['PHP_AUTH_PW']) ? $this->parameters['PHP_AUTH_PW'] : ''; - $headers['AUTHORIZATION'] = 'Basic '.base64_encode($this->parameters['PHP_AUTH_USER'].':'.$pass); - } - - return $headers; - } -} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php b/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php deleted file mode 100644 index fe29832f70c5..000000000000 --- a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php +++ /dev/null @@ -1,142 +0,0 @@ -<?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. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; - -/** - * MemcacheSessionHandler. - * - * @author Drak <drak@zikula.org> - */ -class MemcacheSessionHandler implements \SessionHandlerInterface -{ - /** - * Memcache driver. - * - * @var \Memcache - */ - private $memcache; - - /** - * Configuration options. - * - * @var array - */ - private $memcacheOptions; - - /** - * Key prefix for shared environments. - * - * @var string - */ - private $prefix; - - /** - * Constructor. - * - * @param \Memcache $memcache A \Memcache instance - * @param array $memcacheOptions An associative array of Memcache options - * @param array $options Session configuration options. - */ - public function __construct(\Memcache $memcache, array $memcacheOptions = array(), array $options = array()) - { - $this->memcache = $memcache; - - // defaults - if (!isset($memcacheOptions['serverpool'])) { - $memcacheOptions['serverpool'] = array(array( - 'host' => '127.0.0.1', - 'port' => 11211, - 'timeout' => 1, - 'persistent' => false, - 'weight' => 1, - 'retry_interval' => 15, - )); - } - - $memcacheOptions['expiretime'] = isset($memcacheOptions['expiretime']) ? (int)$memcacheOptions['expiretime'] : 86400; - $this->prefix = isset($memcacheOptions['prefix']) ? $memcacheOptions['prefix'] : 'sf2s'; - - $this->memcacheOptions = $memcacheOptions; - } - - protected function addServer(array $server) - { - if (!array_key_exists('host', $server)) { - throw new \InvalidArgumentException('host key must be set'); - } - - $server['port'] = isset($server['port']) ? (int)$server['port'] : 11211; - $server['timeout'] = isset($server['timeout']) ? (int)$server['timeout'] : 1; - $server['persistent'] = isset($server['persistent']) ? (bool)$server['persistent'] : false; - $server['weight'] = isset($server['weight']) ? (int)$server['weight'] : 1; - $server['retry_interval'] = isset($server['retry_interval']) ? (int)$server['retry_interval'] : 15; - - $this->memcache->addserver($server['host'], $server['port'], $server['persistent'],$server['weight'],$server['timeout'],$server['retry_interval']); - - } - - /** - * {@inheritdoc} - */ - public function open($savePath, $sessionName) - { - foreach ($this->memcacheOptions['serverpool'] as $server) { - $this->addServer($server); - } - - return true; - } - - /** - * {@inheritdoc} - */ - public function close() - { - return $this->memcache->close(); - } - - /** - * {@inheritdoc} - */ - public function read($sessionId) - { - return $this->memcache->get($this->prefix.$sessionId) ?: ''; - } - - /** - * {@inheritdoc} - */ - public function write($sessionId, $data) - { - if (!$this->memcache->replace($this->prefix.$sessionId, $data, 0, $this->memcacheOptions['expiretime'])) { - return $this->memcache->set($this->prefix.$sessionId, $data, 0, $this->memcacheOptions['expiretime']); - } - return true; - } - - /** - * {@inheritdoc} - */ - public function destroy($sessionId) - { - return $this->memcache->delete($this->prefix.$sessionId); - } - - /** - * {@inheritdoc} - */ - public function gc($lifetime) - { - // not required here because memcache will auto expire the records anyhow. - return true; - } -} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php b/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php deleted file mode 100644 index 71770dda83d7..000000000000 --- a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php +++ /dev/null @@ -1,130 +0,0 @@ -<?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. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; - -/** - * MemcachedSessionHandler. - * - * Memcached based session storage handler based on the Memcached class - * provided by the PHP memcached extension. - * - * @see http://php.net/memcached - * - * @author Drak <drak@zikula.org> - */ -class MemcachedSessionHandler implements \SessionHandlerInterface -{ - /** - * Memcached driver. - * - * @var \Memcached - */ - private $memcached; - - /** - * Configuration options. - * - * @var array - */ - private $memcachedOptions; - - /** - * Constructor. - * - * @param \Memcached $memcached A \Memcached instance - * @param array $memcachedOptions An associative array of Memcached options - * @param array $options Session configuration options. - */ - public function __construct(\Memcached $memcached, array $memcachedOptions = array(), array $options = array()) - { - $this->memcached = $memcached; - - // defaults - if (!isset($memcachedOptions['serverpool'])) { - $memcachedOptions['serverpool'][] = array( - 'host' => '127.0.0.1', - 'port' => 11211, - 'weight' => 1); - } - - $memcachedOptions['expiretime'] = isset($memcachedOptions['expiretime']) ? (int)$memcachedOptions['expiretime'] : 86400; - - $this->memcached->setOption(\Memcached::OPT_PREFIX_KEY, isset($memcachedOptions['prefix']) ? $memcachedOptions['prefix'] : 'sf2s'); - - $this->memcachedOptions = $memcachedOptions; - } - - /** - * {@inheritdoc} - */ - public function open($savePath, $sessionName) - { - return $this->memcached->addServers($this->memcachedOptions['serverpool']); - } - - /** - * {@inheritdoc} - */ - public function close() - { - return true; - } - - /** - * {@inheritdoc} - */ - public function read($sessionId) - { - return $this->memcached->get($sessionId) ?: ''; - } - - /** - * {@inheritdoc} - */ - public function write($sessionId, $data) - { - return $this->memcached->set($sessionId, $data, $this->memcachedOptions['expiretime']); - } - - /** - * {@inheritdoc} - */ - public function destroy($sessionId) - { - return $this->memcached->delete($sessionId); - } - - /** - * {@inheritdoc} - */ - public function gc($lifetime) - { - // not required here because memcached will auto expire the records anyhow. - return true; - } - - /** - * Adds a server to the memcached handler. - * - * @param array $server - */ - protected function addServer(array $server) - { - if (array_key_exists('host', $server)) { - throw new \InvalidArgumentException('host key must be set'); - } - $server['port'] = isset($server['port']) ? (int)$server['port'] : 11211; - $server['timeout'] = isset($server['timeout']) ? (int)$server['timeout'] : 1; - $server['presistent'] = isset($server['presistent']) ? (bool)$server['presistent'] : false; - $server['weight'] = isset($server['weight']) ? (bool)$server['weight'] : 1; - } -} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php b/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php deleted file mode 100644 index 422e3a79a6dd..000000000000 --- a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php +++ /dev/null @@ -1,41 +0,0 @@ -<?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. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; - -/** - * NativeFileSessionHandler. - * - * Native session handler using PHP's built in file storage. - * - * @author Drak <drak@zikula.org> - */ -class NativeFileSessionHandler extends NativeSessionHandler -{ - /** - * Constructor. - * - * @param string $savePath Path of directory to save session files. Default null will leave setting as defined by PHP. - */ - public function __construct($savePath = null) - { - if (null === $savePath) { - $savePath = ini_get('session.save_path'); - } - - if ($savePath && !is_dir($savePath)) { - mkdir($savePath, 0777, true); - } - - ini_set('session.save_handler', 'files'); - ini_set('session.save_path', $savePath); - } -} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeMemcacheSessionHandler.php b/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeMemcacheSessionHandler.php deleted file mode 100644 index 4fea88b71baa..000000000000 --- a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeMemcacheSessionHandler.php +++ /dev/null @@ -1,68 +0,0 @@ -<?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. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; - -/** - * NativeMemcacheSessionHandler. - * - * Driver for the memcache session save hadlers provided by the memcache PHP extension. - * - * @see http://php.net/memcache - * - * @author Drak <drak@zikula.org> - */ -class NativeMemcacheSessionHandler extends NativeSessionHandler -{ - /** - * Constructor. - * - * @param string $savePath Path of memcache server. - * @param array $options Session configuration options. - */ - public function __construct($savePath = 'tcp://127.0.0.1:11211?persistent=0', array $options = array()) - { - if (!extension_loaded('memcache')) { - throw new \RuntimeException('PHP does not have "memcache" session module registered'); - } - - if (null === $savePath) { - $savePath = ini_get('session.save_path'); - } - - ini_set('session.save_handler', 'memcache'); - ini_set('session.save_path', $savePath); - - $this->setOptions($options); - } - - /** - * Set any memcached ini values. - * - * @see http://php.net/memcache.ini - */ - protected function setOptions(array $options) - { - $validOptions = array_flip(array( - 'memcache.allow_failover', 'memcache.max_failover_attempts', - 'memcache.chunk_size', 'memcache.default_port', 'memcache.hash_strategy', - 'memcache.hash_function', 'memcache.protocol', 'memcache.redundancy', - 'memcache.session_redundancy', 'memcache.compress_threshold', - 'memcache.lock_timeout', - )); - - foreach ($options as $key => $value) { - if (isset($validOptions[$key])) { - ini_set($key, $value); - } - } - } -} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeMemcachedSessionHandler.php b/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeMemcachedSessionHandler.php deleted file mode 100644 index 8f646605d2b3..000000000000 --- a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeMemcachedSessionHandler.php +++ /dev/null @@ -1,67 +0,0 @@ -<?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. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; - -/** - * NativeMemcachedSessionHandler. - * - * Driver for the memcached session save hadlers provided by the memcached PHP extension. - * - * @see http://php.net/memcached.sessions - * - * @author Drak <drak@zikula.org> - */ -class NativeMemcachedSessionHandler extends NativeSessionHandler -{ - /** - * Constructor. - * - * @param string $savePath Comma separated list of servers: e.g. memcache1.example.com:11211,memcache2.example.com:11211 - * @param array $options Session configuration options. - */ - public function __construct($savePath = '127.0.0.1:11211', array $options = array()) - { - if (!extension_loaded('memcached')) { - throw new \RuntimeException('PHP does not have "memcached" session module registered'); - } - - if (null === $savePath) { - $savePath = ini_get('session.save_path'); - } - - ini_set('session.save_handler', 'memcached'); - ini_set('session.save_path', $savePath); - - $this->setOptions($options); - } - - /** - * Set any memcached ini values. - * - * @see https://github.com/php-memcached-dev/php-memcached/blob/master/memcached.ini - */ - protected function setOptions(array $options) - { - $validOptions = array_flip(array( - 'memcached.sess_locking', 'memcached.sess_lock_wait', - 'memcached.sess_prefix', 'memcached.compression_type', - 'memcached.compression_factor', 'memcached.compression_threshold', - 'memcached.serializer', - )); - - foreach ($options as $key => $value) { - if (isset($validOptions[$key])) { - ini_set($key, $value); - } - } - } -} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeRedisSessionHandler.php b/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeRedisSessionHandler.php deleted file mode 100644 index d155052a97b3..000000000000 --- a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeRedisSessionHandler.php +++ /dev/null @@ -1,43 +0,0 @@ -<?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. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; - -/** - * NativeRedisSessionStorage. - * - * Driver for the redis session save hadlers provided by the redis PHP extension. - * - * @see https://github.com/nicolasff/phpredis - * - * @author Andrej Hudec <pulzarraider@gmail.com> - */ -class NativeRedisSessionHandler extends NativeSessionHandler -{ - /** - * Constructor. - * - * @param string $savePath Path of redis server. - */ - public function __construct($savePath = 'tcp://127.0.0.1:6379?persistent=0') - { - if (!extension_loaded('redis')) { - throw new \RuntimeException('PHP does not have "redis" session module registered'); - } - - if (null === $savePath) { - $savePath = ini_get('session.save_path'); - } - - ini_set('session.save_handler', 'redis'); - ini_set('session.save_path', $savePath); - } -} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php b/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php deleted file mode 100644 index 1260ad0d295a..000000000000 --- a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php +++ /dev/null @@ -1,24 +0,0 @@ -<?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. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; - -/** - * Adds SessionHandler functionality if available. - * - * @see http://php.net/sessionhandler - */ - -if (version_compare(phpversion(), '5.4.0', '>=')) { - class NativeSessionHandler extends \SessionHandler {} -} else { - class NativeSessionHandler {} -} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSqliteSessionHandler.php b/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSqliteSessionHandler.php deleted file mode 100644 index 098cc8a68a8d..000000000000 --- a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSqliteSessionHandler.php +++ /dev/null @@ -1,58 +0,0 @@ -<?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. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; - -/** - * NativeSqliteSessionHandler. - * - * Driver for the sqlite session save hadlers provided by the SQLite PHP extension. - * - * @author Drak <drak@zikula.org> - */ -class NativeSqliteSessionHandler extends NativeSessionHandler -{ - /** - * Constructor. - * - * @param string $savePath Path to SQLite database file itself. - * @param array $options Session configuration options. - */ - public function __construct($savePath, array $options = array()) - { - if (!extension_loaded('sqlite')) { - throw new \RuntimeException('PHP does not have "sqlite" session module registered'); - } - - if (null === $savePath) { - $savePath = ini_get('session.save_path'); - } - - ini_set('session.save_handler', 'sqlite'); - ini_set('session.save_path', $savePath); - - $this->setOptions($options); - } - - /** - * Set any sqlite ini values. - * - * @see http://php.net/sqlite.configuration - */ - protected function setOptions(array $options) - { - foreach ($options as $key => $value) { - if (in_array($key, array('sqlite.assoc_case'))) { - ini_set($key, $value); - } - } - } -} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php b/core/vendor/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php deleted file mode 100644 index b99ad1ce8d8b..000000000000 --- a/core/vendor/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php +++ /dev/null @@ -1,52 +0,0 @@ -<?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. - */ - -namespace Symfony\Component\HttpFoundation\Tests; - -use Symfony\Component\HttpFoundation\ServerBag; - -/** - * ServerBagTest - * - * @author Bulat Shakirzyanov <mallluhuct@gmail.com> - */ -class ServerBagTest extends \PHPUnit_Framework_TestCase -{ - public function testShouldExtractHeadersFromServerArray() - { - $server = array( - 'SOME_SERVER_VARIABLE' => 'value', - 'SOME_SERVER_VARIABLE2' => 'value', - 'ROOT' => 'value', - 'HTTP_CONTENT_TYPE' => 'text/html', - 'HTTP_CONTENT_LENGTH' => '0', - 'HTTP_ETAG' => 'asdf', - 'PHP_AUTH_USER' => 'foo', - 'PHP_AUTH_PW' => 'bar', - ); - - $bag = new ServerBag($server); - - $this->assertEquals(array( - 'CONTENT_TYPE' => 'text/html', - 'CONTENT_LENGTH' => '0', - 'ETAG' => 'asdf', - 'AUTHORIZATION' => 'Basic '.base64_encode('foo:bar'), - ), $bag->getHeaders()); - } - - public function testHttpPasswordIsOptional() - { - $bag = new ServerBag(array('PHP_AUTH_USER' => 'foo')); - - $this->assertEquals(array('AUTHORIZATION' => 'Basic '.base64_encode('foo:')), $bag->getHeaders()); - } -} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php b/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php deleted file mode 100644 index 49e1568a0982..000000000000 --- a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php +++ /dev/null @@ -1,126 +0,0 @@ -<?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. - */ - -namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler; - -use Symfony\Component\HttpFoundation\Session\Storage\Handler\MemcacheSessionHandler; - -class MemcacheSessionHandlerTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var MemcacheSessionHandler - */ - protected $storage; - - protected $memcache; - - protected function setUp() - { - if (!class_exists('Memcache')) { - $this->markTestSkipped('Skipped tests Memcache class is not present'); - } - - $this->memcache = $this->getMock('Memcache'); - $this->storage = new MemcacheSessionHandler($this->memcache); - } - - protected function tearDown() - { - $this->memcache = null; - $this->storage = null; - } - - public function testOpenSession() - { - $this->memcache->expects($this->atLeastOnce()) - ->method('addServer') - ->with('127.0.0.1', 11211, false, 1, 1, 15); - - $this->assertTrue($this->storage->open('', '')); - } - - public function testConstructingWithServerPool() - { - $mock = $this->getMock('Memcache'); - - $storage = new MemcacheSessionHandler($mock, array( - 'serverpool' => array( - array('host' => '127.0.0.2'), - array('host' => '127.0.0.3', - 'port' => 11212, - 'timeout' => 10, - 'persistent' => true, - 'weight' => 5, - 'retry_interval' => 39, - ), - array('host' => '127.0.0.4', - 'port' => 11211, - 'weight' => 2 - ), - ), - )); - - $matcher = $mock - ->expects($this->at(0)) - ->method('addServer') - ->with('127.0.0.2', 11211, false, 1, 1, 15); - $matcher = $mock - ->expects($this->at(1)) - ->method('addServer') - ->with('127.0.0.3', 11212, true, 5, 10, 39); - $matcher = $mock - ->expects($this->at(2)) - ->method('addServer') - ->with('127.0.0.4', 11211, false, 2, 1, 15); - $this->assertTrue($storage->open('', '')); - } - - public function testCloseSession() - { - $this->memcache->expects($this->once()) - ->method('close') - ->will($this->returnValue(true)); - - $this->assertTrue($this->storage->close()); - } - - public function testReadSession() - { - $this->memcache->expects($this->once()) - ->method('get'); - - $this->assertEquals('', $this->storage->read('')); - } - - public function testWriteSession() - { - $this->memcache->expects($this->once()) - ->method('set') - ->will($this->returnValue(true)); - - $this->assertTrue($this->storage->write('', '')); - } - - public function testDestroySession() - { - $this->memcache->expects($this->once()) - ->method('delete') - ->will($this->returnValue(true)); - - $this->assertTrue($this->storage->destroy('')); - } - - public function testGcSession() - { - $this->assertTrue($this->storage->gc(123)); - } - -} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php b/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php deleted file mode 100644 index 5731d92c22dd..000000000000 --- a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php +++ /dev/null @@ -1,87 +0,0 @@ -<?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. - */ - -namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler; - -use Symfony\Component\HttpFoundation\Session\Storage\Handler\MemcachedSessionHandler; - -class MemcacheddSessionHandlerTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var MemcachedSessionHandler - */ - protected $storage; - - protected $memcached; - - protected function setUp() - { - if (!class_exists('Memcached')) { - $this->markTestSkipped('Skipped tests Memcache class is not present'); - } - - $this->memcached = $this->getMock('Memcached'); - $this->storage = new MemcachedSessionHandler($this->memcached); - } - - protected function tearDown() - { - $this->memcached = null; - $this->storage = null; - } - - public function testOpenSession() - { - $this->memcached->expects($this->atLeastOnce()) - ->method('addServers') - ->will($this->returnValue(true)); - - $this->assertTrue($this->storage->open('', '')); - } - - public function testCloseSession() - { - $this->assertTrue($this->storage->close()); - } - - public function testReadSession() - { - $this->memcached->expects($this->once()) - ->method('get'); - - $this->assertEquals('', $this->storage->read('')); - } - - public function testWriteSession() - { - $this->memcached->expects($this->once()) - ->method('set') - ->will($this->returnValue(true)); - - $this->assertTrue($this->storage->write('', '')); - } - - public function testDestroySession() - { - $this->memcached->expects($this->once()) - ->method('delete') - ->will($this->returnValue(true)); - - $this->assertTrue($this->storage->destroy('')); - } - - public function testGcSession() - { - $this->assertTrue($this->storage->gc(123)); - } - - -} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php b/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php deleted file mode 100644 index 7bdf3a1e3ff0..000000000000 --- a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php +++ /dev/null @@ -1,49 +0,0 @@ -<?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. - */ - -namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler; - -use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler; -use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; - -/** - * Test class for NativeFileSessionHandler. - * - * @author Drak <drak@zikula.org> - * - * @runTestsInSeparateProcesses - */ -class NativeFileSessionHandlerTest extends \PHPUnit_Framework_TestCase -{ - public function testConstruct() - { - $storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeFileSessionHandler(sys_get_temp_dir())); - - if (version_compare(phpversion(), '5.4.0', '<')) { - $this->assertEquals('files', $storage->getSaveHandler()->getSaveHandlerName()); - $this->assertEquals('files', ini_get('session.save_handler')); - } else { - $this->assertEquals('files', $storage->getSaveHandler()->getSaveHandlerName()); - $this->assertEquals('user', ini_get('session.save_handler')); - } - - $this->assertEquals(sys_get_temp_dir(), ini_get('session.save_path')); - $this->assertEquals('TESTING', ini_get('session.name')); - } - - public function testConstructDefault() - { - $path = ini_get('session.save_path'); - $storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeFileSessionHandler()); - - $this->assertEquals($path, ini_get('session.save_path')); - } -} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeMemcacheSessionHandlerTest.php b/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeMemcacheSessionHandlerTest.php deleted file mode 100644 index b915e59ca091..000000000000 --- a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeMemcacheSessionHandlerTest.php +++ /dev/null @@ -1,45 +0,0 @@ -<?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. - */ - -namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler; - -use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeMemcacheSessionHandler; -use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; - -/** - * Test class for NativeMemcacheSessionHandler. - * - * @author Drak <drak@zikula.org> - * - * @runTestsInSeparateProcesses - */ -class NativeMemcacheSessionHandlerTest extends \PHPUnit_Framework_TestCase -{ - public function testSaveHandlers() - { - if (!extension_loaded('memcache')) { - $this->markTestSkipped('Skipped tests memcache extension is not present'); - } - - $storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeMemcacheSessionHandler('tcp://127.0.0.1:11211?persistent=0')); - - if (version_compare(phpversion(), '5.4.0', '<')) { - $this->assertEquals('memcache', $storage->getSaveHandler()->getSaveHandlerName()); - $this->assertEquals('memcache', ini_get('session.save_handler')); - } else { - $this->assertEquals('memcache', $storage->getSaveHandler()->getSaveHandlerName()); - $this->assertEquals('user', ini_get('session.save_handler')); - } - - $this->assertEquals('tcp://127.0.0.1:11211?persistent=0', ini_get('session.save_path')); - $this->assertEquals('TESTING', ini_get('session.name')); - } -} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeMemcachedSessionHandlerTest.php b/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeMemcachedSessionHandlerTest.php deleted file mode 100644 index 5f65e9a0fefa..000000000000 --- a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeMemcachedSessionHandlerTest.php +++ /dev/null @@ -1,49 +0,0 @@ -<?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. - */ - -namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler; - -use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeMemcachedSessionHandler; -use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; - -/** - * Test class for NativeMemcachedSessionHandler. - * - * @author Drak <drak@zikula.org> - * - * @runTestsInSeparateProcesses - */ -class NativeMemcachedSessionHandlerTest extends \PHPUnit_Framework_TestCase -{ - public function testSaveHandlers() - { - if (!extension_loaded('memcached')) { - $this->markTestSkipped('Skipped tests memcached extension is not present'); - } - - // test takes too long if memcached server is not running - ini_set('memcached.sess_locking', '0'); - - $storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeMemcachedSessionHandler('127.0.0.1:11211')); - - if (version_compare(phpversion(), '5.4.0', '<')) { - $this->assertEquals('memcached', $storage->getSaveHandler()->getSaveHandlerName()); - $this->assertEquals('memcached', ini_get('session.save_handler')); - } else { - $this->assertEquals('memcached', $storage->getSaveHandler()->getSaveHandlerName()); - $this->assertEquals('user', ini_get('session.save_handler')); - } - - $this->assertEquals('127.0.0.1:11211', ini_get('session.save_path')); - $this->assertEquals('TESTING', ini_get('session.name')); - } -} - diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeRedisSessionHandlerTest.php b/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeRedisSessionHandlerTest.php deleted file mode 100644 index 8a5777659d88..000000000000 --- a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeRedisSessionHandlerTest.php +++ /dev/null @@ -1,43 +0,0 @@ -<?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. - */ - -namespace Symfony\Component\HttpFoundation\Tests\Session\Storage; - -use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeRedisSessionHandler; -use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; - -/** - * Test class for NativeRedisSessionHandlerTest. - * - * @runTestsInSeparateProcesses - */ -class NativeRedisSessionHandlerTest extends \PHPUnit_Framework_TestCase -{ - public function testSaveHandlers() - { - if (!extension_loaded('redis')) { - $this->markTestSkipped('Skipped tests Redis extension is not present'); - } - - $storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeRedisSessionHandler('tcp://127.0.0.1:6379?persistent=0')); - - if (version_compare(phpversion(), '5.4.0', '<')) { - $this->assertEquals('redis', $storage->getSaveHandler()->getSaveHandlerName()); - $this->assertEquals('redis', ini_get('session.save_handler')); - } else { - $this->assertEquals('redis', $storage->getSaveHandler()->getSaveHandlerName()); - $this->assertEquals('user', ini_get('session.save_handler')); - } - - $this->assertEquals('tcp://127.0.0.1:6379?persistent=0', ini_get('session.save_path')); - $this->assertEquals('TESTING', ini_get('session.name')); - } -} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeSqliteSessionHandlerTest.php b/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeSqliteSessionHandlerTest.php deleted file mode 100644 index 983148e27950..000000000000 --- a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeSqliteSessionHandlerTest.php +++ /dev/null @@ -1,47 +0,0 @@ -<?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. - */ - -namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler; - -use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSqliteSessionHandler; -use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; - -/** - * Test class for NativeSqliteSessionHandler. - * - * @author Drak <drak@zikula.org> - * - * @runTestsInSeparateProcesses - */ -class NativeSqliteSessionHandlerTest extends \PHPUnit_Framework_TestCase -{ - public function testSaveHandlers() - { - if (!extension_loaded('sqlite')) { - $this->markTestSkipped('Skipped tests SQLite extension is not present'); - } - - $storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeSqliteSessionHandler(sys_get_temp_dir().'/sqlite.db')); - - if (version_compare(phpversion(), '5.4.0', '<')) { - $this->assertEquals('sqlite', $storage->getSaveHandler()->getSaveHandlerName()); - $this->assertEquals('sqlite', ini_get('session.save_handler')); - } else { - $this->assertEquals('sqlite', $storage->getSaveHandler()->getSaveHandlerName()); - $this->assertEquals('user', ini_get('session.save_handler')); - } - - - $this->assertEquals(sys_get_temp_dir().'/sqlite.db', ini_get('session.save_path')); - $this->assertEquals('TESTING', ini_get('session.name')); - } -} - diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/MemcacheProfilerStorageTest.php b/core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/MemcacheProfilerStorageTest.php deleted file mode 100644 index fb55026a9ad7..000000000000 --- a/core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/MemcacheProfilerStorageTest.php +++ /dev/null @@ -1,67 +0,0 @@ -<?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. - */ - -namespace Symfony\Component\HttpKernel\Tests\Profiler; - -use Symfony\Component\HttpKernel\Profiler\MemcacheProfilerStorage; - -class DummyMemcacheProfilerStorage extends MemcacheProfilerStorage -{ - public function getMemcache() - { - return parent::getMemcache(); - } -} - -/** - * @group memcached - */ -class MemcacheProfilerStorageTest extends AbstractProfilerStorageTest -{ - protected static $storage; - - public static function tearDownAfterClass() - { - if (self::$storage) { - self::$storage->purge(); - } - } - - protected function setUp() - { - if (!extension_loaded('memcache')) { - $this->markTestSkipped('MemcacheProfilerStorageTest requires that the extension memcache is loaded'); - } - - self::$storage = new DummyMemcacheProfilerStorage('memcache://127.0.0.1:11211', '', '', 86400); - try { - self::$storage->getMemcache(); - $stats = self::$storage->getMemcache()->getExtendedStats(); - if (!isset($stats['127.0.0.1:11211']) || $stats['127.0.0.1:11211'] === false) { - throw new \Exception(); - } - } catch (\Exception $e) { - $this->markTestSkipped('MemcacheProfilerStorageTest requires that there is a Memcache server present on localhost'); - } - - if (self::$storage) { - self::$storage->purge(); - } - } - - /** - * @return \Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface - */ - protected function getStorage() - { - return self::$storage; - } -} diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/bootstrap.php b/core/vendor/Symfony/Component/HttpKernel/Tests/bootstrap.php deleted file mode 100644 index 2386a26e1b9a..000000000000 --- a/core/vendor/Symfony/Component/HttpKernel/Tests/bootstrap.php +++ /dev/null @@ -1,37 +0,0 @@ -<?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. - */ - -spl_autoload_register(function ($class) { - foreach (array( - 'SYMFONY_EVENT_DISPATCHER' => 'EventDispatcher', - 'SYMFONY_HTTP_FOUNDATION' => 'HttpFoundation', - 'SYMFONY_DEPENDENCY_INJECTION' => 'DependencyInjection', - 'SYMFONY_CONSOLE' => 'Console', - 'SYMFONY_BROWSER_KIT' => 'BrowserKit', - 'SYMFONY_FINDER' => 'Finder', - 'SYMFONY_CLASS_LOADER' => 'ClassLoader', - 'SYMFONY_PROCESS' => 'Process', - 'SYMFONY_ROUTING' => 'Routing', - 'SYMFONY_CONFIG' => 'Config', - ) as $env => $name) { - if (isset($_SERVER[$env]) && 0 === strpos(ltrim($class, '/'), 'Symfony\Component\\'.$name)) { - if (file_exists($file = $_SERVER[$env].'/'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\\'.$name)).'.php')) { - require_once $file; - } - } - } - - if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\HttpKernel')) { - if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\HttpKernel')).'.php')) { - require_once $file; - } - } -}); diff --git a/core/vendor/Symfony/Component/Routing/Tests/bootstrap.php b/core/vendor/Symfony/Component/Routing/Tests/bootstrap.php deleted file mode 100644 index 8565b3352d0c..000000000000 --- a/core/vendor/Symfony/Component/Routing/Tests/bootstrap.php +++ /dev/null @@ -1,35 +0,0 @@ -<?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. - */ - -spl_autoload_register(function ($class) { - foreach (array( - 'SYMFONY_CONFIG' => 'Config', - 'SYMFONY_YAML' => 'Yaml', - ) as $env => $name) { - if (isset($_SERVER[$env]) && 0 === strpos(ltrim($class, '/'), 'Symfony\Component\\'.$name)) { - if (file_exists($file = $_SERVER[$env].'/'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\\'.$name)).'.php')) { - require_once $file; - } - } - } - - if (isset($_SERVER['DOCTRINE_COMMON']) && 0 === strpos(ltrim($class, '/'), 'Doctrine\Common')) { - if (file_exists($file = $_SERVER['DOCTRINE_COMMON'].'/lib/'.str_replace('\\', '/', $class).'.php')) { - require_once $file; - } - } - - if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\Routing')) { - if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\Routing')).'.php')) { - require_once $file; - } - } -}); diff --git a/core/vendor/autoload.php b/core/vendor/autoload.php new file mode 100644 index 000000000000..85087dda3e7f --- /dev/null +++ b/core/vendor/autoload.php @@ -0,0 +1,25 @@ +<?php + +// autoload.php generated by Composer +if (!class_exists('Composer\\Autoload\\ClassLoader', false)) { + require __DIR__ . '/composer' . '/ClassLoader.php'; +} + +return call_user_func(function() { + $loader = new \Composer\Autoload\ClassLoader(); + $composerDir = __DIR__ . '/composer'; + + $map = require $composerDir . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->add($namespace, $path); + } + + $classMap = require $composerDir . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + + $loader->register(); + + return $loader; +}); diff --git a/core/vendor/composer/ClassLoader.php b/core/vendor/composer/ClassLoader.php new file mode 100644 index 000000000000..146276eb68cb --- /dev/null +++ b/core/vendor/composer/ClassLoader.php @@ -0,0 +1,205 @@ +<?php + +/* + * This file is part of Composer. + * + * (c) Nils Adermann <naderman@naderman.de> + * Jordi Boggiano <j.boggiano@seld.be> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0 class loader + * + * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier <fabien@symfony.com> + * @author Jordi Boggiano <j.boggiano@seld.be> + */ +class ClassLoader +{ + private $prefixes = array(); + private $fallbackDirs = array(); + private $useIncludePath = false; + private $classMap = array(); + + public function getPrefixes() + { + return $this->prefixes; + } + + public function getFallbackDirs() + { + return $this->fallbackDirs; + } + + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param array $classMap Class to filename map + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of classes + * + * @param string $prefix The classes prefix + * @param array|string $paths The location(s) of the classes + */ + public function add($prefix, $paths) + { + if (!$prefix) { + foreach ((array) $paths as $path) { + $this->fallbackDirs[] = $path; + } + + return; + } + if (isset($this->prefixes[$prefix])) { + $this->prefixes[$prefix] = array_merge( + $this->prefixes[$prefix], + (array) $paths + ); + } else { + $this->prefixes[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param Boolean $useIncludePath + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return Boolean + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Registers this instance as an autoloader. + * + * @param Boolean $prepend Whether to prepend the autoloader or not + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + } + + /** + * Unregisters this instance as an autoloader. + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return Boolean|null True, if loaded + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + require $file; + + return true; + } + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|null The path, if found + */ + public function findFile($class) + { + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + + if ('\\' == $class[0]) { + $class = substr($class, 1); + } + + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)) . DIRECTORY_SEPARATOR; + $className = substr($class, $pos + 1); + } else { + // PEAR-like class name + $classPath = null; + $className = $class; + } + + $classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; + + foreach ($this->prefixes as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) { + return $dir . DIRECTORY_SEPARATOR . $classPath; + } + } + } + } + + foreach ($this->fallbackDirs as $dir) { + if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) { + return $dir . DIRECTORY_SEPARATOR . $classPath; + } + } + + if ($this->useIncludePath && $file = stream_resolve_include_path($classPath)) { + return $file; + } + } +} diff --git a/core/vendor/composer/autoload_classmap.php b/core/vendor/composer/autoload_classmap.php new file mode 100644 index 000000000000..4a9177d7fe10 --- /dev/null +++ b/core/vendor/composer/autoload_classmap.php @@ -0,0 +1,9 @@ +<?php + +// autoload_classmap.php generated by Composer + +$vendorDir = dirname(__DIR__); +$baseDir = dirname($vendorDir); + +return array( +); diff --git a/core/vendor/composer/autoload_namespaces.php b/core/vendor/composer/autoload_namespaces.php new file mode 100644 index 000000000000..6ae0e916e6be --- /dev/null +++ b/core/vendor/composer/autoload_namespaces.php @@ -0,0 +1,17 @@ +<?php + +// autoload_namespace.php generated by Composer + +$vendorDir = dirname(__DIR__); +$baseDir = dirname($vendorDir); + +return array( + 'Twig_' => $vendorDir . '/twig/twig/lib/', + 'Symfony\\Component\\Yaml' => $vendorDir . '/symfony/yaml/', + 'Symfony\\Component\\Routing' => $vendorDir . '/symfony/routing/', + 'Symfony\\Component\\HttpKernel' => $vendorDir . '/symfony/http-kernel/', + 'Symfony\\Component\\HttpFoundation' => $vendorDir . '/symfony/http-foundation/', + 'Symfony\\Component\\EventDispatcher' => $vendorDir . '/symfony/event-dispatcher/', + 'Symfony\\Component\\DependencyInjection' => $vendorDir . '/symfony/dependency-injection/', + 'Symfony\\Component\\ClassLoader' => $vendorDir . '/symfony/class-loader/', +); diff --git a/core/vendor/composer/installed.json b/core/vendor/composer/installed.json new file mode 100644 index 000000000000..955de6886e68 --- /dev/null +++ b/core/vendor/composer/installed.json @@ -0,0 +1,402 @@ +[ + { + "name": "twig/twig", + "version": "v1.8.3", + "version_normalized": "1.8.3.0", + "time": "2012-06-17 18:48:16", + "source": { + "type": "git", + "url": "git://github.com/fabpot/Twig.git", + "reference": "v1.8.3" + }, + "dist": { + "type": "zip", + "url": "https://github.com/fabpot/Twig/zipball/v1.8.3", + "reference": "v1.8.3", + "shasum": "" + }, + "require": { + "php": ">=5.2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "installation-source": "dist", + "license": [ + "BSD-3" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": null, + "role": null + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "homepage": null, + "role": null + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "http://twig.sensiolabs.org", + "keywords": [ + "templating" + ], + "autoload": { + "psr-0": { + "Twig_": "lib/" + } + } + }, + { + "name": "symfony/dependency-injection", + "version": "v2.1.0-BETA1", + "version_normalized": "2.1.0.0-beta1", + "target-dir": "Symfony/Component/DependencyInjection", + "time": "2012-06-12 11:59:42", + "source": { + "type": "git", + "url": "https://github.com/symfony/DependencyInjection", + "reference": "v2.1.0-BETA1" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/DependencyInjection/zipball/v2.1.0-BETA1", + "reference": "v2.1.0-BETA1", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "suggest": { + "symfony/yaml": "v2.1.0-BETA1" + }, + "type": "library", + "installation-source": "dist", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": null, + "role": null + }, + { + "name": "Symfony Community", + "email": null, + "homepage": "http://symfony.com/contributors", + "role": null + } + ], + "description": "Symfony DependencyInjection Component", + "homepage": "http://symfony.com", + "autoload": { + "psr-0": { + "Symfony\\Component\\DependencyInjection": "" + } + } + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.1.0-BETA1", + "version_normalized": "2.1.0.0-beta1", + "target-dir": "Symfony/Component/EventDispatcher", + "time": "2012-05-15 16:56:32", + "source": { + "type": "git", + "url": "https://github.com/symfony/EventDispatcher", + "reference": "v2.1.0-BETA1" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/EventDispatcher/zipball/v2.1.0-BETA1", + "reference": "v2.1.0-BETA1", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "installation-source": "dist", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": null, + "role": null + }, + { + "name": "Symfony Community", + "email": null, + "homepage": "http://symfony.com/contributors", + "role": null + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "http://symfony.com", + "autoload": { + "psr-0": { + "Symfony\\Component\\EventDispatcher": "" + } + } + }, + { + "name": "symfony/http-foundation", + "version": "v2.1.0-BETA1", + "version_normalized": "2.1.0.0-beta1", + "target-dir": "Symfony/Component/HttpFoundation", + "time": "2012-06-12 06:10:53", + "source": { + "type": "git", + "url": "https://github.com/symfony/HttpFoundation", + "reference": "v2.1.0-BETA1" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/HttpFoundation/zipball/v2.1.0-BETA1", + "reference": "v2.1.0-BETA1", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "installation-source": "dist", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": null, + "role": null + }, + { + "name": "Symfony Community", + "email": null, + "homepage": "http://symfony.com/contributors", + "role": null + } + ], + "description": "Symfony HttpFoundation Component", + "homepage": "http://symfony.com", + "autoload": { + "psr-0": { + "Symfony\\Component\\HttpFoundation": "" + } + } + }, + { + "name": "symfony/http-kernel", + "version": "v2.1.0-BETA1", + "version_normalized": "2.1.0.0-beta1", + "target-dir": "Symfony/Component/HttpKernel", + "time": "2012-06-12 11:59:42", + "source": { + "type": "git", + "url": "https://github.com/symfony/HttpKernel", + "reference": "v2.1.0-BETA1" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/HttpKernel/zipball/v2.1.0-BETA1", + "reference": "v2.1.0-BETA1", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "symfony/event-dispatcher": "self.version", + "symfony/http-foundation": "self.version" + }, + "suggest": { + "symfony/browser-kit": "v2.1.0-BETA1", + "symfony/class-loader": "v2.1.0-BETA1", + "symfony/config": "v2.1.0-BETA1", + "symfony/console": "v2.1.0-BETA1", + "symfony/dependency-injection": "v2.1.0-BETA1", + "symfony/finder": "v2.1.0-BETA1" + }, + "type": "library", + "installation-source": "dist", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": null, + "role": null + }, + { + "name": "Symfony Community", + "email": null, + "homepage": "http://symfony.com/contributors", + "role": null + } + ], + "description": "Symfony HttpKernel Component", + "homepage": "http://symfony.com", + "autoload": { + "psr-0": { + "Symfony\\Component\\HttpKernel": "" + } + } + }, + { + "name": "symfony/routing", + "version": "v2.1.0-BETA1", + "version_normalized": "2.1.0.0-beta1", + "target-dir": "Symfony/Component/Routing", + "time": "2012-06-12 11:59:42", + "source": { + "type": "git", + "url": "https://github.com/symfony/Routing", + "reference": "v2.1.0-BETA1" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/Routing/zipball/v2.1.0-BETA1", + "reference": "v2.1.0-BETA1", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "suggest": { + "symfony/config": "v2.1.0-BETA1", + "symfony/yaml": "v2.1.0-BETA1" + }, + "type": "library", + "installation-source": "dist", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": null, + "role": null + }, + { + "name": "Symfony Community", + "email": null, + "homepage": "http://symfony.com/contributors", + "role": null + } + ], + "description": "Symfony Routing Component", + "homepage": "http://symfony.com", + "autoload": { + "psr-0": { + "Symfony\\Component\\Routing": "" + } + } + }, + { + "name": "symfony/yaml", + "version": "v2.1.0-BETA1", + "version_normalized": "2.1.0.0-beta1", + "target-dir": "Symfony/Component/Yaml", + "time": "2012-06-09 15:04:17", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml", + "reference": "v2.1.0-BETA1" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/Yaml/zipball/v2.1.0-BETA1", + "reference": "v2.1.0-BETA1", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "installation-source": "dist", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": null, + "role": null + }, + { + "name": "Symfony Community", + "email": null, + "homepage": "http://symfony.com/contributors", + "role": null + } + ], + "description": "Symfony Yaml Component", + "homepage": "http://symfony.com", + "autoload": { + "psr-0": { + "Symfony\\Component\\Yaml": "" + } + } + }, + { + "name": "symfony/class-loader", + "version": "v2.1.0-BETA1", + "version_normalized": "2.1.0.0-beta1", + "target-dir": "Symfony/Component/ClassLoader", + "time": "2012-04-23 05:37:21", + "source": { + "type": "git", + "url": "https://github.com/symfony/ClassLoader", + "reference": "v2.1.0-BETA1" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/ClassLoader/zipball/v2.1.0-BETA1", + "reference": "v2.1.0-BETA1", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "installation-source": "dist", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": null, + "role": null + }, + { + "name": "Symfony Community", + "email": null, + "homepage": "http://symfony.com/contributors", + "role": null + } + ], + "description": "Symfony ClassLoader Component", + "homepage": "http://symfony.com", + "autoload": { + "psr-0": { + "Symfony\\Component\\ClassLoader": "" + } + } + } +] diff --git a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/.gitignore b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/.gitignore new file mode 100644 index 000000000000..d1502b087b4d --- /dev/null +++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/.gitignore @@ -0,0 +1,2 @@ +vendor/ +composer.lock diff --git a/core/vendor/Symfony/Component/ClassLoader/ApcClassLoader.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ApcClassLoader.php similarity index 95% rename from core/vendor/Symfony/Component/ClassLoader/ApcClassLoader.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ApcClassLoader.php index 3508db6d8aff..04104a159761 100644 --- a/core/vendor/Symfony/Component/ClassLoader/ApcClassLoader.php +++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ApcClassLoader.php @@ -47,8 +47,8 @@ class ApcClassLoader /** * Constructor. * - * @param string $prefix A prefix to create a namespace in APC - * @param object $classFinder + * @param string $prefix A prefix to create a namespace in APC + * @param object $classFinder An object that implements findFile() method. * * @api */ @@ -88,6 +88,7 @@ public function unregister() * Loads the given class or interface. * * @param string $class The name of the class + * * @return Boolean|null True, if loaded */ public function loadClass($class) diff --git a/core/vendor/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php similarity index 98% rename from core/vendor/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php index 1295d0ae4493..379fbe4a6d32 100644 --- a/core/vendor/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php +++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php @@ -84,6 +84,8 @@ public function __construct($prefix) * Finds a file by class name while caching lookups to APC. * * @param string $class A class name to resolve to file + * + * @return string|null The path, if found */ public function findFile($class) { diff --git a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/CHANGELOG.md b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/CHANGELOG.md new file mode 100644 index 000000000000..694e7139e6ef --- /dev/null +++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/CHANGELOG.md @@ -0,0 +1,15 @@ +CHANGELOG +========= + +2.1.0 +----- + + * added a DebugClassLoader able to wrap any autoloader providing a findFile + method + * added a new ApcClassLoader and XcacheClassLoader using composition to wrap + other loaders + * added a new ClassLoader which does not distinguish between namespaced and + pear-like classes (as the PEAR convention is a subset of PSR-0) and + supports using Composer's namespace maps + * added a class map generator + * added support for loading globally-installed PEAR packages diff --git a/core/vendor/Symfony/Component/ClassLoader/ClassCollectionLoader.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassCollectionLoader.php similarity index 98% rename from core/vendor/Symfony/Component/ClassLoader/ClassCollectionLoader.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassCollectionLoader.php index 894900b0c159..47588f76c43e 100644 --- a/core/vendor/Symfony/Component/ClassLoader/ClassCollectionLoader.php +++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassCollectionLoader.php @@ -154,6 +154,7 @@ static public function fixNamespaceDeclarations($source) $inNamespace = false; --$i; } else { + $output = rtrim($output); $output .= "\n{"; $inNamespace = true; } @@ -172,7 +173,7 @@ static public function fixNamespaceDeclarations($source) /** * Writes a cache file. * - * @param string $file Filename + * @param string $file Filename * @param string $content Temporary file content * * @throws \RuntimeException when a cache file cannot be written @@ -181,7 +182,7 @@ static private function writeCacheFile($file, $content) { $tmpFile = tempnam(dirname($file), basename($file)); if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $file)) { - chmod($file, 0666 & ~umask()); + @chmod($file, 0666 & ~umask()); return; } diff --git a/core/vendor/Symfony/Component/ClassLoader/ClassLoader.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassLoader.php similarity index 89% rename from core/vendor/Symfony/Component/ClassLoader/ClassLoader.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassLoader.php index b94bdb9c1503..a2038a0d9f8c 100644 --- a/core/vendor/Symfony/Component/ClassLoader/ClassLoader.php +++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassLoader.php @@ -19,13 +19,13 @@ * $loader = new ClassLoader(); * * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); + * $loader->addPrefix('Symfony\Component', __DIR__.'/component'); + * $loader->addPrefix('Symfony', __DIR__.'/framework'); * * // activate the autoloader * $loader->register(); * - * // to enable searching the include path (eg. for PEAR packages) + * // to enable searching the include path (e.g. for PEAR packages) * $loader->setUseIncludePath(true); * * In this example, if you try to use a class in the Symfony\Component @@ -43,16 +43,31 @@ class ClassLoader private $fallbackDirs = array(); private $useIncludePath = false; + /** + * Returns prefixes. + * + * @return array + */ public function getPrefixes() { return $this->prefixes; } + /** + * Returns fallback directories. + * + * @return array + */ public function getFallbackDirs() { return $this->fallbackDirs; } + /** + * Adds prefixes. + * + * @param array $prefixes Prefixes to add + */ public function addPrefixes(array $prefixes) { foreach ($prefixes as $prefix => $path) { @@ -63,8 +78,8 @@ public function addPrefixes(array $prefixes) /** * Registers a set of classes * - * @param string $prefix The classes prefix - * @param array|string $paths The location(s) of the classes + * @param string $prefix The classes prefix + * @param array|string $paths The location(s) of the classes */ public function addPrefix($prefix, $paths) { @@ -128,6 +143,7 @@ public function unregister() * Loads the given class or interface. * * @param string $class The name of the class + * * @return Boolean|null True, if loaded */ public function loadClass($class) diff --git a/core/vendor/Symfony/Component/ClassLoader/ClassMapGenerator.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassMapGenerator.php similarity index 98% rename from core/vendor/Symfony/Component/ClassLoader/ClassMapGenerator.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassMapGenerator.php index c0e9fc6d50f6..91ea9afa5922 100644 --- a/core/vendor/Symfony/Component/ClassLoader/ClassMapGenerator.php +++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassMapGenerator.php @@ -22,7 +22,7 @@ class ClassMapGenerator * Generate a class map file * * @param array|string $dirs Directories or a single path to search in - * @param string $file The name of the class map file + * @param string $file The name of the class map file */ static public function dump($dirs, $file) { diff --git a/core/vendor/Symfony/Component/ClassLoader/DebugClassLoader.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/DebugClassLoader.php similarity index 99% rename from core/vendor/Symfony/Component/ClassLoader/DebugClassLoader.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/DebugClassLoader.php index b6f7968bcace..da7d289df295 100644 --- a/core/vendor/Symfony/Component/ClassLoader/DebugClassLoader.php +++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/DebugClassLoader.php @@ -73,6 +73,7 @@ public function unregister() * Loads the given class or interface. * * @param string $class The name of the class + * * @return Boolean|null True, if loaded */ public function loadClass($class) diff --git a/core/vendor/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php diff --git a/core/vendor/Symfony/Component/ClassLoader/LICENSE b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/LICENSE similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/LICENSE rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/LICENSE diff --git a/core/vendor/Symfony/Component/ClassLoader/MapClassLoader.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/MapClassLoader.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/MapClassLoader.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/MapClassLoader.php diff --git a/core/vendor/Symfony/Component/ClassLoader/README.md b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/README.md similarity index 93% rename from core/vendor/Symfony/Component/ClassLoader/README.md rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/README.md index 5a83c5f3c1fd..64dffe9a68a9 100644 --- a/core/vendor/Symfony/Component/ClassLoader/README.md +++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/README.md @@ -64,10 +64,9 @@ Resources You can run the unit tests with the following command: - phpunit -c src/Symfony/Component/ClassLoader/ + phpunit If you also want to run the unit tests that depend on other Symfony -Components, declare the following environment variables before running -PHPUnit: +Components, install dev dependencies before running PHPUnit: - export SYMFONY_FINDER=../path/to/Finder + php composer.phar install --dev diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/ApcUniversalClassLoaderTest.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ApcUniversalClassLoaderTest.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/ApcUniversalClassLoaderTest.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ApcUniversalClassLoaderTest.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php similarity index 98% rename from core/vendor/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php index cd1c439c411e..5f4db1f06e33 100644 --- a/core/vendor/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php +++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php @@ -43,7 +43,7 @@ class Foo {} { class Foo {} } -namespace Bar +namespace Bar { class Foo {} } diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/ClassLoaderTest.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassLoaderTest.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/ClassLoaderTest.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassLoaderTest.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Bar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Bar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Bar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Bar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Baz.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Baz.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Baz.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Baz.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/FooBar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/FooBar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/FooBar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/FooBar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Bar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Bar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Bar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Bar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Baz.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Baz.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Baz.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Baz.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/ApcPrefixCollision/A/Bar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/ApcPrefixCollision/A/Bar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/ApcPrefixCollision/A/Bar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/ApcPrefixCollision/A/Bar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/ApcPrefixCollision/A/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/ApcPrefixCollision/A/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/ApcPrefixCollision/A/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/ApcPrefixCollision/A/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Bar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Bar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Bar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Bar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Bar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Bar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Bar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Bar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Bar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Bar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Bar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Bar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/fallback/Apc/Pearlike/FooBar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/fallback/Apc/Pearlike/FooBar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/fallback/Apc/Pearlike/FooBar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/fallback/Apc/Pearlike/FooBar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/fallback/Namespaced/FooBar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/fallback/Namespaced/FooBar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/fallback/Namespaced/FooBar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/fallback/Namespaced/FooBar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Bar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Bar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Bar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Bar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Baz.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Baz.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Baz.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Baz.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Bar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Bar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Bar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Bar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Baz.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Baz.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Baz.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Baz.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike/Bar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike/Bar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike/Bar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike/Bar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike/Baz.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike/Baz.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike/Baz.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike/Baz.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike2/Bar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike2/Bar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike2/Bar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike2/Bar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike2/Baz.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike2/Baz.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike2/Baz.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike2/Baz.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike2/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike2/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike2/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike2/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/A/Bar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/A/Bar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/A/Bar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/A/Bar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/A/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/A/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/A/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/A/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/C/Bar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/C/Bar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/C/Bar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/C/Bar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/C/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/C/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/C/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/C/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/A/Bar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/A/Bar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/A/Bar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/A/Bar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/A/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/A/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/A/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/A/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/C/Bar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/C/Bar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/C/Bar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/C/Bar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/C/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/C/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/C/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/C/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/A/B/Bar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/A/B/Bar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/A/B/Bar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/A/B/Bar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/A/B/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/A/B/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/A/B/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/A/B/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/C/B/Bar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/C/B/Bar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/C/B/Bar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/C/B/Bar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/C/B/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/C/B/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/C/B/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/C/B/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/A/B/Bar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/A/B/Bar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/A/B/Bar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/A/B/Bar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/A/B/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/A/B/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/A/B/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/A/B/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/C/B/Bar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/C/B/Bar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/C/B/Bar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/C/B/Bar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/C/B/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/C/B/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/C/B/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/C/B/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeClass.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeClass.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeClass.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeClass.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeInterface.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeInterface.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeInterface.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeInterface.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeParent.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeParent.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeParent.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeParent.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/multipleNs.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/multipleNs.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/multipleNs.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/multipleNs.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/notAClass.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/notAClass.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/notAClass.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/notAClass.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/notPhpFile.md b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/notPhpFile.md similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/notPhpFile.md rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/notPhpFile.md diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/sameNsMultipleClasses.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/sameNsMultipleClasses.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/sameNsMultipleClasses.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/sameNsMultipleClasses.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Namespaced/FooBar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Namespaced/FooBar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Namespaced/FooBar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Namespaced/FooBar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Namespaced2/FooBar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Namespaced2/FooBar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Namespaced2/FooBar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Namespaced2/FooBar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Pearlike/FooBar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Pearlike/FooBar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Pearlike/FooBar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Pearlike/FooBar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Pearlike2/FooBar.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Pearlike2/FooBar.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Pearlike2/FooBar.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Pearlike2/FooBar.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/includepath/Foo.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/includepath/Foo.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/Fixtures/includepath/Foo.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/includepath/Foo.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/UniversalClassLoaderTest.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/UniversalClassLoaderTest.php similarity index 100% rename from core/vendor/Symfony/Component/ClassLoader/Tests/UniversalClassLoaderTest.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/UniversalClassLoaderTest.php diff --git a/core/vendor/Symfony/Component/ClassLoader/Tests/bootstrap.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/bootstrap.php similarity index 58% rename from core/vendor/Symfony/Component/ClassLoader/Tests/bootstrap.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/bootstrap.php index 3364e147a146..54dac3fd265d 100644 --- a/core/vendor/Symfony/Component/ClassLoader/Tests/bootstrap.php +++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/bootstrap.php @@ -10,19 +10,13 @@ */ spl_autoload_register(function ($class) { - foreach (array( - 'SYMFONY_FINDER' => 'Finder', - ) as $env => $name) { - if (isset($_SERVER[$env]) && 0 === strpos(ltrim($class, '/'), 'Symfony\Component\\'.$name)) { - if (file_exists($file = $_SERVER[$env].'/'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\\'.$name)).'.php')) { - require_once $file; - } - } - } - if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\ClassLoader')) { if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\ClassLoader')).'.php')) { require_once $file; } } }); + +if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) { + require_once $loader; +} diff --git a/core/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php similarity index 97% rename from core/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php index 60f245ad1bde..b6128ad6793a 100644 --- a/core/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php +++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php @@ -42,7 +42,7 @@ * )); * * - * // to enable searching the include path (eg. for PEAR packages) + * // to enable searching the include path (e.g. for PEAR packages) * $loader->useIncludePath(true); * * // activate the autoloader @@ -216,8 +216,8 @@ public function registerPrefixes(array $classes) /** * Registers a set of classes using the PEAR naming convention. * - * @param string $prefix The classes prefix - * @param array|string $paths The location(s) of the classes + * @param string $prefix The classes prefix + * @param array|string $paths The location(s) of the classes * * @api */ diff --git a/core/vendor/Symfony/Component/ClassLoader/XcacheClassLoader.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/XcacheClassLoader.php similarity index 95% rename from core/vendor/Symfony/Component/ClassLoader/XcacheClassLoader.php rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/XcacheClassLoader.php index 2eaaba202fa8..2decbce83414 100644 --- a/core/vendor/Symfony/Component/ClassLoader/XcacheClassLoader.php +++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/XcacheClassLoader.php @@ -48,8 +48,8 @@ class XcacheClassLoader /** * Constructor. * - * @param string $prefix A prefix to create a namespace in Xcache - * @param object $classFinder + * @param string $prefix A prefix to create a namespace in Xcache + * @param object $classFinder An object that implements findFile() method. * * @api */ @@ -89,12 +89,14 @@ public function unregister() * Loads the given class or interface. * * @param string $class The name of the class + * * @return Boolean|null True, if loaded */ public function loadClass($class) { if ($file = $this->findFile($class)) { require $file; + return true; } } diff --git a/core/vendor/Symfony/Component/ClassLoader/composer.json b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/composer.json similarity index 88% rename from core/vendor/Symfony/Component/ClassLoader/composer.json rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/composer.json index 2608f041a2e9..a4b32ec2b595 100644 --- a/core/vendor/Symfony/Component/ClassLoader/composer.json +++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/composer.json @@ -16,7 +16,10 @@ } ], "require": { - "php": ">=5.3.2" + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/finder": "2.1.*" }, "autoload": { "psr-0": { "Symfony\\Component\\ClassLoader": "" } diff --git a/core/vendor/Symfony/Component/ClassLoader/phpunit.xml.dist b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/phpunit.xml.dist similarity index 94% rename from core/vendor/Symfony/Component/ClassLoader/phpunit.xml.dist rename to core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/phpunit.xml.dist index bc7a21e8d462..ae7e2ad9518c 100644 --- a/core/vendor/Symfony/Component/ClassLoader/phpunit.xml.dist +++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/phpunit.xml.dist @@ -23,6 +23,7 @@ <exclude> <directory>./Resources</directory> <directory>./Tests</directory> + <directory>./vendor</directory> </exclude> </whitelist> </filter> diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/.gitignore b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/.gitignore new file mode 100644 index 000000000000..d1502b087b4d --- /dev/null +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/.gitignore @@ -0,0 +1,2 @@ +vendor/ +composer.lock diff --git a/core/vendor/Symfony/Component/DependencyInjection/Alias.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Alias.php similarity index 96% rename from core/vendor/Symfony/Component/DependencyInjection/Alias.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Alias.php index 9a377eda6ad0..fd75578cdb9c 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Alias.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Alias.php @@ -22,7 +22,7 @@ class Alias /** * Constructor. * - * @param string $id Alias identifier + * @param string $id Alias identifier * @param Boolean $public If this alias is public * * @api diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/CHANGELOG.md b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/CHANGELOG.md new file mode 100644 index 000000000000..96839e9660c6 --- /dev/null +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/CHANGELOG.md @@ -0,0 +1,12 @@ +CHANGELOG +========= + +2.1.0 +----- + + * added IntrospectableContainerInterface (to be able to check if a service + has been initialized or not) + * added ConfigurationExtensionInterface + * added Definition::clearTag() + * component exceptions that inherit base SPL classes are now used exclusively + (this includes dumped containers) diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php similarity index 96% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php index b565f3f83e34..19079b4038da 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php @@ -74,6 +74,9 @@ public function process(ContainerBuilder $container) if (!$this->onlyConstructorArguments) { $this->processArguments($definition->getMethodCalls()); $this->processArguments($definition->getProperties()); + if ($definition->getConfigurator()) { + $this->processArguments(array($definition->getConfigurator())); + } } } diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/Compiler.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/Compiler.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/Compiler.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/Compiler.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/PassConfig.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/PassConfig.php similarity index 99% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/PassConfig.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/PassConfig.php index eb2266bf5840..e863f75640fb 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Compiler/PassConfig.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/PassConfig.php @@ -96,7 +96,7 @@ public function getPasses() * Adds a pass. * * @param CompilerPassInterface $pass A Compiler pass - * @param string $type The pass type + * @param string $type The pass type * * @throws InvalidArgumentException when a pass type doesn't exist * diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/RemoveUnusedDefinitionsPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveUnusedDefinitionsPass.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/RemoveUnusedDefinitionsPass.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveUnusedDefinitionsPass.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/RepeatablePassInterface.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatablePassInterface.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/RepeatablePassInterface.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatablePassInterface.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php similarity index 92% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php index dc83807eb13d..5d00ed682507 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php @@ -63,8 +63,8 @@ public function process(ContainerBuilder $container) * Updates references to remove aliases. * * @param ContainerBuilder $container The container - * @param string $currentId The alias identifier being replaced - * @param string $newId The id of the service the alias points to + * @param string $currentId The alias identifier being replaced + * @param string $newId The id of the service the alias points to */ private function updateReferences($container, $currentId, $newId) { @@ -94,9 +94,9 @@ private function updateReferences($container, $currentId, $newId) /** * Updates argument references. * - * @param array $arguments An array of Arguments + * @param array $arguments An array of Arguments * @param string $currentId The alias identifier - * @param string $newId The identifier the alias points to + * @param string $newId The identifier the alias points to */ private function updateArgumentReferences(array $arguments, $currentId, $newId) { diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php similarity index 98% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php index 6d3c78a81449..996199cf1b73 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php @@ -69,7 +69,7 @@ public function process(ContainerBuilder $container) /** * Processes arguments to determine invalid references. * - * @param array $arguments An array of Reference objects + * @param array $arguments An array of Reference objects * @param Boolean $inMethodCall */ private function processArguments(array $arguments, $inMethodCall = false) diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php similarity index 96% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php index 60a9295f0c35..19da234ece0a 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php @@ -29,7 +29,7 @@ class ServiceReferenceGraphEdge * * @param ServiceReferenceGraphNode $sourceNode * @param ServiceReferenceGraphNode $destNode - * @param string $value + * @param string $value */ public function __construct(ServiceReferenceGraphNode $sourceNode, ServiceReferenceGraphNode $destNode, $value = null) { diff --git a/core/vendor/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php similarity index 96% rename from core/vendor/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php index da8dc704181e..3fd50771d54e 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php @@ -31,8 +31,8 @@ class ServiceReferenceGraphNode /** * Constructor. * - * @param string $id The node identifier - * @param mixed $value The node value + * @param string $id The node identifier + * @param mixed $value The node value */ public function __construct($id, $value) { diff --git a/core/vendor/Symfony/Component/DependencyInjection/Container.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php similarity index 96% rename from core/vendor/Symfony/Component/DependencyInjection/Container.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php index cf29685c605f..85006446559d 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Container.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php @@ -133,7 +133,7 @@ public function getParameterBag() /** * Gets a parameter. * - * @param string $name The parameter name + * @param string $name The parameter name * * @return mixed The parameter value * @@ -149,7 +149,7 @@ public function getParameter($name) /** * Checks if a parameter exists. * - * @param string $name The parameter name + * @param string $name The parameter name * * @return Boolean The presence of parameter in container * @@ -204,7 +204,7 @@ public function set($id, $service, $scope = self::SCOPE_CONTAINER) /** * Returns true if the given service is defined. * - * @param string $id The service identifier + * @param string $id The service identifier * * @return Boolean true if the service is defined, false otherwise * @@ -223,8 +223,8 @@ public function has($id) * If a service is both defined through a set() method and * with a set*Service() method, the former has always precedence. * - * @param string $id The service identifier - * @param integer $invalidBehavior The behavior when the service does not exist + * @param string $id The service identifier + * @param integer $invalidBehavior The behavior when the service does not exist * * @return object The associated service * @@ -265,11 +265,11 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE throw new ServiceNotFoundException($id); } } - + /** * Returns true if the given service has actually been initialized * - * @param string $id The service identifier + * @param string $id The service identifier * * @return Boolean true if service has already been initialized, false otherwise */ @@ -288,7 +288,7 @@ public function getServiceIds() $ids = array(); $r = new \ReflectionClass($this); foreach ($r->getMethods() as $method) { - if (preg_match('/^get(.+)Service$/', $method->getName(), $match)) { + if (preg_match('/^get(.+)Service$/', $method->name, $match)) { $ids[] = self::underscore($match[1]); } } diff --git a/core/vendor/Symfony/Component/DependencyInjection/ContainerAware.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAware.php similarity index 92% rename from core/vendor/Symfony/Component/DependencyInjection/ContainerAware.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAware.php index 1ae1db44af96..40969153118c 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/ContainerAware.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAware.php @@ -18,7 +18,7 @@ * * @api */ -class ContainerAware implements ContainerAwareInterface +abstract class ContainerAware implements ContainerAwareInterface { /** * @var ContainerInterface diff --git a/core/vendor/Symfony/Component/DependencyInjection/ContainerAwareInterface.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAwareInterface.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/ContainerAwareInterface.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAwareInterface.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/ContainerBuilder.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php similarity index 96% rename from core/vendor/Symfony/Component/DependencyInjection/ContainerBuilder.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php index 1d77ebc001ec..a706229db4bb 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -291,7 +291,7 @@ public function removeDefinition($id) /** * Returns true if the given service is defined. * - * @param string $id The service identifier + * @param string $id The service identifier * * @return Boolean true if the service is defined, false otherwise * @@ -307,8 +307,8 @@ public function has($id) /** * Gets a service. * - * @param string $id The service identifier - * @param integer $invalidBehavior The behavior when the service does not exist + * @param string $id The service identifier + * @param integer $invalidBehavior The behavior when the service does not exist * * @return object The associated service * @@ -532,7 +532,7 @@ public function removeAlias($alias) /** * Returns true if an alias exists under the given identifier. * - * @param string $id The service identifier + * @param string $id The service identifier * * @return Boolean true if the alias exists, false otherwise * @@ -558,7 +558,7 @@ public function getAliases() /** * Gets an alias. * - * @param string $id The service identifier + * @param string $id The service identifier * * @return string The aliased service identifier * @@ -583,8 +583,8 @@ public function getAlias($id) * This methods allows for simple registration of service definition * with a fluid interface. * - * @param string $id The service identifier - * @param string $class The service class + * @param string $id The service identifier + * @param string $class The service class * * @return Definition A Definition instance * @@ -637,8 +637,8 @@ public function getDefinitions() /** * Sets a service definition. * - * @param string $id The service identifier - * @param Definition $definition A Definition instance + * @param string $id The service identifier + * @param Definition $definition A Definition instance * * @throws BadMethodCallException When this ContainerBuilder is frozen * @@ -660,7 +660,7 @@ public function setDefinition($id, Definition $definition) /** * Returns true if a service definition exists under the given identifier. * - * @param string $id The service identifier + * @param string $id The service identifier * * @return Boolean true if the service definition exists, false otherwise * @@ -674,7 +674,7 @@ public function hasDefinition($id) /** * Gets a service definition. * - * @param string $id The service identifier + * @param string $id The service identifier * * @return Definition A Definition instance * @@ -698,7 +698,7 @@ public function getDefinition($id) * * The method "unaliases" recursively to return a Definition instance. * - * @param string $id The service identifier or alias + * @param string $id The service identifier or alias * * @return Definition A Definition instance * @@ -718,8 +718,8 @@ public function findDefinition($id) /** * Creates a service for a service definition. * - * @param Definition $definition A service definition instance - * @param string $id The service identifier + * @param Definition $definition A service definition instance + * @param string $id The service identifier * * @return object The service described by the service definition * @@ -803,7 +803,7 @@ private function createService(Definition $definition, $id) /** * Replaces service references by the real service instance. * - * @param mixed $value A value + * @param mixed $value A value * * @return mixed The same value with all service references replaced by the real service instances */ diff --git a/core/vendor/Symfony/Component/DependencyInjection/ContainerInterface.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerInterface.php similarity index 91% rename from core/vendor/Symfony/Component/DependencyInjection/ContainerInterface.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerInterface.php index 93cbf3a650d5..6a5988eb11d3 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/ContainerInterface.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerInterface.php @@ -43,8 +43,8 @@ function set($id, $service, $scope = self::SCOPE_CONTAINER); /** * Gets a service. * - * @param string $id The service identifier - * @param int $invalidBehavior The behavior when the service does not exist + * @param string $id The service identifier + * @param int $invalidBehavior The behavior when the service does not exist * * @return object The associated service * @@ -59,7 +59,7 @@ function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE); /** * Returns true if the given service is defined. * - * @param string $id The service identifier + * @param string $id The service identifier * * @return Boolean true if the service is defined, false otherwise * @@ -70,7 +70,7 @@ function has($id); /** * Gets a parameter. * - * @param string $name The parameter name + * @param string $name The parameter name * * @return mixed The parameter value * @@ -83,7 +83,7 @@ function getParameter($name); /** * Checks if a parameter exists. * - * @param string $name The parameter name + * @param string $name The parameter name * * @return Boolean The presence of parameter in container * diff --git a/core/vendor/Symfony/Component/DependencyInjection/Definition.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Definition.php similarity index 93% rename from core/vendor/Symfony/Component/DependencyInjection/Definition.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Definition.php index 1c974a6bb014..e7265f2a7015 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Definition.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Definition.php @@ -64,7 +64,7 @@ public function __construct($class = null, array $arguments = array()) * Sets the name of the class that acts as a factory using the factory method, * which will be invoked statically. * - * @param string $factoryClass The factory class name + * @param string $factoryClass The factory class name * * @return Definition The current instance * @@ -92,7 +92,7 @@ public function getFactoryClass() /** * Sets the factory method able to create an instance of this class. * - * @param string $factoryMethod The factory method name + * @param string $factoryMethod The factory method name * * @return Definition The current instance * @@ -148,7 +148,7 @@ public function getFactoryService() /** * Sets the service class. * - * @param string $class The service class + * @param string $class The service class * * @return Definition The current instance * @@ -176,7 +176,7 @@ public function getClass() /** * Sets the arguments to pass to the service constructor/factory method. * - * @param array $arguments An array of arguments + * @param array $arguments An array of arguments * * @return Definition The current instance * @@ -220,7 +220,7 @@ public function setProperty($name, $value) /** * Adds an argument to pass to the service constructor/factory method. * - * @param mixed $argument An argument + * @param mixed $argument An argument * * @return Definition The current instance * @@ -237,7 +237,7 @@ public function addArgument($argument) * Sets a specific argument * * @param integer $index - * @param mixed $argument + * @param mixed $argument * * @return Definition The current instance * @@ -287,7 +287,7 @@ public function getArgument($index) /** * Sets the methods to call after service initialization. * - * @param array $calls An array of method calls + * @param array $calls An array of method calls * * @return Definition The current instance * @@ -306,8 +306,8 @@ public function setMethodCalls(array $calls = array()) /** * Adds a method to call after service initialization. * - * @param string $method The method name to call - * @param array $arguments An array of arguments to pass to the method call + * @param string $method The method name to call + * @param array $arguments An array of arguments to pass to the method call * * @return Definition The current instance * @@ -328,7 +328,7 @@ public function addMethodCall($method, array $arguments = array()) /** * Removes a method to call after service initialization. * - * @param string $method The method name to remove + * @param string $method The method name to remove * * @return Definition The current instance * @@ -349,7 +349,7 @@ public function removeMethodCall($method) /** * Check if the current definition has a given method to call after service initialization. * - * @param string $method The method name to search for + * @param string $method The method name to search for * * @return Boolean * @@ -409,7 +409,7 @@ public function getTags() /** * Gets a tag by name. * - * @param string $name The tag name + * @param string $name The tag name * * @return array An array of attributes * @@ -423,8 +423,8 @@ public function getTag($name) /** * Adds a tag for this definition. * - * @param string $name The tag name - * @param array $attributes An array of attributes + * @param string $name The tag name + * @param array $attributes An array of attributes * * @return Definition The current instance * @@ -484,7 +484,7 @@ public function clearTags() /** * Sets a file to require before creating the service. * - * @param string $file A full pathname to include + * @param string $file A full pathname to include * * @return Definition The current instance * @@ -512,7 +512,7 @@ public function getFile() /** * Sets the scope of the service * - * @param string $scope Whether the service must be shared or not + * @param string $scope Whether the service must be shared or not * * @return Definition The current instance * @@ -628,7 +628,7 @@ public function isAbstract() /** * Sets a configurator to call after the service is fully initialized. * - * @param mixed $callable A PHP callable + * @param mixed $callable A PHP callable * * @return Definition The current instance * diff --git a/core/vendor/Symfony/Component/DependencyInjection/DefinitionDecorator.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/DefinitionDecorator.php similarity index 99% rename from core/vendor/Symfony/Component/DependencyInjection/DefinitionDecorator.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/DefinitionDecorator.php index 8652d80fe320..0306f75b8edb 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/DefinitionDecorator.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/DefinitionDecorator.php @@ -185,7 +185,7 @@ public function getArgument($index) * parent definition, otherwise your arguments will only be appended. * * @param integer $index - * @param mixed $value + * @param mixed $value * * @return DefinitionDecorator the current instance * @throws InvalidArgumentException when $index isn't an integer diff --git a/core/vendor/Symfony/Component/DependencyInjection/Dumper/Dumper.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/Dumper.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Dumper/Dumper.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/Dumper.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php similarity index 92% rename from core/vendor/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php index c05dc6d49d8f..6972cbf8fc7e 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php @@ -23,7 +23,7 @@ interface DumperInterface /** * Dumps the service container. * - * @param array $options An array of options + * @param array $options An array of options * * @return string The representation of the service container * diff --git a/core/vendor/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php similarity index 97% rename from core/vendor/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php index 133c6217ff87..debdc527091e 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php @@ -50,7 +50,7 @@ class GraphvizDumper extends Dumper * * node.definition: The default options for services that are defined via service definition instances * * node.missing: The default options for missing services * - * @param array $options An array of options + * @param array $options An array of options * * @return string The dot representation of the service container */ @@ -119,10 +119,10 @@ private function addEdges() /** * Finds all edges belonging to a specific service id. * - * @param string $id The service id used to find edges - * @param array $arguments An array of arguments + * @param string $id The service id used to find edges + * @param array $arguments An array of arguments * @param Boolean $required - * @param string $name + * @param string $name * * @return array An array of edges */ diff --git a/core/vendor/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php similarity index 98% rename from core/vendor/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index a567dfe45752..4d34e55402ef 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -70,7 +70,7 @@ public function __construct(ContainerBuilder $container) * * class: The class name * * base_class: The base class name * - * @param array $options An array of options + * @param array $options An array of options * * @return string A PHP class representing of the service container * @@ -152,7 +152,7 @@ private function addServiceLocalTempVariables($cId, $definition) /** * Generates the require_once statement for service includes. * - * @param string $id The service id + * @param string $id The service id * @param Definition $definition * * @return string @@ -182,7 +182,7 @@ private function addServiceInclude($id, $definition) /** * Generates the inline definition of a service. * - * @param string $id + * @param string $id * @param Definition $definition * * @return string @@ -261,7 +261,7 @@ private function addServiceInlinedDefinitions($id, $definition) /** * Adds the service return statement. * - * @param string $id Service id + * @param string $id Service id * @param Definition $definition * * @return string @@ -278,7 +278,7 @@ private function addServiceReturn($id, $definition) /** * Generates the service instance. * - * @param string $id + * @param string $id * @param Definition $definition * * @return string @@ -326,7 +326,7 @@ private function addServiceInstance($id, $definition) throw new RuntimeException('Factory method requires a factory service or factory class in service definition for '.$id); } } elseif (false !== strpos($class, '$')) { - $code = sprintf(" \$class = %s;\n $return{$instantiation}new \$class(%s);\n", $class, implode(', ', $arguments)); + $code = sprintf(" \$class = %s;\n\n $return{$instantiation}new \$class(%s);\n", $class, implode(', ', $arguments)); } else { $code = sprintf(" $return{$instantiation}new \\%s(%s);\n", substr(str_replace('\\\\', '\\', $class), 1, -1), implode(', ', $arguments)); } @@ -341,7 +341,7 @@ private function addServiceInstance($id, $definition) /** * Checks if the definition is a simple instance. * - * @param string $id + * @param string $id * @param Definition $definition * * @return Boolean @@ -364,9 +364,9 @@ private function isSimpleInstance($id, $definition) /** * Adds method calls to a service definition. * - * @param string $id + * @param string $id * @param Definition $definition - * @param string $variableName + * @param string $variableName * * @return string */ @@ -398,7 +398,7 @@ private function addServiceProperties($id, $definition, $variableName = 'instanc /** * Generates the inline definition setup. * - * @param string $id + * @param string $id * @param Definition $definition * @return string */ @@ -436,9 +436,9 @@ private function addServiceInlinedDefinitionsSetup($id, $definition) /** * Adds configurator definition * - * @param string $id + * @param string $id * @param Definition $definition - * @param string $variableName + * @param string $variableName * * @return string */ @@ -462,7 +462,7 @@ private function addServiceConfigurator($id, $definition, $variableName = 'insta /** * Adds a service * - * @param string $id + * @param string $id * @param Definition $definition * * @return string @@ -613,7 +613,7 @@ private function addServices() /** * Adds the class headers. * - * @param string $class Class name + * @param string $class Class name * @param string $baseClass The name of the base class * * @return string @@ -802,8 +802,8 @@ protected function getDefaultParameters() /** * Exports parameters. * - * @param array $parameters - * @param string $path + * @param array $parameters + * @param string $path * @param integer $indent * * @return string @@ -871,7 +871,7 @@ private function wrapServiceConditionals($value, $code) /** * Builds service calls from arguments * - * @param array $arguments + * @param array $arguments * @param string &$calls By reference * @param string &$behavior By reference */ @@ -950,7 +950,7 @@ private function getDefinitionsFromArguments(array $arguments) * Checks if a service id has a reference * * @param string $id - * @param array $arguments + * @param array $arguments * * @return Boolean */ @@ -974,7 +974,7 @@ private function hasReference($id, array $arguments) /** * Dumps values. * - * @param array $value + * @param array $value * @param Boolean $interpolate * * @return string @@ -1037,8 +1037,7 @@ private function dumpValue($value, $interpolate = true) return $this->dumpParameter(strtolower($match[1])); } else { $that = $this; - $replaceParameters = function ($match) use ($that) - { + $replaceParameters = function ($match) use ($that) { return "'.".$that->dumpParameter(strtolower($match[2])).".'"; }; diff --git a/core/vendor/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php similarity index 98% rename from core/vendor/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php index 6a91b99fd878..113a24201944 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php @@ -35,7 +35,7 @@ class XmlDumper extends Dumper /** * Dumps the service container as an XML string. * - * @param array $options An array of options + * @param array $options An array of options * * @return string An xml string representing of the service container * @@ -84,7 +84,7 @@ private function addParameters(\DOMElement $parent) /** * Adds method calls. * - * @param array $methodcalls + * @param array $methodcalls * @param DOMElement $parent */ private function addMethodCalls(array $methodcalls, \DOMElement $parent) @@ -103,7 +103,7 @@ private function addMethodCalls(array $methodcalls, \DOMElement $parent) * Adds a service. * * @param Definition $definition - * @param string $id + * @param string $id * @param DOMElement $parent */ private function addService($definition, $id, \DOMElement $parent) @@ -172,8 +172,8 @@ private function addService($definition, $id, \DOMElement $parent) /** * Adds a service alias. * - * @param string $alias - * @param string $id + * @param string $alias + * @param string $id * @param DOMElement $parent */ private function addServiceAlias($alias, $id, \DOMElement $parent) diff --git a/core/vendor/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php similarity index 85% rename from core/vendor/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php index 5768c1e927b1..9717a2593754 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php @@ -11,11 +11,12 @@ namespace Symfony\Component\DependencyInjection\Dumper; -use Symfony\Component\Yaml\Yaml; +use Symfony\Component\Yaml\Dumper as YmlDumper; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Parameter; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\ContainerBuilder; /** * YamlDumper dumps a service container as a YAML string. @@ -26,10 +27,26 @@ */ class YamlDumper extends Dumper { + private $dumper; + + /** + * Constructor. + * + * @param ContainerBuilder $container The service container to dump + * + * @api + */ + public function __construct(ContainerBuilder $container) + { + parent::__construct($container); + + $this->dumper = new YmlDumper(); + } + /** * Dumps the service container as an YAML string. * - * @param array $options An array of options + * @param array $options An array of options * * @return string A YAML string representing of the service container * @@ -43,7 +60,7 @@ public function dump(array $options = array()) /** * Adds a service * - * @param string $id + * @param string $id * @param Definition $definition * * @return string @@ -60,11 +77,11 @@ private function addService($id, $definition) foreach ($tags as $attributes) { $att = array(); foreach ($attributes as $key => $value) { - $att[] = sprintf('%s: %s', Yaml::dump($key), Yaml::dump($value)); + $att[] = sprintf('%s: %s', $this->dumper->dump($key), $this->dumper->dump($value)); } $att = $att ? ', '.implode(' ', $att) : ''; - $tagsCode .= sprintf(" - { name: %s%s }\n", Yaml::dump($name), $att); + $tagsCode .= sprintf(" - { name: %s%s }\n", $this->dumper->dump($name), $att); } } if ($tagsCode) { @@ -84,15 +101,15 @@ private function addService($id, $definition) } if ($definition->getArguments()) { - $code .= sprintf(" arguments: %s\n", Yaml::dump($this->dumpValue($definition->getArguments()), 0)); + $code .= sprintf(" arguments: %s\n", $this->dumper->dump($this->dumpValue($definition->getArguments()), 0)); } if ($definition->getProperties()) { - $code .= sprintf(" properties: %s\n", Yaml::dump($this->dumpValue($definition->getProperties()), 0)); + $code .= sprintf(" properties: %s\n", $this->dumper->dump($this->dumpValue($definition->getProperties()), 0)); } if ($definition->getMethodCalls()) { - $code .= sprintf(" calls:\n %s\n", str_replace("\n", "\n ", Yaml::dump($this->dumpValue($definition->getMethodCalls()), 1))); + $code .= sprintf(" calls:\n%s\n", $this->dumper->dump($this->dumpValue($definition->getMethodCalls()), 1, 12)); } if (ContainerInterface::SCOPE_CONTAINER !== $scope = $definition->getScope()) { @@ -108,7 +125,7 @@ private function addService($id, $definition) } } - $code .= sprintf(" configurator: %s\n", Yaml::dump($callable, 0)); + $code .= sprintf(" configurator: %s\n", $this->dumper->dump($callable, 0)); } return $code; @@ -171,7 +188,7 @@ private function addParameters() $parameters = $this->container->getParameterBag()->all(); } - return Yaml::dump(array('parameters' => $parameters), 2); + return $this->dumper->dump(array('parameters' => $parameters), 2); } /** diff --git a/core/vendor/Symfony/Component/DependencyInjection/Exception/BadMethodCallException.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/BadMethodCallException.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Exception/BadMethodCallException.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/BadMethodCallException.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Exception/ExceptionInterface.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ExceptionInterface.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Exception/ExceptionInterface.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ExceptionInterface.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Exception/InactiveScopeException.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InactiveScopeException.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Exception/InactiveScopeException.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InactiveScopeException.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Exception/LogicException.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/LogicException.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Exception/LogicException.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/LogicException.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Exception/OutOfBoundsException.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/OutOfBoundsException.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Exception/OutOfBoundsException.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/OutOfBoundsException.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Exception/RuntimeException.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/RuntimeException.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Exception/RuntimeException.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/RuntimeException.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Exception/ScopeCrossingInjectionException.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeCrossingInjectionException.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Exception/ScopeCrossingInjectionException.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeCrossingInjectionException.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Exception/ScopeWideningInjectionException.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeWideningInjectionException.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Exception/ScopeWideningInjectionException.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeWideningInjectionException.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php similarity index 90% rename from core/vendor/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php index b633f9006c37..4f33a9bc4c4b 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php @@ -23,7 +23,7 @@ interface ConfigurationExtensionInterface /** * Returns extension configuration * - * @param array $config $config An array of configuration values + * @param array $config $config An array of configuration values * @param ContainerBuilder $container A ContainerBuilder instance * * @return ConfigurationInterface|null The configuration or null diff --git a/core/vendor/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php similarity index 98% rename from core/vendor/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php index 726652c05e50..0ffc7297bb80 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php @@ -24,10 +24,10 @@ interface IntrospectableContainerInterface extends ContainerInterface * Check for whether or not a service has been initialized. * * @param string $id - * + * * @return Boolean true if the service has been initialized, false otherwise * */ function initialized($id); - -} \ No newline at end of file + +} diff --git a/core/vendor/Symfony/Component/DependencyInjection/LICENSE b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LICENSE similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/LICENSE rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LICENSE diff --git a/core/vendor/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php similarity index 94% rename from core/vendor/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php index fa2456572a9a..775a3525d834 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php @@ -49,8 +49,8 @@ public function load($closure, $type = null) /** * Returns true if this class supports the given resource. * - * @param mixed $resource A resource - * @param string $type The resource type + * @param mixed $resource A resource + * @param string $type The resource type * * @return Boolean true if this class supports the given resource, false otherwise */ diff --git a/core/vendor/Symfony/Component/DependencyInjection/Loader/FileLoader.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/FileLoader.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Loader/FileLoader.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/FileLoader.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php similarity index 94% rename from core/vendor/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php index 4eabd6d51e63..e4b99f60d93f 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php @@ -24,8 +24,8 @@ class IniFileLoader extends FileLoader /** * Loads a resource. * - * @param mixed $file The resource - * @param string $type The resource type + * @param mixed $file The resource + * @param string $type The resource type * * @throws InvalidArgumentException When ini file is not valid */ diff --git a/core/vendor/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php similarity index 92% rename from core/vendor/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php index 98fb2dabf925..3a27d372de11 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -44,7 +44,7 @@ public function load($file, $type = null) $this->container->addResource(new FileResource($path)); // anonymous services - $xml = $this->processAnonymousServices($xml, $path); + $this->processAnonymousServices($xml, $path); // imports $this->parseImports($xml, $path); @@ -76,7 +76,7 @@ public function supports($resource, $type = null) * Parses parameters * * @param SimpleXMLElement $xml - * @param string $file + * @param string $file */ private function parseParameters(SimpleXMLElement $xml, $file) { @@ -91,7 +91,7 @@ private function parseParameters(SimpleXMLElement $xml, $file) * Parses imports * * @param SimpleXMLElement $xml - * @param string $file + * @param string $file */ private function parseImports(SimpleXMLElement $xml, $file) { @@ -109,7 +109,7 @@ private function parseImports(SimpleXMLElement $xml, $file) * Parses multiple definitions * * @param SimpleXMLElement $xml - * @param string $file + * @param string $file */ private function parseDefinitions(SimpleXMLElement $xml, $file) { @@ -125,9 +125,9 @@ private function parseDefinitions(SimpleXMLElement $xml, $file) /** * Parses an individual Definition * - * @param string $id + * @param string $id * @param SimpleXMLElement $service - * @param string $file + * @param string $file */ private function parseDefinition($id, $service, $file) { @@ -221,37 +221,33 @@ private function parseFile($file) * Processes anonymous services * * @param SimpleXMLElement $xml - * @param string $file - * - * @return array An array of anonymous services + * @param string $file */ private function processAnonymousServices(SimpleXMLElement $xml, $file) { $definitions = array(); $count = 0; - // anonymous services as arguments - if (false === $nodes = $xml->xpath('//container:argument[@type="service"][not(@id)]')) { - return $xml; - } - foreach ($nodes as $node) { - // give it a unique name - $node['id'] = sprintf('%s_%d', md5($file), ++$count); + // anonymous services as arguments/properties + if (false !== $nodes = $xml->xpath('//container:argument[@type="service"][not(@id)]|//container:property[@type="service"][not(@id)]')) { + foreach ($nodes as $node) { + // give it a unique name + $node['id'] = sprintf('%s_%d', md5($file), ++$count); - $definitions[(string) $node['id']] = array($node->service, $file, false); - $node->service['id'] = (string) $node['id']; + $definitions[(string) $node['id']] = array($node->service, $file, false); + $node->service['id'] = (string) $node['id']; + } } // anonymous services "in the wild" - if (false === $nodes = $xml->xpath('//container:services/container:service[not(@id)]')) { - return $xml; - } - foreach ($nodes as $node) { - // give it a unique name - $node['id'] = sprintf('%s_%d', md5($file), ++$count); + if (false !== $nodes = $xml->xpath('//container:services/container:service[not(@id)]')) { + foreach ($nodes as $node) { + // give it a unique name + $node['id'] = sprintf('%s_%d', md5($file), ++$count); - $definitions[(string) $node['id']] = array($node, $file, true); - $node->service['id'] = (string) $node['id']; + $definitions[(string) $node['id']] = array($node, $file, true); + $node->service['id'] = (string) $node['id']; + } } // resolve definitions @@ -271,15 +267,13 @@ private function processAnonymousServices(SimpleXMLElement $xml, $file) $oNode->parentNode->removeChild($oNode); } } - - return $xml; } /** * Validates an XML document. * * @param DOMDocument $dom - * @param string $file + * @param string $file */ private function validate(\DOMDocument $dom, $file) { @@ -291,7 +285,7 @@ private function validate(\DOMDocument $dom, $file) * Validates a documents XML schema. * * @param \DOMDocument $dom - * @param string $file + * @param string $file * * @throws RuntimeException When extension references a non-existent XSD file * @throws InvalidArgumentException When XML doesn't validate its XSD schema @@ -365,7 +359,7 @@ private function validateSchema(\DOMDocument $dom, $file) * Validates an extension. * * @param \DOMDocument $dom - * @param string $file + * @param string $file * * @throws InvalidArgumentException When no extension is found corresponding to a tag */ diff --git a/core/vendor/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php similarity index 98% rename from core/vendor/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php index e16321921190..63f3893ab617 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php @@ -81,7 +81,7 @@ public function supports($resource, $type = null) /** * Parses all imports * - * @param array $content + * @param array $content * @param string $file */ private function parseImports($content, $file) @@ -99,7 +99,7 @@ private function parseImports($content, $file) /** * Parses definitions * - * @param array $content + * @param array $content * @param string $file */ private function parseDefinitions($content, $file) @@ -117,7 +117,7 @@ private function parseDefinitions($content, $file) * Parses a definition. * * @param string $id - * @param array $service + * @param array $service * @param string $file */ private function parseDefinition($id, $service, $file) @@ -239,7 +239,7 @@ private function loadFile($file) /** * Validates a YAML file. * - * @param mixed $content + * @param mixed $content * @param string $file * * @return array diff --git a/core/vendor/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd similarity index 98% rename from core/vendor/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd index 7d46e8caa6e8..316f2d759687 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd @@ -118,6 +118,9 @@ </xsd:complexType> <xsd:complexType name="property" mixed="true"> + <xsd:choice minOccurs="0" maxOccurs="1"> + <xsd:element name="service" type="service" /> + </xsd:choice> <xsd:attribute name="type" type="argument_type" /> <xsd:attribute name="id" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> diff --git a/core/vendor/Symfony/Component/DependencyInjection/Parameter.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Parameter.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Parameter.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Parameter.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php similarity index 96% rename from core/vendor/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php index dade5770f8f8..a83f1fcaf446 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php @@ -115,7 +115,7 @@ public function set($name, $value) /** * Returns true if a parameter name is defined. * - * @param string $name The parameter name + * @param string $name The parameter name * * @return Boolean true if the parameter name is defined, false otherwise * @@ -126,6 +126,18 @@ public function has($name) return array_key_exists(strtolower($name), $this->parameters); } + /** + * Removes a parameter. + * + * @param string $key The key + * + * @api + */ + public function remove($key) + { + unset($this->parameters[$key]); + } + /** * Replaces parameter placeholders (%name%) by their values for all parameters. */ @@ -154,7 +166,7 @@ public function resolve() /** * Replaces parameter placeholders (%name%) by their values. * - * @param mixed $value A value + * @param mixed $value A value * @param array $resolving An array of keys that are being resolved (used internally to detect circular references) * * @return mixed The resolved value diff --git a/core/vendor/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php similarity index 95% rename from core/vendor/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php index b530d5dc66aa..da83cbe92c01 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php @@ -73,7 +73,7 @@ function set($name, $value); /** * Returns true if a parameter name is defined. * - * @param string $name The parameter name + * @param string $name The parameter name * * @return Boolean true if the parameter name is defined, false otherwise * @@ -89,7 +89,7 @@ function resolve(); /** * Replaces parameter placeholders (%name%) by their values. * - * @param mixed $value A value + * @param mixed $value A value * * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist */ diff --git a/core/vendor/Symfony/Component/DependencyInjection/README.md b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/README.md similarity index 84% rename from core/vendor/Symfony/Component/DependencyInjection/README.md rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/README.md index 06ebe3dfa2ba..5cb62cf1c489 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/README.md +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/README.md @@ -48,8 +48,8 @@ If your service is retrieved by calling a static method: File Include: -For some services, especially those that are difficult or impossible to -autoload, you may need the container to include a file before +For some services, especially those that are difficult or impossible to +autoload, you may need the container to include a file before instantiating your class. $sc = new ContainerBuilder(); @@ -68,11 +68,9 @@ Resources You can run the unit tests with the following command: - phpunit -c src/Symfony/Component/DependencyInjection/ + phpunit If you also want to run the unit tests that depend on other Symfony -Components, declare the following environment variables before running -PHPUnit: +Components, install dev dependencies before running PHPUnit: - export SYMFONY_CONFIG=../path/to/Config - export SYMFONY_YAML=../path/to/Yaml + php composer.phar install --dev diff --git a/core/vendor/Symfony/Component/DependencyInjection/Reference.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Reference.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Reference.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Reference.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Scope.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Scope.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Scope.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Scope.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/ScopeInterface.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ScopeInterface.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/ScopeInterface.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ScopeInterface.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/SimpleXMLElement.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/SimpleXMLElement.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/SimpleXMLElement.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/SimpleXMLElement.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/TaggedContainerInterface.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/TaggedContainerInterface.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/TaggedContainerInterface.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/TaggedContainerInterface.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php similarity index 91% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php index 52577817a981..c99659e5a67f 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php @@ -45,12 +45,19 @@ public function testProcess() ->setProperty('foo', $ref5 = new Reference('b')) ; + $e = $container + ->register('e') + ->setConfigurator(array($ref6 = new Reference('b'), 'methodName')) + ; + $graph = $this->process($container); - $this->assertCount(3, $edges = $graph->getNode('b')->getInEdges()); + $this->assertCount(4, $edges = $graph->getNode('b')->getInEdges()); + $this->assertSame($ref1, $edges[0]->getValue()); $this->assertSame($ref4, $edges[1]->getValue()); $this->assertSame($ref5, $edges[2]->getValue()); + $this->assertSame($ref6, $edges[3]->getValue()); } public function testProcessDetectsReferencesFromInlinedDefinitions() diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/CheckCircularReferencesPassTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckCircularReferencesPassTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/CheckCircularReferencesPassTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckCircularReferencesPassTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/CheckExceptionOnInvalidReferenceBehaviorPassTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckExceptionOnInvalidReferenceBehaviorPassTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/CheckExceptionOnInvalidReferenceBehaviorPassTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckExceptionOnInvalidReferenceBehaviorPassTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/CheckReferenceValidityPassTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckReferenceValidityPassTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/CheckReferenceValidityPassTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckReferenceValidityPassTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInvalidReferencesPassTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInvalidReferencesPassTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInvalidReferencesPassTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInvalidReferencesPassTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/ContainerTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/ContainerTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/DefinitionDecoratorTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionDecoratorTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/DefinitionDecoratorTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionDecoratorTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Dumper/GraphvizDumperTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/GraphvizDumperTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Dumper/GraphvizDumperTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/GraphvizDumperTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Dumper/XmlDumperTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/XmlDumperTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Dumper/XmlDumperTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/XmlDumperTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container10.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container10.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container10.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container10.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container11.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container11.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container11.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container11.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container12.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container12.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container12.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container12.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container8.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container8.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container8.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container8.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces1.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces1.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces1.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces1.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces2.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces2.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces2.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces2.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services1.dot b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services1.dot similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services1.dot rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services1.dot diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10-1.dot b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10-1.dot similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10-1.dot rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10-1.dot diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10.dot b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10.dot similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10.dot rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10.dot diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services9.dot b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services9.dot similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services9.dot rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services9.dot diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtension.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtension.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtension.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtension.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtensionInPhar.phar b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtensionInPhar.phar similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtensionInPhar.phar rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtensionInPhar.phar diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/foo.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/foo.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/foo.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/foo.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/schema/project-1.0.xsd b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/schema/project-1.0.xsd similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/schema/project-1.0.xsd rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/schema/project-1.0.xsd diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/nonvalid.ini b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/nonvalid.ini similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/nonvalid.ini rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/nonvalid.ini diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters.ini b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters.ini similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters.ini rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters.ini diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters1.ini b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters1.ini similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters1.ini rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters1.ini diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters2.ini b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters2.ini similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters2.ini rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters2.ini diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php similarity index 99% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php index 5ab7bab8e900..c1513b63ea40 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php @@ -104,6 +104,7 @@ protected function getFoo_BazService() protected function getFooBarService() { $class = $this->getParameter('foo_class'); + return $this->services['foo_bar'] = new $class(); } diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/php/simple.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/simple.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/php/simple.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/simple.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension1/services.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension1/services.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension1/services.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension1/services.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension2/services.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension2/services.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension2/services.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension2/services.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services1.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services1.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services1.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services1.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services2.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services2.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services2.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services2.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services3.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services3.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services3.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services3.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services4.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services4.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services4.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services4.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services5.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services5.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services5.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services5.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services6.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services6.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services6.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services6.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services7.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services7.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services7.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services7.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/nonvalid.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/nonvalid.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/nonvalid.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/nonvalid.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services1.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services1.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services1.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services1.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services13.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services13.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services13.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services13.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services2.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services2.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services2.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services2.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services3.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services3.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services3.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services3.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4_bad_import.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4_bad_import.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4_bad_import.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4_bad_import.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services5.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services5.xml similarity index 85% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services5.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services5.xml index 787b4ef7f61e..acb93e748e48 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services5.xml +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services5.xml @@ -13,6 +13,9 @@ </argument> </service> </argument> + <property name="p" type="service"> + <service class="BazClass" /> + </property> </service> </services> </container> diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services7.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services7.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services7.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services7.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services8.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services8.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services8.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services8.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag1.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag1.yml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag1.yml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag1.yml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag2.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag2.yml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag2.yml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag2.yml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag3.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag3.yml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag3.yml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag3.yml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid1.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid1.yml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid1.yml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid1.yml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid2.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid2.yml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid2.yml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid2.yml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services1.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services1.yml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services1.yml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services1.yml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services10.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services10.yml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services10.yml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services10.yml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services11.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services11.yml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services11.yml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services11.yml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services13.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services13.yml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services13.yml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services13.yml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services2.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services2.yml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services2.yml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services2.yml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services3.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services3.yml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services3.yml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services3.yml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4.yml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4.yml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4.yml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4_bad_import.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4_bad_import.yml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4_bad_import.yml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4_bad_import.yml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services7.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services7.yml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services7.yml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services7.yml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services8.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services8.yml similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services8.yml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services8.yml diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml similarity index 97% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml index 2aa47a5d9957..0fd2ae37bf4a 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml @@ -15,7 +15,7 @@ services: calls: - [setBar, ['@bar']] - [initialize, { }] - + scope: prototype configurator: sc_configure bar: @@ -36,7 +36,7 @@ services: - [setBar, ['@?foo2']] - [setBar, ['@?foo3']] - [setBar, ['@?foobaz']] - + factory_service: factory_method: getInstance factory_service: foo.baz diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php similarity index 96% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php index 85f02a2b8f6b..33594d640cf6 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php @@ -41,8 +41,7 @@ public function testLoad() { $loader = new ClosureLoader($container = new ContainerBuilder()); - $loader->load(function ($container) - { + $loader->load(function ($container) { $container->setParameter('foo', 'foo'); }); diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php similarity index 96% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php index 12fa71835936..1a157e6dcf19 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php @@ -122,7 +122,9 @@ public function testLoadAnonymousServices() $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); $loader->load('services5.xml'); $services = $container->getDefinitions(); - $this->assertEquals(3, count($services), '->load() attributes unique ids to anonymous services'); + $this->assertEquals(4, count($services), '->load() attributes unique ids to anonymous services'); + + // anonymous service as an argument $args = $services['foo']->getArguments(); $this->assertEquals(1, count($args), '->load() references anonymous services as "normal" ones'); $this->assertEquals('Symfony\\Component\\DependencyInjection\\Reference', get_class($args[0]), '->load() converts anonymous services to references to "normal" services'); @@ -130,12 +132,21 @@ public function testLoadAnonymousServices() $inner = $services[(string) $args[0]]; $this->assertEquals('BarClass', $inner->getClass(), '->load() uses the same configuration as for the anonymous ones'); + // inner anonymous services $args = $inner->getArguments(); $this->assertEquals(1, count($args), '->load() references anonymous services as "normal" ones'); $this->assertEquals('Symfony\\Component\\DependencyInjection\\Reference', get_class($args[0]), '->load() converts anonymous services to references to "normal" services'); $this->assertTrue(isset($services[(string) $args[0]]), '->load() makes a reference to the created ones'); $inner = $services[(string) $args[0]]; $this->assertEquals('BazClass', $inner->getClass(), '->load() uses the same configuration as for the anonymous ones'); + + // anonymous service as a property + $properties = $services['foo']->getProperties(); + $property = $properties['p']; + $this->assertEquals('Symfony\\Component\\DependencyInjection\\Reference', get_class($property), '->load() converts anonymous services to references to "normal" services'); + $this->assertTrue(isset($services[(string) $property]), '->load() makes a reference to the created ones'); + $inner = $services[(string) $property]; + $this->assertEquals('BazClass', $inner->getClass(), '->load() uses the same configuration as for the anonymous ones'); } public function testLoadServices() diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php similarity index 96% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php index 5f5f265baaba..29d238090981 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php @@ -43,6 +43,19 @@ public function testClear() $this->assertEquals(array(), $bag->all(), '->clear() removes all parameters'); } + /** + * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::remove + */ + public function testRemove() + { + $bag = new ParameterBag(array( + 'foo' => 'foo', + 'bar' => 'bar', + )); + $bag->remove('foo'); + $this->assertEquals(array('bar' => 'bar'), $bag->all(), '->remove() removes a parameter'); + } + /** * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::get * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::set diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/ParameterTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ParameterTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/ParameterTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ParameterTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/ReferenceTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ReferenceTest.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/ReferenceTest.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ReferenceTest.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/Tests/bootstrap.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/bootstrap.php similarity index 56% rename from core/vendor/Symfony/Component/DependencyInjection/Tests/bootstrap.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/bootstrap.php index 77fe27526b6d..fd3118fc361c 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/Tests/bootstrap.php +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/bootstrap.php @@ -10,20 +10,13 @@ */ spl_autoload_register(function ($class) { - foreach (array( - 'SYMFONY_CONFIG' => 'Config', - 'SYMFONY_YAML' => 'Yaml', - ) as $env => $name) { - if (isset($_SERVER[$env]) && 0 === strpos(ltrim($class, '/'), 'Symfony\Component\\'.$name)) { - if (file_exists($file = $_SERVER[$env].'/'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\\'.$name)).'.php')) { - require_once $file; - } - } - } - if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\DependencyInjection')) { if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\DependencyInjection')).'.php')) { require_once $file; } } }); + +if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) { + require_once $loader; +} diff --git a/core/vendor/Symfony/Component/DependencyInjection/Variable.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Variable.php similarity index 100% rename from core/vendor/Symfony/Component/DependencyInjection/Variable.php rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Variable.php diff --git a/core/vendor/Symfony/Component/DependencyInjection/composer.json b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/composer.json similarity index 87% rename from core/vendor/Symfony/Component/DependencyInjection/composer.json rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/composer.json index adf6f1109d98..7238bd07ea4e 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/composer.json +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/composer.json @@ -16,7 +16,11 @@ } ], "require": { - "php": ">=5.3.2" + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/yaml": "2.1.*", + "symfony/config": "2.1.*" }, "suggest": { "symfony/yaml": "self.version", diff --git a/core/vendor/Symfony/Component/DependencyInjection/phpunit.xml.dist b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/phpunit.xml.dist similarity index 94% rename from core/vendor/Symfony/Component/DependencyInjection/phpunit.xml.dist rename to core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/phpunit.xml.dist index bb81f45c1bd0..554d1046b52c 100644 --- a/core/vendor/Symfony/Component/DependencyInjection/phpunit.xml.dist +++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/phpunit.xml.dist @@ -23,6 +23,7 @@ <exclude> <directory>./Resources</directory> <directory>./Tests</directory> + <directory>./vendor</directory> </exclude> </whitelist> </filter> diff --git a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/.gitignore b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/.gitignore new file mode 100644 index 000000000000..d1502b087b4d --- /dev/null +++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/.gitignore @@ -0,0 +1,2 @@ +vendor/ +composer.lock diff --git a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/CHANGELOG.md b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/CHANGELOG.md new file mode 100644 index 000000000000..9f8c8129e204 --- /dev/null +++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/CHANGELOG.md @@ -0,0 +1,16 @@ +CHANGELOG +========= + +2.1.0 +----- + + * added TraceableEventDispatcherInterface + * added ContainerAwareEventDispatcher + * added a reference to the EventDispatcher on the Event + * added a reference to the Event name on the event + * added fluid interface to the dispatch() method which now returns the Event + object + * added GenericEvent event class + * added the possibility for subscribers to subscribe several times for the + same event + * added UnmodifiableEventDispatcher diff --git a/core/vendor/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php similarity index 95% rename from core/vendor/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php rename to core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php index 53a0f6784ce0..85ba2ad2c99c 100644 --- a/core/vendor/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php +++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php @@ -18,7 +18,7 @@ * container * * @author Fabien Potencier <fabien@symfony.com> - * @author Bernhard Schussek <bernhard.schussek@symfony.com> + * @author Bernhard Schussek <bschussek@gmail.com> * @author Jordan Alliot <jordan.alliot@gmail.com> */ class ContainerAwareEventDispatcher extends EventDispatcher @@ -54,10 +54,10 @@ public function __construct(ContainerInterface $container) /** * Adds a service as event listener * - * @param string $eventName Event for which the listener is added - * @param array $callback The service ID of the listener service & the method + * @param string $eventName Event for which the listener is added + * @param array $callback The service ID of the listener service & the method * name that has to be called - * @param integer $priority The higher this value, the earlier an event listener + * @param integer $priority The higher this value, the earlier an event listener * will be triggered in the chain. * Defaults to 0. */ diff --git a/core/vendor/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcherInterface.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcherInterface.php similarity index 100% rename from core/vendor/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcherInterface.php rename to core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcherInterface.php diff --git a/core/vendor/Symfony/Component/EventDispatcher/Event.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php similarity index 100% rename from core/vendor/Symfony/Component/EventDispatcher/Event.php rename to core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php diff --git a/core/vendor/Symfony/Component/EventDispatcher/EventDispatcher.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php similarity index 96% rename from core/vendor/Symfony/Component/EventDispatcher/EventDispatcher.php rename to core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php index b2fb51ada877..356f9199cea8 100644 --- a/core/vendor/Symfony/Component/EventDispatcher/EventDispatcher.php +++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php @@ -155,8 +155,8 @@ public function removeSubscriber(EventSubscriberInterface $subscriber) * for each listener. * * @param array[callback] $listeners The event listeners. - * @param string $eventName The name of the event to dispatch. - * @param Event $event The event object to pass to the event handlers/listeners. + * @param string $eventName The name of the event to dispatch. + * @param Event $event The event object to pass to the event handlers/listeners. */ protected function doDispatch($listeners, $eventName, Event $event) { diff --git a/core/vendor/Symfony/Component/EventDispatcher/EventDispatcherInterface.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcherInterface.php similarity index 97% rename from core/vendor/Symfony/Component/EventDispatcher/EventDispatcherInterface.php rename to core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcherInterface.php index d47ee66aa201..e53d71d0e5a2 100644 --- a/core/vendor/Symfony/Component/EventDispatcher/EventDispatcherInterface.php +++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcherInterface.php @@ -28,7 +28,7 @@ interface EventDispatcherInterface * @param string $eventName The name of the event to dispatch. The name of * the event is the name of the method that is * invoked on listeners. - * @param Event $event The event to pass to the event handlers/listeners. + * @param Event $event The event to pass to the event handlers/listeners. * If not supplied, an empty Event instance is created. * * @return Event diff --git a/core/vendor/Symfony/Component/EventDispatcher/EventSubscriberInterface.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventSubscriberInterface.php similarity index 100% rename from core/vendor/Symfony/Component/EventDispatcher/EventSubscriberInterface.php rename to core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventSubscriberInterface.php diff --git a/core/vendor/Symfony/Component/EventDispatcher/GenericEvent.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php similarity index 96% rename from core/vendor/Symfony/Component/EventDispatcher/GenericEvent.php rename to core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php index 0e792d0e6f9f..0ad76eedd5d7 100644 --- a/core/vendor/Symfony/Component/EventDispatcher/GenericEvent.php +++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php @@ -37,8 +37,8 @@ class GenericEvent extends Event implements \ArrayAccess /** * Encapsulate an event with $subject, $args, and $data. * - * @param mixed $subject The subject of the event, usually an object. - * @param array $arguments Arguments to store in the event. + * @param mixed $subject The subject of the event, usually an object. + * @param array $arguments Arguments to store in the event. */ public function __construct($subject = null, array $arguments = array()) { diff --git a/core/vendor/Symfony/Component/EventDispatcher/LICENSE b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/LICENSE similarity index 100% rename from core/vendor/Symfony/Component/EventDispatcher/LICENSE rename to core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/LICENSE diff --git a/core/vendor/Symfony/Component/EventDispatcher/README.md b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md similarity index 68% rename from core/vendor/Symfony/Component/EventDispatcher/README.md rename to core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md index 421b8c6dec33..a2bcfca1e354 100644 --- a/core/vendor/Symfony/Component/EventDispatcher/README.md +++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md @@ -20,11 +20,9 @@ Resources You can run the unit tests with the following command: - phpunit -c src/Symfony/Component/EventDispatcher/ + phpunit If you also want to run the unit tests that depend on other Symfony -Components, declare the following environment variables before running -PHPUnit: +Components, install dev dependencies before running PHPUnit: - export SYMFONY_DEPENDENCY_INJECTION=../path/to/DependencyInjection - export SYMFONY_HTTP_KERNEL=../path/to/HttpKernel + php composer.phar install --dev diff --git a/core/vendor/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php similarity index 99% rename from core/vendor/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php rename to core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php index 10f5e17d99d6..c62fc10bad4d 100644 --- a/core/vendor/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php +++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php @@ -242,7 +242,8 @@ function onEvent(Event $e) class SubscriberService implements EventSubscriberInterface { - static function getSubscribedEvents() { + static function getSubscribedEvents() + { return array( 'onEvent' => 'onEvent', 'onEvent' => array('onEvent', 10), diff --git a/core/vendor/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php similarity index 100% rename from core/vendor/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php rename to core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php diff --git a/core/vendor/Symfony/Component/EventDispatcher/Tests/EventTest.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventTest.php similarity index 100% rename from core/vendor/Symfony/Component/EventDispatcher/Tests/EventTest.php rename to core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventTest.php diff --git a/core/vendor/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php similarity index 100% rename from core/vendor/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php rename to core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php diff --git a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/UnmodifiableEventDispatcherTest.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/UnmodifiableEventDispatcherTest.php new file mode 100644 index 000000000000..d2502b1957c5 --- /dev/null +++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/UnmodifiableEventDispatcherTest.php @@ -0,0 +1,106 @@ +<?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. + */ + +namespace Symfony\Component\EventDispatcher\Tests; + +use Symfony\Component\EventDispatcher\Event; +use Symfony\Component\EventDispatcher\UnmodifiableEventDispatcher; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; + +/** + * @author Bernhard Schussek <bschussek@gmail.com> + */ +class UnmodifiableEventDispatcherTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $innerDispatcher; + + /** + * @var UnmodifiableEventDispatcher + */ + private $dispatcher; + + protected function setUp() + { + $this->innerDispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $this->dispatcher = new UnmodifiableEventDispatcher($this->innerDispatcher); + } + + public function testDispatchDelegates() + { + $event = new Event(); + + $this->innerDispatcher->expects($this->once()) + ->method('dispatch') + ->with('event', $event) + ->will($this->returnValue('result')); + + $this->assertSame('result', $this->dispatcher->dispatch('event', $event)); + } + + public function testGetListenersDelegates() + { + $this->innerDispatcher->expects($this->once()) + ->method('getListeners') + ->with('event') + ->will($this->returnValue('result')); + + $this->assertSame('result', $this->dispatcher->getListeners('event')); + } + + public function testHasListenersDelegates() + { + $this->innerDispatcher->expects($this->once()) + ->method('hasListeners') + ->with('event') + ->will($this->returnValue('result')); + + $this->assertSame('result', $this->dispatcher->hasListeners('event')); + } + + /** + * @expectedException \BadMethodCallException + */ + public function testAddListenerDisallowed() + { + $this->dispatcher->addListener('event', function () { return 'foo'; }); + } + + /** + * @expectedException \BadMethodCallException + */ + public function testAddSubscriberDisallowed() + { + $subscriber = $this->getMock('Symfony\Component\EventDispatcher\EventSubscriberInterface'); + + $this->dispatcher->addSubscriber($subscriber); + } + + /** + * @expectedException \BadMethodCallException + */ + public function testRemoveListenerDisallowed() + { + $this->dispatcher->removeListener('event', function () { return 'foo'; }); + } + + /** + * @expectedException \BadMethodCallException + */ + public function testRemoveSubscriberDisallowed() + { + $subscriber = $this->getMock('Symfony\Component\EventDispatcher\EventSubscriberInterface'); + + $this->dispatcher->removeSubscriber($subscriber); + } +} diff --git a/core/vendor/Symfony/Component/EventDispatcher/Tests/bootstrap.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/bootstrap.php similarity index 53% rename from core/vendor/Symfony/Component/EventDispatcher/Tests/bootstrap.php rename to core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/bootstrap.php index b71ee5286667..033180fd3fb2 100644 --- a/core/vendor/Symfony/Component/EventDispatcher/Tests/bootstrap.php +++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/bootstrap.php @@ -10,20 +10,13 @@ */ spl_autoload_register(function ($class) { - foreach (array( - 'SYMFONY_DEPENDENCY_INJECTION' => 'DependencyInjection', - 'SYMFONY_HTTP_KERNEL' => 'HttpKernel', - ) as $env => $name) { - if (isset($_SERVER[$env]) && 0 === strpos(ltrim($class, '/'), 'Symfony\Component\\'.$name)) { - if (file_exists($file = $_SERVER[$env].'/'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\\'.$name)).'.php')) { - require_once $file; - } - } - } - if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\EventDispatcher')) { if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\EventDispatcher')).'.php')) { require_once $file; } } }); + +if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) { + require_once $loader; +} diff --git a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/UnmodifiableEventDispatcher.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/UnmodifiableEventDispatcher.php new file mode 100644 index 000000000000..c7097aa42987 --- /dev/null +++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/UnmodifiableEventDispatcher.php @@ -0,0 +1,92 @@ +<?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. + */ + +namespace Symfony\Component\EventDispatcher; + +/** + * A read-only proxy for an event dispatcher. + * + * @author Bernhard Schussek <bschussek@gmail.com> + */ +class UnmodifiableEventDispatcher implements EventDispatcherInterface +{ + /** + * The proxied dispatcher. + * @var EventDispatcherInterface + */ + private $dispatcher; + + /** + * Creates an unmodifiable proxy for an event dispatcher. + * + * @param EventDispatcherInterface $dispatcher The proxied event dispatcher. + */ + public function __construct(EventDispatcherInterface $dispatcher) + { + $this->dispatcher = $dispatcher; + } + + /** + * {@inheritdoc} + */ + public function dispatch($eventName, Event $event = null) + { + return $this->dispatcher->dispatch($eventName, $event); + } + + /** + * {@inheritdoc} + */ + public function addListener($eventName, $listener, $priority = 0) + { + throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); + } + + /** + * {@inheritdoc} + */ + public function addSubscriber(EventSubscriberInterface $subscriber) + { + throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); + } + + /** + * {@inheritdoc} + */ + public function removeListener($eventName, $listener) + { + throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); + } + + /** + * {@inheritdoc} + */ + public function removeSubscriber(EventSubscriberInterface $subscriber) + { + throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); + } + + /** + * {@inheritdoc} + */ + public function getListeners($eventName = null) + { + return $this->dispatcher->getListeners($eventName); + } + + /** + * {@inheritdoc} + */ + public function hasListeners($eventName = null) + { + return $this->dispatcher->hasListeners($eventName); + } +} diff --git a/core/vendor/Symfony/Component/EventDispatcher/composer.json b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json similarity index 89% rename from core/vendor/Symfony/Component/EventDispatcher/composer.json rename to core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json index d93d09f20395..9a34819d7fa5 100644 --- a/core/vendor/Symfony/Component/EventDispatcher/composer.json +++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json @@ -16,7 +16,10 @@ } ], "require": { - "php": ">=5.3.2" + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/dependency-injection": "2.1.*" }, "suggest": { "symfony/dependency-injection": "self.version", diff --git a/core/vendor/Symfony/Component/EventDispatcher/phpunit.xml.dist b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/phpunit.xml.dist similarity index 94% rename from core/vendor/Symfony/Component/EventDispatcher/phpunit.xml.dist rename to core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/phpunit.xml.dist index cb261a4c1fc8..c5571353a650 100644 --- a/core/vendor/Symfony/Component/EventDispatcher/phpunit.xml.dist +++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/phpunit.xml.dist @@ -23,6 +23,7 @@ <exclude> <directory>./Resources</directory> <directory>./Tests</directory> + <directory>./vendor</directory> </exclude> </whitelist> </filter> diff --git a/core/vendor/Symfony/Component/HttpFoundation/ApacheRequest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ApacheRequest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/ApacheRequest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ApacheRequest.php diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/CHANGELOG.md b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/CHANGELOG.md new file mode 100644 index 000000000000..d8664e60bcf5 --- /dev/null +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/CHANGELOG.md @@ -0,0 +1,73 @@ +CHANGELOG +========= + +2.1.0 +----- + + * added a fluent interface to the Response class + * added Request::isProxyTrusted() + * added JsonResponse + * added a getTargetUrl method to RedirectResponse + * added support for streamed responses + * made Response::prepare() method the place to enforce HTTP specification + * [BC BREAK] moved management of the locale from the Session class to the Request class + * added a generic access to the PHP built-in filter mechanism: ParameterBag::filter() + * made FileBinaryMimeTypeGuesser command configurable + * added Request::getUser() and Request::getPassword() + * added support for the PATCH method in Request + * removed the ContentTypeMimeTypeGuesser class as it is deprecated and never used on PHP 5.3 + * added ResponseHeaderBag::makeDisposition() (implements RFC 6266) + * made mimetype to extension conversion configurable + * [BC BREAK] Moved all session related classes and interfaces into own namespace, as + `Symfony\Component\HttpFoundation\Session` and renamed classes accordingly. + Session handlers are located in the subnamespace `Symfony\Component\HttpFoundation\Session\Handler`. + * SessionHandlers must implement `\SessionHandlerInterface`. + * Added internal storage driver proxy mechanism for forward compatibility with + PHP 5.4 `\SessionHandler` class. + * Added session handlers for custom Memcache, Memcached and Null session save handlers. + * [BC BREAK] Removed `NativeSessionStorage` and replaced with `NativeFileSessionHandler`. + * [BC BREAK] `SessionStorageInterface` methods removed: `write()`, `read()` and + `remove()`. Added `getBag()`, `registerBag()`. The `NativeSessionStorage` class + is a mediator for the session storage internals including the session handlers + which do the real work of participating in the internal PHP session workflow. + * [BC BREAK] Introduced mock implementations of `SessionStorage` to enable unit + and functional testing without starting real PHP sessions. Removed + `ArraySessionStorage`, and replaced with `MockArraySessionStorage` for unit + tests; removed `FilesystemSessionStorage`, and replaced with`MockFileSessionStorage` + for functional tests. These do not interact with global session ini + configuration values, session functions or `$_SESSION` superglobal. This means + they can be configured directly allowing multiple instances to work without + conflicting in the same PHP process. + * [BC BREAK] Removed the `close()` method from the `Session` class, as this is + now redundant. + * Deprecated the following methods from the Session class: `setFlash()`, `setFlashes()` + `getFlash()`, `hasFlash()`, and `removeFlash()`. Use `getFlashBag()` instead + which returns a `FlashBagInterface`. + * `Session->clear()` now only clears session attributes as before it cleared + flash messages and attributes. `Session->getFlashBag()->all()` clears flashes now. + * Session data is now managed by `SessionBagInterface` to better encapsulate + session data. + * Refactored session attribute and flash messages system to their own + `SessionBagInterface` implementations. + * Added `FlashBag`. Flashes expire when retrieved by `get()` or `all()`. This + implementation is ESI compatible. + * Added `AutoExpireFlashBag` (default) to replicate Symfony 2.0.x auto expire + behaviour of messages auto expiring. + after one page page load. Messages must be retrieved by `get()` or `all()`. + * Added `Symfony\Component\HttpFoundation\Attribute\AttributeBag` to replicate + attributes storage behaviour from 2.0.x (default). + * Added `Symfony\Component\HttpFoundation\Attribute\NamespacedAttributeBag` for + namespace session attributes. + * Flash API can stores messages in an array so there may be multiple messages + per flash type. The old `Session` class API remains without BC break as it + will allow single messages as before. + * Added basic session meta-data to the session to record session create time, + last updated time, and the lifetime of the session cookie that was provided + to the client. + * Request::getClientIp() method doesn't take a parameter anymore but bases + itself on the trustProxy parameter. + * Added isMethod() to Request object. + * [BC BREAK] The methods `getPathInfo()`, `getBaseUrl()` and `getBasePath()` of + a `Request` now all return a raw value (vs a urldecoded value before). Any call + to one of these methods must be checked and wrapped in a `rawurldecode()` if + needed. diff --git a/core/vendor/Symfony/Component/HttpFoundation/Cookie.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Cookie.php similarity index 85% rename from core/vendor/Symfony/Component/HttpFoundation/Cookie.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Cookie.php index 0511162aa6d8..47c2199f2bb4 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Cookie.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Cookie.php @@ -31,13 +31,13 @@ class Cookie /** * Constructor. * - * @param string $name The name of the cookie - * @param string $value The value of the cookie - * @param integer|string|\DateTime $expire The time the cookie expires - * @param string $path The path on the server in which the cookie will be available on - * @param string $domain The domain that the cookie is available to - * @param Boolean $secure Whether the cookie should only be transmitted over a secure HTTPS connection from the client - * @param Boolean $httpOnly Whether the cookie will be made accessible only through the HTTP protocol + * @param string $name The name of the cookie + * @param string $value The value of the cookie + * @param integer|string|\DateTime $expire The time the cookie expires + * @param string $path The path on the server in which the cookie will be available on + * @param string $domain The domain that the cookie is available to + * @param Boolean $secure Whether the cookie should only be transmitted over a secure HTTPS connection from the client + * @param Boolean $httpOnly Whether the cookie will be made accessible only through the HTTP protocol * * @api */ diff --git a/core/vendor/Symfony/Component/HttpFoundation/File/Exception/AccessDeniedException.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/AccessDeniedException.php similarity index 83% rename from core/vendor/Symfony/Component/HttpFoundation/File/Exception/AccessDeniedException.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/AccessDeniedException.php index 9c7fe6812a31..41f7a462506b 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/File/Exception/AccessDeniedException.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/AccessDeniedException.php @@ -14,14 +14,14 @@ /** * Thrown when the access on a file was denied. * - * @author Bernhard Schussek <bernhard.schussek@symfony.com> + * @author Bernhard Schussek <bschussek@gmail.com> */ class AccessDeniedException extends FileException { /** * Constructor. * - * @param string $path The path to the accessed file + * @param string $path The path to the accessed file */ public function __construct($path) { diff --git a/core/vendor/Symfony/Component/HttpFoundation/File/Exception/FileException.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileException.php similarity index 87% rename from core/vendor/Symfony/Component/HttpFoundation/File/Exception/FileException.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileException.php index 43c6cc8998c5..68f827bd543a 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/File/Exception/FileException.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileException.php @@ -14,7 +14,7 @@ /** * Thrown when an error occurred in the component File * - * @author Bernhard Schussek <bernhard.schussek@symfony.com> + * @author Bernhard Schussek <bschussek@gmail.com> */ class FileException extends \RuntimeException { diff --git a/core/vendor/Symfony/Component/HttpFoundation/File/Exception/FileNotFoundException.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileNotFoundException.php similarity index 81% rename from core/vendor/Symfony/Component/HttpFoundation/File/Exception/FileNotFoundException.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileNotFoundException.php index 5b1aef8e2b29..bd70094b096d 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/File/Exception/FileNotFoundException.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileNotFoundException.php @@ -14,14 +14,14 @@ /** * Thrown when a file was not found * - * @author Bernhard Schussek <bernhard.schussek@symfony.com> + * @author Bernhard Schussek <bschussek@gmail.com> */ class FileNotFoundException extends FileException { /** * Constructor. * - * @param string $path The path to the file that was not found + * @param string $path The path to the file that was not found */ public function __construct($path) { diff --git a/core/vendor/Symfony/Component/HttpFoundation/File/Exception/UnexpectedTypeException.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UnexpectedTypeException.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/File/Exception/UnexpectedTypeException.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UnexpectedTypeException.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/File/Exception/UploadException.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UploadException.php similarity index 87% rename from core/vendor/Symfony/Component/HttpFoundation/File/Exception/UploadException.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UploadException.php index 694e864d1c56..382282e74608 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/File/Exception/UploadException.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UploadException.php @@ -14,7 +14,7 @@ /** * Thrown when an error occurred during file upload * - * @author Bernhard Schussek <bernhard.schussek@symfony.com> + * @author Bernhard Schussek <bschussek@gmail.com> */ class UploadException extends FileException { diff --git a/core/vendor/Symfony/Component/HttpFoundation/File/File.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/File.php similarity index 97% rename from core/vendor/Symfony/Component/HttpFoundation/File/File.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/File.php index 20a80cafd739..188f0c3b1d4f 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/File/File.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/File.php @@ -19,7 +19,7 @@ /** * A file in the file system. * - * @author Bernhard Schussek <bernhard.schussek@symfony.com> + * @author Bernhard Schussek <bschussek@gmail.com> * * @api */ @@ -122,7 +122,7 @@ public function move($directory, $name = null) throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s)', $this->getPathname(), $target, strip_tags($error['message']))); } - chmod($target, 0666 & ~umask()); + @chmod($target, 0666 & ~umask()); return new File($target); } diff --git a/core/vendor/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesser.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesser.php similarity index 98% rename from core/vendor/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesser.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesser.php index b73cd999107c..dcea613b2057 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesser.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesser.php @@ -82,7 +82,7 @@ public function register(ExtensionGuesserInterface $guesser) * returns a value that is not NULL, this method terminates and returns the * value. * - * @param string $mimeType The mime type + * @param string $mimeType The mime type * @return string The guessed extension or NULL, if none could be guessed */ public function guess($mimeType) diff --git a/core/vendor/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesserInterface.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesserInterface.php similarity index 92% rename from core/vendor/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesserInterface.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesserInterface.php index 5b14ef9ed3c4..e8db06572485 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesserInterface.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesserInterface.php @@ -19,7 +19,7 @@ interface ExtensionGuesserInterface /** * Makes a best guess for a file extension, given a mime type * - * @param string $mimeType The mime type + * @param string $mimeType The mime type * @return string The guessed extension or NULL, if none could be guessed */ function guess($mimeType); diff --git a/core/vendor/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php similarity index 97% rename from core/vendor/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php index 12b84cdc9aa5..0761c26267d8 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php @@ -17,7 +17,7 @@ /** * Guesses the mime type with the binary "file" (only available on *nix) * - * @author Bernhard Schussek <bernhard.schussek@symfony.com> + * @author Bernhard Schussek <bschussek@gmail.com> */ class FileBinaryMimeTypeGuesser implements MimeTypeGuesserInterface { diff --git a/core/vendor/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php similarity index 95% rename from core/vendor/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php index 45d5a086eda3..873b94b66be6 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php @@ -17,7 +17,7 @@ /** * Guesses the mime type using the PECL extension FileInfo * - * @author Bernhard Schussek <bernhard.schussek@symfony.com> + * @author Bernhard Schussek <bschussek@gmail.com> */ class FileinfoMimeTypeGuesser implements MimeTypeGuesserInterface { diff --git a/core/vendor/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php similarity index 96% rename from core/vendor/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php index d73a093dfdda..84bd4ce29100 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php @@ -28,7 +28,7 @@ * * The last registered guesser is preferred over previously registered ones. * - * @author Bernhard Schussek <bernhard.schussek@symfony.com> + * @author Bernhard Schussek <bschussek@gmail.com> */ class MimeTypeGuesser implements MimeTypeGuesserInterface { @@ -92,7 +92,7 @@ public function register(MimeTypeGuesserInterface $guesser) * returns a value that is not NULL, this method terminates and returns the * value. * - * @param string $path The path to the file + * @param string $path The path to the file * * @return string The mime type or NULL, if none could be guessed * diff --git a/core/vendor/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesserInterface.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesserInterface.php similarity index 86% rename from core/vendor/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesserInterface.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesserInterface.php index 66178bb952ea..40e8ffd72d26 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesserInterface.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesserInterface.php @@ -14,14 +14,14 @@ /** * Guesses the mime type of a file * - * @author Bernhard Schussek <bernhard.schussek@symfony.com> + * @author Bernhard Schussek <bschussek@gmail.com> */ interface MimeTypeGuesserInterface { /** * Guesses the mime type of the file with the given path. * - * @param string $path The path to the file + * @param string $path The path to the file * * @return string The mime type or NULL, if none could be guessed * diff --git a/core/vendor/Symfony/Component/HttpFoundation/File/UploadedFile.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php similarity index 98% rename from core/vendor/Symfony/Component/HttpFoundation/File/UploadedFile.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php index 4e51c5001086..7e57b0274a36 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/File/UploadedFile.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php @@ -17,7 +17,7 @@ /** * A file uploaded through a form. * - * @author Bernhard Schussek <bernhard.schussek@symfony.com> + * @author Bernhard Schussek <bschussek@gmail.com> * @author Florian Eckerstorfer <florian@eckerstorfer.org> * @author Fabien Potencier <fabien@symfony.com> * diff --git a/core/vendor/Symfony/Component/HttpFoundation/FileBag.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/FileBag.php similarity index 97% rename from core/vendor/Symfony/Component/HttpFoundation/FileBag.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/FileBag.php index 702ab84c0222..0f85eb05b334 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/FileBag.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/FileBag.php @@ -80,7 +80,7 @@ public function add(array $files = array()) /** * Converts uploaded files to UploadedFile instances. * - * @param array|UploadedFile $file A (multi-dimensional) array of uploaded file information + * @param array|UploadedFile $file A (multi-dimensional) array of uploaded file information * * @return array A (multi-dimensional) array of UploadedFile instances */ @@ -121,7 +121,7 @@ protected function convertFileInformation($file) * It's safe to pass an already converted array, in which case this method * just returns the original array unmodified. * - * @param array $data + * @param array $data * * @return array */ diff --git a/core/vendor/Symfony/Component/HttpFoundation/HeaderBag.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/HeaderBag.php similarity index 98% rename from core/vendor/Symfony/Component/HttpFoundation/HeaderBag.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/HeaderBag.php index 88ad1afd6822..cb340120b48a 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/HeaderBag.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/HeaderBag.php @@ -90,7 +90,7 @@ public function keys() /** * Replaces the current HTTP headers by a new set. * - * @param array $headers An array of HTTP headers + * @param array $headers An array of HTTP headers * * @api */ @@ -103,7 +103,7 @@ public function replace(array $headers = array()) /** * Adds new headers the current HTTP headers set. * - * @param array $headers An array of HTTP headers + * @param array $headers An array of HTTP headers * * @api */ diff --git a/core/vendor/Symfony/Component/HttpFoundation/JsonResponse.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.php similarity index 79% rename from core/vendor/Symfony/Component/HttpFoundation/JsonResponse.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.php index d30899fa8912..734628ffe8fb 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/JsonResponse.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.php @@ -24,9 +24,9 @@ class JsonResponse extends Response /** * Constructor. * - * @param mixed $data The response data - * @param integer $status The response status code - * @param array $headers An array of response headers + * @param mixed $data The response data + * @param integer $status The response status code + * @param array $headers An array of response headers */ public function __construct($data = array(), $status = 200, $headers = array()) { @@ -55,8 +55,11 @@ public function setCallback($callback = null) if ($callback) { // taken from http://www.geekality.net/2011/08/03/valid-javascript-identifier/ $pattern = '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*+$/u'; - if (!preg_match($pattern, $callback)) { - throw new \InvalidArgumentException('The callback name is not valid.'); + $parts = explode('.', $callback); + foreach ($parts as $part) { + if (!preg_match($pattern, $part)) { + throw new \InvalidArgumentException('The callback name is not valid.'); + } } } @@ -79,7 +82,8 @@ public function setData($data = array()) $data = new \ArrayObject(); } - $this->data = json_encode($data); + // Encode <, >, ', &, and " for RFC4627-compliant JSON, which may also be embedded into HTML. + $this->data = json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT); return $this->update(); } diff --git a/core/vendor/Symfony/Component/HttpFoundation/LICENSE b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/LICENSE similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/LICENSE rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/LICENSE diff --git a/core/vendor/Symfony/Component/HttpFoundation/ParameterBag.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ParameterBag.php similarity index 94% rename from core/vendor/Symfony/Component/HttpFoundation/ParameterBag.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ParameterBag.php index b4fa6760520f..a39756eb6f3c 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/ParameterBag.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ParameterBag.php @@ -92,7 +92,7 @@ public function add(array $parameters = array()) * * @param string $path The key * @param mixed $default The default value if the parameter key does not exist - * @param boolean $deep If true, a path like foo[bar] will find deeper items + * @param boolean $deep If true, a path like foo[bar] will find deeper items * * @api */ @@ -189,7 +189,7 @@ public function remove($key) * * @param string $key The parameter key * @param mixed $default The default value if the parameter key does not exist - * @param boolean $deep If true, a path like foo[bar] will find deeper items + * @param boolean $deep If true, a path like foo[bar] will find deeper items * * @return string The filtered value * @@ -205,7 +205,7 @@ public function getAlpha($key, $default = '', $deep = false) * * @param string $key The parameter key * @param mixed $default The default value if the parameter key does not exist - * @param boolean $deep If true, a path like foo[bar] will find deeper items + * @param boolean $deep If true, a path like foo[bar] will find deeper items * * @return string The filtered value * @@ -221,7 +221,7 @@ public function getAlnum($key, $default = '', $deep = false) * * @param string $key The parameter key * @param mixed $default The default value if the parameter key does not exist - * @param boolean $deep If true, a path like foo[bar] will find deeper items + * @param boolean $deep If true, a path like foo[bar] will find deeper items * * @return string The filtered value * @@ -238,7 +238,7 @@ public function getDigits($key, $default = '', $deep = false) * * @param string $key The parameter key * @param mixed $default The default value if the parameter key does not exist - * @param boolean $deep If true, a path like foo[bar] will find deeper items + * @param boolean $deep If true, a path like foo[bar] will find deeper items * * @return integer The filtered value * diff --git a/core/vendor/Symfony/Component/HttpFoundation/README.md b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/README.md similarity index 96% rename from core/vendor/Symfony/Component/HttpFoundation/README.md rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/README.md index 8e5d8cfefd7f..bb6f02c443c5 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/README.md +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/README.md @@ -43,4 +43,4 @@ Resources You can run the unit tests with the following command: - phpunit -c src/Symfony/Component/HttpFoundation/ + phpunit diff --git a/core/vendor/Symfony/Component/HttpFoundation/RedirectResponse.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RedirectResponse.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/RedirectResponse.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RedirectResponse.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Request.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php similarity index 97% rename from core/vendor/Symfony/Component/HttpFoundation/Request.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php index b4fd7ace5113..581b4c999a91 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Request.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php @@ -470,9 +470,9 @@ static public function isProxyTrusted() * It is better to explicity get request parameters from the appropriate * public property instead (query, request, attributes, ...). * - * @param string $key the key - * @param mixed $default the default value - * @param type $deep is parameter deep in multidimensional array + * @param string $key the key + * @param mixed $default the default value + * @param type $deep is parameter deep in multidimensional array * * @return mixed */ @@ -546,9 +546,16 @@ public function getClientIp() if ($this->server->has('HTTP_CLIENT_IP')) { return $this->server->get('HTTP_CLIENT_IP'); } elseif ($this->server->has('HTTP_X_FORWARDED_FOR')) { - $clientIp = explode(',', $this->server->get('HTTP_X_FORWARDED_FOR'), 2); + $clientIp = explode(',', $this->server->get('HTTP_X_FORWARDED_FOR')); - return isset($clientIp[0]) ? trim($clientIp[0]) : ''; + foreach ($clientIp as $ipAddress) { + $cleanIpAddress = trim($ipAddress); + + if (false !== filter_var($cleanIpAddress, FILTER_VALIDATE_IP)) { + return $cleanIpAddress; + } + } + return ''; } } @@ -659,9 +666,9 @@ public function getPort() { if (self::$trustProxy && $this->headers->has('X-Forwarded-Port')) { return $this->headers->get('X-Forwarded-Port'); - } else { - return $this->server->get('SERVER_PORT'); } + + return $this->server->get('SERVER_PORT'); } /** @@ -884,7 +891,7 @@ public function getMethod() /** * Gets the mime type associated with the format. * - * @param string $format The format + * @param string $format The format * * @return string The associated mime type (null if not found) * @@ -902,7 +909,7 @@ public function getMimeType($format) /** * Gets the format associated with the mime type. * - * @param string $mimeType The associated mime type + * @param string $mimeType The associated mime type * * @return string The format (null if not found) * @@ -930,8 +937,8 @@ public function getFormat($mimeType) /** * Associates a format with mime types. * - * @param string $format The format - * @param string|array $mimeTypes The associated mime types (the preferred one must be the first as it will be used as the content type) + * @param string $format The format + * @param string|array $mimeTypes The associated mime types (the preferred one must be the first as it will be used as the content type) * * @api */ @@ -953,7 +960,7 @@ public function setFormat($format, $mimeTypes) * * _format request parameter * * $default * - * @param string $default The default format + * @param string $default The default format * * @return string The request format * @@ -1053,7 +1060,7 @@ public function isMethodSafe() /** * Returns the request body content. * - * @param Boolean $asResource If true, a resource will be returned + * @param Boolean $asResource If true, a resource will be returned * * @return string|resource The request body content or a resource to read the body stream. */ @@ -1094,7 +1101,7 @@ public function isNoCache() /** * Returns the preferred language. * - * @param array $locales An array of ordered available locales + * @param array $locales An array of ordered available locales * * @return string|null The preferred locale * @@ -1209,7 +1216,7 @@ public function isXmlHttpRequest() /** * Splits an Accept-* HTTP header. * - * @param string $header Header to split + * @param string $header Header to split * * @return array Array indexed by the values of the Accept-* header in preferred order */ diff --git a/core/vendor/Symfony/Component/HttpFoundation/RequestMatcher.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcher.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/RequestMatcher.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcher.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/RequestMatcherInterface.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcherInterface.php similarity index 91% rename from core/vendor/Symfony/Component/HttpFoundation/RequestMatcherInterface.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcherInterface.php index 506ec7940153..0ee161c884c8 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/RequestMatcherInterface.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcherInterface.php @@ -23,7 +23,7 @@ interface RequestMatcherInterface /** * Decides whether the rule(s) implemented by the strategy matches the supplied request. * - * @param Request $request The request to check for a match + * @param Request $request The request to check for a match * * @return Boolean true if the request matches, false otherwise * diff --git a/core/vendor/Symfony/Component/HttpFoundation/Resources/stubs/SessionHandlerInterface.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs/SessionHandlerInterface.php similarity index 97% rename from core/vendor/Symfony/Component/HttpFoundation/Resources/stubs/SessionHandlerInterface.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs/SessionHandlerInterface.php index 4378b814bef6..11fcf3bc18ef 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Resources/stubs/SessionHandlerInterface.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs/SessionHandlerInterface.php @@ -12,7 +12,7 @@ /** * SessionHandlerInterface * - * Provides forward compatability with PHP 5.4 + * Provides forward compatibility with PHP 5.4 * * Extensive documentation can be found at php.net, see links: * diff --git a/core/vendor/Symfony/Component/HttpFoundation/Response.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php similarity index 95% rename from core/vendor/Symfony/Component/HttpFoundation/Response.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php index 5d443ef488d9..882ac4d36561 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Response.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php @@ -102,26 +102,26 @@ class Response 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', - 418 => 'I\'m a teapot', - 422 => 'Unprocessable Entity', // RFC4918 - 423 => 'Locked', // RFC4918 - 424 => 'Failed Dependency', // RFC4918 + 418 => 'I\'m a teapot', // RFC2324 + 422 => 'Unprocessable Entity', // RFC4918 + 423 => 'Locked', // RFC4918 + 424 => 'Failed Dependency', // RFC4918 425 => 'Reserved for WebDAV advanced collections expired proposal', // RFC2817 - 426 => 'Upgrade Required', // RFC2817 - 428 => 'Precondition Required', // RFC-nottingham-http-new-status-04 - 429 => 'Too Many Requests', // RFC-nottingham-http-new-status-04 - 431 => 'Request Header Fields Too Large', // RFC-nottingham-http-new-status-04 + 426 => 'Upgrade Required', // RFC2817 + 428 => 'Precondition Required', // RFC6585 + 429 => 'Too Many Requests', // RFC6585 + 431 => 'Request Header Fields Too Large', // RFC6585 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported', - 506 => 'Variant Also Negotiates (Experimental)', // [RFC2295] - 507 => 'Insufficient Storage', // RFC4918 - 508 => 'Loop Detected', // RFC5842 - 510 => 'Not Extended', // RFC2774 - 511 => 'Network Authentication Required', // RFC-nottingham-http-new-status-04 + 506 => 'Variant Also Negotiates (Experimental)', // RFC2295 + 507 => 'Insufficient Storage', // RFC4918 + 508 => 'Loop Detected', // RFC5842 + 510 => 'Not Extended', // RFC2774 + 511 => 'Network Authentication Required', // RFC6585 ); /** @@ -206,7 +206,7 @@ public function prepare(Request $request) $headers = $this->headers; if ($this->isInformational() || in_array($this->statusCode, array(204, 304))) { - $this->setContent(''); + $this->setContent(null); } // Content-type based on the Request @@ -234,7 +234,7 @@ public function prepare(Request $request) if ('HEAD' === $request->getMethod()) { // cf. RFC2616 14.13 $length = $headers->get('Content-Length'); - $this->setContent(''); + $this->setContent(null); if ($length) { $headers->set('Content-Length', $length); } @@ -533,7 +533,7 @@ public function setPublic() */ public function mustRevalidate() { - return $this->headers->hasCacheControlDirective('must-revalidate') || $this->headers->has('must-proxy-revalidate'); + return $this->headers->hasCacheControlDirective('must-revalidate') || $this->headers->has('proxy-revalidate'); } /** @@ -1100,7 +1100,7 @@ public function isNotFound() */ public function isRedirect($location = null) { - return in_array($this->statusCode, array(201, 301, 302, 303, 307)) && (null === $location ?: $location == $this->headers->get('Location')); + return in_array($this->statusCode, array(201, 301, 302, 303, 307, 308)) && (null === $location ?: $location == $this->headers->get('Location')); } /** diff --git a/core/vendor/Symfony/Component/HttpFoundation/ResponseHeaderBag.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ResponseHeaderBag.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/ResponseHeaderBag.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ResponseHeaderBag.php diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ServerBag.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ServerBag.php new file mode 100644 index 000000000000..352321f55619 --- /dev/null +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ServerBag.php @@ -0,0 +1,82 @@ +<?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. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * ServerBag is a container for HTTP headers from the $_SERVER variable. + * + * @author Fabien Potencier <fabien@symfony.com> + * @author Bulat Shakirzyanov <mallluhuct@gmail.com> + * @author Robert Kiss <kepten@gmail.com> + */ +class ServerBag extends ParameterBag +{ + /** + * Gets the HTTP headers. + * + * @return string + */ + public function getHeaders() + { + $headers = array(); + foreach ($this->parameters as $key => $value) { + if (0 === strpos($key, 'HTTP_')) { + $headers[substr($key, 5)] = $value; + } + // CONTENT_* are not prefixed with HTTP_ + elseif (in_array($key, array('CONTENT_LENGTH', 'CONTENT_MD5', 'CONTENT_TYPE'))) { + $headers[$key] = $value; + } + } + + if (isset($this->parameters['PHP_AUTH_USER'])) { + $headers['PHP_AUTH_USER'] = $this->parameters['PHP_AUTH_USER']; + $headers['PHP_AUTH_PW'] = isset($this->parameters['PHP_AUTH_PW']) ? $this->parameters['PHP_AUTH_PW'] : ''; + } else { + /* + * php-cgi under Apache does not pass HTTP Basic user/pass to PHP by default + * For this workaround to work, add these lines to your .htaccess file: + * RewriteCond %{HTTP:Authorization} ^(.+)$ + * RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + * + * A sample .htaccess file: + * RewriteEngine On + * RewriteCond %{HTTP:Authorization} ^(.+)$ + * RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + * RewriteCond %{REQUEST_FILENAME} !-f + * RewriteRule ^(.*)$ app.php [QSA,L] + */ + + $authorizationHeader = null; + if (isset($this->parameters['HTTP_AUTHORIZATION'])) { + $authorizationHeader = $this->parameters['HTTP_AUTHORIZATION']; + } elseif (isset($this->parameters['REDIRECT_HTTP_AUTHORIZATION'])) { + $authorizationHeader = $this->parameters['REDIRECT_HTTP_AUTHORIZATION']; + } + + // Decode AUTHORIZATION header into PHP_AUTH_USER and PHP_AUTH_PW when authorization header is basic + if ((null !== $authorizationHeader) && (0 === stripos($authorizationHeader, 'basic'))) { + $exploded = explode(':', base64_decode(substr($authorizationHeader, 6))); + if (count($exploded) == 2) { + list($headers['PHP_AUTH_USER'], $headers['PHP_AUTH_PW']) = $exploded; + } + } + } + + // PHP_AUTH_USER/PHP_AUTH_PW + if (isset($headers['PHP_AUTH_USER'])) { + $headers['AUTHORIZATION'] = 'Basic '.base64_encode($headers['PHP_AUTH_USER'].':'.$headers['PHP_AUTH_PW']); + } + + return $headers; + } +} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php similarity index 97% rename from core/vendor/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php index 7da122709601..2fab8bddb80b 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php @@ -26,7 +26,7 @@ interface FlashBagInterface extends SessionBagInterface * @param string $type * @param string $message */ - public function add($type, $message); + function add($type, $message); /** * Registers a message for a given type. diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Session.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Session.php similarity index 96% rename from core/vendor/Symfony/Component/HttpFoundation/Session/Session.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Session.php index 0c40c1c32f89..b70a334f6ae2 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Session/Session.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Session.php @@ -209,7 +209,7 @@ public function setName($name) } /** - * {@iheritdoc} + * {@inheritdoc} */ public function getMetadataBag() { @@ -217,7 +217,7 @@ public function getMetadataBag() } /** - * {@iheritdoc} + * {@inheritdoc} */ public function registerBag(SessionBagInterface $bag) { @@ -225,7 +225,7 @@ public function registerBag(SessionBagInterface $bag) } /** - * {@iheritdoc} + * {@inheritdoc} */ public function getBag($name) { @@ -256,7 +256,11 @@ public function getFlashes() $return = array(); if ($all) { foreach ($all as $name => $array) { - $return[$name] = reset($array); + if (is_numeric(key($array))) { + $return[$name] = reset($array); + } else { + $return[$name] = $array; + } } } diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/SessionBagInterface.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionBagInterface.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Session/SessionBagInterface.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionBagInterface.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/SessionInterface.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionInterface.php similarity index 96% rename from core/vendor/Symfony/Component/HttpFoundation/Session/SessionInterface.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionInterface.php index 15b4c2924c74..833dd9cf8426 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Session/SessionInterface.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionInterface.php @@ -179,7 +179,7 @@ function clear(); * * @param SessionBagInterface $bag */ - public function registerBag(SessionBagInterface $bag); + function registerBag(SessionBagInterface $bag); /** * Gets a bag instance by name. @@ -188,12 +188,12 @@ public function registerBag(SessionBagInterface $bag); * * @return SessionBagInterface */ - public function getBag($name); + function getBag($name); /** * Gets session meta. * * @return MetadataBag */ - public function getMetadataBag(); + function getMetadataBag(); } diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/FileSessionHandler.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/FileSessionHandler.php new file mode 100644 index 000000000000..1417b5ad8c2c --- /dev/null +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/FileSessionHandler.php @@ -0,0 +1,115 @@ +<?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. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +/** + * FileSessionHandler. + * + * @author Drak <drak@zikula.org> + */ +class FileSessionHandler implements \SessionHandlerInterface +{ + /** + * @var string + */ + private $savePath; + + /** + * @var string + */ + private $prefix; + + /** + * Constructor. + * + * @param string $savePath Path of directory to save session files. + */ + public function __construct($savePath = null, $prefix = 'sess_') + { + if (null === $savePath) { + $savePath = sys_get_temp_dir(); + } + + $this->savePath = $savePath; + if (false === is_dir($this->savePath)) { + mkdir($this->savePath, 0777, true); + } + + $this->prefix = $prefix; + } + + /** + * {@inheritdoc] + */ + public function open($savePath, $sessionName) + { + return true; + } + + /** + * {@inheritdoc] + */ + public function close() + { + return true; + } + + /** + * {@inheritdoc] + */ + public function read($id) + { + $file = $this->getPath().$id; + + return is_readable($file) ? file_get_contents($file) : ''; + } + + /** + * {@inheritdoc] + */ + public function write($id, $data) + { + return false === file_put_contents($this->getPath().$id, $data) ? false : true; + } + + /** + * {@inheritdoc] + */ + public function destroy($id) + { + $file = $this->getPath().$id; + if (is_file($file)) { + unlink($file); + } + + return true; + } + + /** + * {@inheritdoc] + */ + public function gc($maxlifetime) + { + foreach (glob($this->getPath().'*') as $file) { + if ((filemtime($file) + $maxlifetime) < time()) { + unlink($file); + } + } + + return true; + } + + private function getPath() + { + return $this->savePath.'/'.$this->prefix; + } +} diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php new file mode 100644 index 000000000000..4a5e63989a46 --- /dev/null +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php @@ -0,0 +1,109 @@ +<?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. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +/** + * MemcacheSessionHandler. + * + * @author Drak <drak@zikula.org> + */ +class MemcacheSessionHandler implements \SessionHandlerInterface +{ + /** + * @var \Memcache Memcache driver. + */ + private $memcache; + + /** + * @var integer Time to live in seconds + */ + private $ttl; + + /** + * @var string Key prefix for shared environments. + */ + private $prefix; + + /** + * Constructor. + * + * List of available options: + * * prefix: The prefix to use for the memcache keys in order to avoid collision + * * expiretime: The time to live in seconds + * + * @param \Memcache $memcache A \Memcache instance + * @param array $options An associative array of Memcache options + * + * @throws \InvalidArgumentException When unsupported options are passed + */ + public function __construct(\Memcache $memcache, array $options = array()) + { + if ($diff = array_diff(array_keys($options), array('prefix', 'expiretime'))) { + throw new \InvalidArgumentException(sprintf( + 'The following options are not supported "%s"', implode(', ', $diff) + )); + } + + $this->memcache = $memcache; + $this->ttl = isset($options['expiretime']) ? (int) $options['expiretime'] : 86400; + $this->prefix = isset($options['prefix']) ? $options['prefix'] : 'sf2s'; + } + + /** + * {@inheritDoc} + */ + public function open($savePath, $sessionName) + { + return true; + } + + /** + * {@inheritDoc} + */ + public function close() + { + return $this->memcache->close(); + } + + /** + * {@inheritDoc} + */ + public function read($sessionId) + { + return $this->memcache->get($this->prefix.$sessionId) ?: ''; + } + + /** + * {@inheritDoc} + */ + public function write($sessionId, $data) + { + return $this->memcache->set($this->prefix.$sessionId, $data, 0, time() + $this->ttl); + } + + /** + * {@inheritDoc} + */ + public function destroy($sessionId) + { + return $this->memcache->delete($this->prefix.$sessionId); + } + + /** + * {@inheritDoc} + */ + public function gc($lifetime) + { + // not required here because memcache will auto expire the records anyhow. + return true; + } +} diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php new file mode 100644 index 000000000000..b666199a453d --- /dev/null +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php @@ -0,0 +1,116 @@ +<?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. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +/** + * MemcachedSessionHandler. + * + * Memcached based session storage handler based on the Memcached class + * provided by the PHP memcached extension. + * + * @see http://php.net/memcached + * + * @author Drak <drak@zikula.org> + */ +class MemcachedSessionHandler implements \SessionHandlerInterface +{ + /** + * @var \Memcached Memcached driver. + */ + private $memcached; + + /** + * @var integer Time to live in seconds + */ + private $ttl; + + + /** + * @var string Key prefix for shared environments. + */ + private $prefix; + + /** + * Constructor. + * + * List of available options: + * * prefix: The prefix to use for the memcached keys in order to avoid collision + * * expiretime: The time to live in seconds + * + * @param \Memcached $memcached A \Memcached instance + * @param array $options An associative array of Memcached options + * + * @throws \InvalidArgumentException When unsupported options are passed + */ + public function __construct(\Memcached $memcached, array $options = array()) + { + $this->memcached = $memcached; + + if ($diff = array_diff(array_keys($options), array('prefix', 'expiretime'))) { + throw new \InvalidArgumentException(sprintf( + 'The following options are not supported "%s"', implode(', ', $diff) + )); + } + + $this->ttl = isset($options['expiretime']) ? (int) $options['expiretime'] : 86400; + $this->prefix = isset($options['prefix']) ? $options['prefix'] : 'sf2s'; + } + + /** + * {@inheritDoc} + */ + public function open($savePath, $sessionName) + { + return true; + } + + /** + * {@inheritDoc} + */ + public function close() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function read($sessionId) + { + return $this->memcached->get($this->prefix.$sessionId) ?: ''; + } + + /** + * {@inheritDoc} + */ + public function write($sessionId, $data) + { + return $this->memcached->set($this->prefix.$sessionId, $data, time() + $this->ttl); + } + + /** + * {@inheritDoc} + */ + public function destroy($sessionId) + { + return $this->memcached->delete($this->prefix.$sessionId); + } + + /** + * {@inheritDoc} + */ + public function gc($lifetime) + { + // not required here because memcached will auto expire the records anyhow. + return true; + } +} diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php new file mode 100644 index 000000000000..6006773c9ddb --- /dev/null +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php @@ -0,0 +1,145 @@ +<?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. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +/** + * MongoDB session handler + * + * @author Markus Bachmann <markus.bachmann@bachi.biz> + */ +class MongoDbSessionHandler implements \SessionHandlerInterface +{ + /** + * @var \Mongo + */ + private $mongo; + + /** + * @var \MongoCollection + */ + private $collection; + + /** + * @var array + */ + private $options; + + /** + * Constructor. + * + * @param \Mongo $mongo A "Mongo" instance + * @param array $options An associative array of field options + * + * @throws \InvalidArgumentException When "database" or "collection" not provided + */ + public function __construct(\Mongo $mongo, array $options) + { + if (!isset($options['database']) || !isset($options['collection'])) { + throw new \InvalidArgumentException('You must provide the "database" and "collection" option for MongoDBSessionHandler'); + } + + $this->mongo = $mongo; + + $this->options = array_merge(array( + 'id_field' => 'sess_id', + 'data_field' => 'sess_data', + 'time_field' => 'sess_time', + ), $options); + } + + /** + * {@inheritDoc} + */ + public function open($savePath, $sessionName) + { + return true; + } + + /** + * {@inheritDoc} + */ + public function close() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function destroy($sessionId) + { + $this->getCollection()->remove( + array($this->options['id_field'] => $sessionId), + array('justOne' => true) + ); + + return true; + } + + /** + * {@inheritDoc} + */ + public function gc($lifetime) + { + $time = new \MongoTimestamp(time() - $lifetime); + + $this->getCollection()->remove(array( + $this->options['time_field'] => array('$lt' => $time), + )); + } + + /** + * {@inheritDoc] + */ + public function write($sessionId, $data) + { + $data = array( + $this->options['id_field'] => $sessionId, + $this->options['data_field'] => new \MongoBinData($data), + $this->options['time_field'] => new \MongoTimestamp() + ); + + $this->getCollection()->update( + array($this->options['id_field'] => $sessionId), + array('$set' => $data), + array('upsert' => true) + ); + + return true; + } + + /** + * {@inheritDoc} + */ + public function read($sessionId) + { + $dbData = $this->getCollection()->findOne(array( + $this->options['id_field'] => $sessionId, + )); + + return null === $dbData ? '' : $dbData[$this->options['data_field']]->bin; + } + + /** + * Return a "MongoCollection" instance + * + * @return \MongoCollection + */ + private function getCollection() + { + if (null === $this->collection) { + $this->collection = $this->mongo->selectDB($this->options['database'])->selectCollection($this->options['collection']); + } + + return $this->collection; + } +} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php similarity index 92% rename from core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php index dd9f0c79aebe..62068aff1b7c 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php @@ -14,7 +14,7 @@ /** * NullSessionHandler. * - * Can be used in unit testing or in a sitation where persisted sessions are not desired. + * Can be used in unit testing or in a situations where persisted sessions are not desired. * * @author Drak <drak@zikula.org> * diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php similarity index 65% rename from core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php index 28dccba80157..9c4c5aa3d1ff 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php @@ -20,30 +20,30 @@ class PdoSessionHandler implements \SessionHandlerInterface { /** - * PDO instance. - * - * @var \PDO + * @var \PDO PDO instance. */ private $pdo; /** - * Database options. - * - * - * @var array + * @var array Database options. */ private $dbOptions; /** * Constructor. * + * List of available options: + * * db_table: The name of the table [required] + * * db_id_col: The column where to store the session id [default: sess_id] + * * db_data_col: The column where to store the session data [default: sess_data] + * * db_time_col: The column where to store the timestamp [default: sess_time] + * * @param \PDO $pdo A \PDO instance * @param array $dbOptions An associative array of DB options - * @param array $options Session configuration options * * @throws \InvalidArgumentException When "db_table" option is not provided */ - public function __construct(\PDO $pdo, array $dbOptions = array(), array $options = array()) + public function __construct(\PDO $pdo, array $dbOptions = array()) { if (!array_key_exists('db_table', $dbOptions)) { throw new \InvalidArgumentException('You must provide the "db_table" option for a PdoSessionStorage.'); @@ -58,7 +58,7 @@ public function __construct(\PDO $pdo, array $dbOptions = array(), array $option } /** - * {@inheritdoc} + * {@inheritDoc} */ public function open($path, $name) { @@ -66,7 +66,7 @@ public function open($path, $name) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function close() { @@ -74,12 +74,12 @@ public function close() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function destroy($id) { // get table/column - $dbTable = $this->dbOptions['db_table']; + $dbTable = $this->dbOptions['db_table']; $dbIdCol = $this->dbOptions['db_id_col']; // delete the record associated with this id @@ -97,20 +97,20 @@ public function destroy($id) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function gc($lifetime) { // get table/column - $dbTable = $this->dbOptions['db_table']; + $dbTable = $this->dbOptions['db_table']; $dbTimeCol = $this->dbOptions['db_time_col']; // delete the session records that have expired - $sql = "DELETE FROM $dbTable WHERE $dbTimeCol < (:time - $lifetime)"; + $sql = "DELETE FROM $dbTable WHERE $dbTimeCol < :time"; try { $stmt = $this->pdo->prepare($sql); - $stmt->bindValue(':time', time(), \PDO::PARAM_INT); + $stmt->bindValue(':time', time() - $lifetime, \PDO::PARAM_INT); $stmt->execute(); } catch (\PDOException $e) { throw new \RuntimeException(sprintf('PDOException was thrown when trying to manipulate session data: %s', $e->getMessage()), 0, $e); @@ -120,12 +120,12 @@ public function gc($lifetime) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function read($id) { // get table/columns - $dbTable = $this->dbOptions['db_table']; + $dbTable = $this->dbOptions['db_table']; $dbDataCol = $this->dbOptions['db_data_col']; $dbIdCol = $this->dbOptions['db_id_col']; @@ -154,7 +154,7 @@ public function read($id) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function write($id, $data) { @@ -164,27 +164,37 @@ public function write($id, $data) $dbIdCol = $this->dbOptions['db_id_col']; $dbTimeCol = $this->dbOptions['db_time_col']; - $sql = ('mysql' === $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME)) - ? "INSERT INTO $dbTable ($dbIdCol, $dbDataCol, $dbTimeCol) VALUES (:id, :data, :time) " - ."ON DUPLICATE KEY UPDATE $dbDataCol = VALUES($dbDataCol), $dbTimeCol = CASE WHEN $dbTimeCol = :time THEN (VALUES($dbTimeCol) + 1) ELSE VALUES($dbTimeCol) END" - : "UPDATE $dbTable SET $dbDataCol = :data, $dbTimeCol = :time WHERE $dbIdCol = :id"; + //session data can contain non binary safe characters so we need to encode it + $encoded = base64_encode($data); try { - //session data can contain non binary safe characters so we need to encode it - $encoded = base64_encode($data); - $stmt = $this->pdo->prepare($sql); - $stmt->bindParam(':id', $id, \PDO::PARAM_STR); - $stmt->bindParam(':data', $encoded, \PDO::PARAM_STR); - $stmt->bindValue(':time', time(), \PDO::PARAM_INT); - $stmt->execute(); - - if (!$stmt->rowCount()) { - // No session exists in the database to update. This happens when we have called - // session_regenerate_id() - $this->createNewSession($id, $data); + if ('mysql' === $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME)) { + // MySQL would report $stmt->rowCount() = 0 on UPDATE when the data is left unchanged + // it could result in calling createNewSession() whereas the session already exists in + // the DB which would fail as the id is unique + $stmt = $this->pdo->prepare( + "INSERT INTO $dbTable ($dbIdCol, $dbDataCol, $dbTimeCol) VALUES (:id, :data, :time) " . + "ON DUPLICATE KEY UPDATE $dbDataCol = VALUES($dbDataCol), $dbTimeCol = VALUES($dbTimeCol)" + ); + $stmt->bindParam(':id', $id, \PDO::PARAM_STR); + $stmt->bindParam(':data', $encoded, \PDO::PARAM_STR); + $stmt->bindValue(':time', time(), \PDO::PARAM_INT); + $stmt->execute(); + } else { + $stmt = $this->pdo->prepare("UPDATE $dbTable SET $dbDataCol = :data, $dbTimeCol = :time WHERE $dbIdCol = :id"); + $stmt->bindParam(':id', $id, \PDO::PARAM_STR); + $stmt->bindParam(':data', $encoded, \PDO::PARAM_STR); + $stmt->bindValue(':time', time(), \PDO::PARAM_INT); + $stmt->execute(); + + if (!$stmt->rowCount()) { + // No session exists in the database to update. This happens when we have called + // session_regenerate_id() + $this->createNewSession($id, $data); + } } } catch (\PDOException $e) { - throw new \RuntimeException(sprintf('PDOException was thrown when trying to write the session data: %s', $e->getMessage()), 0, $e); + throw new \RuntimeException(sprintf('PDOException was thrown when trying to write the session data: %s', $e->getMessage()), 0, $e); } return true; @@ -201,7 +211,7 @@ public function write($id, $data) private function createNewSession($id, $data = '') { // get table/column - $dbTable = $this->dbOptions['db_table']; + $dbTable = $this->dbOptions['db_table']; $dbDataCol = $this->dbOptions['db_data_col']; $dbIdCol = $this->dbOptions['db_id_col']; $dbTimeCol = $this->dbOptions['db_time_col']; diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php similarity index 99% rename from core/vendor/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php index 5500a0341991..45725522e826 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php @@ -61,7 +61,7 @@ class MockArraySessionStorage implements SessionStorageInterface /** * Constructor. * - * @param string $name Session name + * @param string $name Session name * @param MetadataBag $metaBag MetadataBag instance. */ public function __construct($name = 'MOCKSESSID', MetadataBag $metaBag = null) diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php similarity index 62% rename from core/vendor/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php index 5bf2962ae65f..23b86b3b7f99 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php @@ -11,6 +11,9 @@ namespace Symfony\Component\HttpFoundation\Session\Storage; +use Symfony\Component\HttpFoundation\Session\Storage\Handler\FileSessionHandler; +use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag; + /** * MockFileSessionStorage is used to mock sessions for * functional testing when done in a single PHP process. @@ -25,31 +28,27 @@ class MockFileSessionStorage extends MockArraySessionStorage { /** - * @var string + * @var FileSessionHandler */ - private $savePath; - - private $sessionData; + private $handler; /** * Constructor. * - * @param string $savePath Path of directory to save session files. - * @param string $name Session name. + * @param string $savePath Path of directory to save session files. + * @param string $name Session name. + * @param FileSessionHandler $handler Save handler + * @param MetadataBag $metaData Metadatabag */ - public function __construct($savePath = null, $name = 'MOCKSESSID') + public function __construct($savePath = null, $name = 'MOCKSESSID', FileSessionHandler $handler = null, MetadataBag $metaData = null) { - if (null === $savePath) { - $savePath = sys_get_temp_dir(); - } - - if (!is_dir($savePath)) { - mkdir($savePath, 0777, true); + if (null == $handler) { + $handler = new FileSessionHandler($savePath, 'mocksess_'); } - $this->savePath = $savePath; + $this->handler = $handler; - parent::__construct($name); + parent::__construct($name, $metaData); } /** @@ -93,7 +92,12 @@ public function regenerate($destroy = false, $lifetime = null) */ public function save() { - file_put_contents($this->getFilePath(), serialize($this->data)); + $this->handler->write($this->id, serialize($this->data)); + + // this is needed for Silex, where the session object is re-used across requests + // in functional tests. In Symfony, the container is rebooted, so we don't have + // this issue + $this->started = false; } /** @@ -102,19 +106,7 @@ public function save() */ private function destroy() { - if (is_file($this->getFilePath())) { - unlink($this->getFilePath()); - } - } - - /** - * Calculate path to file. - * - * @return string File path - */ - private function getFilePath() - { - return $this->savePath.'/'.$this->id.'.mocksess'; + $this->handler->destroy($this->id); } /** @@ -122,8 +114,8 @@ private function getFilePath() */ private function read() { - $filePath = $this->getFilePath(); - $this->data = is_readable($filePath) && is_file($filePath) ? unserialize(file_get_contents($filePath)) : array(); + $data = $this->handler->read($this->id); + $this->data = $data ? unserialize($data) : array(); $this->loadSession(); } diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php similarity index 98% rename from core/vendor/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php index 215ed26ab0ff..7a9d77531e7d 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php @@ -89,8 +89,8 @@ class NativeSessionStorage implements SessionStorageInterface * upload_progress.min-freq, "1" * url_rewriter.tags, "a=href,area=href,frame=src,form=,fieldset=" * - * @param array $options Session configuration options. - * @param object $handler SessionHandlerInterface. + * @param array $options Session configuration options. + * @param object $handler SessionHandlerInterface. * @param MetadataBag $handler MetadataBag. */ public function __construct(array $options = array(), $handler = null, MetadataBag $metaBag = null) diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php similarity index 98% rename from core/vendor/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php index 20c533c2eb19..c07ed7fb6f78 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php @@ -82,7 +82,7 @@ function setName($name); * Note regenerate+destroy should not clear the session data in memory * only delete the session data from persistent storage. * - * @param Boolean $destroy Destroy session when regenerating? + * @param Boolean $destroy Destroy session when regenerating? * @param integer $lifetime Sets the cookie lifetime for the session cookie. A null value * will leave the system settings unchanged, 0 sets the cookie * to expire with browser session. Time is in seconds, and is diff --git a/core/vendor/Symfony/Component/HttpFoundation/StreamedResponse.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/StreamedResponse.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/StreamedResponse.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/StreamedResponse.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/CookieTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/CookieTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/CookieTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/CookieTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/File/FileTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/FileTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/File/FileTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/FileTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/File/Fixtures/.unknownextension b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/Fixtures/.unknownextension similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/File/Fixtures/.unknownextension rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/Fixtures/.unknownextension diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/File/Fixtures/directory/.empty b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/Fixtures/directory/.empty similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/File/Fixtures/directory/.empty rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/Fixtures/directory/.empty diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/File/Fixtures/test b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/Fixtures/test similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/File/Fixtures/test rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/Fixtures/test diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/File/Fixtures/test.gif b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/Fixtures/test.gif similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/File/Fixtures/test.gif rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/Fixtures/test.gif diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/File/MimeType/MimeTypeTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/MimeType/MimeTypeTest.php similarity index 98% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/File/MimeType/MimeTypeTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/MimeType/MimeTypeTest.php index 2990c210ff74..7bf10a297e19 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Tests/File/MimeType/MimeTypeTest.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/MimeType/MimeTypeTest.php @@ -84,7 +84,7 @@ public function testGuessWithNonReadablePath() $path = __DIR__.'/../Fixtures/to_delete'; touch($path); - chmod($path, 0333); + @chmod($path, 0333); if (get_current_user() != 'root' && substr(sprintf('%o', fileperms($path)), -4) == '0333') { $this->setExpectedException('Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException'); @@ -98,7 +98,7 @@ public static function tearDownAfterClass() { $path = __DIR__.'/../Fixtures/to_delete'; if (file_exists($path)) { - chmod($path, 0666); + @chmod($path, 0666); @unlink($path); } } diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/FileBagTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/FileBagTest.php similarity index 91% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/FileBagTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/FileBagTest.php index 5042506bc6d3..1f29d56bc034 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Tests/FileBagTest.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/FileBagTest.php @@ -129,6 +129,20 @@ public function testShouldNotConvertNestedUploadedFiles() protected function createTempFile() { - return tempnam(sys_get_temp_dir(), 'FormTest'); + return tempnam(sys_get_temp_dir().'/form_test', 'FormTest'); + } + + protected function setUp() + { + mkdir(sys_get_temp_dir().'/form_test', 0777, true); + } + + protected function tearDown() + { + foreach (glob(sys_get_temp_dir().'/form_test/*') as $file) { + unlink($file); + } + + rmdir(sys_get_temp_dir().'/form_test'); } } diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/HeaderBagTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/HeaderBagTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/HeaderBagTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/HeaderBagTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php similarity index 94% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php index 16ad0d614ee3..a89da9325a9a 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php @@ -104,4 +104,11 @@ public function testSetCallbackInvalidIdentifier() $this->setExpectedException('InvalidArgumentException'); $response->setCallback('+invalid'); } + + public function testJsonEncodeFlags() + { + $response = new JsonResponse('<>\'&"'); + + $this->assertEquals('"\u003C\u003E\u0027\u0026\u0022"', $response->getContent()); + } } diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/RequestTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestTest.php similarity index 99% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/RequestTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestTest.php index 84f19a26c976..9d943ef0d48f 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Tests/RequestTest.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestTest.php @@ -552,7 +552,6 @@ public function testGetClientIp($expected, $proxy, $remoteAddr, $httpClientIp, $ { $request = new Request(); $this->assertEquals('', $request->getClientIp()); - $this->assertEquals('', $request->getClientIp(true)); $server = array('REMOTE_ADDR' => $remoteAddr); if (null !== $httpClientIp) { @@ -584,6 +583,7 @@ public function testGetClientIpProvider() array('2620:0:1cfe:face:b00c::3', true, '::1', '2620:0:1cfe:face:b00c::3', null), array('2620:0:1cfe:face:b00c::3', true, '::1', null, '2620:0:1cfe:face:b00c::3, ::1'), array('88.88.88.88', true, '123.45.67.89', null, '88.88.88.88, 87.65.43.21, 127.0.0.1'), + array('88.88.88.88', true, '123.45.67.89', null, 'unknown, 88.88.88.88'), ); } @@ -1053,7 +1053,7 @@ public function urlencodedStringPrefixData() array('fo%2Bo/bar', 'fo+o', 'fo%2Bo'), ); } - + private function stopTrustingProxyData() { $class = new \ReflectionClass('Symfony\\Component\\HttpFoundation\\Request'); diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/ResponseTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseTest.php similarity index 98% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/ResponseTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseTest.php index 6e76cd2fe81e..4edcd6dd1d9c 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Tests/ResponseTest.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseTest.php @@ -352,14 +352,14 @@ public function testIsInvalid() try { $response->setStatusCode(99); $this->fail(); - } catch(\InvalidArgumentException $e) { + } catch (\InvalidArgumentException $e) { $this->assertTrue($response->isInvalid()); } try { $response->setStatusCode(650); $this->fail(); - } catch(\InvalidArgumentException $e) { + } catch (\InvalidArgumentException $e) { $this->assertTrue($response->isInvalid()); } @@ -378,8 +378,7 @@ public function testIsInformational() public function testIsRedirectRedirection() { - foreach (array(301, 302, 303, 307) as $code) - { + foreach (array(301, 302, 303, 307) as $code) { $response = new Response('', $code); $this->assertTrue($response->isRedirection()); $this->assertTrue($response->isRedirect()); @@ -413,8 +412,7 @@ public function testIsNotFound() public function testIsEmpty() { - foreach (array(201, 204, 304) as $code) - { + foreach (array(201, 204, 304) as $code) { $response = new Response('', $code); $this->assertTrue($response->isEmpty()); } diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php new file mode 100644 index 000000000000..f8e487d7f874 --- /dev/null +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php @@ -0,0 +1,101 @@ +<?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. + */ + +namespace Symfony\Component\HttpFoundation\Tests; + +use Symfony\Component\HttpFoundation\ServerBag; + +/** + * ServerBagTest + * + * @author Bulat Shakirzyanov <mallluhuct@gmail.com> + */ +class ServerBagTest extends \PHPUnit_Framework_TestCase +{ + public function testShouldExtractHeadersFromServerArray() + { + $server = array( + 'SOME_SERVER_VARIABLE' => 'value', + 'SOME_SERVER_VARIABLE2' => 'value', + 'ROOT' => 'value', + 'HTTP_CONTENT_TYPE' => 'text/html', + 'HTTP_CONTENT_LENGTH' => '0', + 'HTTP_ETAG' => 'asdf', + 'PHP_AUTH_USER' => 'foo', + 'PHP_AUTH_PW' => 'bar', + ); + + $bag = new ServerBag($server); + + $this->assertEquals(array( + 'CONTENT_TYPE' => 'text/html', + 'CONTENT_LENGTH' => '0', + 'ETAG' => 'asdf', + 'AUTHORIZATION' => 'Basic '.base64_encode('foo:bar'), + 'PHP_AUTH_USER' => 'foo', + 'PHP_AUTH_PW' => 'bar', + ), $bag->getHeaders()); + } + + public function testHttpPasswordIsOptional() + { + $bag = new ServerBag(array('PHP_AUTH_USER' => 'foo')); + + $this->assertEquals(array( + 'AUTHORIZATION' => 'Basic '.base64_encode('foo:'), + 'PHP_AUTH_USER' => 'foo', + 'PHP_AUTH_PW' => '' + ), $bag->getHeaders()); + } + + public function testHttpBasicAuthWithPhpCgi() + { + $bag = new ServerBag(array('HTTP_AUTHORIZATION' => 'Basic '.base64_encode('foo:bar'))); + + $this->assertEquals(array( + 'AUTHORIZATION' => 'Basic '.base64_encode('foo:bar'), + 'PHP_AUTH_USER' => 'foo', + 'PHP_AUTH_PW' => 'bar' + ), $bag->getHeaders()); + } + + public function testHttpBasicAuthWithPhpCgiRedirect() + { + $bag = new ServerBag(array('REDIRECT_HTTP_AUTHORIZATION' => 'Basic '.base64_encode('foo:bar'))); + + $this->assertEquals(array( + 'AUTHORIZATION' => 'Basic '.base64_encode('foo:bar'), + 'PHP_AUTH_USER' => 'foo', + 'PHP_AUTH_PW' => 'bar' + ), $bag->getHeaders()); + } + + public function testHttpBasicAuthWithPhpCgiEmptyPassword() + { + $bag = new ServerBag(array('HTTP_AUTHORIZATION' => 'Basic '.base64_encode('foo:'))); + + $this->assertEquals(array( + 'AUTHORIZATION' => 'Basic '.base64_encode('foo:'), + 'PHP_AUTH_USER' => 'foo', + 'PHP_AUTH_PW' => '' + ), $bag->getHeaders()); + } + + public function testOAuthBearerAuth() + { + $headerContent = 'Bearer L-yLEOr9zhmUYRkzN1jwwxwQ-PBNiKDc8dgfB4hTfvo'; + $bag = new ServerBag(array('HTTP_AUTHORIZATION' => $headerContent)); + + $this->assertEquals(array( + 'AUTHORIZATION' => $headerContent, + ), $bag->getHeaders()); + } +} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Attribute/AttributeBagTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Attribute/AttributeBagTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Attribute/AttributeBagTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Attribute/AttributeBagTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Flash/AutoExpireFlashBagTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Flash/AutoExpireFlashBagTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Flash/AutoExpireFlashBagTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Flash/AutoExpireFlashBagTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php similarity index 92% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php index bd45b2fbe6f4..2f2b26fb3ea2 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php @@ -183,6 +183,21 @@ public function testGetSetFlashes() $this->assertEquals(array('notice' => 'foo'), $this->session->getFlashes()); } + public function testGetFlashesWithArray() + { + $array = array('notice' => 'hello', 'error' => 'none'); + $this->assertEquals(array(), $this->session->getFlashes()); + $this->session->setFlash('foo', $array); + $this->assertEquals(array('foo' => $array), $this->session->getFlashes()); + $this->assertEquals(array(), $this->session->getFlashes()); + + $array = array('hello', 'foo'); + $this->assertEquals(array(), $this->session->getFlashes()); + $this->session->setFlash('foo', $array); + $this->assertEquals(array('foo' => 'hello'), $this->session->getFlashes()); + $this->assertEquals(array(), $this->session->getFlashes()); + } + public function testGetSetFlash() { $this->assertNull($this->session->getFlash('notice')); diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/FileSessionHandlerTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/FileSessionHandlerTest.php new file mode 100644 index 000000000000..d935b34bd278 --- /dev/null +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/FileSessionHandlerTest.php @@ -0,0 +1,106 @@ +<?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. + */ + +namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler; + +use Symfony\Component\HttpFoundation\Session\Storage\Handler\FileSessionHandler; + +/** + * Test class for FileSessionHandler. + * + * @author Drak <drak@zikula.org> + */ +class FileSessionStorageTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var FileSessionHandler + */ + private $handler; + + /** + * @var string + */ + private $path; + + public function setUp() + { + $this->path = sys_get_temp_dir().'/filesessionhandler'; + $this->handler = new FileSessionHandler($this->path, 'mocksess_'); + + parent::setUp(); + } + + public function tearDown() + { + foreach (glob($this->path.'/*') as $file) { + unlink($file); + } + + rmdir($this->path); + + $this->handler = null; + } + + public function test__construct() + { + $this->assertTrue(is_dir($this->path)); + } + + public function testOpen() + { + $this->assertTrue($this->handler->open('a', 'b')); + } + + public function testClose() + { + $this->assertTrue($this->handler->close()); + } + + public function testReadWrite() + { + $this->assertEmpty($this->handler->read('123')); + $this->assertTrue($this->handler->write('123', 'data')); + $this->assertEquals('data', $this->handler->read('123')); + } + + public function testDestroy() + { + $this->handler->write('456', 'data'); + $this->handler->destroy('123'); + $this->assertEquals('data', $this->handler->read('456')); + $this->handler->destroy('456'); + $this->assertEmpty($this->handler->read('456')); + } + + public function testGc() + { + $prefix = $this->path.'/mocksess_'; + $this->handler->write('1', 'data'); + touch($prefix.'1', time()-86400); + + $this->handler->write('2', 'data'); + touch($prefix.'2', time()-3600); + + $this->handler->write('3', 'data'); + touch($prefix.'3', time()-300); + + $this->handler->write('4', 'data'); + + $this->handler->gc(90000); + $this->assertEquals(4, count(glob($this->path.'/*'))); + + $this->handler->gc(4000); + $this->assertEquals(3, count(glob($this->path.'/*'))); + + $this->handler->gc(200); + $this->assertEquals(1, count(glob($this->path.'/*'))); + } +} diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php new file mode 100644 index 000000000000..da0440d4289e --- /dev/null +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php @@ -0,0 +1,124 @@ +<?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. + */ + +namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler; + +use Symfony\Component\HttpFoundation\Session\Storage\Handler\MemcacheSessionHandler; + +class MemcacheSessionHandlerTest extends \PHPUnit_Framework_TestCase +{ + const PREFIX = 'prefix_'; + const TTL = 1000; + /** + * @var MemcacheSessionHandler + */ + protected $storage; + + protected $memcache; + + protected function setUp() + { + if (!class_exists('Memcache')) { + $this->markTestSkipped('Skipped tests Memcache class is not present'); + } + + $this->memcache = $this->getMock('Memcache'); + $this->storage = new MemcacheSessionHandler( + $this->memcache, + array('prefix' => self::PREFIX, 'expiretime' => self::TTL) + ); + } + + protected function tearDown() + { + $this->memcache = null; + $this->storage = null; + } + + public function testOpenSession() + { + $this->assertTrue($this->storage->open('', '')); + } + + public function testCloseSession() + { + $this->memcache + ->expects($this->once()) + ->method('close') + ->will($this->returnValue(true)) + ; + + $this->assertTrue($this->storage->close()); + } + + public function testReadSession() + { + $this->memcache + ->expects($this->once()) + ->method('get') + ->with(self::PREFIX.'id') + ; + + $this->assertEquals('', $this->storage->read('id')); + } + + public function testWriteSession() + { + $this->memcache + ->expects($this->once()) + ->method('set') + ->with(self::PREFIX.'id', 'data', 0, $this->equalTo(time() + self::TTL, 2)) + ->will($this->returnValue(true)) + ; + + $this->assertTrue($this->storage->write('id', 'data')); + } + + public function testDestroySession() + { + $this->memcache + ->expects($this->once()) + ->method('delete') + ->with(self::PREFIX.'id') + ->will($this->returnValue(true)) + ; + + $this->assertTrue($this->storage->destroy('id')); + } + + public function testGcSession() + { + $this->assertTrue($this->storage->gc(123)); + } + + /** + * @dataProvider getOptionFixtures + */ + public function testSupportedOptions($options, $supported) + { + try { + new MemcacheSessionHandler($this->memcache, $options); + $this->assertTrue($supported); + } catch (\InvalidArgumentException $e) { + $this->assertFalse($supported); + } + } + + public function getOptionFixtures() + { + return array( + array(array('prefix' => 'session'), true), + array(array('expiretime' => 100), true), + array(array('prefix' => 'session', 'expiretime' => 200), true), + array(array('expiretime' => 100, 'foo' => 'bar'), false), + ); + } +} diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php new file mode 100644 index 000000000000..6f158cd1b767 --- /dev/null +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php @@ -0,0 +1,119 @@ +<?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. + */ + +namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler; + +use Symfony\Component\HttpFoundation\Session\Storage\Handler\MemcachedSessionHandler; + +class MemcacheddSessionHandlerTest extends \PHPUnit_Framework_TestCase +{ + const PREFIX = 'prefix_'; + const TTL = 1000; + + /** + * @var MemcachedSessionHandler + */ + protected $storage; + + protected $memcached; + + protected function setUp() + { + if (!class_exists('Memcached')) { + $this->markTestSkipped('Skipped tests Memcache class is not present'); + } + + $this->memcached = $this->getMock('Memcached'); + $this->storage = new MemcachedSessionHandler( + $this->memcached, + array('prefix' => self::PREFIX, 'expiretime' => self::TTL) + ); + } + + protected function tearDown() + { + $this->memcached = null; + $this->storage = null; + } + + public function testOpenSession() + { + $this->assertTrue($this->storage->open('', '')); + } + + public function testCloseSession() + { + $this->assertTrue($this->storage->close()); + } + + public function testReadSession() + { + $this->memcached + ->expects($this->once()) + ->method('get') + ->with(self::PREFIX.'id') + ; + + $this->assertEquals('', $this->storage->read('id')); + } + + public function testWriteSession() + { + $this->memcached + ->expects($this->once()) + ->method('set') + ->with(self::PREFIX.'id', 'data', $this->equalTo(time() + self::TTL, 2)) + ->will($this->returnValue(true)) + ; + + $this->assertTrue($this->storage->write('id', 'data')); + } + + public function testDestroySession() + { + $this->memcached + ->expects($this->once()) + ->method('delete') + ->with(self::PREFIX.'id') + ->will($this->returnValue(true)) + ; + + $this->assertTrue($this->storage->destroy('id')); + } + + public function testGcSession() + { + $this->assertTrue($this->storage->gc(123)); + } + + /** + * @dataProvider getOptionFixtures + */ + public function testSupportedOptions($options, $supported) + { + try { + new MemcachedSessionHandler($this->memcached, $options); + $this->assertTrue($supported); + } catch (\InvalidArgumentException $e) { + $this->assertFalse($supported); + } + } + + public function getOptionFixtures() + { + return array( + array(array('prefix' => 'session'), true), + array(array('expiretime' => 100), true), + array(array('prefix' => 'session', 'expiretime' => 200), true), + array(array('expiretime' => 100, 'foo' => 'bar'), false), + ); + } +} diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php new file mode 100644 index 000000000000..c9eb0b38d694 --- /dev/null +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php @@ -0,0 +1,99 @@ +<?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. + */ + +namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler; + +use Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler; + +/** + * @author Markus Bachmann <markus.bachmann@bachi.biz> + */ +class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase +{ + private static $mongo; + + public static function setUpBeforeClass() + { + if (class_exists('\Mongo')) { + try { + self::$mongo = new \Mongo(); + } catch (\Exception $e) { + } + } + } + + protected function setUp() + { + if (null === self::$mongo) { + $this->markTestSkipped('MongoDbSessionHandler requires the php "mongo" extension and a mongodb server on localhost'); + } + + $this->options = array('database' => 'sf2-test', 'collection' => 'session-test'); + $this->options = array('database' => 'sf2-test', 'collection' => 'session-test'); + + $this->storage = new MongoDbSessionHandler(self::$mongo, $this->options); + } + + protected function tearDown() + { + if (null !== self::$mongo) { + self::$mongo->dropDB($this->options['database']); + } + } + + public function testOpenMethodAlwaysReturnTrue() + { + $this->assertTrue($this->storage->open('test', 'test'), 'The "open" method should always return true'); + } + + public function testCloseMethodAlwaysReturnTrue() + { + $this->assertTrue($this->storage->close(), 'The "close" method should always return true'); + } + + public function testWrite() + { + $this->assertTrue($this->storage->write('foo', 'bar')); + $this->assertEquals('bar', $this->storage->read('foo')); + } + + public function testReplaceSessionData() + { + $this->storage->write('foo', 'bar'); + $this->storage->write('foo', 'foobar'); + + $coll = self::$mongo->selectDB($this->options['database'])->selectCollection($this->options['collection']); + + $this->assertEquals('foobar', $this->storage->read('foo')); + $this->assertEquals(1, $coll->find(array('sess_id' => 'foo'))->count()); + } + + public function testDestroy() + { + $this->storage->write('foo', 'bar'); + $this->storage->destroy('foo'); + + $this->assertEquals('', $this->storage->read('foo')); + } + + public function testGc() + { + $this->storage->write('foo', 'bar'); + $this->storage->write('bar', 'foo'); + + $coll = self::$mongo->selectDB($this->options['database'])->selectCollection($this->options['collection']); + + $this->assertEquals(2, $coll->count()); + $this->storage->gc(-1); + $this->assertEquals(0, $coll->count()); + + } +} diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/MetadataBagTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MetadataBagTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/MetadataBagTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MetadataBagTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php similarity index 92% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php index 9578ec98a811..7bfe6a779df5 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php @@ -28,7 +28,7 @@ class MockFileSessionStorageTest extends \PHPUnit_Framework_TestCase private $sessionDir; /** - * @var FileMockSessionStorage + * @var MockFileSessionStorage */ protected $storage; @@ -40,12 +40,14 @@ protected function setUp() protected function tearDown() { + foreach (glob($this->sessionDir.'/mocksess_*') as $file) { + unlink($file); + } + + rmdir($this->sessionDir); + $this->sessionDir = null; $this->storage = null; - array_map('unlink', glob($this->sessionDir.'/*.session')); - if (is_dir($this->sessionDir)) { - rmdir($this->sessionDir); - } } public function testStart() @@ -109,8 +111,8 @@ public function testMultipleInstances() private function getStorage() { $storage = new MockFileSessionStorage($this->sessionDir); - $storage->registerBag(new FlashBag); - $storage->registerBag(new AttributeBag); + $storage->registerBag(new FlashBag()); + $storage->registerBag(new AttributeBag()); return $storage; } diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php similarity index 96% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php index 4b88a237a007..528a1d7b02a2 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php @@ -12,7 +12,6 @@ namespace Symfony\Component\HttpFoundation\Tests\Session\Storage; use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; -use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler; use Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler; use Symfony\Component\HttpFoundation\Session\Flash\FlashBag; use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag; @@ -137,8 +136,8 @@ public function testSetSaveHandlerPHP53() $this->markTestSkipped('Test skipped, for PHP 5.3 only.'); } + ini_set('session.save_handler', 'files'); $storage = $this->getStorage(); - $storage->setSaveHandler(new NativeFileSessionHandler()); $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy', $storage->getSaveHandler()); } diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/NativeProxyTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/NativeProxyTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/NativeProxyTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/NativeProxyTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/StreamedResponseTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/StreamedResponseTest.php similarity index 93% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/StreamedResponseTest.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/StreamedResponseTest.php index d95c93730ad3..2d8654ef6868 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/Tests/StreamedResponseTest.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/StreamedResponseTest.php @@ -50,6 +50,14 @@ public function testPrepareWith10Protocol() $this->assertEquals('no-cache, private', $response->headers->get('Cache-Control')); } + public function testPrepareWithHeadRequest() + { + $response = new StreamedResponse(function () { echo 'foo'; }); + $request = Request::create('/', 'HEAD'); + + $response->prepare($request); + } + public function testSendContent() { $called = 0; diff --git a/core/vendor/Symfony/Component/HttpFoundation/Tests/bootstrap.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/bootstrap.php similarity index 100% rename from core/vendor/Symfony/Component/HttpFoundation/Tests/bootstrap.php rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/bootstrap.php diff --git a/core/vendor/Symfony/Component/HttpFoundation/composer.json b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/composer.json similarity index 97% rename from core/vendor/Symfony/Component/HttpFoundation/composer.json rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/composer.json index d0f1015c0963..4e4f90779fc6 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/composer.json +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.2" + "php": ">=5.3.3" }, "autoload": { "psr-0": { diff --git a/core/vendor/Symfony/Component/HttpFoundation/phpunit.xml.dist b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/phpunit.xml.dist similarity index 94% rename from core/vendor/Symfony/Component/HttpFoundation/phpunit.xml.dist rename to core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/phpunit.xml.dist index 95e0f03d8235..2a760f290c73 100644 --- a/core/vendor/Symfony/Component/HttpFoundation/phpunit.xml.dist +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/phpunit.xml.dist @@ -23,6 +23,7 @@ <exclude> <directory>./Resources</directory> <directory>./Tests</directory> + <directory>./vendor</directory> </exclude> </whitelist> </filter> diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/.gitignore b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/.gitignore new file mode 100644 index 000000000000..d1502b087b4d --- /dev/null +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/.gitignore @@ -0,0 +1,2 @@ +vendor/ +composer.lock diff --git a/core/vendor/Symfony/Component/HttpKernel/Bundle/Bundle.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/Bundle.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Bundle/Bundle.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/Bundle.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Bundle/BundleInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/BundleInterface.php similarity index 90% rename from core/vendor/Symfony/Component/HttpKernel/Bundle/BundleInterface.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/BundleInterface.php index 99d591f9e36b..980b8907c586 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Bundle/BundleInterface.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/BundleInterface.php @@ -11,7 +11,9 @@ namespace Symfony\Component\HttpKernel\Bundle; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; /** * BundleInterface. @@ -20,7 +22,7 @@ * * @api */ -interface BundleInterface +interface BundleInterface extends ContainerAwareInterface { /** * Boots the Bundle. diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CHANGELOG.md b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CHANGELOG.md new file mode 100644 index 000000000000..d061c7decbc6 --- /dev/null +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CHANGELOG.md @@ -0,0 +1,19 @@ +CHANGELOG +========= + +2.1.0 +----- + + * added the HTTP method to the profiler storage + * updated all listeners to implement EventSubscriberInterface + * added TimeDataCollector + * added ContainerAwareTraceableEventDispatcher + * moved TraceableEventDispatcherInterface to the EventDispatcher component + * added RouterListener, LocaleListener, and StreamedResponseListener + * added CacheClearerInterface (and ChainCacheClearer) + * added a kernel.terminate event (via TerminableInterface and PostResponseEvent) + * added a Stopwatch class + * added WarmableInterface + * improved extensibility between bundles + * added profiler storages for Memcache(d), File-based, MongoDB, Redis + * moved Filesystem class to its own component diff --git a/core/vendor/Symfony/Component/HttpKernel/CacheClearer/CacheClearerInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/CacheClearerInterface.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/CacheClearer/CacheClearerInterface.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/CacheClearerInterface.php diff --git a/core/vendor/Symfony/Component/HttpKernel/CacheClearer/ChainCacheClearer.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/ChainCacheClearer.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/CacheClearer/ChainCacheClearer.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/ChainCacheClearer.php diff --git a/core/vendor/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmer.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmer.php similarity index 94% rename from core/vendor/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmer.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmer.php index 2406c65a6d4e..948b3ffd141c 100644 --- a/core/vendor/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmer.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmer.php @@ -22,7 +22,7 @@ protected function writeCacheFile($file, $content) { $tmpFile = tempnam(dirname($file), basename($file)); if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $file)) { - chmod($file, 0666 & ~umask()); + @chmod($file, 0666 & ~umask()); return; } diff --git a/core/vendor/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php diff --git a/core/vendor/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerInterface.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerInterface.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerInterface.php diff --git a/core/vendor/Symfony/Component/HttpKernel/CacheWarmer/WarmableInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/WarmableInterface.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/CacheWarmer/WarmableInterface.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/WarmableInterface.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Client.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Client.php similarity index 99% rename from core/vendor/Symfony/Component/HttpKernel/Client.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Client.php index ff93bf795071..f5dcd9a376b2 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Client.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Client.php @@ -52,7 +52,7 @@ public function __construct(HttpKernelInterface $kernel, array $server = array() /** * Makes a request. * - * @param Request $request A Request instance + * @param Request $request A Request instance * * @return Response A Response instance */ diff --git a/core/vendor/Symfony/Component/HttpKernel/Config/FileLocator.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Config/FileLocator.php similarity index 93% rename from core/vendor/Symfony/Component/HttpKernel/Config/FileLocator.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Config/FileLocator.php index 6cc615ca948d..d241b9da1943 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Config/FileLocator.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Config/FileLocator.php @@ -29,7 +29,7 @@ class FileLocator extends BaseFileLocator * * @param KernelInterface $kernel A KernelInterface instance * @param string $path The path the global resource directory - * @param string|array $paths A path or an array of paths where to look for resources + * @param string|array $paths A path or an array of paths where to look for resources */ public function __construct(KernelInterface $kernel, $path = null, array $paths = array()) { diff --git a/core/vendor/Symfony/Component/HttpKernel/Controller/ControllerResolver.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolver.php similarity index 96% rename from core/vendor/Symfony/Component/HttpKernel/Controller/ControllerResolver.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolver.php index d535c55e4b17..cd3caf615847 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Controller/ControllerResolver.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolver.php @@ -114,8 +114,8 @@ protected function doGetArguments(Request $request, $controller, array $paramete $attributes = $request->attributes->all(); $arguments = array(); foreach ($parameters as $param) { - if (array_key_exists($param->getName(), $attributes)) { - $arguments[] = $attributes[$param->getName()]; + if (array_key_exists($param->name, $attributes)) { + $arguments[] = $attributes[$param->name]; } elseif ($param->getClass() && $param->getClass()->isInstance($request)) { $arguments[] = $request; } elseif ($param->isDefaultValueAvailable()) { @@ -129,7 +129,7 @@ protected function doGetArguments(Request $request, $controller, array $paramete $repr = $controller; } - throw new \RuntimeException(sprintf('Controller "%s" requires that you provide a value for the "$%s" argument (because there is no default value or because there is a non optional argument after this one).', $repr, $param->getName())); + throw new \RuntimeException(sprintf('Controller "%s" requires that you provide a value for the "$%s" argument (because there is no default value or because there is a non optional argument after this one).', $repr, $param->name)); } } diff --git a/core/vendor/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php diff --git a/core/vendor/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php diff --git a/core/vendor/Symfony/Component/HttpKernel/DataCollector/DataCollector.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollector.php similarity index 93% rename from core/vendor/Symfony/Component/HttpKernel/DataCollector/DataCollector.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollector.php index f1002fbb838b..7da36b678dcc 100644 --- a/core/vendor/Symfony/Component/HttpKernel/DataCollector/DataCollector.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollector.php @@ -11,7 +11,6 @@ namespace Symfony\Component\HttpKernel\DataCollector; -use Symfony\Component\HttpKernel\Profiler\Profiler; /** * DataCollector. diff --git a/core/vendor/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php similarity index 95% rename from core/vendor/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php index 5e0ff7a0dc61..7cfbbd132fc1 100644 --- a/core/vendor/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php @@ -11,7 +11,6 @@ namespace Symfony\Component\HttpKernel\DataCollector; -use Symfony\Component\HttpKernel\Profiler\Profiler; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; diff --git a/core/vendor/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php diff --git a/core/vendor/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php diff --git a/core/vendor/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php diff --git a/core/vendor/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php diff --git a/core/vendor/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php similarity index 90% rename from core/vendor/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php index 4029d7cf4a59..f7cf88eee362 100644 --- a/core/vendor/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php @@ -59,6 +59,14 @@ public function collect(Request $request, Response $response, \Exception $except $content = false; } + $sessionMetadata = array(); + + if ($request->hasSession()) { + $sessionMetadata['Created'] = date(DATE_RFC822, $request->getSession()->getMetadataBag()->getCreated()); + $sessionMetadata['Last used'] = date(DATE_RFC822, $request->getSession()->getMetadataBag()->getLastUsed()); + $sessionMetadata['Lifetime'] = $request->getSession()->getMetadataBag()->getLifetime(); + } + $this->data = array( 'format' => $request->getRequestFormat(), 'content' => $content, @@ -71,6 +79,7 @@ public function collect(Request $request, Response $response, \Exception $except 'request_cookies' => $request->cookies->all(), 'request_attributes' => $attributes, 'response_headers' => $responseHeaders, + 'session_metadata' => $sessionMetadata, 'session_attributes' => $request->hasSession() ? $request->getSession()->all() : array(), 'flashes' => $request->hasSession() ? $request->getSession()->getFlashBag()->peekAll() : array(), 'path_info' => $request->getPathInfo(), @@ -117,6 +126,11 @@ public function getResponseHeaders() return new ResponseHeaderBag($this->data['response_headers']); } + public function getSessionMetadata() + { + return $this->data['session_metadata']; + } + public function getSessionAttributes() { return $this->data['session_attributes']; diff --git a/core/vendor/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Debug/ContainerAwareTraceableEventDispatcher.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ContainerAwareTraceableEventDispatcher.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Debug/ContainerAwareTraceableEventDispatcher.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ContainerAwareTraceableEventDispatcher.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Debug/ErrorHandler.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ErrorHandler.php similarity index 95% rename from core/vendor/Symfony/Component/HttpKernel/Debug/ErrorHandler.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ErrorHandler.php index 942e82bec1c2..a2466d609f40 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Debug/ErrorHandler.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ErrorHandler.php @@ -26,6 +26,8 @@ class ErrorHandler E_USER_NOTICE => 'User Notice', E_STRICT => 'Runtime Notice', E_RECOVERABLE_ERROR => 'Catchable Fatal Error', + E_DEPRECATED => 'Deprecated', + E_USER_DEPRECATED => 'User Deprecated', ); private $level; diff --git a/core/vendor/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Debug/Stopwatch.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/Stopwatch.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Debug/Stopwatch.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/Stopwatch.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php similarity index 97% rename from core/vendor/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php index 36e65419085e..200c465bacfa 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php @@ -26,8 +26,8 @@ class StopwatchEvent /** * Constructor. * - * @param float $origin The origin time in milliseconds - * @param string $category The event category + * @param float $origin The origin time in milliseconds + * @param string $category The event category * * @throws \InvalidArgumentException When the raw time is not valid */ diff --git a/core/vendor/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php diff --git a/core/vendor/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php old mode 100755 new mode 100644 similarity index 96% rename from core/vendor/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php index 4f6f6a3dd509..8388ccfd6a18 --- a/core/vendor/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php @@ -38,7 +38,7 @@ public final function load(array $configs, ContainerBuilder $container) /** * Configures the passed container according to the merged configuration. * - * @param array $mergedConfig + * @param array $mergedConfig * @param ContainerBuilder $container */ abstract protected function loadInternal(array $mergedConfig, ContainerBuilder $container); diff --git a/core/vendor/Symfony/Component/HttpKernel/DependencyInjection/Extension.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/Extension.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/DependencyInjection/Extension.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/Extension.php diff --git a/core/vendor/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php similarity index 97% rename from core/vendor/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php index fbac347fae6a..cc47b7195c8b 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php @@ -23,7 +23,7 @@ * * Controllers should be callables. * - * @author Bernhard Schussek <bernhard.schussek@symfony.com> + * @author Bernhard Schussek <bschussek@gmail.com> * * @api */ diff --git a/core/vendor/Symfony/Component/HttpKernel/Event/FilterResponseEvent.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterResponseEvent.php similarity index 96% rename from core/vendor/Symfony/Component/HttpKernel/Event/FilterResponseEvent.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterResponseEvent.php index 7e1f4a209fe3..196bd67e7182 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Event/FilterResponseEvent.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterResponseEvent.php @@ -22,7 +22,7 @@ * setResponse() you can set a new response that will be returned to the * browser. * - * @author Bernhard Schussek <bernhard.schussek@symfony.com> + * @author Bernhard Schussek <bschussek@gmail.com> * * @api */ diff --git a/core/vendor/Symfony/Component/HttpKernel/Event/GetResponseEvent.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseEvent.php similarity index 96% rename from core/vendor/Symfony/Component/HttpKernel/Event/GetResponseEvent.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseEvent.php index eb726c046261..c8c2f00625f3 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Event/GetResponseEvent.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseEvent.php @@ -20,7 +20,7 @@ * current request. The propagation of this event is stopped as soon as a * response is set. * - * @author Bernhard Schussek <bernhard.schussek@symfony.com> + * @author Bernhard Schussek <bschussek@gmail.com> * * @api */ diff --git a/core/vendor/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php similarity index 95% rename from core/vendor/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php index 25ceca8b85b2..bcabcf32d5ea 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php @@ -21,7 +21,7 @@ * current request. The propagation of this event is stopped as soon as a * response is set. * - * @author Bernhard Schussek <bernhard.schussek@symfony.com> + * @author Bernhard Schussek <bschussek@gmail.com> * * @api */ diff --git a/core/vendor/Symfony/Component/HttpKernel/Event/GetResponseForExceptionEvent.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForExceptionEvent.php similarity index 93% rename from core/vendor/Symfony/Component/HttpKernel/Event/GetResponseForExceptionEvent.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForExceptionEvent.php index f7cf28d95114..3787f627baab 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Event/GetResponseForExceptionEvent.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForExceptionEvent.php @@ -25,7 +25,7 @@ * exception will be thrown if no response is set during processing of this * event. * - * @author Bernhard Schussek <bernhard.schussek@symfony.com> + * @author Bernhard Schussek <bschussek@gmail.com> * * @api */ @@ -61,7 +61,7 @@ public function getException() * * This exception will be thrown if no response is set in the event. * - * @param \Exception $exception The thrown exception + * @param \Exception $exception The thrown exception * * @api */ diff --git a/core/vendor/Symfony/Component/HttpKernel/Event/KernelEvent.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/KernelEvent.php similarity index 97% rename from core/vendor/Symfony/Component/HttpKernel/Event/KernelEvent.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/KernelEvent.php index 4dcfd11819ed..2e1790a3c2c6 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Event/KernelEvent.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/KernelEvent.php @@ -18,7 +18,7 @@ /** * Base class for events thrown in the HttpKernel component * - * @author Bernhard Schussek <bernhard.schussek@symfony.com> + * @author Bernhard Schussek <bschussek@gmail.com> * * @api */ diff --git a/core/vendor/Symfony/Component/HttpKernel/Event/PostResponseEvent.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/PostResponseEvent.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Event/PostResponseEvent.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/PostResponseEvent.php diff --git a/core/vendor/Symfony/Component/HttpKernel/EventListener/EsiListener.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/EsiListener.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/EventListener/EsiListener.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/EsiListener.php diff --git a/core/vendor/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php diff --git a/core/vendor/Symfony/Component/HttpKernel/EventListener/LocaleListener.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/LocaleListener.php similarity index 91% rename from core/vendor/Symfony/Component/HttpKernel/EventListener/LocaleListener.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/LocaleListener.php index 8adefc553078..cfe9734a5175 100644 --- a/core/vendor/Symfony/Component/HttpKernel/EventListener/LocaleListener.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/LocaleListener.php @@ -13,7 +13,7 @@ use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\Routing\RouterInterface; +use Symfony\Component\Routing\RequestContextAwareInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** @@ -26,7 +26,7 @@ class LocaleListener implements EventSubscriberInterface private $router; private $defaultLocale; - public function __construct($defaultLocale = 'en', RouterInterface $router = null) + public function __construct($defaultLocale = 'en', RequestContextAwareInterface $router = null) { $this->defaultLocale = $defaultLocale; $this->router = $router; diff --git a/core/vendor/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php diff --git a/core/vendor/Symfony/Component/HttpKernel/EventListener/ResponseListener.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ResponseListener.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/EventListener/ResponseListener.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ResponseListener.php diff --git a/core/vendor/Symfony/Component/HttpKernel/EventListener/RouterListener.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php similarity index 77% rename from core/vendor/Symfony/Component/HttpKernel/EventListener/RouterListener.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php index 5d5a5436d393..be43a72dd289 100644 --- a/core/vendor/Symfony/Component/HttpKernel/EventListener/RouterListener.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php @@ -20,6 +20,7 @@ use Symfony\Component\Routing\Exception\MethodNotAllowedException; use Symfony\Component\Routing\Exception\ResourceNotFoundException; use Symfony\Component\Routing\Matcher\UrlMatcherInterface; +use Symfony\Component\Routing\Matcher\RequestMatcherInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** @@ -29,12 +30,16 @@ */ class RouterListener implements EventSubscriberInterface { - private $urlMatcher; + private $matcher; private $logger; - public function __construct(UrlMatcherInterface $urlMatcher, LoggerInterface $logger = null) + public function __construct($matcher, LoggerInterface $logger = null) { - $this->urlMatcher = $urlMatcher; + if (!$matcher instanceof UrlMatcherInterface && !$matcher instanceof RequestMatcherInterface) { + throw new \InvalidArgumentException('Matcher must either implement UrlMatcherInterface or RequestMatcherInterface.'); + } + + $this->matcher = $matcher; $this->logger = $logger; } @@ -43,7 +48,7 @@ public function onKernelRequest(GetResponseEvent $event) $request = $event->getRequest(); if (HttpKernelInterface::MASTER_REQUEST === $event->getRequestType()) { - $this->urlMatcher->getContext()->fromRequest($request); + $this->matcher->getContext()->fromRequest($request); } if ($request->attributes->has('_controller')) { @@ -53,7 +58,12 @@ public function onKernelRequest(GetResponseEvent $event) // add attributes based on the path info (routing) try { - $parameters = $this->urlMatcher->match($request->getPathInfo()); + // matching requests is more powerful than matching URLs only, so try that first + if ($this->matcher instanceof RequestMatcherInterface) { + $parameters = $this->matcher->matchRequest($request); + } else { + $parameters = $this->matcher->match($request->getPathInfo()); + } if (null !== $this->logger) { $this->logger->info(sprintf('Matched route "%s" (parameters: %s)', $parameters['_route'], $this->parametersToString($parameters))); diff --git a/core/vendor/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Exception/AccessDeniedHttpException.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/AccessDeniedHttpException.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Exception/AccessDeniedHttpException.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/AccessDeniedHttpException.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Exception/FlattenException.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/FlattenException.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Exception/FlattenException.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/FlattenException.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Exception/HttpException.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/HttpException.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Exception/HttpException.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/HttpException.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Exception/HttpExceptionInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/HttpExceptionInterface.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Exception/HttpExceptionInterface.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/HttpExceptionInterface.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Exception/MethodNotAllowedHttpException.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/MethodNotAllowedHttpException.php similarity index 73% rename from core/vendor/Symfony/Component/HttpKernel/Exception/MethodNotAllowedHttpException.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/MethodNotAllowedHttpException.php index 7ae7b7a85cff..cdfcc8ab7b40 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Exception/MethodNotAllowedHttpException.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/MethodNotAllowedHttpException.php @@ -21,10 +21,10 @@ class MethodNotAllowedHttpException extends HttpException /** * Constructor. * - * @param array $allow An array of allowed methods - * @param string $message The internal exception message - * @param Exception $previous The previous exception - * @param integer $code The internal exception code + * @param array $allow An array of allowed methods + * @param string $message The internal exception message + * @param Exception $previous The previous exception + * @param integer $code The internal exception code */ public function __construct(array $allow, $message = null, \Exception $previous = null, $code = 0) { diff --git a/core/vendor/Symfony/Component/HttpKernel/Exception/NotFoundHttpException.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/NotFoundHttpException.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Exception/NotFoundHttpException.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/NotFoundHttpException.php diff --git a/core/vendor/Symfony/Component/HttpKernel/HttpCache/Esi.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Esi.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/HttpCache/Esi.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Esi.php diff --git a/core/vendor/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php diff --git a/core/vendor/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategyInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategyInterface.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategyInterface.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategyInterface.php diff --git a/core/vendor/Symfony/Component/HttpKernel/HttpCache/HttpCache.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php similarity index 99% rename from core/vendor/Symfony/Component/HttpKernel/HttpCache/HttpCache.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php index ce3e005d920e..ec66dcd5fcbe 100644 --- a/core/vendor/Symfony/Component/HttpKernel/HttpCache/HttpCache.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php @@ -581,7 +581,7 @@ protected function store(Request $request, Response $response) private function restoreResponseBody(Request $request, Response $response) { if ('HEAD' === $request->getMethod() || 304 === $response->getStatusCode()) { - $response->setContent(''); + $response->setContent(null); $response->headers->remove('X-Body-Eval'); $response->headers->remove('X-Body-File'); @@ -647,7 +647,7 @@ private function isPrivateRequest(Request $request) * Records that an event took place. * * @param Request $request A Request instance - * @param string $event The event name + * @param string $event The event name */ private function record(Request $request, $event) { diff --git a/core/vendor/Symfony/Component/HttpKernel/HttpCache/Store.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Store.php similarity index 98% rename from core/vendor/Symfony/Component/HttpKernel/HttpCache/Store.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Store.php index fe19f3a54db3..b60c647e743b 100644 --- a/core/vendor/Symfony/Component/HttpKernel/HttpCache/Store.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Store.php @@ -167,7 +167,7 @@ public function write(Request $request, Response $response) $entries = array(); $vary = $response->headers->get('vary'); foreach ($this->getMetadata($key) as $entry) { - if (!isset($entry[1]['vary'])) { + if (!isset($entry[1]['vary'][0])) { $entry[1]['vary'] = array(''); } @@ -293,7 +293,7 @@ public function purge($url) /** * Loads data for the given key. * - * @param string $key The store key + * @param string $key The store key * * @return string The data associated with the key */ @@ -332,7 +332,7 @@ private function save($key, $data) return false; } - chmod($path, 0666 & ~umask()); + @chmod($path, 0666 & ~umask()); } public function getPath($key) diff --git a/core/vendor/Symfony/Component/HttpKernel/HttpCache/StoreInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/StoreInterface.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/HttpCache/StoreInterface.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/StoreInterface.php diff --git a/core/vendor/Symfony/Component/HttpKernel/HttpKernel.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php similarity index 95% rename from core/vendor/Symfony/Component/HttpKernel/HttpKernel.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php index 9a465d1df38b..eea71e855eb2 100644 --- a/core/vendor/Symfony/Component/HttpKernel/HttpKernel.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php @@ -55,10 +55,10 @@ public function __construct(EventDispatcherInterface $dispatcher, ControllerReso * When $catch is true, the implementation must catch all exceptions * and do its best to convert them to a Response instance. * - * @param Request $request A Request instance - * @param integer $type The type of the request + * @param Request $request A Request instance + * @param integer $type The type of the request * (one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST) - * @param Boolean $catch Whether to catch exceptions or not + * @param Boolean $catch Whether to catch exceptions or not * * @return Response A Response instance * @@ -173,9 +173,9 @@ private function filterResponse(Response $response, Request $request, $type) /** * Handles and exception by trying to convert it to a Response. * - * @param \Exception $e An \Exception instance - * @param Request $request A Request instance - * @param integer $type The type of the request + * @param \Exception $e An \Exception instance + * @param Request $request A Request instance + * @param integer $type The type of the request * * @return Response A Response instance */ diff --git a/core/vendor/Symfony/Component/HttpKernel/HttpKernelInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernelInterface.php similarity index 87% rename from core/vendor/Symfony/Component/HttpKernel/HttpKernelInterface.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernelInterface.php index a2a0f1c5fd59..efcf39da9131 100644 --- a/core/vendor/Symfony/Component/HttpKernel/HttpKernelInterface.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernelInterface.php @@ -32,10 +32,10 @@ interface HttpKernelInterface * When $catch is true, the implementation must catch all exceptions * and do its best to convert them to a Response instance. * - * @param Request $request A Request instance - * @param integer $type The type of the request + * @param Request $request A Request instance + * @param integer $type The type of the request * (one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST) - * @param Boolean $catch Whether to catch exceptions or not + * @param Boolean $catch Whether to catch exceptions or not * * @return Response A Response instance * diff --git a/core/vendor/Symfony/Component/HttpKernel/Kernel.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Kernel.php similarity index 98% rename from core/vendor/Symfony/Component/HttpKernel/Kernel.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Kernel.php index 7fdb5466d185..bc45891fd939 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Kernel.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Kernel.php @@ -58,7 +58,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $classes; protected $errorReportingLevel; - const VERSION = '2.1.0-DEV'; + const VERSION = '2.1.0-BETA1'; + const VERSION_ID = '20100'; + const MAJOR_VERSION = '2'; + const MINOR_VERSION = '1'; + const RELEASE_VERSION = '0'; + const EXTRA_VERSION = 'BETA'; /** * Constructor. @@ -387,7 +392,7 @@ public function getRootDir() { if (null === $this->rootDir) { $r = new \ReflectionObject($this); - $this->rootDir = dirname($r->getFileName()); + $this->rootDir = str_replace('\\', '/', dirname($r->getFileName())); } return $this->rootDir; @@ -408,8 +413,8 @@ public function getContainer() /** * Loads the PHP class cache. * - * @param string $name The cache name prefix - * @param string $extension File extension of the resulting file + * @param string $name The cache name prefix + * @param string $extension File extension of the resulting file */ public function loadClassCache($name = 'classes', $extension = '.php') { diff --git a/core/vendor/Symfony/Component/HttpKernel/KernelEvents.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelEvents.php similarity index 97% rename from core/vendor/Symfony/Component/HttpKernel/KernelEvents.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelEvents.php index 1594d3e7a88c..c2a43090b3d4 100644 --- a/core/vendor/Symfony/Component/HttpKernel/KernelEvents.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelEvents.php @@ -14,7 +14,7 @@ /** * Contains all events thrown in the HttpKernel component * - * @author Bernhard Schussek <bernhard.schussek@symfony.com> + * @author Bernhard Schussek <bschussek@gmail.com> * * @api */ diff --git a/core/vendor/Symfony/Component/HttpKernel/KernelInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelInterface.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/KernelInterface.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelInterface.php diff --git a/core/vendor/Symfony/Component/HttpKernel/LICENSE b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/LICENSE similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/LICENSE rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/LICENSE diff --git a/core/vendor/Symfony/Component/HttpKernel/Log/DebugLoggerInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/DebugLoggerInterface.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Log/DebugLoggerInterface.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/DebugLoggerInterface.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Log/LoggerInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/LoggerInterface.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Log/LoggerInterface.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/LoggerInterface.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Log/NullLogger.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/NullLogger.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Log/NullLogger.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/NullLogger.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php similarity index 89% rename from core/vendor/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php index 5a54d624610e..ebf19127f252 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php @@ -95,7 +95,28 @@ public function find($ip, $url, $limit, $method) */ public function purge() { - $this->flush(); + // delete only items from index + $indexName = $this->getIndexName(); + + $indexContent = $this->getValue($indexName); + + if (!$indexContent) { + return false; + } + + $profileList = explode("\n", $indexContent); + + foreach ($profileList as $item) { + if ($item == '') { + continue; + } + + if (false !== $pos = strpos($item, "\t")) { + $this->delete($this->getItemName(substr($item, 0, $pos))); + } + } + + return $this->delete($indexName); } /** @@ -164,25 +185,27 @@ abstract protected function getValue($key); * Store an item on the memcache server under the specified key * * @param string $key - * @param mixed $value - * @param int $expiration + * @param mixed $value + * @param int $expiration * * @return boolean */ abstract protected function setValue($key, $value, $expiration = 0); /** - * Flush all existing items at the memcache server + * Delete item from the memcache server + * + * @param string $key * * @return boolean */ - abstract protected function flush(); + abstract protected function delete($key); /** * Append data to an existing item on the memcache server * @param string $key * @param string $value - * @param int $expiration + * @param int $expiration * * @return boolean */ diff --git a/core/vendor/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php similarity index 89% rename from core/vendor/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php index dfcf48705bbd..ebf3b5c2acc4 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php @@ -50,6 +50,16 @@ protected function getMemcache() return $this->memcache; } + /** + * Set instance of the Memcache + * + * @param Memcache $memcache + */ + public function setMemcache($memcache) + { + $this->memcache = $memcache; + } + /** * {@inheritdoc} */ @@ -69,9 +79,9 @@ protected function setValue($key, $value, $expiration = 0) /** * {@inheritdoc} */ - protected function flush() + protected function delete($key) { - return $this->getMemcache()->flush(); + return $this->getMemcache()->delete($key); } /** diff --git a/core/vendor/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php similarity index 88% rename from core/vendor/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php index 4b45c6be8ae6..34ca1cbcadd1 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php @@ -54,6 +54,16 @@ protected function getMemcached() return $this->memcached; } + /** + * Set instance of the Memcached + * + * @param Memcached $memcached + */ + public function setMemcached($memcached) + { + $this->memcached = $memcached; + } + /** * {@inheritdoc} */ @@ -73,9 +83,9 @@ protected function setValue($key, $value, $expiration = 0) /** * {@inheritdoc} */ - protected function flush() + protected function delete($key) { - return $this->getMemcached()->flush(); + return $this->getMemcached()->delete($key); } /** diff --git a/core/vendor/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Profiler/MysqlProfilerStorage.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MysqlProfilerStorage.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Profiler/MysqlProfilerStorage.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MysqlProfilerStorage.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php similarity index 90% rename from core/vendor/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php index 8e2bea4a4414..4091232f1370 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php @@ -11,7 +11,6 @@ namespace Symfony\Component\HttpKernel\Profiler; - /** * Base PDO storage for profiling information in a PDO database. * @@ -92,7 +91,7 @@ public function write(Profile $profile) ); try { - if ($this->read($profile->getToken())) { + if ($this->has($profile->getToken())) { $this->exec($db, 'UPDATE sf_profiler_data SET parent = :parent, data = :data, ip = :ip, method = :method, url = :url, time = :time, created_at = :created_at WHERE token = :token', $args); } else { $this->exec($db, 'INSERT INTO sf_profiler_data (token, parent, data, ip, method, url, time, created_at) VALUES (:token, :parent, :data, :ip, :method, :url, :time, :created_at)', $args); @@ -121,9 +120,9 @@ public function purge() /** * Build SQL criteria to fetch records by ip and url * - * @param string $ip The IP - * @param string $url The URL - * @param string $limit The maximum number of tokens to return + * @param string $ip The IP + * @param string $url The URL + * @param string $limit The maximum number of tokens to return * @param string $method The request method * * @return array An array with (criteria, args) @@ -214,7 +213,7 @@ protected function createProfileFromData($token, $data, $parent = null) /** * Reads the child profiles for the given token. * - * @param string $token The parent token + * @param string $token The parent token * @param string $parent The parent instance * * @return array An array of Profile instance @@ -236,4 +235,20 @@ protected function readChildren($token, $parent) return $profiles; } + + /** + * Returns whether data for the given token already exists in storage. + * + * @param string $token The profile token + * + * @return Boolean + */ + protected function has($token) + { + $db = $this->initDb(); + $tokenExists = $this->fetch($db, 'SELECT 1 FROM sf_profiler_data WHERE token = :token LIMIT 1', array(':token' => $token)); + $this->close($db); + + return !empty($tokenExists); + } } diff --git a/core/vendor/Symfony/Component/HttpKernel/Profiler/Profile.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profile.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Profiler/Profile.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profile.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Profiler/Profiler.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profiler.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Profiler/Profiler.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profiler.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php similarity index 86% rename from core/vendor/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php index 67722e1c1532..f7e5f3c8ff26 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php @@ -22,6 +22,11 @@ class RedisProfilerStorage implements ProfilerStorageInterface { const TOKEN_PREFIX = 'sf_profiler_'; + const REDIS_OPT_SERIALIZER = 1; + const REDIS_OPT_PREFIX = 2; + const REDIS_SERIALIZER_NONE = 0; + const REDIS_SERIALIZER_PHP = 1; + protected $dsn; protected $lifetime; @@ -33,10 +38,10 @@ class RedisProfilerStorage implements ProfilerStorageInterface /** * Constructor. * - * @param string $dsn A data source name - * @param string $username Not used - * @param string $password Not used - * @param int $lifetime The lifetime to use for the purge + * @param string $dsn A data source name + * @param string $username Not used + * @param string $password Not used + * @param int $lifetime The lifetime to use for the purge */ public function __construct($dsn, $username = '', $password = '', $lifetime = 86400) { @@ -51,7 +56,7 @@ public function find($ip, $url, $limit, $method) { $indexName = $this->getIndexName(); - if (!$indexContent = $this->getValue($indexName, Redis::SERIALIZER_NONE)) { + if (!$indexContent = $this->getValue($indexName, self::REDIS_SERIALIZER_NONE)) { return array(); } @@ -103,7 +108,7 @@ public function purge() // delete only items from index $indexName = $this->getIndexName(); - $indexContent = $this->getValue($indexName, Redis::SERIALIZER_NONE); + $indexContent = $this->getValue($indexName, self::REDIS_SERIALIZER_NONE); if (!$indexContent) { return false; @@ -137,7 +142,7 @@ public function read($token) return false; } - $profile = $this->getValue($this->getItemName($token), Redis::SERIALIZER_PHP); + $profile = $this->getValue($this->getItemName($token), self::REDIS_SERIALIZER_PHP); if (false !== $profile) { $profile = $this->createProfileFromData($token, $profile); @@ -162,7 +167,7 @@ public function write(Profile $profile) 'time' => $profile->getTime(), ); - if ($this->setValue($this->getItemName($profile->getToken()), $data, $this->lifetime, Redis::SERIALIZER_PHP)) { + if ($this->setValue($this->getItemName($profile->getToken()), $data, $this->lifetime, self::REDIS_SERIALIZER_PHP)) { // Add to index $indexName = $this->getIndexName(); @@ -203,7 +208,7 @@ protected function getRedis() $redis = new Redis; $redis->connect($host, $port); - $redis->setOption(Redis::OPT_PREFIX, self::TOKEN_PREFIX); + $redis->setOption(self::REDIS_OPT_PREFIX, self::TOKEN_PREFIX); $this->redis = $redis; } @@ -211,6 +216,16 @@ protected function getRedis() return $this->redis; } + /** + * Set instance of the Redis + * + * @param Redis $redis + */ + public function setRedis($redis) + { + $this->redis = $redis; + } + private function createProfileFromData($token, $data, $parent = null) { $profile = new Profile($token); @@ -233,7 +248,7 @@ private function createProfileFromData($token, $data, $parent = null) continue; } - if (!$childProfileData = $this->getValue($this->getItemName($token), Redis::SERIALIZER_PHP)) { + if (!$childProfileData = $this->getValue($this->getItemName($token), self::REDIS_SERIALIZER_PHP)) { continue; } @@ -296,10 +311,10 @@ private function isItemNameValid($name) * * @return mixed */ - private function getValue($key, $serializer = Redis::SERIALIZER_NONE) + private function getValue($key, $serializer = self::REDIS_SERIALIZER_NONE) { $redis = $this->getRedis(); - $redis->setOption(Redis::OPT_SERIALIZER, $serializer); + $redis->setOption(self::REDIS_OPT_SERIALIZER, $serializer); return $redis->get($key); } @@ -314,10 +329,10 @@ private function getValue($key, $serializer = Redis::SERIALIZER_NONE) * * @return Boolean */ - private function setValue($key, $value, $expiration = 0, $serializer = Redis::SERIALIZER_NONE) + private function setValue($key, $value, $expiration = 0, $serializer = self::REDIS_SERIALIZER_NONE) { $redis = $this->getRedis(); - $redis->setOption(Redis::OPT_SERIALIZER, $serializer); + $redis->setOption(self::REDIS_OPT_SERIALIZER, $serializer); return $redis->setex($key, $expiration, $value); } @@ -334,7 +349,7 @@ private function setValue($key, $value, $expiration = 0, $serializer = Redis::SE private function appendValue($key, $value, $expiration = 0) { $redis = $this->getRedis(); - $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_NONE); + $redis->setOption(self::REDIS_OPT_SERIALIZER, self::REDIS_SERIALIZER_NONE); if ($redis->exists($key)) { $redis->append($key, $value); diff --git a/core/vendor/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php diff --git a/core/vendor/Symfony/Component/HttpKernel/README.md b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/README.md similarity index 79% rename from core/vendor/Symfony/Component/HttpKernel/README.md rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/README.md index 1460f0e47532..c44d53085820 100644 --- a/core/vendor/Symfony/Component/HttpKernel/README.md +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/README.md @@ -21,7 +21,7 @@ framework: It takes a ``Request`` as an input and should return a ``Response`` as an output. Using this interface makes your code compatible with all frameworks -using the Symfony2 components. And this will gives you many cool features for +using the Symfony2 components. And this will give you many cool features for free. Creating a framework based on the Symfony2 components is really easy. Here is @@ -84,18 +84,9 @@ Resources You can run the unit tests with the following command: - phpunit -c src/Symfony/Component/HttpKernel/ + phpunit If you also want to run the unit tests that depend on other Symfony -Components, declare the following environment variables before running -PHPUnit: - - export SYMFONY_EVENT_DISPATCHER=../path/to/EventDispatcher - export SYMFONY_HTTP_FOUNDATION=../path/to/HttpFoundation - export SYMFONY_DEPENDENCY_INJECTION=../path/to/DependencyInjection - export SYMFONY_CONSOLE=../path/to/Console - export SYMFONY_BROWSER_KIT=../path/to/BrowserKit - export SYMFONY_FINDER=../path/to/Finder - export SYMFONY_PROCESS=../path/to/Process - export SYMFONY_ROUTING=../path/to/Routing - export SYMFONY_CONFIG=../path/to/Config +Components, install dev dependencies before running PHPUnit: + + php composer.phar install --dev diff --git a/core/vendor/Symfony/Component/HttpKernel/TerminableInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/TerminableInterface.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/TerminableInterface.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/TerminableInterface.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php similarity index 88% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php index 2b8cc79d3656..eaff42a1bcd1 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php @@ -25,6 +25,10 @@ public function testRegisterCommands() $this->markTestSkipped('The "Console" component is not available'); } + if (!class_exists('Symfony\Component\DependencyInjection\ContainerAwareInterface')) { + $this->markTestSkipped('The "DependencyInjection" component is not available'); + } + if (!class_exists('Symfony\Component\Finder\Finder')) { $this->markTestSkipped('The "Finder" component is not available'); } diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/CacheClearer/ChainCacheClearerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/CacheClearer/ChainCacheClearerTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/CacheClearer/ChainCacheClearerTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/CacheClearer/ChainCacheClearerTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerAggregateTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerAggregateTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerAggregateTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerAggregateTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/ClientTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/ClientTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/ClientTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/ClientTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/DataCollector/EventDataCollectorTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/EventDataCollectorTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/DataCollector/EventDataCollectorTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/EventDataCollectorTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Debug/ContainerAwareTraceableEventDispatcherTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/ContainerAwareTraceableEventDispatcherTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Debug/ContainerAwareTraceableEventDispatcherTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/ContainerAwareTraceableEventDispatcherTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Debug/ErrorHandlerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/ErrorHandlerTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Debug/ErrorHandlerTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/ErrorHandlerTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Debug/ExceptionHandlerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/ExceptionHandlerTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Debug/ExceptionHandlerTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/ExceptionHandlerTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Debug/StopwatchEventTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/StopwatchEventTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Debug/StopwatchEventTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/StopwatchEventTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Debug/StopwatchTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/StopwatchTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Debug/StopwatchTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/StopwatchTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php similarity index 98% rename from core/vendor/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php index f999a35ebbea..e5e612476838 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php @@ -66,7 +66,7 @@ public function testHandleWithoutLogger($event, $event2) try { $l->onKernelException($event2); - } catch(\Exception $e) { + } catch (\Exception $e) { $this->assertSame('foo', $e->getMessage()); } @@ -88,7 +88,7 @@ public function testHandleWithLogger($event, $event2) try { $l->onKernelException($event2); - } catch(\Exception $e) { + } catch (\Exception $e) { $this->assertSame('foo', $e->getMessage()); } diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php similarity index 72% rename from core/vendor/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php index c33b33dc5601..9ac028c65235 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php @@ -77,4 +77,33 @@ private function createGetResponseEventForUri($uri) return new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST); } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidMatcher() + { + new RouterListener(new \stdClass()); + } + + public function testRequestMatcher() + { + $kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'); + $request = Request::create('http://localhost/'); + $event = new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST); + + $context = new RequestContext(); + + $requestMatcher = $this->getMock('Symfony\Component\Routing\Matcher\RequestMatcherInterface'); + $requestMatcher->expects($this->any()) + ->method('getContext') + ->will($this->returnValue($context)); + $requestMatcher->expects($this->once()) + ->method('matchRequest') + ->with($this->isInstanceOf('Symfony\Component\HttpFoundation\Request')) + ->will($this->returnValue(array())); + + $listener = new RouterListener($requestMatcher); + $listener->onKernelRequest($event); + } } diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Exception/FlattenExceptionTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Exception/FlattenExceptionTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Exception/FlattenExceptionTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Exception/FlattenExceptionTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/BaseBundle/Resources/foo.txt b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/BaseBundle/Resources/foo.txt similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/BaseBundle/Resources/foo.txt rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/BaseBundle/Resources/foo.txt diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/BaseBundle/Resources/hide.txt b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/BaseBundle/Resources/hide.txt similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/BaseBundle/Resources/hide.txt rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/BaseBundle/Resources/hide.txt diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/Resources/foo.txt b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/Resources/foo.txt similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/Resources/foo.txt rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/Resources/foo.txt diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/bar.txt b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/bar.txt similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/bar.txt rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/bar.txt diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/foo.txt b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/foo.txt similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/foo.txt rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/foo.txt diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle2Bundle/foo.txt b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle2Bundle/foo.txt similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle2Bundle/foo.txt rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle2Bundle/foo.txt diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/ChildBundle/Resources/foo.txt b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ChildBundle/Resources/foo.txt similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/ChildBundle/Resources/foo.txt rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ChildBundle/Resources/foo.txt diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/ChildBundle/Resources/hide.txt b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ChildBundle/Resources/hide.txt similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/ChildBundle/Resources/hide.txt rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ChildBundle/Resources/hide.txt diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionAbsentBundle/ExtensionAbsentBundle.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionAbsentBundle/ExtensionAbsentBundle.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionAbsentBundle/ExtensionAbsentBundle.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionAbsentBundle/ExtensionAbsentBundle.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionLoadedBundle/DependencyInjection/ExtensionLoadedExtension.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionLoadedBundle/DependencyInjection/ExtensionLoadedExtension.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionLoadedBundle/DependencyInjection/ExtensionLoadedExtension.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionLoadedBundle/DependencyInjection/ExtensionLoadedExtension.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionLoadedBundle/ExtensionLoadedBundle.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionLoadedBundle/ExtensionLoadedBundle.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionLoadedBundle/ExtensionLoadedBundle.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionLoadedBundle/ExtensionLoadedBundle.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/Command/FooCommand.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/Command/FooCommand.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/Command/FooCommand.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/Command/FooCommand.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/DependencyInjection/ExtensionPresentExtension.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/DependencyInjection/ExtensionPresentExtension.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/DependencyInjection/ExtensionPresentExtension.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/DependencyInjection/ExtensionPresentExtension.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/ExtensionPresentBundle.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/ExtensionPresentBundle.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/ExtensionPresentBundle.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/ExtensionPresentBundle.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/FooBarBundle.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/FooBarBundle.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/FooBarBundle.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/FooBarBundle.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/BaseBundle/hide.txt b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/BaseBundle/hide.txt similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/BaseBundle/hide.txt rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/BaseBundle/hide.txt diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/Bundle1Bundle/foo.txt b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/Bundle1Bundle/foo.txt similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/Bundle1Bundle/foo.txt rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/Bundle1Bundle/foo.txt diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/ChildBundle/foo.txt b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/ChildBundle/foo.txt similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/ChildBundle/foo.txt rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/ChildBundle/foo.txt diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/FooBundle/foo.txt b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/FooBundle/foo.txt similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/FooBundle/foo.txt rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/FooBundle/foo.txt diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/TestClient.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/TestClient.php similarity index 90% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/TestClient.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/TestClient.php index ddab206a3bf2..48ff956b4daf 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/TestClient.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/TestClient.php @@ -19,7 +19,7 @@ protected function getScript($request) { $script = parent::getScript($request); - $script = preg_replace('/(\->register\(\);)/', "$0\nrequire_once '".__DIR__."/../TestHttpKernel.php';", $script); + $script = preg_replace('/(\->register\(\);)/', "$0\nrequire_once '".__DIR__."/../bootstrap.php';", $script); return $script; } diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/TestEventDispatcher.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/TestEventDispatcher.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Fixtures/TestEventDispatcher.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/TestEventDispatcher.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php similarity index 98% rename from core/vendor/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php index 2ac581df39c9..5060a696c210 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php @@ -169,8 +169,7 @@ public function testRespondsWith304OnlyIfIfNoneMatchAndIfModifiedSinceBothMatch( { $time = new \DateTime(); - $this->setNextResponse(200, array(), '', function ($request, $response) use ($time) - { + $this->setNextResponse(200, array(), '', function ($request, $response) use ($time) { $response->setStatusCode(200); $response->headers->set('ETag', '12345'); $response->headers->set('Last-Modified', $time->format(DATE_RFC2822)); @@ -197,8 +196,7 @@ public function testRespondsWith304OnlyIfIfNoneMatchAndIfModifiedSinceBothMatch( public function testValidatesPrivateResponsesCachedOnTheClient() { - $this->setNextResponse(200, array(), '', function ($request, $response) - { + $this->setNextResponse(200, array(), '', function ($request, $response) { $etags = preg_split('/\s*,\s*/', $request->headers->get('IF_NONE_MATCH')); if ($request->cookies->has('authenticated')) { $response->headers->set('Cache-Control', 'private, no-store'); @@ -257,8 +255,7 @@ public function testReloadsResponsesWhenCacheHitsButNoCacheRequestDirectivePrese { $count = 0; - $this->setNextResponse(200, array('Cache-Control' => 'public, max-age=10000'), '', function ($request, $response) use (&$count) - { + $this->setNextResponse(200, array('Cache-Control' => 'public, max-age=10000'), '', function ($request, $response) use (&$count) { ++$count; $response->setContent(1 == $count ? 'Hello World' : 'Goodbye World'); }); @@ -285,8 +282,7 @@ public function testDoesNotReloadResponsesWhenAllowReloadIsSetFalseDefault() { $count = 0; - $this->setNextResponse(200, array('Cache-Control' => 'public, max-age=10000'), '', function ($request, $response) use (&$count) - { + $this->setNextResponse(200, array('Cache-Control' => 'public, max-age=10000'), '', function ($request, $response) use (&$count) { ++$count; $response->setContent(1 == $count ? 'Hello World' : 'Goodbye World'); }); @@ -317,8 +313,7 @@ public function testRevalidatesFreshCacheEntryWhenMaxAgeRequestDirectiveIsExceed { $count = 0; - $this->setNextResponse(200, array(), '', function ($request, $response) use (&$count) - { + $this->setNextResponse(200, array(), '', function ($request, $response) use (&$count) { ++$count; $response->headers->set('Cache-Control', 'public, max-age=10000'); $response->setETag($count); @@ -348,8 +343,7 @@ public function testDoesNotRevalidateFreshCacheEntryWhenEnableRevalidateOptionIs { $count = 0; - $this->setNextResponse(200, array(), '', function ($request, $response) use (&$count) - { + $this->setNextResponse(200, array(), '', function ($request, $response) use (&$count) { ++$count; $response->headers->set('Cache-Control', 'public, max-age=10000'); $response->setETag($count); @@ -658,8 +652,7 @@ public function testFetchesFullResponseWhenCacheStaleAndNoValidatorsPresent() public function testValidatesCachedResponsesWithLastModifiedAndNoFreshnessInformation() { $time = \DateTime::createFromFormat('U', time()); - $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($time) - { + $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($time) { $response->headers->set('Cache-Control', 'public'); $response->headers->set('Last-Modified', $time->format(DATE_RFC2822)); if ($time->format(DATE_RFC2822) == $request->headers->get('IF_MODIFIED_SINCE')) { @@ -695,8 +688,7 @@ public function testValidatesCachedResponsesWithLastModifiedAndNoFreshnessInform public function testValidatesCachedResponsesWithETagAndNoFreshnessInformation() { - $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) - { + $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) { $response->headers->set('Cache-Control', 'public'); $response->headers->set('ETag', '"12345"'); if ($response->getETag() == $request->headers->get('IF_NONE_MATCH')) { @@ -733,8 +725,7 @@ public function testReplacesCachedResponsesWhenValidationResultsInNon304Response { $time = \DateTime::createFromFormat('U', time()); $count = 0; - $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($time, &$count) - { + $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($time, &$count) { $response->headers->set('Last-Modified', $time->format(DATE_RFC2822)); $response->headers->set('Cache-Control', 'public'); switch (++$count) { @@ -772,8 +763,7 @@ public function testReplacesCachedResponsesWhenValidationResultsInNon304Response public function testPassesHeadRequestsThroughDirectlyOnPass() { $that = $this; - $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($that) - { + $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($that) { $response->setContent(''); $response->setStatusCode(200); $that->assertEquals('HEAD', $request->getMethod()); @@ -787,8 +777,7 @@ public function testPassesHeadRequestsThroughDirectlyOnPass() public function testUsesCacheToRespondToHeadRequestsWhenFresh() { $that = $this; - $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($that) - { + $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($that) { $response->headers->set('Cache-Control', 'public, max-age=10'); $response->setContent('Hello World'); $response->setStatusCode(200); @@ -810,8 +799,7 @@ public function testSendsNoContentWhenFresh() { $time = \DateTime::createFromFormat('U', time()); $that = $this; - $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($that, $time) - { + $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($that, $time) { $response->headers->set('Cache-Control', 'public, max-age=10'); $response->headers->set('Last-Modified', $time->format(DATE_RFC2822)); }); @@ -828,8 +816,7 @@ public function testSendsNoContentWhenFresh() public function testInvalidatesCachedResponsesOnPost() { - $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) - { + $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) { if ('GET' == $request->getMethod()) { $response->setStatusCode(200); $response->headers->set('Cache-Control', 'public, max-age=500'); @@ -878,8 +865,7 @@ public function testInvalidatesCachedResponsesOnPost() public function testServesFromCacheWhenHeadersMatch() { $count = 0; - $this->setNextResponse(200, array('Cache-Control' => 'max-age=10000'), '', function ($request, $response) use (&$count) - { + $this->setNextResponse(200, array('Cache-Control' => 'max-age=10000'), '', function ($request, $response) use (&$count) { $response->headers->set('Vary', 'Accept User-Agent Foo'); $response->headers->set('Cache-Control', 'public, max-age=10'); $response->headers->set('X-Response-Count', ++$count); @@ -903,8 +889,7 @@ public function testServesFromCacheWhenHeadersMatch() public function testStoresMultipleResponsesWhenHeadersDiffer() { $count = 0; - $this->setNextResponse(200, array('Cache-Control' => 'max-age=10000'), '', function ($request, $response) use (&$count) - { + $this->setNextResponse(200, array('Cache-Control' => 'max-age=10000'), '', function ($request, $response) use (&$count) { $response->headers->set('Vary', 'Accept User-Agent Foo'); $response->headers->set('Cache-Control', 'public, max-age=10'); $response->headers->set('X-Response-Count', ++$count); diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php similarity index 98% rename from core/vendor/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php index 6bbcdfba48e4..3d78c7c8cef0 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php @@ -162,8 +162,7 @@ static public function clearDirectory($directory) $fp = opendir($directory); while (false !== $file = readdir($fp)) { - if (!in_array($file, array('.', '..'))) - { + if (!in_array($file, array('.', '..'))) { if (is_link($directory.'/'.$file)) { unlink($directory.'/'.$file); } elseif (is_dir($directory.'/'.$file)) { diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/HttpCache/TestHttpKernel.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestHttpKernel.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/HttpCache/TestHttpKernel.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestHttpKernel.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php similarity index 99% rename from core/vendor/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php index 8a184b462df8..bdbc4e80ff8c 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php @@ -54,8 +54,7 @@ public function testHandleWhenControllerThrowsAnExceptionAndRawIsFalseAndNoListe public function testHandleWhenControllerThrowsAnExceptionAndRawIsFalse() { $dispatcher = new EventDispatcher(); - $dispatcher->addListener(KernelEvents::EXCEPTION, function ($event) - { + $dispatcher->addListener(KernelEvents::EXCEPTION, function ($event) { $event->setResponse(new Response($event->getException()->getMessage())); }); @@ -67,8 +66,7 @@ public function testHandleWhenControllerThrowsAnExceptionAndRawIsFalse() public function testHandleWhenAListenerReturnsAResponse() { $dispatcher = new EventDispatcher(); - $dispatcher->addListener(KernelEvents::REQUEST, function ($event) - { + $dispatcher->addListener(KernelEvents::REQUEST, function ($event) { $event->setResponse(new Response('hello')); }); @@ -154,8 +152,7 @@ public function testHandleWhenTheControllerDoesNotReturnAResponse() public function testHandleWhenTheControllerDoesNotReturnAResponseButAViewIsRegistered() { $dispatcher = new EventDispatcher(); - $dispatcher->addListener(KernelEvents::VIEW, function ($event) - { + $dispatcher->addListener(KernelEvents::VIEW, function ($event) { $event->setResponse(new Response($event->getControllerResult())); }); $kernel = new HttpKernel($dispatcher, $this->getResolver(function () { return 'foo'; })); @@ -166,8 +163,7 @@ public function testHandleWhenTheControllerDoesNotReturnAResponseButAViewIsRegis public function testHandleWithAResponseListener() { $dispatcher = new EventDispatcher(); - $dispatcher->addListener(KernelEvents::RESPONSE, function ($event) - { + $dispatcher->addListener(KernelEvents::RESPONSE, function ($event) { $event->setResponse(new Response('foo')); }); $kernel = new HttpKernel($dispatcher, $this->getResolver()); diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/KernelTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/KernelTest.php similarity index 98% rename from core/vendor/Symfony/Component/HttpKernel/Tests/KernelTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/KernelTest.php index a26d9d7fc1df..8fc46cc8f18e 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Tests/KernelTest.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/KernelTest.php @@ -12,7 +12,6 @@ namespace Symfony\Component\HttpKernel\Tests; use Symfony\Component\HttpKernel\Kernel; -use Symfony\Component\HttpKernel\Bundle\BundleInterface; use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpFoundation\Request; @@ -724,7 +723,7 @@ public function testTerminateDelegatesTerminationOnlyForTerminableInterface() protected function getBundle($dir = null, $parent = null, $className = null, $bundleName = null) { $bundle = $this - ->getMockBuilder('Symfony\Component\HttpKernel\Tests\BundleForTest') + ->getMockBuilder('Symfony\Component\HttpKernel\Bundle\BundleInterface') ->setMethods(array('getPath', 'getParent', 'getName')) ->disableOriginalConstructor() ; @@ -775,8 +774,3 @@ protected function getKernelForInvalidLocateResource() ; } } - -abstract class BundleForTest implements BundleInterface -{ - // We can not extend Symfony\Component\HttpKernel\Bundle\Bundle as we want to mock getName() which is final -} diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Logger.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Logger.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Logger.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Logger.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/AbstractProfilerStorageTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/AbstractProfilerStorageTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/AbstractProfilerStorageTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/AbstractProfilerStorageTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/FileProfilerStorageTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/FileProfilerStorageTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/FileProfilerStorageTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/FileProfilerStorageTest.php diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/MemcacheProfilerStorageTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/MemcacheProfilerStorageTest.php new file mode 100644 index 000000000000..f582dff79993 --- /dev/null +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/MemcacheProfilerStorageTest.php @@ -0,0 +1,49 @@ +<?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. + */ + +namespace Symfony\Component\HttpKernel\Tests\Profiler; + +use Symfony\Component\HttpKernel\Profiler\MemcacheProfilerStorage; +use Symfony\Component\HttpKernel\Tests\Profiler\Mock\MemcacheMock; + +class MemcacheProfilerStorageTest extends AbstractProfilerStorageTest +{ + protected static $storage; + + protected function setUp() + { + $memcacheMock = new MemcacheMock(); + $memcacheMock->addServer('127.0.0.1', 11211); + + self::$storage = new MemcacheProfilerStorage('memcache://127.0.0.1:11211', '', '', 86400); + self::$storage->setMemcache($memcacheMock); + + if (self::$storage) { + self::$storage->purge(); + } + } + + protected function tearDown() + { + if (self::$storage) { + self::$storage->purge(); + self::$storage = false; + } + } + + /** + * @return \Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface + */ + protected function getStorage() + { + return self::$storage; + } +} diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/MemcachedProfilerStorageTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/MemcachedProfilerStorageTest.php similarity index 53% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/MemcachedProfilerStorageTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/MemcachedProfilerStorageTest.php index 5f2f5c352275..565ac35f33a8 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/MemcachedProfilerStorageTest.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/MemcachedProfilerStorageTest.php @@ -12,44 +12,30 @@ namespace Symfony\Component\HttpKernel\Tests\Profiler; use Symfony\Component\HttpKernel\Profiler\MemcachedProfilerStorage; +use Symfony\Component\HttpKernel\Tests\Profiler\Mock\MemcachedMock; -class DummyMemcachedProfilerStorage extends MemcachedProfilerStorage -{ - public function getMemcached() - { - return parent::getMemcached(); - } -} - -/** - * @group memcached - */ class MemcachedProfilerStorageTest extends AbstractProfilerStorageTest { protected static $storage; - public static function tearDownAfterClass() + protected function setUp() { + $memcachedMock = new MemcachedMock(); + $memcachedMock->addServer('127.0.0.1', 11211); + + self::$storage = new MemcachedProfilerStorage('memcached://127.0.0.1:11211', '', '', 86400); + self::$storage->setMemcached($memcachedMock); + if (self::$storage) { self::$storage->purge(); } } - protected function setUp() + protected function tearDown() { - if (!extension_loaded('memcached')) { - $this->markTestSkipped('MemcachedProfilerStorageTest requires that the extension memcached is loaded'); - } - - self::$storage = new DummyMemcachedProfilerStorage('memcached://127.0.0.1:11211', '', '', 86400); - try { - self::$storage->getMemcached(); - } catch (\Exception $e) { - $this->markTestSkipped('MemcachedProfilerStorageTest requires that there is a Memcache server present on localhost'); - } - if (self::$storage) { self::$storage->purge(); + self::$storage = false; } } diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcacheMock.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcacheMock.php new file mode 100644 index 000000000000..014f5492fc8e --- /dev/null +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcacheMock.php @@ -0,0 +1,260 @@ +<?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. + */ + +namespace Symfony\Component\HttpKernel\Tests\Profiler\Mock; + +/** + * MemcacheMock for simulating Memcache extension in tests. + * + * @author Andrej Hudec <pulzarraider@gmail.com> + */ +class MemcacheMock +{ + private $connected; + private $storage; + + public function __construct() + { + $this->connected = false; + $this->storage = array(); + } + + /** + * Open memcached server connection + * + * @param string $host + * @param integer $port + * @param integer $timeout + * + * @return boolean + */ + public function connect($host, $port = null, $timeout = null) + { + if ('127.0.0.1' == $host && 11211 == $port) { + $this->connected = true; + + return true; + } + + return false; + } + + /** + * Open memcached server persistent connection + * + * @param string $host + * @param integer $port + * @param integer $timeout + * + * @return boolean + */ + public function pconnect($host, $port = null, $timeout = null) + { + if ('127.0.0.1' == $host && 11211 == $port) { + $this->connected = true; + + return true; + } + + return false; + } + + /** + * Add a memcached server to connection pool + * + * @param string $host + * @param integer $port + * @param boolean $persistent + * @param integer $weight + * @param integer $timeout + * @param integer $retry_interval + * @param boolean $status + * @param callable $failure_callback + * @param integer $timeoutms + * + * @return boolean + */ + public function addServer($host, $port = 11211, $persistent = null, $weight = null, $timeout = null, $retry_interval = null, $status = null, $failure_callback = null, $timeoutms = null) + { + if ('127.0.0.1' == $host && 11211 == $port) { + $this->connected = true; + + return true; + } + + return false; + } + + /** + * Add an item to the server only if such key doesn't exist at the server yet. + * + * @param string $key + * @param mixed $var + * @param integer $flag + * @param integer $expire + * + * @return boolean + */ + public function add($key, $var, $flag = null, $expire = null) + { + if (!$this->connected) { + return false; + } + + if (!isset($this->storage[$key])) { + $this->storeData($key, $var); + + return true; + } + + return false; + } + + /** + * Store data at the server. + * + * @param string $key + * @param string $var + * @param integer $flag + * @param integer $expire + * + * @return boolean + */ + public function set($key, $var, $flag = null, $expire = null) + { + if (!$this->connected) { + return false; + } + + $this->storeData($key, $var); + + return true; + } + + /** + * Replace value of the existing item. + * + * @param string $key + * @param mixed $var + * @param integer $flag + * @param integer $expire + * + * @return boolean + */ + public function replace($key, $var, $flag = null, $expire = null) + { + if (!$this->connected) { + return false; + } + + if (isset($this->storage[$key])) { + $this->storeData($key, $var); + + return true; + } + + return false; + } + + /** + * Retrieve item from the server. + * + * @param string|array $key + * @param integer|array $flags + * + * @return mixed + */ + public function get($key, &$flags = null) + { + if (!$this->connected) { + return false; + } + + if (is_array($key)) { + $result = array(); + foreach ($key as $k) { + if (isset($this->storage[$k])) { + $result[] = $this->getData($k); + } + } + + return $result; + } + + return $this->getData($key); + } + + /** + * Delete item from the server + * + * @param string $key + * + * @return boolean + */ + public function delete($key) + { + if (!$this->connected) { + return false; + } + + if (isset($this->storage[$key])) { + unset($this->storage[$key]); + + return true; + } + + return false; + } + + /** + * Flush all existing items at the server + * + * @return boolean + */ + public function flush() + { + if (!$this->connected) { + return false; + } + + $this->storage = array(); + + return true; + } + + /** + * Close memcached server connection + * + * @return boolean + */ + public function close() + { + $this->connected = false; + + return true; + } + + private function getData($key) + { + if (isset($this->storage[$key])) { + return unserialize($this->storage[$key]); + } + + return false; + } + + private function storeData($key, $value) + { + $this->storage[$key] = serialize($value); + + return true; + } +} diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcachedMock.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcachedMock.php new file mode 100644 index 000000000000..2b17d70d2832 --- /dev/null +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcachedMock.php @@ -0,0 +1,225 @@ +<?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. + */ + +namespace Symfony\Component\HttpKernel\Tests\Profiler\Mock; + +/** + * MemcachedMock for simulating Memcached extension in tests. + * + * @author Andrej Hudec <pulzarraider@gmail.com> + */ +class MemcachedMock +{ + private $connected; + private $storage; + + public function __construct() + { + $this->connected = false; + $this->storage = array(); + } + + /** + * Set a Memcached option + * + * @param integer $option + * @param mixed $value + * + * @return boolean + */ + public function setOption($option, $value) + { + return true; + } + + /** + * Add a memcached server to connection pool + * + * @param string $host + * @param integer $port + * @param integer $weight + * + * @return boolean + */ + public function addServer($host, $port = 11211, $weight = 0) + { + if ('127.0.0.1' == $host && 11211 == $port) { + $this->connected = true; + + return true; + } + + return false; + } + + /** + * Add an item to the server only if such key doesn't exist at the server yet. + * + * @param string $key + * @param mixed $value + * @param integer $expiration + * + * @return boolean + */ + public function add($key, $value, $expiration = 0) + { + if (!$this->connected) { + return false; + } + + if (!isset($this->storage[$key])) { + $this->storeData($key, $value); + + return true; + } + + return false; + } + + /** + * Store data at the server. + * + * @param string $key + * @param mixed $value + * @param integer $expiration + * + * @return boolean + */ + public function set($key, $value, $expiration = null) + { + if (!$this->connected) { + return false; + } + + $this->storeData($key, $value); + + return true; + } + + /** + * Replace value of the existing item. + * + * @param string $key + * @param mixed $value + * @param integer $expiration + * + * @return boolean + */ + public function replace($key, $value, $expiration = null) + { + if (!$this->connected) { + return false; + } + + if (isset($this->storage[$key])) { + $this->storeData($key, $value); + + return true; + } + + return false; + } + + /** + * Retrieve item from the server. + * + * @param string $key + * @param callable $cache_cb + * @param float $cas_token + * + * @return boolean + */ + public function get($key, $cache_cb = null, &$cas_token = null) + { + if (!$this->connected) { + return false; + } + + return $this->getData($key); + } + + /** + * Append data to an existing item + * + * @param string $key + * @param string $value + * + * @return boolean + */ + public function append($key, $value) + { + if (!$this->connected) { + return false; + } + + if (isset($this->storage[$key])) { + $this->storeData($key, $this->getData($key).$value); + + return true; + } + + return false; + } + + /** + * Delete item from the server + * + * @param string $key + * + * @return boolean + */ + public function delete($key) + { + if (!$this->connected) { + return false; + } + + if (isset($this->storage[$key])) { + unset($this->storage[$key]); + + return true; + } + + return false; + } + + /** + * Flush all existing items at the server + * + * @return boolean + */ + public function flush() + { + if (!$this->connected) { + return false; + } + + $this->storage = array(); + + return true; + } + + private function getData($key) + { + if (isset($this->storage[$key])) { + return unserialize($this->storage[$key]); + } + + return false; + } + + private function storeData($key, $value) + { + $this->storage[$key] = serialize($value); + + return true; + } +} diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php new file mode 100644 index 000000000000..b79e097fec9c --- /dev/null +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php @@ -0,0 +1,241 @@ +<?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. + */ + +namespace Symfony\Component\HttpKernel\Tests\Profiler\Mock; + +/** + * RedisMock for simulating Redis extension in tests. + * + * @author Andrej Hudec <pulzarraider@gmail.com> + */ +class RedisMock +{ + + private $connected; + private $storage; + + public function __construct() + { + $this->connected = false; + $this->storage = array(); + } + + /** + * Add a memcached server to connection pool + * + * @param string $host + * @param integer $port + * @param float $timeout + * + * @return boolean + */ + public function connect($host, $port = 6379, $timeout = 0) + { + if ('127.0.0.1' == $host && 6379 == $port) { + $this->connected = true; + + return true; + } + + return false; + } + + /** + * Set client option. + * + * @param integer $name + * @param integer $value + * + * @return boolean + */ + public function setOption($name, $value) + { + if (!$this->connected) { + return false; + } + + return true; + } + + /** + * Verify if the specified key exists. + * + * @param string $key + * + * @return boolean + */ + public function exists($key) + { + if (!$this->connected) { + return false; + } + + return isset($this->storage[$key]); + } + + /** + * Store data at the server with expiration time. + * + * @param string $key + * @param integer $ttl + * @param mixed $value + * + * @return boolean + */ + public function setex($key, $ttl, $value) + { + if (!$this->connected) { + return false; + } + + $this->storeData($key, $value); + + return true; + } + + /** + * Sets an expiration time on an item. + * + * @param string $key + * @param integer $ttl + * + * @return boolean + */ + public function setTimeout($key, $ttl) + { + if (!$this->connected) { + return false; + } + + if (isset($this->storage[$key])) { + return true; + } + + return false; + } + + /** + * Retrieve item from the server. + * + * @param string $key + * + * @return boolean + */ + public function get($key) + { + if (!$this->connected) { + return false; + } + + return $this->getData($key); + } + + /** + * Append data to an existing item + * + * @param string $key + * @param string $value + * + * @return integer Size of the value after the append. + */ + public function append($key, $value) + { + if (!$this->connected) { + return false; + } + + if (isset($this->storage[$key])) { + $this->storeData($key, $this->getData($key).$value); + + return strlen($this->storage[$key]); + } + + return false; + } + + /** + * Remove specified keys. + * + * @param string|array $key + * + * @return integer + */ + public function delete($key) + { + if (!$this->connected) { + return false; + } + + if (is_array($key)) { + $result = 0; + foreach ($key as $k) { + if (isset($this->storage[$k])) { + unset($this->storage[$k]); + ++$result; + } + } + + return $result; + } + + if (isset($this->storage[$key])) { + unset($this->storage[$key]); + + return 1; + } + + return 0; + } + + /** + * Flush all existing items from all databases at the server. + * + * @return boolean + */ + public function flushAll() + { + if (!$this->connected) { + return false; + } + + $this->storage = array(); + + return true; + } + + /** + * Close Redis server connection + * + * @return boolean + */ + public function close() + { + $this->connected = false; + + return true; + } + + private function getData($key) + { + if (isset($this->storage[$key])) { + return unserialize($this->storage[$key]); + } + + return false; + } + + private function storeData($key, $value) + { + $this->storage[$key] = serialize($value); + + return true; + } +} diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php similarity index 96% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php index 310320cd6568..4679a0efa5e9 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php @@ -75,7 +75,7 @@ protected function setUp() if (self::$storage) { self::$storage->purge(); } else { - $this->markTestSkipped('MongoDbProfilerStorageTest requires then mongo PHP extennsion and a MongoDB server on localhost'); + $this->markTestSkipped('MongoDbProfilerStorageTest requires the mongo PHP extension and a MongoDB server on localhost'); } } } diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/ProfilerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/ProfilerTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/ProfilerTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/ProfilerTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/RedisProfilerStorageTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/RedisProfilerStorageTest.php similarity index 56% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/RedisProfilerStorageTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/RedisProfilerStorageTest.php index 88779bc71810..91354ae93548 100644 --- a/core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/RedisProfilerStorageTest.php +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/RedisProfilerStorageTest.php @@ -12,14 +12,7 @@ namespace Symfony\Component\HttpKernel\Tests\Profiler; use Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage; - -class DummyRedisProfilerStorage extends RedisProfilerStorage -{ - public function getRedis() - { - return parent::getRedis(); - } -} +use Symfony\Component\HttpKernel\Tests\Profiler\Mock\RedisMock; class RedisProfilerStorageTest extends AbstractProfilerStorageTest { @@ -27,19 +20,14 @@ class RedisProfilerStorageTest extends AbstractProfilerStorageTest protected function setUp() { - if (!extension_loaded('redis')) { - $this->markTestSkipped('RedisProfilerStorageTest requires redis extension to be loaded'); - } + $redisMock = new RedisMock(); + $redisMock->connect('127.0.0.1', 6379); - self::$storage = new DummyRedisProfilerStorage('redis://127.0.0.1:6379', '', '', 86400); - try { - self::$storage->getRedis(); + self::$storage = new RedisProfilerStorage('redis://127.0.0.1:6379', '', '', 86400); + self::$storage->setRedis($redisMock); + if (self::$storage) { self::$storage->purge(); - - } catch (\Exception $e) { - self::$storage = false; - $this->markTestSkipped('RedisProfilerStorageTest requires that there is a Redis server present on localhost'); } } @@ -47,7 +35,6 @@ protected function tearDown() { if (self::$storage) { self::$storage->purge(); - self::$storage->getRedis()->close(); self::$storage = false; } } diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/SqliteProfilerStorageTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/SqliteProfilerStorageTest.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/Profiler/SqliteProfilerStorageTest.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/SqliteProfilerStorageTest.php diff --git a/core/vendor/Symfony/Component/HttpKernel/Tests/TestHttpKernel.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/TestHttpKernel.php similarity index 100% rename from core/vendor/Symfony/Component/HttpKernel/Tests/TestHttpKernel.php rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/TestHttpKernel.php diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/bootstrap.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/bootstrap.php new file mode 100644 index 000000000000..24b1009e9acd --- /dev/null +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/bootstrap.php @@ -0,0 +1,22 @@ +<?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. + */ + +spl_autoload_register(function ($class) { + if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\HttpKernel')) { + if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\HttpKernel')).'.php')) { + require_once $file; + } + } +}); + +if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) { + require_once $loader; +} diff --git a/core/vendor/Symfony/Component/HttpKernel/composer.json b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/composer.json similarity index 68% rename from core/vendor/Symfony/Component/HttpKernel/composer.json rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/composer.json index 95fb176dc6b6..e8c693f72b63 100644 --- a/core/vendor/Symfony/Component/HttpKernel/composer.json +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/composer.json @@ -16,9 +16,19 @@ } ], "require": { - "php": ">=5.3.2", - "symfony/event-dispatcher": "self.version", - "symfony/http-foundation": "self.version" + "php": ">=5.3.3", + "symfony/event-dispatcher": "2.1.*", + "symfony/http-foundation": "2.1.*" + }, + "require-dev": { + "symfony/browser-kit": "2.1.*", + "symfony/class-loader": "2.1.*", + "symfony/config": "2.1.*", + "symfony/console": "2.1.*", + "symfony/dependency-injection": "2.1.*", + "symfony/finder": "2.1.*", + "symfony/process": "2.1.*", + "symfony/routing": "2.1.*" }, "suggest": { "symfony/browser-kit": "self.version", diff --git a/core/vendor/Symfony/Component/HttpKernel/phpunit.xml.dist b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/phpunit.xml.dist similarity index 93% rename from core/vendor/Symfony/Component/HttpKernel/phpunit.xml.dist rename to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/phpunit.xml.dist index 0d881e106073..dd824acdf7ea 100644 --- a/core/vendor/Symfony/Component/HttpKernel/phpunit.xml.dist +++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/phpunit.xml.dist @@ -21,8 +21,8 @@ <whitelist> <directory>./</directory> <exclude> - <directory>./Resources</directory> <directory>./Tests</directory> + <directory>./vendor</directory> </exclude> </whitelist> </filter> diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/.gitignore b/core/vendor/symfony/routing/Symfony/Component/Routing/.gitignore new file mode 100644 index 000000000000..d1502b087b4d --- /dev/null +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/.gitignore @@ -0,0 +1,2 @@ +vendor/ +composer.lock diff --git a/core/vendor/Symfony/Component/Routing/Annotation/Route.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Annotation/Route.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Annotation/Route.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Annotation/Route.php diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/CHANGELOG.md b/core/vendor/symfony/routing/Symfony/Component/Routing/CHANGELOG.md new file mode 100644 index 000000000000..741d18c7b559 --- /dev/null +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/CHANGELOG.md @@ -0,0 +1,26 @@ +CHANGELOG +========= + +2.1.0 +----- + + * added RequestMatcherInterface + * added RequestContext::fromRequest() + * the UrlMatcher does not throw a \LogicException anymore when the required + scheme is not the current one + * added TraceableUrlMatcher + * added the possibility to define options, default values and requirements + for placeholders in prefix, including imported routes + * added RouterInterface::getRouteCollection + * [BC BREAK] the UrlMatcher urldecodes the route parameters only once, they + were decoded twice before. Note that the `urldecode()` calls have been + changed for a single `rawurldecode()` in order to support `+` for input + paths. + * added RouteCollection::getRoot method to retrieve the root of a + RouteCollection tree + * [BC BREAK] made RouteCollection::setParent private which could not have + been used anyway without creating inconsistencies + * [BC BREAK] RouteCollection::remove also removes a route from parent + collections (not only from its children) + * added strict_parameters option to disable exceptions (and generate empty + URLs instead) when generating a route with an invalid parameter value diff --git a/core/vendor/Symfony/Component/Routing/CompiledRoute.php b/core/vendor/symfony/routing/Symfony/Component/Routing/CompiledRoute.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/CompiledRoute.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/CompiledRoute.php diff --git a/core/vendor/Symfony/Component/Routing/Exception/ExceptionInterface.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Exception/ExceptionInterface.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Exception/ExceptionInterface.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Exception/ExceptionInterface.php diff --git a/core/vendor/Symfony/Component/Routing/Exception/InvalidParameterException.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Exception/InvalidParameterException.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Exception/InvalidParameterException.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Exception/InvalidParameterException.php diff --git a/core/vendor/Symfony/Component/Routing/Exception/MethodNotAllowedException.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Exception/MethodNotAllowedException.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Exception/MethodNotAllowedException.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Exception/MethodNotAllowedException.php diff --git a/core/vendor/Symfony/Component/Routing/Exception/MissingMandatoryParametersException.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Exception/MissingMandatoryParametersException.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Exception/MissingMandatoryParametersException.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Exception/MissingMandatoryParametersException.php diff --git a/core/vendor/Symfony/Component/Routing/Exception/ResourceNotFoundException.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Exception/ResourceNotFoundException.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Exception/ResourceNotFoundException.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Exception/ResourceNotFoundException.php diff --git a/core/vendor/Symfony/Component/Routing/Exception/RouteNotFoundException.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Exception/RouteNotFoundException.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Exception/RouteNotFoundException.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Exception/RouteNotFoundException.php diff --git a/core/vendor/Symfony/Component/Routing/Generator/Dumper/GeneratorDumper.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/GeneratorDumper.php similarity index 95% rename from core/vendor/Symfony/Component/Routing/Generator/Dumper/GeneratorDumper.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/GeneratorDumper.php index 1291bd12d0ee..408be9c6abbc 100644 --- a/core/vendor/Symfony/Component/Routing/Generator/Dumper/GeneratorDumper.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/GeneratorDumper.php @@ -32,6 +32,9 @@ public function __construct(RouteCollection $routes) $this->routes = $routes; } + /** + * {@inheritdoc} + */ public function getRoutes() { return $this->routes; diff --git a/core/vendor/Symfony/Component/Routing/Generator/Dumper/GeneratorDumperInterface.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/GeneratorDumperInterface.php similarity index 72% rename from core/vendor/Symfony/Component/Routing/Generator/Dumper/GeneratorDumperInterface.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/GeneratorDumperInterface.php index 7179af291cb1..0f2f68403266 100644 --- a/core/vendor/Symfony/Component/Routing/Generator/Dumper/GeneratorDumperInterface.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/GeneratorDumperInterface.php @@ -23,16 +23,12 @@ interface GeneratorDumperInterface { /** - * Dumps a set of routes to a PHP class. + * Dumps a set of routes to a string representation of executable code + * that can then be used to generate a URL of such a route. * - * Available options: + * @param array $options An array of options * - * * class: The class name - * * base_class: The base class name - * - * @param array $options An array of options - * - * @return string A PHP class representing the generator class + * @return string Executable code */ function dump(array $options = array()); diff --git a/core/vendor/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php similarity index 93% rename from core/vendor/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php index 0edd6e9b655b..fad8ceaac08d 100644 --- a/core/vendor/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php @@ -31,7 +31,7 @@ class PhpGeneratorDumper extends GeneratorDumper * * class: The class name * * base_class: The base class name * - * @param array $options An array of options + * @param array $options An array of options * * @return string A PHP class representing the generator class * @@ -49,6 +49,7 @@ public function dump(array $options = array()) use Symfony\Component\Routing\RequestContext; use Symfony\Component\Routing\Exception\RouteNotFoundException; +use Symfony\Component\HttpKernel\Log\LoggerInterface; /** * {$options['class']} @@ -63,9 +64,10 @@ class {$options['class']} extends {$options['base_class']} /** * Constructor. */ - public function __construct(RequestContext \$context) + public function __construct(RequestContext \$context, LoggerInterface \$logger = null) { \$this->context = \$context; + \$this->logger = \$logger; } {$this->generateGenerateMethod()} diff --git a/core/vendor/Symfony/Component/Routing/Generator/UrlGenerator.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGenerator.php similarity index 78% rename from core/vendor/Symfony/Component/Routing/Generator/UrlGenerator.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGenerator.php index f47f3e5121fe..760d7294204f 100644 --- a/core/vendor/Symfony/Component/Routing/Generator/UrlGenerator.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGenerator.php @@ -17,6 +17,7 @@ use Symfony\Component\Routing\Exception\InvalidParameterException; use Symfony\Component\Routing\Exception\RouteNotFoundException; use Symfony\Component\Routing\Exception\MissingMandatoryParametersException; +use Symfony\Component\HttpKernel\Log\LoggerInterface; /** * UrlGenerator generates a URL based on a set of routes. @@ -28,8 +29,10 @@ class UrlGenerator implements UrlGeneratorInterface { protected $context; + protected $strictParameters = true; + protected $logger; protected $decodedChars = array( - // %2F is not valid in a URL, so we don't encode it (which is fine as the requirements explicitely allowed it) + // %2F is not valid in a URL, so we don't encode it (which is fine as the requirements explicitly allowed it) '%2F' => '/', ); @@ -40,21 +43,19 @@ class UrlGenerator implements UrlGeneratorInterface * * @param RouteCollection $routes A RouteCollection instance * @param RequestContext $context The context + * @param LoggerInterface $logger A logger instance * * @api */ - public function __construct(RouteCollection $routes, RequestContext $context) + public function __construct(RouteCollection $routes, RequestContext $context, LoggerInterface $logger = null) { $this->routes = $routes; $this->context = $context; + $this->logger = $logger; } /** - * Sets the request context. - * - * @param RequestContext $context The context - * - * @api + * {@inheritdoc} */ public function setContext(RequestContext $context) { @@ -62,9 +63,7 @@ public function setContext(RequestContext $context) } /** - * Gets the request context. - * - * @return RequestContext The context + * {@inheritdoc} */ public function getContext() { @@ -72,9 +71,27 @@ public function getContext() } /** - * {@inheritDoc} + * Enables or disables the exception on incorrect parameters. * - * @api + * @param Boolean $enabled + */ + public function setStrictParameters($enabled) + { + $this->strictParameters = $enabled; + } + + /** + * Gets the strict check of incorrect parameters. + * + * @return Boolean + */ + public function getStrictParameters() + { + return $this->strictParameters; + } + + /** + * {@inheritDoc} */ public function generate($name, $parameters = array(), $absolute = false) { @@ -113,7 +130,16 @@ protected function doGenerate($variables, $defaults, $requirements, $tokens, $pa if (!$isEmpty = in_array($tparams[$token[3]], array(null, '', false), true)) { // check requirement if ($tparams[$token[3]] && !preg_match('#^'.$token[2].'$#', $tparams[$token[3]])) { - throw new InvalidParameterException(sprintf('Parameter "%s" for route "%s" must match "%s" ("%s" given).', $token[3], $name, $token[2], $tparams[$token[3]])); + $message = sprintf('Parameter "%s" for route "%s" must match "%s" ("%s" given).', $token[3], $name, $token[2], $tparams[$token[3]]); + if ($this->strictParameters) { + throw new InvalidParameterException($message); + } + + if ($this->logger) { + $this->logger->err($message); + } + + return null; } } @@ -135,7 +161,7 @@ protected function doGenerate($variables, $defaults, $requirements, $tokens, $pa // add a query string if needed $extra = array_diff_key($originParameters, $variables, $defaults); - if ($extra && $query = http_build_query($extra)) { + if ($extra && $query = http_build_query($extra, '', '&')) { $url .= '?'.$query; } diff --git a/core/vendor/Symfony/Component/Routing/Generator/UrlGeneratorInterface.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGeneratorInterface.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Generator/UrlGeneratorInterface.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGeneratorInterface.php diff --git a/core/vendor/Symfony/Component/Routing/LICENSE b/core/vendor/symfony/routing/Symfony/Component/Routing/LICENSE similarity index 100% rename from core/vendor/Symfony/Component/Routing/LICENSE rename to core/vendor/symfony/routing/Symfony/Component/Routing/LICENSE diff --git a/core/vendor/Symfony/Component/Routing/Loader/AnnotationClassLoader.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationClassLoader.php similarity index 89% rename from core/vendor/Symfony/Component/Routing/Loader/AnnotationClassLoader.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationClassLoader.php index 28fa896b9cd6..d94f7d2c82b9 100644 --- a/core/vendor/Symfony/Component/Routing/Loader/AnnotationClassLoader.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationClassLoader.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Routing\Loader; use Doctrine\Common\Annotations\Reader; -use Symfony\Component\Routing\Annotation\Route as RouteAnnotation; use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\Routing\Route; use Symfony\Component\Routing\RouteCollection; @@ -161,12 +160,7 @@ protected function addRoute(RouteCollection $collection, $annot, $globals, \Refl } /** - * Returns true if this class supports the given resource. - * - * @param mixed $resource A resource - * @param string $type The resource type - * - * @return Boolean True if this class supports the given resource, false otherwise + * {@inheritdoc} */ public function supports($resource, $type = null) { @@ -174,18 +168,14 @@ public function supports($resource, $type = null) } /** - * Sets the loader resolver. - * - * @param LoaderResolverInterface $resolver A LoaderResolverInterface instance + * {@inheritdoc} */ public function setResolver(LoaderResolverInterface $resolver) { } /** - * Gets the loader resolver. - * - * @return LoaderResolverInterface A LoaderResolverInterface instance + * {@inheritdoc} */ public function getResolver() { @@ -194,14 +184,14 @@ public function getResolver() /** * Gets the default route name for a class method. * - * @param \ReflectionClass $class + * @param \ReflectionClass $class * @param \ReflectionMethod $method * * @return string */ protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method) { - $name = strtolower(str_replace('\\', '_', $class->getName()).'_'.$method->getName()); + $name = strtolower(str_replace('\\', '_', $class->name).'_'.$method->name); if ($this->defaultRouteIndex > 0) { $name .= '_'.$this->defaultRouteIndex; } diff --git a/core/vendor/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php similarity index 89% rename from core/vendor/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php index 0fca30494299..f549fd0fb77e 100644 --- a/core/vendor/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php @@ -62,12 +62,7 @@ public function load($path, $type = null) } /** - * Returns true if this class supports the given resource. - * - * @param mixed $resource A resource - * @param string $type The resource type - * - * @return Boolean True if this class supports the given resource, false otherwise + * {@inheritdoc} */ public function supports($resource, $type = null) { diff --git a/core/vendor/Symfony/Component/Routing/Loader/AnnotationFileLoader.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationFileLoader.php similarity index 93% rename from core/vendor/Symfony/Component/Routing/Loader/AnnotationFileLoader.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationFileLoader.php index 49e1cb2f7752..bb965e9a45a0 100644 --- a/core/vendor/Symfony/Component/Routing/Loader/AnnotationFileLoader.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationFileLoader.php @@ -68,12 +68,7 @@ public function load($file, $type = null) } /** - * Returns true if this class supports the given resource. - * - * @param mixed $resource A resource - * @param string $type The resource type - * - * @return Boolean True if this class supports the given resource, false otherwise + * {@inheritdoc} */ public function supports($resource, $type = null) { diff --git a/core/vendor/Symfony/Component/Routing/Loader/ClosureLoader.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/ClosureLoader.php similarity index 79% rename from core/vendor/Symfony/Component/Routing/Loader/ClosureLoader.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Loader/ClosureLoader.php index ca49c8fa35a9..c5ad1e70ccb5 100644 --- a/core/vendor/Symfony/Component/Routing/Loader/ClosureLoader.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/ClosureLoader.php @@ -38,12 +38,7 @@ public function load($closure, $type = null) } /** - * Returns true if this class supports the given resource. - * - * @param mixed $resource A resource - * @param string $type The resource type - * - * @return Boolean True if this class supports the given resource, false otherwise + * {@inheritdoc} * * @api */ diff --git a/core/vendor/Symfony/Component/Routing/Loader/PhpFileLoader.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/PhpFileLoader.php similarity index 84% rename from core/vendor/Symfony/Component/Routing/Loader/PhpFileLoader.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Loader/PhpFileLoader.php index ffd31f94442d..de2104b8d0f3 100644 --- a/core/vendor/Symfony/Component/Routing/Loader/PhpFileLoader.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/PhpFileLoader.php @@ -48,12 +48,7 @@ public function load($file, $type = null) } /** - * Returns true if this class supports the given resource. - * - * @param mixed $resource A resource - * @param string $type The resource type - * - * @return Boolean True if this class supports the given resource, false otherwise + * {@inheritdoc} * * @api */ diff --git a/core/vendor/Symfony/Component/Routing/Loader/XmlFileLoader.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/XmlFileLoader.php similarity index 94% rename from core/vendor/Symfony/Component/Routing/Loader/XmlFileLoader.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Loader/XmlFileLoader.php index 8f27b03c300e..f83ce6f370d0 100644 --- a/core/vendor/Symfony/Component/Routing/Loader/XmlFileLoader.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/XmlFileLoader.php @@ -62,8 +62,8 @@ public function load($file, $type = null) * Parses a node from a loaded XML file. * * @param RouteCollection $collection the collection to associate with the node - * @param DOMElement $node the node to parse - * @param string $path the path of the XML file being processed + * @param DOMElement $node the node to parse + * @param string $path the path of the XML file being processed * @param string $file */ protected function parseNode(RouteCollection $collection, \DOMElement $node, $path, $file) @@ -110,12 +110,7 @@ protected function parseNode(RouteCollection $collection, \DOMElement $node, $pa } /** - * Returns true if this class supports the given resource. - * - * @param mixed $resource A resource - * @param string $type The resource type - * - * @return Boolean True if this class supports the given resource, false otherwise + * {@inheritdoc} * * @api */ diff --git a/core/vendor/Symfony/Component/Routing/Loader/YamlFileLoader.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/YamlFileLoader.php similarity index 93% rename from core/vendor/Symfony/Component/Routing/Loader/YamlFileLoader.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Loader/YamlFileLoader.php index 1f9d711f8145..d51e33918490 100644 --- a/core/vendor/Symfony/Component/Routing/Loader/YamlFileLoader.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/YamlFileLoader.php @@ -82,12 +82,7 @@ public function load($file, $type = null) } /** - * Returns true if this class supports the given resource. - * - * @param mixed $resource A resource - * @param string $type The resource type - * - * @return Boolean True if this class supports the given resource, false otherwise + * {@inheritdoc} * * @api */ @@ -124,7 +119,7 @@ protected function parseRoute(RouteCollection $collection, $name, $config, $file /** * Normalize route configuration. * - * @param array $config A resource config + * @param array $config A resource config * * @return array * diff --git a/core/vendor/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd similarity index 100% rename from core/vendor/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd rename to core/vendor/symfony/routing/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd diff --git a/core/vendor/Symfony/Component/Routing/Matcher/ApacheUrlMatcher.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/ApacheUrlMatcher.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Matcher/ApacheUrlMatcher.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/ApacheUrlMatcher.php diff --git a/core/vendor/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php similarity index 99% rename from core/vendor/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php index 7499bddff4b7..6e0561dd5843 100644 --- a/core/vendor/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php @@ -144,7 +144,7 @@ static private function escape($string, $char, $with) { $escaped = false; $output = ''; - foreach(str_split($string) as $symbol) { + foreach (str_split($string) as $symbol) { if ($escaped) { $output .= $symbol; $escaped = false; diff --git a/core/vendor/Symfony/Component/Routing/Matcher/Dumper/MatcherDumper.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumper.php similarity index 89% rename from core/vendor/Symfony/Component/Routing/Matcher/Dumper/MatcherDumper.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumper.php index 423368b57ed3..30778cc97a83 100644 --- a/core/vendor/Symfony/Component/Routing/Matcher/Dumper/MatcherDumper.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumper.php @@ -33,9 +33,7 @@ public function __construct(RouteCollection $routes) } /** - * Gets the routes to dump. - * - * @return RouteCollection A RouteCollection instance + * {@inheritdoc} */ public function getRoutes() { diff --git a/core/vendor/Symfony/Component/Routing/Matcher/Dumper/MatcherDumperInterface.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumperInterface.php similarity index 67% rename from core/vendor/Symfony/Component/Routing/Matcher/Dumper/MatcherDumperInterface.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumperInterface.php index 950c396089c6..08d03f5933a6 100644 --- a/core/vendor/Symfony/Component/Routing/Matcher/Dumper/MatcherDumperInterface.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumperInterface.php @@ -19,21 +19,17 @@ interface MatcherDumperInterface { /** - * Dumps a set of routes to a PHP class. + * Dumps a set of routes to a string representation of executable code + * that can then be used to match a request against these routes. * - * Available options: + * @param array $options An array of options * - * * class: The class name - * * base_class: The base class name - * - * @param array $options An array of options - * - * @return string A PHP class representing the matcher class + * @return string Executable code */ function dump(array $options = array()); /** - * Gets the routes to match. + * Gets the routes to dump. * * @return RouteCollection A RouteCollection instance */ diff --git a/core/vendor/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php similarity index 99% rename from core/vendor/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php index bc26c0cd0f7d..a8e0dcb183a4 100644 --- a/core/vendor/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php @@ -30,7 +30,7 @@ class PhpMatcherDumper extends MatcherDumper * * class: The class name * * base_class: The base class name * - * @param array $options An array of options + * @param array $options An array of options * * @return string A PHP class representing the matcher class */ @@ -231,6 +231,7 @@ private function compileRoute(Route $route, $name, $supportsRedirections, $paren goto $gotoname; } + EOF; } else { $methods = implode("', '", $methods); @@ -240,6 +241,7 @@ private function compileRoute(Route $route, $name, $supportsRedirections, $paren goto $gotoname; } + EOF; } } @@ -250,6 +252,7 @@ private function compileRoute(Route $route, $name, $supportsRedirections, $paren return \$this->redirect(\$pathinfo.'/', '$name'); } + EOF; } @@ -263,6 +266,7 @@ private function compileRoute(Route $route, $name, $supportsRedirections, $paren return \$this->redirect(\$pathinfo, '$name', '$scheme'); } + EOF; } @@ -271,7 +275,7 @@ private function compileRoute(Route $route, $name, $supportsRedirections, $paren $code .= sprintf(" return array_merge(\$this->mergeDefaults(\$matches, %s), array('_route' => '%s'));\n" , str_replace("\n", '', var_export($compiledRoute->getDefaults(), true)), $name); } elseif (true === $matches) { - $code .= sprintf(" \$matches['_route'] = '%s';\n", $name); + $code .= sprintf(" \$matches['_route'] = '%s';\n\n", $name); $code .= " return \$matches;\n"; } elseif ($compiledRoute->getDefaults()) { $code .= sprintf(" return %s;\n", str_replace("\n", '', var_export(array_merge($compiledRoute->getDefaults(), array('_route' => $name)), true))); diff --git a/core/vendor/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php similarity index 96% rename from core/vendor/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php index ee8005dc73bc..8826c59854de 100644 --- a/core/vendor/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php @@ -22,9 +22,7 @@ abstract class RedirectableUrlMatcher extends UrlMatcher implements RedirectableUrlMatcherInterface { /** - * @see UrlMatcher::match() - * - * @api + * {@inheritdoc} */ public function match($pathinfo) { diff --git a/core/vendor/Symfony/Component/Routing/Matcher/RedirectableUrlMatcherInterface.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcherInterface.php similarity index 77% rename from core/vendor/Symfony/Component/Routing/Matcher/RedirectableUrlMatcherInterface.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcherInterface.php index 72a2ec46552b..7225c81cd543 100644 --- a/core/vendor/Symfony/Component/Routing/Matcher/RedirectableUrlMatcherInterface.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcherInterface.php @@ -23,9 +23,9 @@ interface RedirectableUrlMatcherInterface /** * Redirects the user to another URL. * - * @param string $path The path info to redirect to. - * @param string $route The route that matched - * @param string $scheme The URL scheme (null to keep the current one) + * @param string $path The path info to redirect to. + * @param string $route The route that matched + * @param string $scheme The URL scheme (null to keep the current one) * * @return array An array of parameters * diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RequestMatcherInterface.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RequestMatcherInterface.php new file mode 100644 index 000000000000..6a5c235ac0e6 --- /dev/null +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RequestMatcherInterface.php @@ -0,0 +1,40 @@ +<?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. + */ + +namespace Symfony\Component\Routing\Matcher; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\RequestContextAwareInterface; +use Symfony\Component\Routing\Exception\ResourceNotFoundException; +use Symfony\Component\Routing\Exception\MethodNotAllowedException; + +/** + * UrlMatcherInterface is the interface that all URL matcher classes must implement. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +interface RequestMatcherInterface extends RequestContextAwareInterface +{ + /** + * Tries to match a request with a set of routes. + * + * If the matcher can not find information, it must throw one of the exceptions documented + * below. + * + * @param Request $request The request to match + * + * @return array An array of parameters + * + * @throws ResourceNotFoundException If no matching resource could be found + * @throws MethodNotAllowedException If a matching resource was found but the request method is not allowed + */ + function matchRequest(Request $request); +} diff --git a/core/vendor/Symfony/Component/Routing/Matcher/TraceableUrlMatcher.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/TraceableUrlMatcher.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Matcher/TraceableUrlMatcher.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/TraceableUrlMatcher.php diff --git a/core/vendor/Symfony/Component/Routing/Matcher/UrlMatcher.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcher.php similarity index 89% rename from core/vendor/Symfony/Component/Routing/Matcher/UrlMatcher.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcher.php index ded89e637bbe..33c7f54c1819 100644 --- a/core/vendor/Symfony/Component/Routing/Matcher/UrlMatcher.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcher.php @@ -50,11 +50,7 @@ public function __construct(RouteCollection $routes, RequestContext $context) } /** - * Sets the request context. - * - * @param RequestContext $context The context - * - * @api + * {@inheritdoc} */ public function setContext(RequestContext $context) { @@ -62,9 +58,7 @@ public function setContext(RequestContext $context) } /** - * Gets the request context. - * - * @return RequestContext The context + * {@inheritdoc} */ public function getContext() { @@ -72,16 +66,7 @@ public function getContext() } /** - * Tries to match a URL with a set of routes. - * - * @param string $pathinfo The path info to be parsed (raw format, i.e. not urldecoded) - * - * @return array An array of parameters - * - * @throws ResourceNotFoundException If the resource could not be found - * @throws MethodNotAllowedException If the resource was found but the request method is not allowed - * - * @api + * {@inheritdoc} */ public function match($pathinfo) { @@ -177,8 +162,16 @@ protected function handleRouteRequirements($pathinfo, $name, Route $route) $status = $scheme && $scheme !== $this->context->getScheme() ? self::REQUIREMENT_MISMATCH : self::REQUIREMENT_MATCH; return array($status, null); - } + } + /** + * Get merged default parameters. + * + * @param array $params The parameters + * @param array $defaults The defaults + * + * @return array Merged default parameters + */ protected function mergeDefaults($params, $defaults) { $parameters = $defaults; diff --git a/core/vendor/Symfony/Component/Routing/Matcher/UrlMatcherInterface.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcherInterface.php similarity index 92% rename from core/vendor/Symfony/Component/Routing/Matcher/UrlMatcherInterface.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcherInterface.php index 58c5688ad980..afccf8009eee 100644 --- a/core/vendor/Symfony/Component/Routing/Matcher/UrlMatcherInterface.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcherInterface.php @@ -30,7 +30,7 @@ interface UrlMatcherInterface extends RequestContextAwareInterface * If the matcher can not find information, it must throw one of the exceptions documented * below. * - * @param string $pathinfo The path info to be parsed (raw format, i.e. not urldecoded) + * @param string $pathinfo The path info to be parsed (raw format, i.e. not urldecoded) * * @return array An array of parameters * diff --git a/core/vendor/Symfony/Component/Routing/README.md b/core/vendor/symfony/routing/Symfony/Component/Routing/README.md similarity index 78% rename from core/vendor/Symfony/Component/Routing/README.md rename to core/vendor/symfony/routing/Symfony/Component/Routing/README.md index 63c398cfa651..61504c84d946 100644 --- a/core/vendor/Symfony/Component/Routing/README.md +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/README.md @@ -29,12 +29,9 @@ Resources You can run the unit tests with the following command: - phpunit -c src/Symfony/Component/Routing/ + phpunit If you also want to run the unit tests that depend on other Symfony -Components, declare the following environment variables before running -PHPUnit: +Components, install dev dependencies before running PHPUnit: - export SYMFONY_CONFIG=../path/to/Config - export SYMFONY_YAML=../path/to/Yaml - export DOCTRINE_COMMON=../path/to/doctrine-common + php composer.phar install --dev diff --git a/core/vendor/Symfony/Component/Routing/RequestContext.php b/core/vendor/symfony/routing/Symfony/Component/Routing/RequestContext.php similarity index 99% rename from core/vendor/Symfony/Component/Routing/RequestContext.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/RequestContext.php index 013d9427754c..7406b20439c4 100644 --- a/core/vendor/Symfony/Component/Routing/RequestContext.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/RequestContext.php @@ -250,7 +250,7 @@ public function hasParameter($name) /** * Sets a parameter value. * - * @param string $name A parameter name + * @param string $name A parameter name * @param mixed $parameter The parameter value * * @api diff --git a/core/vendor/Symfony/Component/Routing/RequestContextAwareInterface.php b/core/vendor/symfony/routing/Symfony/Component/Routing/RequestContextAwareInterface.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/RequestContextAwareInterface.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/RequestContextAwareInterface.php diff --git a/core/vendor/Symfony/Component/Routing/Route.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Route.php similarity index 96% rename from core/vendor/Symfony/Component/Routing/Route.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Route.php index 05d8a74e8273..f18b0ed7570e 100644 --- a/core/vendor/Symfony/Component/Routing/Route.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Route.php @@ -35,10 +35,10 @@ class Route * * * compiler_class: A class name able to compile this route instance (RouteCompiler by default) * - * @param string $pattern The pattern to match - * @param array $defaults An array of default parameter values - * @param array $requirements An array of requirements for parameters (regexes) - * @param array $options An array of options + * @param string $pattern The pattern to match + * @param array $defaults An array of default parameter values + * @param array $requirements An array of requirements for parameters (regexes) + * @param array $options An array of options * * @api */ @@ -314,7 +314,7 @@ public function getRequirement($key) /** * Sets a requirement for the given key. * - * @param string $key The key + * @param string $key The key * @param string $regex The regex * * @return Route The current Route instance diff --git a/core/vendor/Symfony/Component/Routing/RouteCollection.php b/core/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/RouteCollection.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php diff --git a/core/vendor/Symfony/Component/Routing/RouteCompiler.php b/core/vendor/symfony/routing/Symfony/Component/Routing/RouteCompiler.php similarity index 84% rename from core/vendor/Symfony/Component/Routing/RouteCompiler.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/RouteCompiler.php index dc5e5e62c661..b93d36b446a2 100644 --- a/core/vendor/Symfony/Component/Routing/RouteCompiler.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/RouteCompiler.php @@ -21,11 +21,9 @@ class RouteCompiler implements RouteCompilerInterface const REGEX_DELIMITER = '#'; /** - * Compiles the current route instance. + * {@inheritDoc} * - * @param Route $route A Route instance - * - * @return CompiledRoute A CompiledRoute instance + * @throws \LogicException If a variable is referenced more than once */ public function compile(Route $route) { @@ -34,22 +32,26 @@ public function compile(Route $route) $tokens = array(); $variables = array(); $pos = 0; - preg_match_all('#.\{([\w\d_]+)\}#', $pattern, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER); + preg_match_all('#.\{(\w+)\}#', $pattern, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER); foreach ($matches as $match) { if ($text = substr($pattern, $pos, $match[0][1] - $pos)) { $tokens[] = array('text', $text); } - $seps = array($pattern[$pos]); + $pos = $match[0][1] + strlen($match[0][0]); $var = $match[1][0]; if ($req = $route->getRequirement($var)) { $regexp = $req; } else { + // Use the character preceding the variable as a separator + $separators = array($match[0][0][0]); + if ($pos !== $len) { - $seps[] = $pattern[$pos]; + // Use the character following the variable as the separator when available + $separators[] = $pattern[$pos]; } - $regexp = sprintf('[^%s]+?', preg_quote(implode('', array_unique($seps)), self::REGEX_DELIMITER)); + $regexp = sprintf('[^%s]+', preg_quote(implode('', array_unique($separators)), self::REGEX_DELIMITER)); } $tokens[] = array('variable', $match[0][0][0], $regexp, $var); @@ -103,12 +105,12 @@ public function compile(Route $route) private function computeRegexp(array $tokens, $index, $firstOptional) { $token = $tokens[$index]; - if('text' === $token[0]) { + if ('text' === $token[0]) { // Text tokens return preg_quote($token[1], self::REGEX_DELIMITER); } else { // Variable tokens - if (0 === $index && 0 === $firstOptional && 1 == count($tokens)) { + if (0 === $index && 0 === $firstOptional) { // When the only token is an optional variable token, the separator is required return sprintf('%s(?<%s>%s)?', preg_quote($token[1], self::REGEX_DELIMITER), $token[3], $token[2]); } else { @@ -121,7 +123,7 @@ private function computeRegexp(array $tokens, $index, $firstOptional) $nbTokens = count($tokens); if ($nbTokens - 1 == $index) { // Close the optional subpatterns - $regexp .= str_repeat(")?", $nbTokens - $firstOptional); + $regexp .= str_repeat(")?", $nbTokens - $firstOptional - (0 === $firstOptional ? 1 : 0)); } } diff --git a/core/vendor/Symfony/Component/Routing/RouteCompilerInterface.php b/core/vendor/symfony/routing/Symfony/Component/Routing/RouteCompilerInterface.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/RouteCompilerInterface.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/RouteCompilerInterface.php diff --git a/core/vendor/Symfony/Component/Routing/Router.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Router.php similarity index 81% rename from core/vendor/Symfony/Component/Routing/Router.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Router.php index 34970290391f..2e0333e6734e 100644 --- a/core/vendor/Symfony/Component/Routing/Router.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Router.php @@ -13,6 +13,7 @@ use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\Config\ConfigCache; +use Symfony\Component\HttpKernel\Log\LoggerInterface; /** * The Router class is an example of the integration of all pieces of the @@ -24,12 +25,12 @@ class Router implements RouterInterface { protected $matcher; protected $generator; - protected $defaults; protected $context; protected $loader; protected $collection; protected $resource; protected $options; + protected $logger; /** * Constructor. @@ -38,14 +39,14 @@ class Router implements RouterInterface * @param mixed $resource The main resource to load * @param array $options An array of options * @param RequestContext $context The context - * @param array $defaults The default values + * @param LoggerInterface $logger A logger instance */ - public function __construct(LoaderInterface $loader, $resource, array $options = array(), RequestContext $context = null, array $defaults = array()) + public function __construct(LoaderInterface $loader, $resource, array $options = array(), RequestContext $context = null, LoggerInterface $logger = null) { $this->loader = $loader; $this->resource = $resource; + $this->logger = $logger; $this->context = null === $context ? new RequestContext() : $context; - $this->defaults = $defaults; $this->setOptions($options); } @@ -76,6 +77,7 @@ public function setOptions(array $options) 'matcher_dumper_class' => 'Symfony\\Component\\Routing\\Matcher\\Dumper\\PhpMatcherDumper', 'matcher_cache_class' => 'ProjectUrlMatcher', 'resource_type' => null, + 'strict_parameters' => true, ); // check option names and live merge, if errors are encountered Exception will be thrown @@ -131,9 +133,7 @@ public function getOption($key) } /** - * Gets the RouteCollection instance associated with this Router. - * - * @return RouteCollection A RouteCollection instance + * {@inheritdoc} */ public function getRouteCollection() { @@ -145,9 +145,7 @@ public function getRouteCollection() } /** - * Sets the request context. - * - * @param RequestContext $context The context + * {@inheritdoc} */ public function setContext(RequestContext $context) { @@ -158,9 +156,7 @@ public function setContext(RequestContext $context) } /** - * Gets the request context. - * - * @return RequestContext The context + * {@inheritdoc} */ public function getContext() { @@ -195,7 +191,7 @@ public function getMatcher() } if (null === $this->options['cache_dir'] || null === $this->options['matcher_cache_class']) { - return $this->matcher = new $this->options['matcher_class']($this->getRouteCollection(), $this->context, $this->defaults); + return $this->matcher = new $this->options['matcher_class']($this->getRouteCollection(), $this->context); } $class = $this->options['matcher_cache_class']; @@ -213,7 +209,7 @@ public function getMatcher() require_once $cache; - return $this->matcher = new $class($this->context, $this->defaults); + return $this->matcher = new $class($this->context); } /** @@ -228,24 +224,30 @@ public function getGenerator() } if (null === $this->options['cache_dir'] || null === $this->options['generator_cache_class']) { - return $this->generator = new $this->options['generator_class']($this->getRouteCollection(), $this->context, $this->defaults); - } - - $class = $this->options['generator_cache_class']; - $cache = new ConfigCache($this->options['cache_dir'].'/'.$class.'.php', $this->options['debug']); - if (!$cache->isFresh($class)) { - $dumper = new $this->options['generator_dumper_class']($this->getRouteCollection()); + $this->generator = new $this->options['generator_class']($this->getRouteCollection(), $this->context, $this->logger); + } else { + $class = $this->options['generator_cache_class']; + $cache = new ConfigCache($this->options['cache_dir'].'/'.$class.'.php', $this->options['debug']); + if (!$cache->isFresh($class)) { + $dumper = new $this->options['generator_dumper_class']($this->getRouteCollection()); + + $options = array( + 'class' => $class, + 'base_class' => $this->options['generator_base_class'], + ); + + $cache->write($dumper->dump($options), $this->getRouteCollection()->getResources()); + } - $options = array( - 'class' => $class, - 'base_class' => $this->options['generator_base_class'], - ); + require_once $cache; - $cache->write($dumper->dump($options), $this->getRouteCollection()->getResources()); + $this->generator = new $class($this->context, $this->logger); } - require_once $cache; + if (false === $this->options['strict_parameters']) { + $this->generator->setStrictParameters(false); + } - return $this->generator = new $class($this->context, $this->defaults); + return $this->generator; } } diff --git a/core/vendor/Symfony/Component/Routing/RouterInterface.php b/core/vendor/symfony/routing/Symfony/Component/Routing/RouterInterface.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/RouterInterface.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/RouterInterface.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/Annotation/RouteTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Annotation/RouteTest.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Annotation/RouteTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Annotation/RouteTest.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/CompiledRouteTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/CompiledRouteTest.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/CompiledRouteTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/CompiledRouteTest.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/AnnotatedClasses/AbstractClass.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/AnnotatedClasses/AbstractClass.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/AnnotatedClasses/AbstractClass.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/AnnotatedClasses/AbstractClass.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/AnnotatedClasses/FooClass.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/AnnotatedClasses/FooClass.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/AnnotatedClasses/FooClass.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/AnnotatedClasses/FooClass.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/CustomXmlFileLoader.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/CustomXmlFileLoader.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/CustomXmlFileLoader.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/CustomXmlFileLoader.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/RedirectableUrlMatcher.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/RedirectableUrlMatcher.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/RedirectableUrlMatcher.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/RedirectableUrlMatcher.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/annotated.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/annotated.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/annotated.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/annotated.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.apache b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.apache similarity index 79% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.apache rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.apache index a93799808983..25f6060fdd33 100644 --- a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.apache +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.apache @@ -7,17 +7,17 @@ RewriteCond %{REQUEST_URI} ^/foo/(baz|symfony)$ RewriteRule .* app.php [QSA,L,E=_ROUTING__route:foo,E=_ROUTING_bar:%1,E=_ROUTING_def:test] # bar -RewriteCond %{REQUEST_URI} ^/bar/([^/]+?)$ +RewriteCond %{REQUEST_URI} ^/bar/([^/]+)$ RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [NC] RewriteRule .* - [S=1,E=_ROUTING__allow_GET:1,E=_ROUTING__allow_HEAD:1] -RewriteCond %{REQUEST_URI} ^/bar/([^/]+?)$ +RewriteCond %{REQUEST_URI} ^/bar/([^/]+)$ RewriteRule .* app.php [QSA,L,E=_ROUTING__route:bar,E=_ROUTING_foo:%1] # baragain -RewriteCond %{REQUEST_URI} ^/baragain/([^/]+?)$ +RewriteCond %{REQUEST_URI} ^/baragain/([^/]+)$ RewriteCond %{REQUEST_METHOD} !^(GET|POST|HEAD)$ [NC] RewriteRule .* - [S=1,E=_ROUTING__allow_GET:1,E=_ROUTING__allow_POST:1,E=_ROUTING__allow_HEAD:1] -RewriteCond %{REQUEST_URI} ^/baragain/([^/]+?)$ +RewriteCond %{REQUEST_URI} ^/baragain/([^/]+)$ RewriteRule .* app.php [QSA,L,E=_ROUTING__route:baragain,E=_ROUTING_foo:%1] # baz @@ -35,25 +35,25 @@ RewriteCond %{REQUEST_URI} ^/test/baz3/$ RewriteRule .* app.php [QSA,L,E=_ROUTING__route:baz3] # baz4 -RewriteCond %{REQUEST_URI} ^/test/([^/]+?)$ +RewriteCond %{REQUEST_URI} ^/test/([^/]+)$ RewriteRule .* $0/ [QSA,L,R=301] -RewriteCond %{REQUEST_URI} ^/test/([^/]+?)/$ +RewriteCond %{REQUEST_URI} ^/test/([^/]+)/$ RewriteRule .* app.php [QSA,L,E=_ROUTING__route:baz4,E=_ROUTING_foo:%1] # baz5 -RewriteCond %{REQUEST_URI} ^/test/([^/]+?)/$ +RewriteCond %{REQUEST_URI} ^/test/([^/]+)/$ RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [NC] RewriteRule .* - [S=2,E=_ROUTING__allow_GET:1,E=_ROUTING__allow_HEAD:1] -RewriteCond %{REQUEST_URI} ^/test/([^/]+?)$ +RewriteCond %{REQUEST_URI} ^/test/([^/]+)$ RewriteRule .* $0/ [QSA,L,R=301] -RewriteCond %{REQUEST_URI} ^/test/([^/]+?)/$ +RewriteCond %{REQUEST_URI} ^/test/([^/]+)/$ RewriteRule .* app.php [QSA,L,E=_ROUTING__route:baz5,E=_ROUTING_foo:%1] # baz5unsafe -RewriteCond %{REQUEST_URI} ^/testunsafe/([^/]+?)/$ +RewriteCond %{REQUEST_URI} ^/testunsafe/([^/]+)/$ RewriteCond %{REQUEST_METHOD} !^(POST)$ [NC] RewriteRule .* - [S=1,E=_ROUTING__allow_POST:1] -RewriteCond %{REQUEST_URI} ^/testunsafe/([^/]+?)/$ +RewriteCond %{REQUEST_URI} ^/testunsafe/([^/]+)/$ RewriteRule .* app.php [QSA,L,E=_ROUTING__route:baz5unsafe,E=_ROUTING_foo:%1] # baz6 diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php similarity index 85% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php index 2c764d0df3c2..53e86fa36441 100644 --- a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php @@ -31,23 +31,27 @@ public function match($pathinfo) } // bar - if (0 === strpos($pathinfo, '/bar') && preg_match('#^/bar/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/bar') && preg_match('#^/bar/(?<foo>[^/]+)$#s', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) { $allow = array_merge($allow, array('GET', 'HEAD')); goto not_bar; } + $matches['_route'] = 'bar'; + return $matches; } not_bar: // barhead - if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?<foo>[^/]+)$#s', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) { $allow = array_merge($allow, array('GET', 'HEAD')); goto not_barhead; } + $matches['_route'] = 'barhead'; + return $matches; } not_barhead: @@ -68,29 +72,34 @@ public function match($pathinfo) } // baz4 - if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?<foo>[^/]+?)/$#s', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?<foo>[^/]+)/$#s', $pathinfo, $matches)) { $matches['_route'] = 'baz4'; + return $matches; } // baz5 - if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?<foo>[^/]+?)/$#s', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?<foo>[^/]+)/$#s', $pathinfo, $matches)) { if ($this->context->getMethod() != 'POST') { $allow[] = 'POST'; goto not_baz5; } + $matches['_route'] = 'baz5'; + return $matches; } not_baz5: // baz.baz6 - if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?<foo>[^/]+?)/$#s', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?<foo>[^/]+)/$#s', $pathinfo, $matches)) { if ($this->context->getMethod() != 'PUT') { $allow[] = 'PUT'; goto not_bazbaz6; } + $matches['_route'] = 'baz.baz6'; + return $matches; } not_bazbaz6: @@ -103,6 +112,7 @@ public function match($pathinfo) // quoter if (preg_match('#^/(?<quoter>[\']+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'quoter'; + return $matches; } @@ -114,14 +124,16 @@ public function match($pathinfo) if (0 === strpos($pathinfo, '/a')) { if (0 === strpos($pathinfo, '/a/b\'b')) { // foo1 - if (preg_match('#^/a/b\'b/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) { + if (preg_match('#^/a/b\'b/(?<foo>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'foo1'; + return $matches; } // bar1 - if (preg_match('#^/a/b\'b/(?<bar>[^/]+?)$#s', $pathinfo, $matches)) { + if (preg_match('#^/a/b\'b/(?<bar>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'bar1'; + return $matches; } @@ -130,19 +142,22 @@ public function match($pathinfo) // overriden if (preg_match('#^/a/(?<var>.*)$#s', $pathinfo, $matches)) { $matches['_route'] = 'overriden'; + return $matches; } if (0 === strpos($pathinfo, '/a/b\'b')) { // foo2 - if (preg_match('#^/a/b\'b/(?<foo1>[^/]+?)$#s', $pathinfo, $matches)) { + if (preg_match('#^/a/b\'b/(?<foo1>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'foo2'; + return $matches; } // bar2 - if (preg_match('#^/a/b\'b/(?<bar1>[^/]+?)$#s', $pathinfo, $matches)) { + if (preg_match('#^/a/b\'b/(?<bar1>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'bar2'; + return $matches; } @@ -152,7 +167,7 @@ public function match($pathinfo) if (0 === strpos($pathinfo, '/multi')) { // helloWorld - if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?<who>[^/]+?))?$#s', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?<who>[^/]+))?$#s', $pathinfo, $matches)) { return array_merge($this->mergeDefaults($matches, array ( 'who' => 'World!',)), array('_route' => 'helloWorld')); } @@ -169,14 +184,16 @@ public function match($pathinfo) } // foo3 - if (preg_match('#^/(?<_locale>[^/]+?)/b/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) { + if (preg_match('#^/(?<_locale>[^/]+)/b/(?<foo>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'foo3'; + return $matches; } // bar3 - if (preg_match('#^/(?<_locale>[^/]+?)/b/(?<bar>[^/]+?)$#s', $pathinfo, $matches)) { + if (preg_match('#^/(?<_locale>[^/]+)/b/(?<bar>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'bar3'; + return $matches; } @@ -186,8 +203,9 @@ public function match($pathinfo) } // foo4 - if (0 === strpos($pathinfo, '/aba') && preg_match('#^/aba/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/aba') && preg_match('#^/aba/(?<foo>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'foo4'; + return $matches; } @@ -199,14 +217,16 @@ public function match($pathinfo) if (0 === strpos($pathinfo, '/a/b')) { // b - if (preg_match('#^/a/b/(?<var>[^/]+?)$#s', $pathinfo, $matches)) { + if (preg_match('#^/a/b/(?<var>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'b'; + return $matches; } // c - if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?<var>[^/]+?)$#s', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?<var>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'c'; + return $matches; } diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.apache b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.apache similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.apache rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.apache diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php similarity index 87% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php index 4b9af5c5a159..a3c105cc8be5 100644 --- a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php @@ -31,23 +31,27 @@ public function match($pathinfo) } // bar - if (0 === strpos($pathinfo, '/bar') && preg_match('#^/bar/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/bar') && preg_match('#^/bar/(?<foo>[^/]+)$#s', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) { $allow = array_merge($allow, array('GET', 'HEAD')); goto not_bar; } + $matches['_route'] = 'bar'; + return $matches; } not_bar: // barhead - if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?<foo>[^/]+)$#s', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) { $allow = array_merge($allow, array('GET', 'HEAD')); goto not_barhead; } + $matches['_route'] = 'barhead'; + return $matches; } not_barhead: @@ -67,36 +71,43 @@ public function match($pathinfo) if (substr($pathinfo, -1) !== '/') { return $this->redirect($pathinfo.'/', 'baz3'); } + return array('_route' => 'baz3'); } // baz4 - if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?<foo>[^/]+?)/?$#s', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?<foo>[^/]+)/?$#s', $pathinfo, $matches)) { if (substr($pathinfo, -1) !== '/') { return $this->redirect($pathinfo.'/', 'baz4'); } + $matches['_route'] = 'baz4'; + return $matches; } // baz5 - if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?<foo>[^/]+?)/$#s', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?<foo>[^/]+)/$#s', $pathinfo, $matches)) { if ($this->context->getMethod() != 'POST') { $allow[] = 'POST'; goto not_baz5; } + $matches['_route'] = 'baz5'; + return $matches; } not_baz5: // baz.baz6 - if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?<foo>[^/]+?)/$#s', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?<foo>[^/]+)/$#s', $pathinfo, $matches)) { if ($this->context->getMethod() != 'PUT') { $allow[] = 'PUT'; goto not_bazbaz6; } + $matches['_route'] = 'baz.baz6'; + return $matches; } not_bazbaz6: @@ -109,6 +120,7 @@ public function match($pathinfo) // quoter if (preg_match('#^/(?<quoter>[\']+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'quoter'; + return $matches; } @@ -120,14 +132,16 @@ public function match($pathinfo) if (0 === strpos($pathinfo, '/a')) { if (0 === strpos($pathinfo, '/a/b\'b')) { // foo1 - if (preg_match('#^/a/b\'b/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) { + if (preg_match('#^/a/b\'b/(?<foo>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'foo1'; + return $matches; } // bar1 - if (preg_match('#^/a/b\'b/(?<bar>[^/]+?)$#s', $pathinfo, $matches)) { + if (preg_match('#^/a/b\'b/(?<bar>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'bar1'; + return $matches; } @@ -136,19 +150,22 @@ public function match($pathinfo) // overriden if (preg_match('#^/a/(?<var>.*)$#s', $pathinfo, $matches)) { $matches['_route'] = 'overriden'; + return $matches; } if (0 === strpos($pathinfo, '/a/b\'b')) { // foo2 - if (preg_match('#^/a/b\'b/(?<foo1>[^/]+?)$#s', $pathinfo, $matches)) { + if (preg_match('#^/a/b\'b/(?<foo1>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'foo2'; + return $matches; } // bar2 - if (preg_match('#^/a/b\'b/(?<bar1>[^/]+?)$#s', $pathinfo, $matches)) { + if (preg_match('#^/a/b\'b/(?<bar1>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'bar2'; + return $matches; } @@ -158,7 +175,7 @@ public function match($pathinfo) if (0 === strpos($pathinfo, '/multi')) { // helloWorld - if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?<who>[^/]+?))?$#s', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?<who>[^/]+))?$#s', $pathinfo, $matches)) { return array_merge($this->mergeDefaults($matches, array ( 'who' => 'World!',)), array('_route' => 'helloWorld')); } @@ -172,20 +189,23 @@ public function match($pathinfo) if (substr($pathinfo, -1) !== '/') { return $this->redirect($pathinfo.'/', 'hey'); } + return array('_route' => 'hey'); } } // foo3 - if (preg_match('#^/(?<_locale>[^/]+?)/b/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) { + if (preg_match('#^/(?<_locale>[^/]+)/b/(?<foo>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'foo3'; + return $matches; } // bar3 - if (preg_match('#^/(?<_locale>[^/]+?)/b/(?<bar>[^/]+?)$#s', $pathinfo, $matches)) { + if (preg_match('#^/(?<_locale>[^/]+)/b/(?<bar>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'bar3'; + return $matches; } @@ -195,8 +215,9 @@ public function match($pathinfo) } // foo4 - if (0 === strpos($pathinfo, '/aba') && preg_match('#^/aba/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/aba') && preg_match('#^/aba/(?<foo>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'foo4'; + return $matches; } @@ -208,14 +229,16 @@ public function match($pathinfo) if (0 === strpos($pathinfo, '/a/b')) { // b - if (preg_match('#^/a/b/(?<var>[^/]+?)$#s', $pathinfo, $matches)) { + if (preg_match('#^/a/b/(?<var>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'b'; + return $matches; } // c - if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?<var>[^/]+?)$#s', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?<var>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'c'; + return $matches; } @@ -228,6 +251,7 @@ public function match($pathinfo) if ($this->context->getScheme() !== 'https') { return $this->redirect($pathinfo, 'secure', 'https'); } + return array('_route' => 'secure'); } @@ -236,6 +260,7 @@ public function match($pathinfo) if ($this->context->getScheme() !== 'http') { return $this->redirect($pathinfo, 'nonsecure', 'http'); } + return array('_route' => 'nonsecure'); } diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php similarity index 92% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php index 3373931ba616..13ffeb95e43e 100644 --- a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php @@ -32,8 +32,9 @@ public function match($pathinfo) } // dynamic - if (preg_match('#^/rootprefix/(?<var>[^/]+?)$#s', $pathinfo, $matches)) { + if (preg_match('#^/rootprefix/(?<var>[^/]+)$#s', $pathinfo, $matches)) { $matches['_route'] = 'dynamic'; + return $matches; } diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/empty.yml b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/empty.yml similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/empty.yml rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/empty.yml diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/foo.xml b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/foo.xml similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/foo.xml rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/foo.xml diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/foo1.xml b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/foo1.xml similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/foo1.xml rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/foo1.xml diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/incomplete.yml b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/incomplete.yml similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/incomplete.yml rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/incomplete.yml diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/nonvalid.xml b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/nonvalid.xml similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/nonvalid.xml rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/nonvalid.xml diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/nonvalid.yml b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/nonvalid.yml similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/nonvalid.yml rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/nonvalid.yml diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/nonvalidkeys.yml b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/nonvalidkeys.yml similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/nonvalidkeys.yml rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/nonvalidkeys.yml diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/nonvalidnode.xml b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/nonvalidnode.xml similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/nonvalidnode.xml rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/nonvalidnode.xml diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/nonvalidroute.xml b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/nonvalidroute.xml similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/nonvalidroute.xml rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/nonvalidroute.xml diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/validpattern.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validpattern.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/validpattern.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validpattern.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/validpattern.xml b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validpattern.xml similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/validpattern.xml rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validpattern.xml diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/validpattern.yml b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validpattern.yml similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/validpattern.yml rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validpattern.yml diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/validresource.xml b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validresource.xml similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/validresource.xml rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validresource.xml diff --git a/core/vendor/Symfony/Component/Routing/Tests/Fixtures/validresource.yml b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validresource.yml similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Fixtures/validresource.yml rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validresource.yml diff --git a/core/vendor/Symfony/Component/Routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php similarity index 97% rename from core/vendor/Symfony/Component/Routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php index 7a3dabe4d038..6a86736abbb1 100644 --- a/core/vendor/Symfony/Component/Routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\Routing\Tests\Generator\Dumper\PhpGeneratorDumper; +namespace Symfony\Component\Routing\Tests\Generator\Dumper; use Symfony\Component\Routing\RouteCollection; use Symfony\Component\Routing\Route; @@ -38,7 +38,7 @@ protected function setUp() parent::setUp(); $this->routeCollection = new RouteCollection(); - $this->generatorDumper = new PhpGeneratorDumper($this->routeCollection, new RequestContext()); + $this->generatorDumper = new PhpGeneratorDumper($this->routeCollection); $this->testTmpFilepath = sys_get_temp_dir().DIRECTORY_SEPARATOR.'php_generator.php'; @unlink($this->testTmpFilepath); } diff --git a/core/vendor/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php similarity index 87% rename from core/vendor/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php index e4834e55110b..b9a116f45483 100644 --- a/core/vendor/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php @@ -165,6 +165,29 @@ public function testGenerateForRouteWithInvalidOptionalParameter() $this->getGenerator($routes)->generate('test', array('foo' => 'bar'), true); } + public function testGenerateForRouteWithInvalidOptionalParameterNonStrict() + { + $routes = $this->getRoutes('test', new Route('/testing/{foo}', array('foo' => '1'), array('foo' => 'd+'))); + $generator = $this->getGenerator($routes); + $generator->setStrictParameters(false); + $this->assertNull($generator->generate('test', array('foo' => 'bar'), true)); + } + + public function testGenerateForRouteWithInvalidOptionalParameterNonStrictWithLogger() + { + if (!class_exists('Symfony\Component\HttpKernel\Log\LoggerInterface')) { + $this->markTestSkipped('The "HttpKernel" component is not available'); + } + + $routes = $this->getRoutes('test', new Route('/testing/{foo}', array('foo' => '1'), array('foo' => 'd+'))); + $logger = $this->getMock('Symfony\Component\HttpKernel\Log\LoggerInterface'); + $logger->expects($this->once()) + ->method('err'); + $generator = $this->getGenerator($routes, array(), $logger); + $generator->setStrictParameters(false); + $this->assertNull($generator->generate('test', array('foo' => 'bar'), true)); + } + /** * @expectedException Symfony\Component\Routing\Exception\InvalidParameterException */ @@ -206,14 +229,14 @@ public function testWithAnIntegerAsADefaultValue() $this->assertEquals('/app.php/foo', $this->getGenerator($routes)->generate('test', array('default' => 'foo'))); } - protected function getGenerator(RouteCollection $routes, array $parameters = array()) + protected function getGenerator(RouteCollection $routes, array $parameters = array(), $logger = null) { $context = new RequestContext('/app.php'); foreach ($parameters as $key => $value) { $method = 'set'.$key; $context->$method($value); } - $generator = new UrlGenerator($routes, $context); + $generator = new UrlGenerator($routes, $context, $logger); return $generator; } diff --git a/core/vendor/Symfony/Component/Routing/Tests/Loader/AbstractAnnotationLoaderTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/AbstractAnnotationLoaderTest.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Loader/AbstractAnnotationLoaderTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/AbstractAnnotationLoaderTest.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/Loader/AnnotationDirectoryLoaderTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/AnnotationDirectoryLoaderTest.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Loader/AnnotationDirectoryLoaderTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/AnnotationDirectoryLoaderTest.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/Loader/AnnotationFileLoaderTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/AnnotationFileLoaderTest.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Loader/AnnotationFileLoaderTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/AnnotationFileLoaderTest.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/Loader/ClosureLoaderTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/ClosureLoaderTest.php similarity index 96% rename from core/vendor/Symfony/Component/Routing/Tests/Loader/ClosureLoaderTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/ClosureLoaderTest.php index 6c34fe460830..d9e3ff50d71e 100644 --- a/core/vendor/Symfony/Component/Routing/Tests/Loader/ClosureLoaderTest.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/ClosureLoaderTest.php @@ -48,8 +48,7 @@ public function testLoad() $loader = new ClosureLoader(); $route = new Route('/'); - $routes = $loader->load(function () use ($route) - { + $routes = $loader->load(function () use ($route) { $routes = new RouteCollection(); $routes->add('foo', $route); diff --git a/core/vendor/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/Loader/YamlFileLoaderTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/YamlFileLoaderTest.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Loader/YamlFileLoaderTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/YamlFileLoaderTest.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/Matcher/ApacheUrlMatcherTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/ApacheUrlMatcherTest.php similarity index 95% rename from core/vendor/Symfony/Component/Routing/Tests/Matcher/ApacheUrlMatcherTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/ApacheUrlMatcherTest.php index 9cae8b8a2603..e68b61804cca 100644 --- a/core/vendor/Symfony/Component/Routing/Tests/Matcher/ApacheUrlMatcherTest.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/ApacheUrlMatcherTest.php @@ -22,8 +22,8 @@ class ApacheUrlMatcherTest extends \PHPUnit_Framework_TestCase */ public function testMatch($name, $pathinfo, $server, $expect) { - $collection = new RouteCollection; - $context = new RequestContext; + $collection = new RouteCollection(); + $context = new RequestContext(); $matcher = new ApacheUrlMatcher($collection, $context); $_SERVER = $server; diff --git a/core/vendor/Symfony/Component/Routing/Tests/Matcher/Dumper/ApacheMatcherDumperTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/Dumper/ApacheMatcherDumperTest.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Matcher/Dumper/ApacheMatcherDumperTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/Dumper/ApacheMatcherDumperTest.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php similarity index 97% rename from core/vendor/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php index 0aea0396b670..3677c7e324eb 100644 --- a/core/vendor/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php @@ -29,7 +29,7 @@ public function testDumpWhenSchemeIsUsedWithoutAProperDumper() array(), array('_scheme' => 'https') )); - $dumper = new PhpMatcherDumper($collection, new RequestContext()); + $dumper = new PhpMatcherDumper($collection); $dumper->dump(); } @@ -40,7 +40,7 @@ public function testDump(RouteCollection $collection, $fixture, $options = array { $basePath = __DIR__.'/../../Fixtures/dumper/'; - $dumper = new PhpMatcherDumper($collection, new RequestContext()); + $dumper = new PhpMatcherDumper($collection); $this->assertStringEqualsFile($basePath.$fixture, $dumper->dump($options), '->dump() correctly dumps routes as optimized PHP code.'); } diff --git a/core/vendor/Symfony/Component/Routing/Tests/Matcher/RedirectableUrlMatcherTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/RedirectableUrlMatcherTest.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Matcher/RedirectableUrlMatcherTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/RedirectableUrlMatcherTest.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/Matcher/TraceableUrlMatcherTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/TraceableUrlMatcherTest.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/Matcher/TraceableUrlMatcherTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/TraceableUrlMatcherTest.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php similarity index 89% rename from core/vendor/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php index e38c75a0303f..77d1f2087ff6 100644 --- a/core/vendor/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php @@ -74,7 +74,7 @@ public function testMatch() // test the patterns are matched and parameters are returned $collection = new RouteCollection(); $collection->add('foo', new Route('/foo/{bar}')); - $matcher = new UrlMatcher($collection, new RequestContext(), array()); + $matcher = new UrlMatcher($collection, new RequestContext()); try { $matcher->match('/no-match'); $this->fail(); @@ -84,40 +84,48 @@ public function testMatch() // test that defaults are merged $collection = new RouteCollection(); $collection->add('foo', new Route('/foo/{bar}', array('def' => 'test'))); - $matcher = new UrlMatcher($collection, new RequestContext(), array()); + $matcher = new UrlMatcher($collection, new RequestContext()); $this->assertEquals(array('_route' => 'foo', 'bar' => 'baz', 'def' => 'test'), $matcher->match('/foo/baz')); // test that route "method" is ignored if no method is given in the context $collection = new RouteCollection(); $collection->add('foo', new Route('/foo', array(), array('_method' => 'GET|head'))); - $matcher = new UrlMatcher($collection, new RequestContext(), array()); + $matcher = new UrlMatcher($collection, new RequestContext()); $this->assertInternalType('array', $matcher->match('/foo')); // route does not match with POST method context - $matcher = new UrlMatcher($collection, new RequestContext('', 'post'), array()); + $matcher = new UrlMatcher($collection, new RequestContext('', 'post')); try { $matcher->match('/foo'); $this->fail(); } catch (MethodNotAllowedException $e) {} // route does match with GET or HEAD method context - $matcher = new UrlMatcher($collection, new RequestContext(), array()); + $matcher = new UrlMatcher($collection, new RequestContext()); $this->assertInternalType('array', $matcher->match('/foo')); - $matcher = new UrlMatcher($collection, new RequestContext('', 'head'), array()); + $matcher = new UrlMatcher($collection, new RequestContext('', 'head')); $this->assertInternalType('array', $matcher->match('/foo')); // route with an optional variable as the first segment $collection = new RouteCollection(); $collection->add('bar', new Route('/{bar}/foo', array('bar' => 'bar'), array('bar' => 'foo|bar'))); - $matcher = new UrlMatcher($collection, new RequestContext(), array()); + $matcher = new UrlMatcher($collection, new RequestContext()); $this->assertEquals(array('_route' => 'bar', 'bar' => 'bar'), $matcher->match('/bar/foo')); $this->assertEquals(array('_route' => 'bar', 'bar' => 'foo'), $matcher->match('/foo/foo')); $collection = new RouteCollection(); $collection->add('bar', new Route('/{bar}', array('bar' => 'bar'), array('bar' => 'foo|bar'))); - $matcher = new UrlMatcher($collection, new RequestContext(), array()); + $matcher = new UrlMatcher($collection, new RequestContext()); $this->assertEquals(array('_route' => 'bar', 'bar' => 'foo'), $matcher->match('/foo')); $this->assertEquals(array('_route' => 'bar', 'bar' => 'bar'), $matcher->match('/')); + + // route with only optional variables + $collection = new RouteCollection(); + $collection->add('bar', new Route('/{foo}/{bar}', array('foo' => 'foo', 'bar' => 'bar'), array())); + $matcher = new UrlMatcher($collection, new RequestContext()); + $this->assertEquals(array('_route' => 'bar', 'foo' => 'foo', 'bar' => 'bar'), $matcher->match('/')); + $this->assertEquals(array('_route' => 'bar', 'foo' => 'a', 'bar' => 'bar'), $matcher->match('/a')); + $this->assertEquals(array('_route' => 'bar', 'foo' => 'a', 'bar' => 'b'), $matcher->match('/a/b')); } public function testMatchWithPrefixes() @@ -131,7 +139,7 @@ public function testMatchWithPrefixes() $collection = new RouteCollection(); $collection->addCollection($collection2, '/a'); - $matcher = new UrlMatcher($collection, new RequestContext(), array()); + $matcher = new UrlMatcher($collection, new RequestContext()); $this->assertEquals(array('_route' => 'foo', 'foo' => 'foo'), $matcher->match('/a/b/foo')); } @@ -146,7 +154,7 @@ public function testMatchWithDynamicPrefix() $collection = new RouteCollection(); $collection->addCollection($collection2, '/{_locale}'); - $matcher = new UrlMatcher($collection, new RequestContext(), array()); + $matcher = new UrlMatcher($collection, new RequestContext()); $this->assertEquals(array('_locale' => 'fr', '_route' => 'foo', 'foo' => 'foo'), $matcher->match('/fr/b/foo')); } @@ -156,7 +164,7 @@ public function testMatchNonAlpha() $chars = '!"$%éà &\'()*+,./:;<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ\\[]^_`abcdefghijklmnopqrstuvwxyz{|}~-'; $collection->add('foo', new Route('/{foo}/bar', array(), array('foo' => '['.preg_quote($chars).']+'))); - $matcher = new UrlMatcher($collection, new RequestContext(), array()); + $matcher = new UrlMatcher($collection, new RequestContext()); $this->assertEquals(array('_route' => 'foo', 'foo' => $chars), $matcher->match('/'.rawurlencode($chars).'/bar')); $this->assertEquals(array('_route' => 'foo', 'foo' => $chars), $matcher->match('/'.strtr($chars, array('%' => '%25')).'/bar')); } @@ -166,7 +174,7 @@ public function testMatchWithDotMetacharacterInRequirements() $collection = new RouteCollection(); $collection->add('foo', new Route('/{foo}/bar', array(), array('foo' => '.+'))); - $matcher = new UrlMatcher($collection, new RequestContext(), array()); + $matcher = new UrlMatcher($collection, new RequestContext()); $this->assertEquals(array('_route' => 'foo', 'foo' => "\n"), $matcher->match('/'.urlencode("\n").'/bar'), 'linefeed character is matched'); } @@ -180,7 +188,7 @@ public function testMatchOverridenRoute() $collection->addCollection($collection1); - $matcher = new UrlMatcher($collection, new RequestContext(), array()); + $matcher = new UrlMatcher($collection, new RequestContext()); $this->assertEquals(array('_route' => 'foo'), $matcher->match('/foo1')); $this->setExpectedException('Symfony\Component\Routing\Exception\ResourceNotFoundException'); @@ -198,7 +206,7 @@ public function testMatchRegression() $collection = new RouteCollection(); $collection->add('foo', new Route('/{bar}')); - $matcher = new UrlMatcher($collection, new RequestContext(), array()); + $matcher = new UrlMatcher($collection, new RequestContext()); try { $matcher->match('/'); $this->fail(); @@ -206,6 +214,15 @@ public function testMatchRegression() } } + public function testMatchingIsEager() + { + $coll = new RouteCollection(); + $coll->add('test', new Route('/{foo}-{bar}-', array(), array('foo' => '.+', 'bar' => '.+'))); + + $matcher = new UrlMatcher($coll, new RequestContext()); + $this->assertEquals(array('foo' => 'text1-text2-text3', 'bar' => 'text4', '_route' => 'test'), $matcher->match('/text1-text2-text3-text4-')); + } + /** * @expectedException Symfony\Component\Routing\Exception\ResourceNotFoundException */ diff --git a/core/vendor/Symfony/Component/Routing/Tests/RouteCollectionTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouteCollectionTest.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/RouteCollectionTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouteCollectionTest.php diff --git a/core/vendor/Symfony/Component/Routing/Tests/RouteCompilerTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouteCompilerTest.php similarity index 59% rename from core/vendor/Symfony/Component/Routing/Tests/RouteCompilerTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouteCompilerTest.php index 7245e7909caf..5288ca68fa2c 100644 --- a/core/vendor/Symfony/Component/Routing/Tests/RouteCompilerTest.php +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouteCompilerTest.php @@ -43,51 +43,51 @@ public function provideCompileData() array( 'Route with a variable', array('/foo/{bar}'), - '/foo', '#^/foo/(?<bar>[^/]+?)$#s', array('bar'), array( - array('variable', '/', '[^/]+?', 'bar'), + '/foo', '#^/foo/(?<bar>[^/]+)$#s', array('bar'), array( + array('variable', '/', '[^/]+', 'bar'), array('text', '/foo'), )), array( 'Route with a variable that has a default value', array('/foo/{bar}', array('bar' => 'bar')), - '/foo', '#^/foo(?:/(?<bar>[^/]+?))?$#s', array('bar'), array( - array('variable', '/', '[^/]+?', 'bar'), + '/foo', '#^/foo(?:/(?<bar>[^/]+))?$#s', array('bar'), array( + array('variable', '/', '[^/]+', 'bar'), array('text', '/foo'), )), array( 'Route with several variables', array('/foo/{bar}/{foobar}'), - '/foo', '#^/foo/(?<bar>[^/]+?)/(?<foobar>[^/]+?)$#s', array('bar', 'foobar'), array( - array('variable', '/', '[^/]+?', 'foobar'), - array('variable', '/', '[^/]+?', 'bar'), + '/foo', '#^/foo/(?<bar>[^/]+)/(?<foobar>[^/]+)$#s', array('bar', 'foobar'), array( + array('variable', '/', '[^/]+', 'foobar'), + array('variable', '/', '[^/]+', 'bar'), array('text', '/foo'), )), array( 'Route with several variables that have default values', array('/foo/{bar}/{foobar}', array('bar' => 'bar', 'foobar' => '')), - '/foo', '#^/foo(?:/(?<bar>[^/]+?)(?:/(?<foobar>[^/]+?))?)?$#s', array('bar', 'foobar'), array( - array('variable', '/', '[^/]+?', 'foobar'), - array('variable', '/', '[^/]+?', 'bar'), + '/foo', '#^/foo(?:/(?<bar>[^/]+)(?:/(?<foobar>[^/]+))?)?$#s', array('bar', 'foobar'), array( + array('variable', '/', '[^/]+', 'foobar'), + array('variable', '/', '[^/]+', 'bar'), array('text', '/foo'), )), array( 'Route with several variables but some of them have no default values', array('/foo/{bar}/{foobar}', array('bar' => 'bar')), - '/foo', '#^/foo/(?<bar>[^/]+?)/(?<foobar>[^/]+?)$#s', array('bar', 'foobar'), array( - array('variable', '/', '[^/]+?', 'foobar'), - array('variable', '/', '[^/]+?', 'bar'), + '/foo', '#^/foo/(?<bar>[^/]+)/(?<foobar>[^/]+)$#s', array('bar', 'foobar'), array( + array('variable', '/', '[^/]+', 'foobar'), + array('variable', '/', '[^/]+', 'bar'), array('text', '/foo'), )), array( 'Route with an optional variable as the first segment', array('/{bar}', array('bar' => 'bar')), - '', '#^/(?<bar>[^/]+?)?$#s', array('bar'), array( - array('variable', '/', '[^/]+?', 'bar'), + '', '#^/(?<bar>[^/]+)?$#s', array('bar'), array( + array('variable', '/', '[^/]+', 'bar'), )), array( @@ -96,6 +96,31 @@ public function provideCompileData() '', '#^/(?<bar>(foo|bar))?$#s', array('bar'), array( array('variable', '/', '(foo|bar)', 'bar'), )), + + array( + 'Route with only optional variables', + array('/{foo}/{bar}', array('foo' => 'foo', 'bar' => 'bar')), + '', '#^/(?<foo>[^/]+)?(?:/(?<bar>[^/]+))?$#s', array('foo', 'bar'), array( + array('variable', '/', '[^/]+', 'bar'), + array('variable', '/', '[^/]+', 'foo'), + )), + + array( + 'Route with a variable in last position', + array('/foo-{bar}'), + '/foo', '#^/foo\-(?<bar>[^\-]+)$#s', array('bar'), array( + array('variable', '-', '[^\-]+', 'bar'), + array('text', '/foo'), + )), + + array( + 'Route with a format', + array('/foo/{bar}.{_format}'), + '/foo', '#^/foo/(?<bar>[^/\.]+)\.(?<_format>[^\.]+)$#s', array('bar', '_format'), array( + array('variable', '.', '[^\.]+', '_format'), + array('variable', '/', '[^/\.]+', 'bar'), + array('text', '/foo'), + )), ); } diff --git a/core/vendor/Symfony/Component/Routing/Tests/RouteTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouteTest.php similarity index 100% rename from core/vendor/Symfony/Component/Routing/Tests/RouteTest.php rename to core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouteTest.php diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/bootstrap.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/bootstrap.php new file mode 100644 index 000000000000..23303c04bb7e --- /dev/null +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/bootstrap.php @@ -0,0 +1,22 @@ +<?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. + */ + +spl_autoload_register(function ($class) { + if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\Routing')) { + if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\Routing')).'.php')) { + require_once $file; + } + } +}); + +if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) { + require_once $loader; +} diff --git a/core/vendor/Symfony/Component/Routing/composer.json b/core/vendor/symfony/routing/Symfony/Component/Routing/composer.json similarity index 71% rename from core/vendor/Symfony/Component/Routing/composer.json rename to core/vendor/symfony/routing/Symfony/Component/Routing/composer.json index fb0af2d6a1f2..44869a369517 100644 --- a/core/vendor/Symfony/Component/Routing/composer.json +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/composer.json @@ -16,11 +16,18 @@ } ], "require": { - "php": ">=5.3.2" + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/config": "2.1.*", + "symfony/yaml": "2.1.*", + "symfony/http-kernel": "2.1.*", + "doctrine/common": ">=2.2,<2.4-dev" }, "suggest": { "symfony/config": "self.version", - "symfony/yaml": "self.version" + "symfony/yaml": "self.version", + "doctrine/common": ">=2.2,<2.4-dev" }, "autoload": { "psr-0": { "Symfony\\Component\\Routing": "" } diff --git a/core/vendor/Symfony/Component/Routing/phpunit.xml.dist b/core/vendor/symfony/routing/Symfony/Component/Routing/phpunit.xml.dist similarity index 93% rename from core/vendor/Symfony/Component/Routing/phpunit.xml.dist rename to core/vendor/symfony/routing/Symfony/Component/Routing/phpunit.xml.dist index f6d9ede400ef..6d25ebf91f83 100644 --- a/core/vendor/Symfony/Component/Routing/phpunit.xml.dist +++ b/core/vendor/symfony/routing/Symfony/Component/Routing/phpunit.xml.dist @@ -21,7 +21,7 @@ <whitelist> <directory>./</directory> <exclude> - <directory>./Resources</directory> + <directory>./vendor</directory> <directory>./Tests</directory> </exclude> </whitelist> diff --git a/core/vendor/Symfony/Component/Yaml/CHANGELOG.md b/core/vendor/symfony/yaml/Symfony/Component/Yaml/CHANGELOG.md similarity index 100% rename from core/vendor/Symfony/Component/Yaml/CHANGELOG.md rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/CHANGELOG.md diff --git a/core/vendor/Symfony/Component/Yaml/Dumper.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Dumper.php similarity index 87% rename from core/vendor/Symfony/Component/Yaml/Dumper.php rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Dumper.php index 97ec9d2c5f13..233891698545 100644 --- a/core/vendor/Symfony/Component/Yaml/Dumper.php +++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Dumper.php @@ -21,9 +21,9 @@ class Dumper /** * Dumps a PHP value to YAML. * - * @param mixed $input The PHP value - * @param integer $inline The level where you switch to inline YAML - * @param integer $indent The level of indentation (used internally) + * @param mixed $input The PHP value + * @param integer $inline The level where you switch to inline YAML + * @param integer $indent The level of indentation (used internally) * * @return string The YAML representation of the PHP value */ diff --git a/core/vendor/Symfony/Component/Yaml/Escaper.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Escaper.php rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php diff --git a/core/vendor/Symfony/Component/Yaml/Exception/DumpException.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/DumpException.php similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Exception/DumpException.php rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/DumpException.php diff --git a/core/vendor/Symfony/Component/Yaml/Exception/ExceptionInterface.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ExceptionInterface.php similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Exception/ExceptionInterface.php rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ExceptionInterface.php diff --git a/core/vendor/Symfony/Component/Yaml/Exception/ParseException.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ParseException.php similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Exception/ParseException.php rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ParseException.php diff --git a/core/vendor/Symfony/Component/Yaml/Inline.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php similarity index 92% rename from core/vendor/Symfony/Component/Yaml/Inline.php rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php index 5933ac79c72b..8bcfcda62b9a 100644 --- a/core/vendor/Symfony/Component/Yaml/Inline.php +++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php @@ -50,7 +50,13 @@ static public function parse($value) $result = self::parseMapping($value); break; default: - $result = self::parseScalar($value); + $i = 0; + $result = self::parseScalar($value, null, array('"', "'"), $i); + + // some comment can end the scalar + if (preg_replace('/\s+#.*$/A', '', substr($value, $i))) { + throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i))); + } } if (isset($mbEncoding)) { @@ -146,9 +152,9 @@ static private function dumpArray($value) /** * Parses a scalar to a YAML string. * - * @param scalar $scalar - * @param string $delimiters - * @param array $stringDelimiters + * @param scalar $scalar + * @param string $delimiters + * @param array $stringDelimiters * @param integer &$i * @param Boolean $evaluate * @@ -161,6 +167,13 @@ static public function parseScalar($scalar, $delimiters = null, $stringDelimiter if (in_array($scalar[$i], $stringDelimiters)) { // quoted scalar $output = self::parseQuotedScalar($scalar, $i); + + if (null !== $delimiters) { + $tmp = ltrim(substr($scalar, $i), ' '); + if (!in_array($tmp[0], $delimiters)) { + throw new ParseException(sprintf('Unexpected characters (%s).', substr($scalar, $i))); + } + } } else { // "normal" string if (!$delimiters) { @@ -187,7 +200,7 @@ static public function parseScalar($scalar, $delimiters = null, $stringDelimiter /** * Parses a quoted scalar to YAML. * - * @param string $scalar + * @param string $scalar * @param integer &$i * * @return string A YAML string @@ -196,6 +209,11 @@ static public function parseScalar($scalar, $delimiters = null, $stringDelimiter */ static private function parseQuotedScalar($scalar, &$i) { + // Only check the current item we're dealing with (for sequences) + $subject = substr($scalar, $i); + $items = preg_split('/[\'"]\s*(?:[,:]|[}\]]\s*,)/', $subject); + $subject = substr($subject, 0, strlen($items[0]) + 1); + if (!preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) { throw new ParseException(sprintf('Malformed inline YAML string (%s).', substr($scalar, $i))); } @@ -217,7 +235,7 @@ static private function parseQuotedScalar($scalar, &$i) /** * Parses a sequence to a YAML string. * - * @param string $sequence + * @param string $sequence * @param integer &$i * * @return string A YAML string @@ -273,7 +291,7 @@ static private function parseSequence($sequence, &$i = 0) /** * Parses a mapping to a YAML string. * - * @param string $mapping + * @param string $mapping * @param integer &$i * * @return string A YAML string diff --git a/core/vendor/Symfony/Component/Yaml/LICENSE b/core/vendor/symfony/yaml/Symfony/Component/Yaml/LICENSE similarity index 100% rename from core/vendor/Symfony/Component/Yaml/LICENSE rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/LICENSE diff --git a/core/vendor/Symfony/Component/Yaml/Parser.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php similarity index 89% rename from core/vendor/Symfony/Component/Yaml/Parser.php rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php index 074306969a20..76d1926b9473 100644 --- a/core/vendor/Symfony/Component/Yaml/Parser.php +++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php @@ -38,7 +38,7 @@ public function __construct($offset = 0) /** * Parses a YAML string to a PHP value. * - * @param string $value A YAML string + * @param string $value A YAML string * * @return mixed A PHP value * @@ -159,7 +159,7 @@ public function parse($value) // hash } elseif (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { // if next line is less indented or equal, then it means that the current value is null - if ($this->isNextLineIndented()) { + if ($this->isNextLineIndented() && !$this->isNextLineUnIndentedCollection()) { $data[$key] = null; } else { $c = $this->getRealCurrentLineNb() + 1; @@ -275,7 +275,9 @@ private function getNextEmbedBlock($indentation = null) if (null === $indentation) { $newIndent = $this->getCurrentLineIndentation(); - if (!$this->isCurrentLineEmpty() && 0 == $newIndent) { + $unindentedEmbedBlock = $this->isStringUnIndentedCollectionItem($this->currentLine); + + if (!$this->isCurrentLineEmpty() && 0 === $newIndent && !$unindentedEmbedBlock) { throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine); } } else { @@ -284,7 +286,15 @@ private function getNextEmbedBlock($indentation = null) $data = array(substr($this->currentLine, $newIndent)); + $isItUnindentedCollection = $this->isStringUnIndentedCollectionItem($this->currentLine); + while ($this->moveToNextLine()) { + + if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem($this->currentLine)) { + $this->moveToPreviousLine(); + break; + } + if ($this->isCurrentLineEmpty()) { if ($this->isCurrentLineBlank()) { $data[] = substr($this->currentLine, $newIndent); @@ -339,7 +349,7 @@ private function moveToPreviousLine() /** * Parses a YAML value. * - * @param string $value A YAML value + * @param string $value A YAML value * * @return mixed A PHP value * @@ -380,9 +390,9 @@ private function parseValue($value) /** * Parses a folded scalar. * - * @param string $separator The separator that was used to begin this folded scalar (| or >) - * @param string $indicator The indicator that was used to begin this folded scalar (+ or -) - * @param integer $indentation The indentation that was used to begin this folded scalar + * @param string $separator The separator that was used to begin this folded scalar (| or >) + * @param string $indicator The indicator that was used to begin this folded scalar (+ or -) + * @param integer $indentation The indentation that was used to begin this folded scalar * * @return string The text value */ @@ -515,7 +525,7 @@ private function isCurrentLineComment() /** * Cleanups a YAML string to be parsed. * - * @param string $value The input YAML string + * @param string $value The input YAML string * * @return string A cleaned up YAML string */ @@ -553,4 +563,47 @@ private function cleanup($value) return $value; } + + /** + * Returns true if the next line starts unindented collection + * + * @return Boolean Returns true if the next line starts unindented collection, false otherwise + */ + private function isNextLineUnIndentedCollection() + { + $currentIndentation = $this->getCurrentLineIndentation(); + $notEOF = $this->moveToNextLine(); + + while ($notEOF && $this->isCurrentLineEmpty()) { + $notEOF = $this->moveToNextLine(); + } + + if (false === $notEOF) { + return false; + } + + $ret = false; + if ( + $this->getCurrentLineIndentation() == $currentIndentation + && + $this->isStringUnIndentedCollectionItem($this->currentLine) + ) { + $ret = true; + } + + $this->moveToPreviousLine(); + + return $ret; + } + + /** + * Returns true if the string is unindented collection item + * + * @return Boolean Returns true if the string is unindented collection item, false otherwise + */ + private function isStringUnIndentedCollectionItem($string) + { + return (0 === strpos($this->currentLine, '- ')); + } + } diff --git a/core/vendor/Symfony/Component/Yaml/README.md b/core/vendor/symfony/yaml/Symfony/Component/Yaml/README.md similarity index 100% rename from core/vendor/Symfony/Component/Yaml/README.md rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/README.md diff --git a/core/vendor/Symfony/Component/Yaml/Tests/DumperTest.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/DumperTest.php similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/DumperTest.php rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/DumperTest.php diff --git a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsAnchorAlias.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsAnchorAlias.yml similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsAnchorAlias.yml rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsAnchorAlias.yml diff --git a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsBasicTests.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsBasicTests.yml similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsBasicTests.yml rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsBasicTests.yml diff --git a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsBlockMapping.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsBlockMapping.yml similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsBlockMapping.yml rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsBlockMapping.yml diff --git a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsDocumentSeparator.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsDocumentSeparator.yml similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsDocumentSeparator.yml rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsDocumentSeparator.yml diff --git a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsErrorTests.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsErrorTests.yml similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsErrorTests.yml rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsErrorTests.yml diff --git a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsFlowCollections.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsFlowCollections.yml similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsFlowCollections.yml rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsFlowCollections.yml diff --git a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsFoldedScalars.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsFoldedScalars.yml similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsFoldedScalars.yml rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsFoldedScalars.yml diff --git a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsNullsAndEmpties.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsNullsAndEmpties.yml similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsNullsAndEmpties.yml rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsNullsAndEmpties.yml diff --git a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml diff --git a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsTypeTransfers.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsTypeTransfers.yml similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/Fixtures/YtsTypeTransfers.yml rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsTypeTransfers.yml diff --git a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/escapedCharacters.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/escapedCharacters.yml similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/Fixtures/escapedCharacters.yml rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/escapedCharacters.yml diff --git a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/index.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/index.yml similarity index 92% rename from core/vendor/Symfony/Component/Yaml/Tests/Fixtures/index.yml rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/index.yml index a1d7f39e0b90..3216a89ebbc3 100644 --- a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/index.yml +++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/index.yml @@ -15,3 +15,4 @@ - YtsNullsAndEmpties - YtsSpecificationExamples - YtsTypeTransfers +- unindentedCollections diff --git a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/sfComments.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfComments.yml similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/Fixtures/sfComments.yml rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfComments.yml diff --git a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/sfCompact.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfCompact.yml similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/Fixtures/sfCompact.yml rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfCompact.yml diff --git a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/sfMergeKey.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfMergeKey.yml similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/Fixtures/sfMergeKey.yml rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfMergeKey.yml diff --git a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/sfObjects.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfObjects.yml similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/Fixtures/sfObjects.yml rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfObjects.yml diff --git a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/sfQuotes.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfQuotes.yml similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/Fixtures/sfQuotes.yml rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfQuotes.yml diff --git a/core/vendor/Symfony/Component/Yaml/Tests/Fixtures/sfTests.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfTests.yml similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/Fixtures/sfTests.yml rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfTests.yml diff --git a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/unindentedCollections.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/unindentedCollections.yml new file mode 100644 index 000000000000..fd8ad7ed448d --- /dev/null +++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/unindentedCollections.yml @@ -0,0 +1,62 @@ +--- %YAML:1.0 +test: Unindented collection +brief: > + Unindented collection +yaml: | + collection: + - item1 + - item2 + - item3 +php: | + array('collection' => array('item1', 'item2', 'item3')) +--- +test: Nested unindented collection (two levels) +brief: > + Nested unindented collection +yaml: | + collection: + key: + - a + - b + - c +php: | + array('collection' => array('key' => array('a', 'b', 'c'))) +--- +test: Nested unindented collection (three levels) +brief: > + Nested unindented collection +yaml: | + collection: + key: + subkey: + - one + - two + - three +php: | + array('collection' => array('key' => array('subkey' => array('one', 'two', 'three')))) +--- +test: Key/value after unindented collection (1) +brief: > + Key/value after unindented collection (1) +yaml: | + collection: + key: + - a + - b + - c + foo: bar +php: | + array('collection' => array('key' => array('a', 'b', 'c')), 'foo' => 'bar') +--- +test: Key/value after unindented collection (at the same level) +brief: > + Key/value after unindented collection +yaml: | + collection: + key: + - a + - b + - c + foo: bar +php: | + array('collection' => array('key' => array('a', 'b', 'c'), 'foo' => 'bar')) diff --git a/core/vendor/Symfony/Component/Yaml/Tests/InlineTest.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php similarity index 82% rename from core/vendor/Symfony/Component/Yaml/Tests/InlineTest.php rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php index f22b9fa13309..2684fa557eb8 100644 --- a/core/vendor/Symfony/Component/Yaml/Tests/InlineTest.php +++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php @@ -65,6 +65,41 @@ public function testHashStringsResemblingExponentialNumericsShouldNotBeChangedTo $this->assertSame($value, Inline::parse(Inline::dump($value))); } + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + */ + public function testParseScalarWithIncorrectlyQuotedStringShouldThrowException() + { + $value = "'don't do somthin' like that'"; + Inline::parse($value); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + */ + public function testParseScalarWithIncorrectlyDoubleQuotedStringShouldThrowException() + { + $value = '"don"t do somthin" like that"'; + Inline::parse($value); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + */ + public function testParseInvalidMappingKeyShouldThrowException() + { + $value = '{ "foo " bar": "bar" }'; + Inline::parse($value); + } + + public function testParseScalarWithCorrectlyQuotedStringShouldReturnString() + { + $value = "'don''t do somthin'' like that'"; + $expect = "don't do somthin' like that"; + + $this->assertSame($expect, Inline::parseScalar($value)); + } + protected function getTestsForParse() { return array( @@ -87,6 +122,7 @@ protected function getTestsForParse() "'foo#bar'" => 'foo#bar', "'foo # bar'" => 'foo # bar', "'#cfcfcf'" => '#cfcfcf', + '::form_base.html.twig' => '::form_base.html.twig', '2007-10-30' => mktime(0, 0, 0, 10, 30, 2007), '2007-10-30T02:59:43Z' => gmmktime(2, 59, 43, 10, 30, 2007), @@ -124,6 +160,7 @@ protected function getTestsForParse() '[foo, {bar: foo, foo: [foo, {bar: foo}]}, [foo, {bar: foo}]]' => array('foo', array('bar' => 'foo', 'foo' => array('foo', array('bar' => 'foo'))), array('foo', array('bar' => 'foo'))), '[foo, bar: { foo: bar }]' => array('foo', '1' => array('bar' => array('foo' => 'bar'))), + '[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']' => array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%',), true, '@service_container',), ); } @@ -167,6 +204,8 @@ protected function getTestsForDump() '[foo, { bar: foo }]' => array('foo', array('bar' => 'foo')), '[foo, { bar: foo, foo: [foo, { bar: foo }] }, [foo, { bar: foo }]]' => array('foo', array('bar' => 'foo', 'foo' => array('foo', array('bar' => 'foo'))), array('foo', array('bar' => 'foo'))), + + '[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']' => array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%',), true, '@service_container',), ); } } diff --git a/core/vendor/Symfony/Component/Yaml/Tests/ParserTest.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php similarity index 93% rename from core/vendor/Symfony/Component/Yaml/Tests/ParserTest.php rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php index 98689ae6bde3..6b4e2d482bfa 100644 --- a/core/vendor/Symfony/Component/Yaml/Tests/ParserTest.php +++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php @@ -140,6 +140,26 @@ public function testNonUtf8Exception() } } } + + /** + * + * @expectedException Symfony\Component\Yaml\Exception\ParseException + * + */ + public function testUnindentedCollectionException() + { + $yaml = <<<EOF + +collection: +-item1 +-item2 +-item3 + +EOF; + + $this->parser->parse($yaml); + } + } class B diff --git a/core/vendor/Symfony/Component/Yaml/Tests/bootstrap.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/bootstrap.php similarity index 100% rename from core/vendor/Symfony/Component/Yaml/Tests/bootstrap.php rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/bootstrap.php diff --git a/core/vendor/Symfony/Component/Yaml/Unescaper.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php similarity index 97% rename from core/vendor/Symfony/Component/Yaml/Unescaper.php rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php index 807a35eeb352..0061dfdcc352 100644 --- a/core/vendor/Symfony/Component/Yaml/Unescaper.php +++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php @@ -134,10 +134,10 @@ public function unescapeCharacter($value) */ private function convertEncoding($value, $to, $from) { - if (function_exists('iconv')) { - return iconv($from, $to, $value); - } elseif (function_exists('mb_convert_encoding')) { + if (function_exists('mb_convert_encoding')) { return mb_convert_encoding($value, $to, $from); + } elseif (function_exists('iconv')) { + return iconv($from, $to, $value); } throw new \RuntimeException('No suitable convert encoding function (install the iconv or mbstring extension).'); diff --git a/core/vendor/Symfony/Component/Yaml/Yaml.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Yaml.php similarity index 98% rename from core/vendor/Symfony/Component/Yaml/Yaml.php rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/Yaml.php index cd30b0f7dd8a..29e941343e44 100644 --- a/core/vendor/Symfony/Component/Yaml/Yaml.php +++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Yaml.php @@ -95,7 +95,7 @@ static public function parse($input) * The dump method, when supplied with an array, will do its best * to convert the array into friendly YAML. * - * @param array $array PHP array + * @param array $array PHP array * @param integer $inline The level where you switch to inline YAML * * @return string A YAML string representing the original PHP array diff --git a/core/vendor/Symfony/Component/Yaml/composer.json b/core/vendor/symfony/yaml/Symfony/Component/Yaml/composer.json similarity index 96% rename from core/vendor/Symfony/Component/Yaml/composer.json rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/composer.json index dc87721228cc..c2894da6a325 100644 --- a/core/vendor/Symfony/Component/Yaml/composer.json +++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.2" + "php": ">=5.3.3" }, "autoload": { "psr-0": { "Symfony\\Component\\Yaml": "" } diff --git a/core/vendor/Symfony/Component/Yaml/phpunit.xml.dist b/core/vendor/symfony/yaml/Symfony/Component/Yaml/phpunit.xml.dist similarity index 100% rename from core/vendor/Symfony/Component/Yaml/phpunit.xml.dist rename to core/vendor/symfony/yaml/Symfony/Component/Yaml/phpunit.xml.dist diff --git a/core/vendor/twig/twig/.travis.yml b/core/vendor/twig/twig/.travis.yml new file mode 100644 index 000000000000..e6d3b61cf41f --- /dev/null +++ b/core/vendor/twig/twig/.travis.yml @@ -0,0 +1,14 @@ +language: php + +php: + - 5.2 + - 5.3 + - 5.4 + +env: + - TWIG_EXT=no + - TWIG_EXT=yes + +before_script: + - if [ "$TWIG_EXT" == "yes" ]; then sh -c "cd ext/twig && phpize && ./configure --enable-twig && make && sudo make install"; fi + - if [ "$TWIG_EXT" == "yes" ]; then echo "extension=twig.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi diff --git a/core/vendor/Twig/AUTHORS b/core/vendor/twig/twig/AUTHORS similarity index 100% rename from core/vendor/Twig/AUTHORS rename to core/vendor/twig/twig/AUTHORS diff --git a/core/vendor/twig/twig/CHANGELOG b/core/vendor/twig/twig/CHANGELOG new file mode 100644 index 000000000000..fd38774eacc8 --- /dev/null +++ b/core/vendor/twig/twig/CHANGELOG @@ -0,0 +1,520 @@ +* 1.8.3 (2012-06-17) + + * fixed paths in the filesystem loader when passing a path that ends with a slash or a backslash + * fixed escaping when a project defines a function named html or js + * fixed chmod mode to apply the umask correctly + +* 1.8.2 (2012-05-30) + + * added the abs filter + * fixed a regression when using a number in template attributes + * fixed compiler when mbstring.func_overload is set to 2 + * fixed DateTimeZone support in date filter + +* 1.8.1 (2012-05-17) + + * fixed a regression when dealing with SimpleXMLElement instances in templates + * fixed "is_safe" value for the "dump" function when "html_errors" is not defined in php.ini + * switched to use mbstring whenever possible instead of iconv (you might need to update your encoding as mbstring and iconv encoding names sometimes differ) + +* 1.8.0 (2012-05-08) + + * enforced interface when adding tests, filters, functions, and node visitors from extensions + * fixed a side-effect of the date filter where the timezone might be changed + * simplified usage of the autoescape tag; the only (optional) argument is now the escaping strategy or false (with a BC layer) + * added a way to dynamically change the auto-escaping strategy according to the template "filename" + * changed the autoescape option to also accept a supported escaping strategy (for BC, true is equivalent to html) + * added an embed tag + +* 1.7.0 (2012-04-24) + + * fixed a PHP warning when using CIFS + * fixed template line number in some exceptions + * added an iterable test + * added an error when defining two blocks with the same name in a template + * added the preserves_safety option for filters + * fixed a PHP notice when trying to access a key on a non-object/array variable + * enhanced error reporting when the template file is an instance of SplFileInfo + * added Twig_Environment::mergeGlobals() + * added compilation checks to avoid misuses of the sandbox tag + * fixed filesystem loader freshness logic for high traffic websites + * fixed random function when charset is null + +* 1.6.5 (2012-04-11) + + * fixed a regression when a template only extends another one without defining any blocks + +* 1.6.4 (2012-04-02) + + * fixed PHP notice in Twig_Error::guessTemplateLine() introduced in 1.6.3 + * fixed performance when compiling large files + * optimized parent template creation when the template does not use dynamic inheritance + +* 1.6.3 (2012-03-22) + + * fixed usage of Z_ADDREF_P for PHP 5.2 in the C extension + * fixed compilation of numeric values used in templates when using a locale where the decimal separator is not a dot + * made the strategy used to guess the real template file name and line number in exception messages much faster and more accurate + +* 1.6.2 (2012-03-18) + + * fixed sandbox mode when used with inheritance + * added preserveKeys support for the slice filter + * fixed the date filter when a DateTime instance is passed with a specific timezone + * added a trim filter + +* 1.6.1 (2012-02-29) + + * fixed Twig C extension + * removed the creation of Twig_Markup instances when not needed + * added a way to set the default global timezone for dates + * fixed the slice filter on strings when the length is not specified + * fixed the creation of the cache directory in case of a race condition + +* 1.6.0 (2012-02-04) + + * fixed raw blocks when used with the whitespace trim option + * made a speed optimization to macro calls when imported via the "from" tag + * fixed globals, parsers, visitors, filters, tests, and functions management in Twig_Environment when a new one or new extension is added + * fixed the attribute function when passing arguments + * added slice notation support for the [] operator (syntactic sugar for the slice operator) + * added a slice filter + * added string support for the reverse filter + * fixed the empty test and the length filter for Twig_Markup instances + * added a date function to ease date comparison + * fixed unary operators precedence + * added recursive parsing support in the parser + * added string and integer handling for the random function + +* 1.5.1 (2012-01-05) + + * fixed a regression when parsing strings + +* 1.5.0 (2012-01-04) + + * added Traversable objects support for the join filter + +* 1.5.0-RC2 (2011-12-30) + + * added a way to set the default global date interval format + * fixed the date filter for DateInterval instances (setTimezone() does not exist for them) + * refactored Twig_Template::display() to ease its extension + * added a number_format filter + +* 1.5.0-RC1 (2011-12-26) + + * removed the need to quote hash keys + * allowed hash keys to be any expression + * added a do tag + * added a flush tag + * added support for dynamically named filters and functions + * added a dump function to help debugging templates + * added a nl2br filter + * added a random function + * added a way to change the default format for the date filter + * fixed the lexer when an operator ending with a letter ends a line + * added string interpolation support + * enhanced exceptions for unknown filters, functions, tests, and tags + +* 1.4.0 (2011-12-07) + + * fixed lexer when using big numbers (> PHP_INT_MAX) + * added missing preserveKeys argument to the reverse filter + * fixed macros containing filter tag calls + +* 1.4.0-RC2 (2011-11-27) + + * removed usage of Reflection in Twig_Template::getAttribute() + * added a C extension that can optionally replace Twig_Template::getAttribute() + * added negative timestamp support to the date filter + +* 1.4.0-RC1 (2011-11-20) + + * optimized variable access when using PHP 5.4 + * changed the precedence of the .. operator to be more consistent with languages that implements such a feature like Ruby + * added an Exception to Twig_Loader_Array::isFresh() method when the template does not exist to be consistent with other loaders + * added Twig_Function_Node to allow more complex functions to have their own Node class + * added Twig_Filter_Node to allow more complex filters to have their own Node class + * added Twig_Test_Node to allow more complex tests to have their own Node class + * added a better error message when a template is empty but contain a BOM + * fixed "in" operator for empty strings + * fixed the "defined" test and the "default" filter (now works with more than one call (foo.bar.foo) and for both values of the strict_variables option) + * changed the way extensions are loaded (addFilter/addFunction/addGlobal/addTest/addNodeVisitor/addTokenParser/addExtension can now be called in any order) + * added Twig_Environment::display() + * made the escape filter smarter when the encoding is not supported by PHP + * added a convert_encoding filter + * moved all node manipulations outside the compile() Node method + * made several speed optimizations + +* 1.3.0 (2011-10-08) + +no changes + +* 1.3.0-RC1 (2011-10-04) + + * added an optimization for the parent() function + * added cache reloading when auto_reload is true and an extension has been modified + * added the possibility to force the escaping of a string already marked as safe (instance of Twig_Markup) + * allowed empty templates to be used as traits + * added traits support for the "parent" function + +* 1.2.0 (2011-09-13) + +no changes + +* 1.2.0-RC1 (2011-09-10) + + * enhanced the exception when a tag remains unclosed + * added support for empty Countable objects for the "empty" test + * fixed algorithm that determines if a template using inheritance is valid (no output between block definitions) + * added better support for encoding problems when escaping a string (available as of PHP 5.4) + * added a way to ignore a missing template when using the "include" tag ({% include "foo" ignore missing %}) + * added support for an array of templates to the "include" and "extends" tags ({% include ['foo', 'bar'] %}) + * added support for bitwise operators in expressions + * added the "attribute" function to allow getting dynamic attributes on variables + * added Twig_Loader_Chain + * added Twig_Loader_Array::setTemplate() + * added an optimization for the set tag when used to capture a large chunk of static text + * changed name regex to match PHP one "[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*" (works for blocks, tags, functions, filters, and macros) + * removed the possibility to use the "extends" tag from a block + * added "if" modifier support to "for" loops + +* 1.1.2 (2011-07-30) + + * fixed json_encode filter on PHP 5.2 + * fixed regression introduced in 1.1.1 ({{ block(foo|lower) }}) + * fixed inheritance when using conditional parents + * fixed compilation of templates when the body of a child template is not empty + * fixed output when a macro throws an exception + * fixed a parsing problem when a large chunk of text is enclosed in a comment tag + * added PHPDoc for all Token parsers and Core extension functions + +* 1.1.1 (2011-07-17) + + * added a performance optimization in the Optimizer (also helps to lower the number of nested level calls) + * made some performance improvement for some edge cases + +* 1.1.0 (2011-06-28) + + * fixed json_encode filter + +* 1.1.0-RC3 (2011-06-24) + + * fixed method case-sensitivity when using the sandbox mode + * added timezone support for the date filter + * fixed possible security problems with NUL bytes + +* 1.1.0-RC2 (2011-06-16) + + * added an exception when the template passed to "use" is not a string + * made 'a.b is defined' not throw an exception if a is not defined (in strict mode) + * added {% line \d+ %} directive + +* 1.1.0-RC1 (2011-05-28) + +Flush your cache after upgrading. + + * fixed date filter when using a timestamp + * fixed the defined test for some cases + * fixed a parsing problem when a large chunk of text is enclosed in a raw tag + * added support for horizontal reuse of template blocks (see docs for more information) + * added whitespace control modifier to all tags (see docs for more information) + * added null as an alias for none (the null test is also an alias for the none test now) + * made TRUE, FALSE, NONE equivalent to their lowercase counterparts + * wrapped all compilation and runtime exceptions with Twig_Error_Runtime and added logic to guess the template name and line + * moved display() method to Twig_Template (generated templates should now use doDisplay() instead) + +* 1.0.0 (2011-03-27) + + * fixed output when using mbstring + * fixed duplicate call of methods when using the sandbox + * made the charset configurable for the escape filter + +* 1.0.0-RC2 (2011-02-21) + + * changed the way {% set %} works when capturing (the content is now marked as safe) + * added support for macro name in the endmacro tag + * make Twig_Error compatible with PHP 5.3.0 > + * fixed an infinite loop on some Windows configurations + * fixed the "length" filter for numbers + * fixed Template::getAttribute() as properties in PHP are case sensitive + * removed coupling between Twig_Node and Twig_Template + * fixed the ternary operator precedence rule + +* 1.0.0-RC1 (2011-01-09) + +Backward incompatibilities: + + * the "items" filter, which has been deprecated for quite a long time now, has been removed + * the "range" filter has been converted to a function: 0|range(10) -> range(0, 10) + * the "constant" filter has been converted to a function: {{ some_date|date('DATE_W3C'|constant) }} -> {{ some_date|date(constant('DATE_W3C')) }} + * the "cycle" filter has been converted to a function: {{ ['odd', 'even']|cycle(i) }} -> {{ cycle(['odd', 'even'], i) }} + * the "for" tag does not support "joined by" anymore + * the "autoescape" first argument is now "true"/"false" (instead of "on"/"off") + * the "parent" tag has been replaced by a "parent" function ({{ parent() }} instead of {% parent %}) + * the "display" tag has been replaced by a "block" function ({{ block('title') }} instead of {% display title %}) + * removed the grammar and simple token parser (moved to the Twig Extensions repository) + +Changes: + + * added "needs_context" option for filters and functions (the context is then passed as a first argument) + * added global variables support + * made macros return their value instead of echoing directly (fixes calling a macro in sandbox mode) + * added the "from" tag to import macros as functions + * added support for functions (a function is just syntactic sugar for a getAttribute() call) + * made macros callable when sandbox mode is enabled + * added an exception when a macro uses a reserved name + * the "default" filter now uses the "empty" test instead of just checking for null + * added the "empty" test + +* 0.9.10 (2010-12-16) + +Backward incompatibilities: + + * The Escaper extension is enabled by default, which means that all displayed + variables are now automatically escaped. You can revert to the previous + behavior by removing the extension via $env->removeExtension('escaper') + or just set the 'autoescape' option to 'false'. + * removed the "without loop" attribute for the "for" tag (not needed anymore + as the Optimizer take care of that for most cases) + * arrays and hashes have now a different syntax + * arrays keep the same syntax with square brackets: [1, 2] + * hashes now use curly braces (["a": "b"] should now be written as {"a": "b"}) + * support for "arrays with keys" and "hashes without keys" is not supported anymore ([1, "foo": "bar"] or {"foo": "bar", 1}) + * the i18n extension is now part of the Twig Extensions repository + +Changes: + + * added the merge filter + * removed 'is_escaper' option for filters (a left over from the previous version) -- you must use 'is_safe' now instead + * fixed usage of operators as method names (like is, in, and not) + * changed the order of execution for node visitors + * fixed default() filter behavior when used with strict_variables set to on + * fixed filesystem loader compatibility with PHAR files + * enhanced error messages when an unexpected token is parsed in an expression + * fixed filename not being added to syntax error messages + * added the autoescape option to enable/disable autoescaping + * removed the newline after a comment (mimicks PHP behavior) + * added a syntax error exception when parent block is used on a template that does not extend another one + * made the Escaper extension enabled by default + * fixed sandbox extension when used with auto output escaping + * fixed escaper when wrapping a Twig_Node_Print (the original class must be preserved) + * added an Optimizer extension (enabled by default; optimizes "for" loops and "raw" filters) + * added priority to node visitors + +* 0.9.9 (2010-11-28) + +Backward incompatibilities: + * the self special variable has been renamed to _self + * the odd and even filters are now tests: + {{ foo|odd }} must now be written {{ foo is odd }} + * the "safe" filter has been renamed to "raw" + * in Node classes, + sub-nodes are now accessed via getNode() (instead of property access) + attributes via getAttribute() (instead of array access) + * the urlencode filter had been renamed to url_encode + * the include tag now merges the passed variables with the current context by default + (the old behavior is still possible by adding the "only" keyword) + * moved Exceptions to Twig_Error_* (Twig_SyntaxError/Twig_RuntimeError are now Twig_Error_Syntax/Twig_Error_Runtime) + * removed support for {{ 1 < i < 3 }} (use {{ i > 1 and i < 3 }} instead) + * the "in" filter has been removed ({{ a|in(b) }} should now be written {{ a in b }}) + +Changes: + * added file and line to Twig_Error_Runtime exceptions thrown from Twig_Template + * changed trans tag to accept any variable for the plural count + * fixed sandbox mode (__toString() method check was not enforced if called implicitly from complex statements) + * added the ** (power) operator + * changed the algorithm used for parsing expressions + * added the spaceless tag + * removed trim_blocks option + * added support for is*() methods for attributes (foo.bar now looks for foo->getBar() or foo->isBar()) + * changed all exceptions to extend Twig_Error + * fixed unary expressions ({{ not(1 or 0) }}) + * fixed child templates (with an extend tag) that uses one or more imports + * added support for {{ 1 not in [2, 3] }} (more readable than the current {{ not (1 in [2, 3]) }}) + * escaping has been rewritten + * the implementation of template inheritance has been rewritten + (blocks can now be called individually and still work with inheritance) + * fixed error handling for if tag when a syntax error occurs within a subparse process + * added a way to implement custom logic for resolving token parsers given a tag name + * fixed js escaper to be stricter (now uses a whilelist-based js escaper) + * added the following filers: "constant", "trans", "replace", "json_encode" + * added a "constant" test + * fixed objects with __toString() not being autoescaped + * fixed subscript expressions when calling __call() (methods now keep the case) + * added "test" feature (accessible via the "is" operator) + * removed the debug tag (should be done in an extension) + * fixed trans tag when no vars are used in plural form + * fixed race condition when writing template cache + * added the special _charset variable to reference the current charset + * added the special _context variable to reference the current context + * renamed self to _self (to avoid conflict) + * fixed Twig_Template::getAttribute() for protected properties + +* 0.9.8 (2010-06-28) + +Backward incompatibilities: + * the trans tag plural count is now attached to the plural tag: + old: `{% trans count %}...{% plural %}...{% endtrans %}` + new: `{% trans %}...{% plural count %}...{% endtrans %}` + + * added a way to translate strings coming from a variable ({% trans var %}) + * fixed trans tag when used with the Escaper extension + * fixed default cache umask + * removed Twig_Template instances from the debug tag output + * fixed objects with __isset() defined + * fixed set tag when used with a capture + * fixed type hinting for Twig_Environment::addFilter() method + +* 0.9.7 (2010-06-12) + +Backward incompatibilities: + * changed 'as' to '=' for the set tag ({% set title as "Title" %} must now be {% set title = "Title" %}) + * removed the sandboxed attribute of the include tag (use the new sandbox tag instead) + * refactored the Node system (if you have custom nodes, you will have to update them to use the new API) + + * added self as a special variable that refers to the current template (useful for importing macros from the current template) + * added Twig_Template instance support to the include tag + * added support for dynamic and conditional inheritance ({% extends some_var %} and {% extends standalone ? "minimum" : "base" %}) + * added a grammar sub-framework to ease the creation of custom tags + * fixed the for tag for large arrays (some loop variables are now only available for arrays and objects that implement the Countable interface) + * removed the Twig_Resource::resolveMissingFilter() method + * fixed the filter tag which did not apply filtering to included files + * added a bunch of unit tests + * added a bunch of phpdoc + * added a sandbox tag in the sandbox extension + * changed the date filter to support any date format supported by DateTime + * added strict_variable setting to throw an exception when an invalid variable is used in a template (disabled by default) + * added the lexer, parser, and compiler as arguments to the Twig_Environment constructor + * changed the cache option to only accepts an explicit path to a cache directory or false + * added a way to add token parsers, filters, and visitors without creating an extension + * added three interfaces: Twig_NodeInterface, Twig_TokenParserInterface, and Twig_FilterInterface + * changed the generated code to match the new coding standards + * fixed sandbox mode (__toString() method check was not enforced if called implicitly from a simple statement like {{ article }}) + * added an exception when a child template has a non-empty body (as it is always ignored when rendering) + +* 0.9.6 (2010-05-12) + + * fixed variables defined outside a loop and for which the value changes in a for loop + * fixed the test suite for PHP 5.2 and older versions of PHPUnit + * added support for __call() in expression resolution + * fixed node visiting for macros (macros are now visited by visitors as any other node) + * fixed nested block definitions with a parent call (rarely useful but nonetheless supported now) + * added the cycle filter + * fixed the Lexer when mbstring.func_overload is used with an mbstring.internal_encoding different from ASCII + * added a long-syntax for the set tag ({% set foo %}...{% endset %}) + * unit tests are now powered by PHPUnit + * added support for gettext via the `i18n` extension + * fixed twig_capitalize_string_filter() and fixed twig_length_filter() when used with UTF-8 values + * added a more useful exception if an if tag is not closed properly + * added support for escaping strategy in the autoescape tag + * fixed lexer when a template has a big chunk of text between/in a block + +* 0.9.5 (2010-01-20) + +As for any new release, don't forget to remove all cached templates after +upgrading. + +If you have defined custom filters, you MUST upgrade them for this release. To +upgrade, replace "array" with "new Twig_Filter_Function", and replace the +environment constant by the "needs_environment" option: + + // before + 'even' => array('twig_is_even_filter', false), + 'escape' => array('twig_escape_filter', true), + + // after + 'even' => new Twig_Filter_Function('twig_is_even_filter'), + 'escape' => new Twig_Filter_Function('twig_escape_filter', array('needs_environment' => true)), + +If you have created NodeTransformer classes, you will need to upgrade them to +the new interface (please note that the interface is not yet considered +stable). + + * fixed list nodes that did not extend the Twig_NodeListInterface + * added the "without loop" option to the for tag (it disables the generation of the loop variable) + * refactored node transformers to node visitors + * fixed automatic-escaping for blocks + * added a way to specify variables to pass to an included template + * changed the automatic-escaping rules to be more sensible and more configurable in custom filters (the documentation lists all the rules) + * improved the filter system to allow object methods to be used as filters + * changed the Array and String loaders to actually make use of the cache mechanism + * included the default filter function definitions in the extension class files directly (Core, Escaper) + * added the // operator (like the floor() PHP function) + * added the .. operator (as a syntactic sugar for the range filter when the step is 1) + * added the in operator (as a syntactic sugar for the in filter) + * added the following filters in the Core extension: in, range + * added support for arrays (same behavior as in PHP, a mix between lists and dictionaries, arrays and hashes) + * enhanced some error messages to provide better feedback in case of parsing errors + +* 0.9.4 (2009-12-02) + +If you have custom loaders, you MUST upgrade them for this release: The +Twig_Loader base class has been removed, and the Twig_LoaderInterface has also +been changed (see the source code for more information or the documentation). + + * added support for DateTime instances for the date filter + * fixed loop.last when the array only has one item + * made it possible to insert newlines in tag and variable blocks + * fixed a bug when a literal '\n' were present in a template text + * fixed bug when the filename of a template contains */ + * refactored loaders + +* 0.9.3 (2009-11-11) + +This release is NOT backward compatible with the previous releases. + + The loaders do not take the cache and autoReload arguments anymore. Instead, + the Twig_Environment class has two new options: cache and auto_reload. + Upgrading your code means changing this kind of code: + + $loader = new Twig_Loader_Filesystem('/path/to/templates', '/path/to/compilation_cache', true); + $twig = new Twig_Environment($loader); + + to something like this: + + $loader = new Twig_Loader_Filesystem('/path/to/templates'); + $twig = new Twig_Environment($loader, array( + 'cache' => '/path/to/compilation_cache', + 'auto_reload' => true, + )); + + * deprecated the "items" filter as it is not needed anymore + * made cache and auto_reload options of Twig_Environment instead of arguments of Twig_Loader + * optimized template loading speed + * removed output when an error occurs in a template and render() is used + * made major speed improvements for loops (up to 300% on even the smallest loops) + * added properties as part of the sandbox mode + * added public properties support (obj.item can now be the item property on the obj object) + * extended set tag to support expression as value ({% set foo as 'foo' ~ 'bar' %} ) + * fixed bug when \ was used in HTML + +* 0.9.2 (2009-10-29) + + * made some speed optimizations + * changed the cache extension to .php + * added a js escaping strategy + * added support for short block tag + * changed the filter tag to allow chained filters + * made lexer more flexible as you can now change the default delimiters + * added set tag + * changed default directory permission when cache dir does not exist (more secure) + * added macro support + * changed filters first optional argument to be a Twig_Environment instance instead of a Twig_Template instance + * made Twig_Autoloader::autoload() a static method + * avoid writing template file if an error occurs + * added $ escaping when outputting raw strings + * enhanced some error messages to ease debugging + * fixed empty cache files when the template contains an error + +* 0.9.1 (2009-10-14) + + * fixed a bug in PHP 5.2.6 + * fixed numbers with one than one decimal + * added support for method calls with arguments ({{ foo.bar('a', 43) }}) + * made small speed optimizations + * made minor tweaks to allow better extensibility and flexibility + +* 0.9.0 (2009-10-12) + + * Initial release diff --git a/core/vendor/Twig/LICENSE b/core/vendor/twig/twig/LICENSE similarity index 100% rename from core/vendor/Twig/LICENSE rename to core/vendor/twig/twig/LICENSE diff --git a/core/vendor/twig/twig/README.markdown b/core/vendor/twig/twig/README.markdown new file mode 100644 index 000000000000..88d6fabc0701 --- /dev/null +++ b/core/vendor/twig/twig/README.markdown @@ -0,0 +1,17 @@ +Twig, the flexible, fast, and secure template language for PHP +============================================================== + +[](http://travis-ci.org/fabpot/Twig) + +Twig is a template language for PHP, released under the new BSD license (code +and documentation). + +Twig uses a syntax similar to the Django and Jinja template languages which +inspired the Twig runtime environment. + +More Information +---------------- + +Read the [documentation][1] for more information. + +[1]: http://twig.sensiolabs.org/documentation diff --git a/core/vendor/twig/twig/bin/create_pear_package.php b/core/vendor/twig/twig/bin/create_pear_package.php new file mode 100644 index 000000000000..4899927fb4ac --- /dev/null +++ b/core/vendor/twig/twig/bin/create_pear_package.php @@ -0,0 +1,42 @@ +<?php + +if (!isset($argv[1])) +{ + die('You must provide the version (1.0.0)'); +} + +if (!isset($argv[2])) +{ + die('You must provide the stability (alpha, beta, or stable)'); +} + +$context = array( + 'date' => date('Y-m-d'), + 'time' => date('H:m:00'), + 'version' => $argv[1], + 'api_version' => $argv[1], + 'stability' => $argv[2], + 'api_stability' => $argv[2], +); + +$context['files'] = ''; +$path = realpath(dirname(__FILE__).'/../lib/Twig'); +foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::LEAVES_ONLY) as $file) +{ + if (preg_match('/\.php$/', $file)) + { + $name = str_replace($path.'/', '', $file); + $context['files'] .= ' <file install-as="Twig/'.$name.'" name="'.$name.'" role="php" />'."\n"; + } +} + +$template = file_get_contents(dirname(__FILE__).'/../package.xml.tpl'); +$content = preg_replace_callback('/\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/', 'replace_parameters', $template); +file_put_contents(dirname(__FILE__).'/../package.xml', $content); + +function replace_parameters($matches) +{ + global $context; + + return isset($context[$matches[1]]) ? $context[$matches[1]] : null; +} diff --git a/core/vendor/twig/twig/composer.json b/core/vendor/twig/twig/composer.json new file mode 100644 index 000000000000..9ca80fc9854a --- /dev/null +++ b/core/vendor/twig/twig/composer.json @@ -0,0 +1,31 @@ +{ + "name": "twig/twig", + "type": "library", + "description": "Twig, the flexible, fast, and secure template language for PHP", + "keywords": ["templating"], + "homepage": "http://twig.sensiolabs.org", + "license": "BSD-3", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com" + } + ], + "require": { + "php": ">=5.2.4" + }, + "autoload": { + "psr-0" : { + "Twig_" : "lib/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + } +} diff --git a/core/vendor/twig/twig/doc/advanced.rst b/core/vendor/twig/twig/doc/advanced.rst new file mode 100644 index 000000000000..0b33bead2c3f --- /dev/null +++ b/core/vendor/twig/twig/doc/advanced.rst @@ -0,0 +1,833 @@ +Extending Twig +============== + +Twig can be extended in many ways; you can add extra tags, filters, tests, +operators, global variables, and functions. You can even extend the parser +itself with node visitors. + +.. note:: + + The first section of this chapter describes how to extend Twig easily. If + you want to reuse your changes in different projects or if you want to + share them with others, you should then create an extension as described + in the following section. + +.. caution:: + + When extending Twig by calling methods on the Twig environment instance, + Twig won't be able to recompile your templates when the PHP code is + updated. To see your changes in real-time, either disable template caching + or package your code into an extension (see the next section of this + chapter). + +Before extending Twig, you must understand the differences between all the +different possible extension points and when to use them. + +First, remember that Twig has two main language constructs: + +* ``{{ }}``: used to print the result of an expression evaluation; + +* ``{% %}``: used to execute statements. + +To understand why Twig exposes so many extension points, let's see how to +implement a *Lorem ipsum* generator (it needs to know the number of words to +generate). + +You can use a ``lipsum`` *tag*: + +.. code-block:: jinja + + {% lipsum 40 %} + +That works, but using a tag for ``lipsum`` is not a good idea for at least +three main reasons: + +* ``lipsum`` is not a language construct; +* The tag outputs something; +* The tag is not flexible as you cannot use it in an expression: + + .. code-block:: jinja + + {{ 'some text' ~ {% lipsum 40 %} ~ 'some more text' }} + +In fact, you rarely need to create tags; and that's good news because tags are +the most complex extension point of Twig. + +Now, let's use a ``lipsum`` *filter*: + +.. code-block:: jinja + + {{ 40|lipsum }} + +Again, it works, but it looks weird. A filter transforms the passed value to +something else but here we use the value to indicate the number of words to +generate. + +Next, let's use a ``lipsum`` *function*: + +.. code-block:: jinja + + {{ lipsum(40) }} + +Here we go. For this specific example, the creation of a function is the +extension point to use. And you can use it anywhere an expression is accepted: + +.. code-block:: jinja + + {{ 'some text' ~ ipsum(40) ~ 'some more text' }} + + {% set ipsum = ipsum(40) %} + +Last but not the least, you can also use a *global* object with a method able +to generate lorem ipsum text: + +.. code-block:: jinja + + {{ text.lipsum(40) }} + +As a rule of thumb, use functions for frequently used features and global +objects for everything else. + +Keep in mind the following when you want to extend Twig: + +========== ========================== ========== ========================= +What? Implementation difficulty? How often? When? +========== ========================== ========== ========================= +*macro* trivial frequent Content generation +*global* trivial frequent Helper object +*function* trivial frequent Content generation +*filter* trivial frequent Value transformation +*tag* complex rare DSL language construct +*test* trivial rare Boolean decision +*operator* trivial rare Values transformation +========== ========================== ========== ========================= + +Globals +------- + +A global variable is like any other template variable, except that it's +available in all templates and macros:: + + $twig = new Twig_Environment($loader); + $twig->addGlobal('text', new Text()); + +You can then use the ``text`` variable anywhere in a template: + +.. code-block:: jinja + + {{ text.lipsum(40) }} + +Filters +------- + +A filter is a regular PHP function or an object method that takes the left +side of the filter (before the pipe ``|``) as first argument and the extra +arguments passed to the filter (within parentheses ``()``) as extra arguments. + +Defining a filter is as easy as associating the filter name with a PHP +callable. For instance, let's say you have the following code in a template: + +.. code-block:: jinja + + {{ 'TWIG'|lower }} + +When compiling this template to PHP, Twig looks for the PHP callable +associated with the ``lower`` filter. The ``lower`` filter is a built-in Twig +filter, and it is simply mapped to the PHP ``strtolower()`` function. After +compilation, the generated PHP code is roughly equivalent to: + +.. code-block:: html+php + + <?php echo strtolower('TWIG') ?> + +As you can see, the ``'TWIG'`` string is passed as a first argument to the PHP +function. + +A filter can also take extra arguments like in the following example: + +.. code-block:: jinja + + {{ now|date('d/m/Y') }} + +In this case, the extra arguments are passed to the function after the main +argument, and the compiled code is equivalent to: + +.. code-block:: html+php + + <?php echo twig_date_format_filter($now, 'd/m/Y') ?> + +Let's see how to create a new filter. + +In this section, we will create a ``rot13`` filter, which should return the +`rot13`_ transformation of a string. Here is an example of its usage and the +expected output: + +.. code-block:: jinja + + {{ "Twig"|rot13 }} + + {# should displays Gjvt #} + +Adding a filter is as simple as calling the ``addFilter()`` method on the +``Twig_Environment`` instance:: + + $twig = new Twig_Environment($loader); + $twig->addFilter('rot13', new Twig_Filter_Function('str_rot13')); + +The second argument of ``addFilter()`` is an instance of ``Twig_Filter``. +Here, we use ``Twig_Filter_Function`` as the filter is a PHP function. The +first argument passed to the ``Twig_Filter_Function`` constructor is the name +of the PHP function to call, here ``str_rot13``, a native PHP function. + +Let's say I now want to be able to add a prefix before the converted string: + +.. code-block:: jinja + + {{ "Twig"|rot13('prefix_') }} + + {# should displays prefix_Gjvt #} + +As the PHP ``str_rot13()`` function does not support this requirement, let's +create a new PHP function:: + + function project_compute_rot13($string, $prefix = '') + { + return $prefix.str_rot13($string); + } + +As you can see, the ``prefix`` argument of the filter is passed as an extra +argument to the ``project_compute_rot13()`` function. + +Adding this filter is as easy as before:: + + $twig->addFilter('rot13', new Twig_Filter_Function('project_compute_rot13')); + +For better encapsulation, a filter can also be defined as a static method of a +class. The ``Twig_Filter_Function`` class can also be used to register such +static methods as filters:: + + $twig->addFilter('rot13', new Twig_Filter_Function('SomeClass::rot13Filter')); + +.. tip:: + + In an extension, you can also define a filter as a static method of the + extension class. + +Environment aware Filters +~~~~~~~~~~~~~~~~~~~~~~~~~ + +The ``Twig_Filter`` classes take options as their last argument. For instance, +if you want access to the current environment instance in your filter, set the +``needs_environment`` option to ``true``:: + + $filter = new Twig_Filter_Function('str_rot13', array('needs_environment' => true)); + +Twig will then pass the current environment as the first argument to the +filter call:: + + function twig_compute_rot13(Twig_Environment $env, $string) + { + // get the current charset for instance + $charset = $env->getCharset(); + + return str_rot13($string); + } + +Automatic Escaping +~~~~~~~~~~~~~~~~~~ + +If automatic escaping is enabled, the output of the filter may be escaped +before printing. If your filter acts as an escaper (or explicitly outputs html +or javascript code), you will want the raw output to be printed. In such a +case, set the ``is_safe`` option:: + + $filter = new Twig_Filter_Function('nl2br', array('is_safe' => array('html'))); + +Some filters may have to work on already escaped or safe values. In such a +case, set the ``pre_escape`` option:: + + $filter = new Twig_Filter_Function('somefilter', array('pre_escape' => 'html', 'is_safe' => array('html'))); + +Dynamic Filters +~~~~~~~~~~~~~~~ + +.. versionadded:: 1.5 + Dynamic filters support was added in Twig 1.5. + +A filter name containing the special ``*`` character is a dynamic filter as +the ``*`` can be any string:: + + $twig->addFilter('*_path', new Twig_Filter_Function('twig_path')); + + function twig_path($name, $arguments) + { + // ... + } + +The following filters will be matched by the above defined dynamic filter: + +* ``product_path`` +* ``category_path`` + +A dynamic filter can define more than one dynamic parts:: + + $twig->addFilter('*_path_*', new Twig_Filter_Function('twig_path')); + + function twig_path($name, $suffix, $arguments) + { + // ... + } + +The filter will receive all dynamic part values before the normal filters +arguments. For instance, a call to ``'foo'|a_path_b()`` will result in the +following PHP call: ``twig_path('a', 'b', 'foo')``. + +Functions +--------- + +A function is a regular PHP function or an object method that can be called from +templates. + +.. code-block:: jinja + + {{ constant("DATE_W3C") }} + +When compiling this template to PHP, Twig looks for the PHP callable +associated with the ``constant`` function. The ``constant`` function is a built-in Twig +function, and it is simply mapped to the PHP ``constant()`` function. After +compilation, the generated PHP code is roughly equivalent to: + +.. code-block:: html+php + + <?php echo constant('DATE_W3C') ?> + +Adding a function is similar to adding a filter. This can be done by calling the +``addFunction()`` method on the ``Twig_Environment`` instance:: + + $twig = new Twig_Environment($loader); + $twig->addFunction('functionName', new Twig_Function_Function('someFunction')); + +You can also expose extension methods as functions in your templates:: + + // $this is an object that implements Twig_ExtensionInterface. + $twig = new Twig_Environment($loader); + $twig->addFunction('otherFunction', new Twig_Function_Method($this, 'someMethod')); + +Functions also support ``needs_environment`` and ``is_safe`` parameters. + +Dynamic Functions +~~~~~~~~~~~~~~~~~ + +.. versionadded:: 1.5 + Dynamic functions support was added in Twig 1.5. + +A function name containing the special ``*`` character is a dynamic function +as the ``*`` can be any string:: + + $twig->addFunction('*_path', new Twig_Function_Function('twig_path')); + + function twig_path($name, $arguments) + { + // ... + } + +The following functions will be matched by the above defined dynamic function: + +* ``product_path`` +* ``category_path`` + +A dynamic function can define more than one dynamic parts:: + + $twig->addFilter('*_path_*', new Twig_Filter_Function('twig_path')); + + function twig_path($name, $suffix, $arguments) + { + // ... + } + +The function will receive all dynamic part values before the normal functions +arguments. For instance, a call to ``a_path_b('foo')`` will result in the +following PHP call: ``twig_path('a', 'b', 'foo')``. + +Tags +---- + +One of the most exciting feature of a template engine like Twig is the +possibility to define new language constructs. This is also the most complex +feature as you need to understand how Twig's internals work. + +Let's create a simple ``set`` tag that allows the definition of simple +variables from within a template. The tag can be used like follows: + +.. code-block:: jinja + + {% set name = "value" %} + + {{ name }} + + {# should output value #} + +.. note:: + + The ``set`` tag is part of the Core extension and as such is always + available. The built-in version is slightly more powerful and supports + multiple assignments by default (cf. the template designers chapter for + more information). + +Three steps are needed to define a new tag: + +* Defining a Token Parser class (responsible for parsing the template code); + +* Defining a Node class (responsible for converting the parsed code to PHP); + +* Registering the tag. + +Registering a new tag +~~~~~~~~~~~~~~~~~~~~~ + +Adding a tag is as simple as calling the ``addTokenParser`` method on the +``Twig_Environment`` instance:: + + $twig = new Twig_Environment($loader); + $twig->addTokenParser(new Project_Set_TokenParser()); + +Defining a Token Parser +~~~~~~~~~~~~~~~~~~~~~~~ + +Now, let's see the actual code of this class:: + + class Project_Set_TokenParser extends Twig_TokenParser + { + public function parse(Twig_Token $token) + { + $lineno = $token->getLine(); + $name = $this->parser->getStream()->expect(Twig_Token::NAME_TYPE)->getValue(); + $this->parser->getStream()->expect(Twig_Token::OPERATOR_TYPE, '='); + $value = $this->parser->getExpressionParser()->parseExpression(); + + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + + return new Project_Set_Node($name, $value, $lineno, $this->getTag()); + } + + public function getTag() + { + return 'set'; + } + } + +The ``getTag()`` method must return the tag we want to parse, here ``set``. + +The ``parse()`` method is invoked whenever the parser encounters a ``set`` +tag. It should return a ``Twig_Node`` instance that represents the node (the +``Project_Set_Node`` calls creating is explained in the next section). + +The parsing process is simplified thanks to a bunch of methods you can call +from the token stream (``$this->parser->getStream()``): + +* ``getCurrent()``: Gets the current token in the stream. + +* ``next()``: Moves to the next token in the stream, *but returns the old one*. + +* ``test($type)``, ``test($value)`` or ``test($type, $value)``: Determines whether + the current token is of a particular type or value (or both). The value may be an + array of several possible values. + +* ``expect($type[, $value[, $message]])``: If the current token isn't of the given + type/value a syntax error is thrown. Otherwise, if the type and value are correct, + the token is returned and the stream moves to the next token. + +* ``look()``: Looks a the next token without consuming it. + +Parsing expressions is done by calling the ``parseExpression()`` like we did for +the ``set`` tag. + +.. tip:: + + Reading the existing ``TokenParser`` classes is the best way to learn all + the nitty-gritty details of the parsing process. + +Defining a Node +~~~~~~~~~~~~~~~ + +The ``Project_Set_Node`` class itself is rather simple:: + + class Project_Set_Node extends Twig_Node + { + public function __construct($name, Twig_Node_Expression $value, $lineno, $tag = null) + { + parent::__construct(array('value' => $value), array('name' => $name), $lineno, $tag); + } + + public function compile(Twig_Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write('$context[\''.$this->getAttribute('name').'\'] = ') + ->subcompile($this->getNode('value')) + ->raw(";\n") + ; + } + } + +The compiler implements a fluid interface and provides methods that helps the +developer generate beautiful and readable PHP code: + +* ``subcompile()``: Compiles a node. + +* ``raw()``: Writes the given string as is. + +* ``write()``: Writes the given string by adding indentation at the beginning + of each line. + +* ``string()``: Writes a quoted string. + +* ``repr()``: Writes a PHP representation of a given value (see + ``Twig_Node_For`` for a usage example). + +* ``addDebugInfo()``: Adds the line of the original template file related to + the current node as a comment. + +* ``indent()``: Indents the generated code (see ``Twig_Node_Block`` for a + usage example). + +* ``outdent()``: Outdents the generated code (see ``Twig_Node_Block`` for a + usage example). + +.. _creating_extensions: + +Creating an Extension +--------------------- + +The main motivation for writing an extension is to move often used code into a +reusable class like adding support for internationalization. An extension can +define tags, filters, tests, operators, global variables, functions, and node +visitors. + +Creating an extension also makes for a better separation of code that is +executed at compilation time and code needed at runtime. As such, it makes +your code faster. + +Most of the time, it is useful to create a single extension for your project, +to host all the specific tags and filters you want to add to Twig. + +.. tip:: + + When packaging your code into an extension, Twig is smart enough to + recompile your templates whenever you make a change to it (when the + ``auto_reload`` is enabled). + +.. note:: + + Before writing your own extensions, have a look at the Twig official + extension repository: http://github.com/fabpot/Twig-extensions. + +An extension is a class that implements the following interface:: + + interface Twig_ExtensionInterface + { + /** + * Initializes the runtime environment. + * + * This is where you can load some file that contains filter functions for instance. + * + * @param Twig_Environment $environment The current Twig_Environment instance + */ + function initRuntime(Twig_Environment $environment); + + /** + * Returns the token parser instances to add to the existing list. + * + * @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances + */ + function getTokenParsers(); + + /** + * Returns the node visitor instances to add to the existing list. + * + * @return array An array of Twig_NodeVisitorInterface instances + */ + function getNodeVisitors(); + + /** + * Returns a list of filters to add to the existing list. + * + * @return array An array of filters + */ + function getFilters(); + + /** + * Returns a list of tests to add to the existing list. + * + * @return array An array of tests + */ + function getTests(); + + /** + * Returns a list of functions to add to the existing list. + * + * @return array An array of functions + */ + function getFunctions(); + + /** + * Returns a list of operators to add to the existing list. + * + * @return array An array of operators + */ + function getOperators(); + + /** + * Returns a list of global variables to add to the existing list. + * + * @return array An array of global variables + */ + function getGlobals(); + + /** + * Returns the name of the extension. + * + * @return string The extension name + */ + function getName(); + } + +To keep your extension class clean and lean, it can inherit from the built-in +``Twig_Extension`` class instead of implementing the whole interface. That +way, you just need to implement the ``getName()`` method as the +``Twig_Extension`` provides empty implementations for all other methods. + +The ``getName()`` method must return a unique identifier for your extension. + +Now, with this information in mind, let's create the most basic extension +possible:: + + class Project_Twig_Extension extends Twig_Extension + { + public function getName() + { + return 'project'; + } + } + +.. note:: + + Of course, this extension does nothing for now. We will customize it in + the next sections. + +Twig does not care where you save your extension on the filesystem, as all +extensions must be registered explicitly to be available in your templates. + +You can register an extension by using the ``addExtension()`` method on your +main ``Environment`` object:: + + $twig = new Twig_Environment($loader); + $twig->addExtension(new Project_Twig_Extension()); + +Of course, you need to first load the extension file by either using +``require_once()`` or by using an autoloader (see `spl_autoload_register()`_). + +.. tip:: + + The bundled extensions are great examples of how extensions work. + +Globals +~~~~~~~ + +Global variables can be registered in an extension via the ``getGlobals()`` +method:: + + class Project_Twig_Extension extends Twig_Extension + { + public function getGlobals() + { + return array( + 'text' => new Text(), + ); + } + + // ... + } + +Functions +~~~~~~~~~ + +Functions can be registered in an extension via the ``getFunctions()`` +method:: + + class Project_Twig_Extension extends Twig_Extension + { + public function getFunctions() + { + return array( + 'lipsum' => new Twig_Function_Function('generate_lipsum'), + ); + } + + // ... + } + +Filters +~~~~~~~ + +To add a filter to an extension, you need to override the ``getFilters()`` +method. This method must return an array of filters to add to the Twig +environment:: + + class Project_Twig_Extension extends Twig_Extension + { + public function getFilters() + { + return array( + 'rot13' => new Twig_Filter_Function('str_rot13'), + ); + } + + // ... + } + +As you can see in the above code, the ``getFilters()`` method returns an array +where keys are the name of the filters (``rot13``) and the values the +definition of the filter (``new Twig_Filter_Function('str_rot13')``). + +As seen in the previous chapter, you can also define filters as static methods +on the extension class:: + +$twig->addFilter('rot13', new Twig_Filter_Function('Project_Twig_Extension::rot13Filter')); + +You can also use ``Twig_Filter_Method`` instead of ``Twig_Filter_Function`` +when defining a filter to use a method:: + + class Project_Twig_Extension extends Twig_Extension + { + public function getFilters() + { + return array( + 'rot13' => new Twig_Filter_Method($this, 'rot13Filter'), + ); + } + + public function rot13Filter($string) + { + return str_rot13($string); + } + + // ... + } + +The first argument of the ``Twig_Filter_Method`` constructor is always +``$this``, the current extension object. The second one is the name of the +method to call. + +Using methods for filters is a great way to package your filter without +polluting the global namespace. This also gives the developer more flexibility +at the cost of a small overhead. + +Overriding default Filters +.......................... + +If some default core filters do not suit your needs, you can easily override +them by creating your own core extension. Of course, you don't need to copy +and paste the whole core extension code of Twig. Instead, you can just extends +it and override the filter(s) you want by overriding the ``getFilters()`` +method:: + + class MyCoreExtension extends Twig_Extension_Core + { + public function getFilters() + { + return array_merge(parent::getFilters(), array( + 'date' => new Twig_Filter_Method($this, 'dateFilter'), + // ... + )); + } + + public function dateFilter($timestamp, $format = 'F j, Y H:i') + { + return '...'.twig_date_format_filter($timestamp, $format); + } + + // ... + } + +Here, we override the ``date`` filter with a custom one. Using this new core +extension is as simple as registering the ``MyCoreExtension`` extension by +calling the ``addExtension()`` method on the environment instance:: + + $twig = new Twig_Environment($loader); + $twig->addExtension(new MyCoreExtension()); + +But I can already hear some people wondering how it can work as the Core +extension is loaded by default. That's true, but the trick is that both +extensions share the same unique identifier (``core`` - defined in the +``getName()`` method). By registering an extension with the same name as an +existing one, you have actually overridden the default one, even if it is +already registered:: + + $twig->addExtension(new Twig_Extension_Core()); + $twig->addExtension(new MyCoreExtension()); + +Tags +~~~~ + +Adding a tag in an extension can be done by overriding the +``getTokenParsers()`` method. This method must return an array of tags to add +to the Twig environment:: + + class Project_Twig_Extension extends Twig_Extension + { + public function getTokenParsers() + { + return array(new Project_Set_TokenParser()); + } + + // ... + } + +In the above code, we have added a single new tag, defined by the +``Project_Set_TokenParser`` class. The ``Project_Set_TokenParser`` class is +responsible for parsing the tag and compiling it to PHP. + +Operators +~~~~~~~~~ + +The ``getOperators()`` methods allows to add new operators. Here is how to add +``!``, ``||``, and ``&&`` operators:: + + class Project_Twig_Extension extends Twig_Extension + { + public function getOperators() + { + return array( + array( + '!' => array('precedence' => 50, 'class' => 'Twig_Node_Expression_Unary_Not'), + ), + array( + '||' => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + '&&' => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + ), + ); + } + + // ... + } + +Tests +~~~~~ + +The ``getTests()`` methods allows to add new test functions:: + + class Project_Twig_Extension extends Twig_Extension + { + public function getTests() + { + return array( + 'even' => new Twig_Test_Function('twig_test_even'), + ); + } + + // ... + } + +.. _`spl_autoload_register()`: http://www.php.net/spl_autoload_register +.. _`rot13`: http://www.php.net/manual/en/function.str-rot13.php diff --git a/core/vendor/twig/twig/doc/api.rst b/core/vendor/twig/twig/doc/api.rst new file mode 100644 index 000000000000..a4620666bbb4 --- /dev/null +++ b/core/vendor/twig/twig/doc/api.rst @@ -0,0 +1,487 @@ +Twig for Developers +=================== + +This chapter describes the API to Twig and not the template language. It will +be most useful as reference to those implementing the template interface to +the application and not those who are creating Twig templates. + +Basics +------ + +Twig uses a central object called the **environment** (of class +``Twig_Environment``). Instances of this class are used to store the +configuration and extensions, and are used to load templates from the file +system or other locations. + +Most applications will create one ``Twig_Environment`` object on application +initialization and use that to load templates. In some cases it's however +useful to have multiple environments side by side, if different configurations +are in use. + +The simplest way to configure Twig to load templates for your application +looks roughly like this:: + + require_once '/path/to/lib/Twig/Autoloader.php'; + Twig_Autoloader::register(); + + $loader = new Twig_Loader_Filesystem('/path/to/templates'); + $twig = new Twig_Environment($loader, array( + 'cache' => '/path/to/compilation_cache', + )); + +This will create a template environment with the default settings and a loader +that looks up the templates in the ``/path/to/templates/`` folder. Different +loaders are available and you can also write your own if you want to load +templates from a database or other resources. + +.. note:: + + Notice that the second argument of the environment is an array of options. + The ``cache`` option is a compilation cache directory, where Twig caches + the compiled templates to avoid the parsing phase for sub-sequent + requests. It is very different from the cache you might want to add for + the evaluated templates. For such a need, you can use any available PHP + cache library. + +To load a template from this environment you just have to call the +``loadTemplate()`` method which then returns a ``Twig_Template`` instance:: + + $template = $twig->loadTemplate('index.html'); + +To render the template with some variables, call the ``render()`` method:: + + echo $template->render(array('the' => 'variables', 'go' => 'here')); + +.. note:: + + The ``display()`` method is a shortcut to output the template directly. + +You can also load and render the template in one fell swoop:: + + echo $twig->render('index.html', array('the' => 'variables', 'go' => 'here')); + +.. _environment_options: + +Environment Options +------------------- + +When creating a new ``Twig_Environment`` instance, you can pass an array of +options as the constructor second argument:: + + $twig = new Twig_Environment($loader, array('debug' => true)); + +The following options are available: + +* ``debug``: When set to ``true``, the generated templates have a + ``__toString()`` method that you can use to display the generated nodes + (default to ``false``). + +* ``charset``: The charset used by the templates (default to ``utf-8``). + +* ``base_template_class``: The base template class to use for generated + templates (default to ``Twig_Template``). + +* ``cache``: An absolute path where to store the compiled templates, or + ``false`` to disable caching (which is the default). + +* ``auto_reload``: When developing with Twig, it's useful to recompile the + template whenever the source code changes. If you don't provide a value for + the ``auto_reload`` option, it will be determined automatically based on the + ``debug`` value. + +* ``strict_variables``: If set to ``false``, Twig will silently ignore invalid + variables (variables and or attributes/methods that do not exist) and + replace them with a ``null`` value. When set to ``true``, Twig throws an + exception instead (default to ``false``). + +* ``autoescape``: If set to ``true``, auto-escaping will be enabled by default + for all templates (default to ``true``). As of Twig 1.8, you can set the + escaping strategy to use (``html``, ``js``, ``false`` to disable, or a PHP + callback that takes the template "filename" and must return the escaping + strategy to use -- the callback cannot be a function name to avoid collision + with built-in escaping strategies). + +* ``optimizations``: A flag that indicates which optimizations to apply + (default to ``-1`` -- all optimizations are enabled; set it to ``0`` to + disable). + +Loaders +------- + +Loaders are responsible for loading templates from a resource such as the file +system. + +Compilation Cache +~~~~~~~~~~~~~~~~~ + +All template loaders can cache the compiled templates on the filesystem for +future reuse. It speeds up Twig a lot as templates are only compiled once; and +the performance boost is even larger if you use a PHP accelerator such as APC. +See the ``cache`` and ``auto_reload`` options of ``Twig_Environment`` above +for more information. + +Built-in Loaders +~~~~~~~~~~~~~~~~ + +Here is a list of the built-in loaders Twig provides: + +* ``Twig_Loader_Filesystem``: Loads templates from the file system. This + loader can find templates in folders on the file system and is the preferred + way to load them:: + + $loader = new Twig_Loader_Filesystem($templateDir); + + It can also look for templates in an array of directories:: + + $loader = new Twig_Loader_Filesystem(array($templateDir1, $templateDir2)); + + With such a configuration, Twig will first look for templates in + ``$templateDir1`` and if they do not exist, it will fallback to look for + them in the ``$templateDir2``. + +* ``Twig_Loader_String``: Loads templates from a string. It's a dummy loader + as you pass it the source code directly:: + + $loader = new Twig_Loader_String(); + +* ``Twig_Loader_Array``: Loads a template from a PHP array. It's passed an + array of strings bound to template names. This loader is useful for unit + testing:: + + $loader = new Twig_Loader_Array($templates); + +.. tip:: + + When using the ``Array`` or ``String`` loaders with a cache mechanism, you + should know that a new cache key is generated each time a template content + "changes" (the cache key being the source code of the template). If you + don't want to see your cache grows out of control, you need to take care + of clearing the old cache file by yourself. + +Create your own Loader +~~~~~~~~~~~~~~~~~~~~~~ + +All loaders implement the ``Twig_LoaderInterface``:: + + interface Twig_LoaderInterface + { + /** + * Gets the source code of a template, given its name. + * + * @param string $name string The name of the template to load + * + * @return string The template source code + */ + function getSource($name); + + /** + * Gets the cache key to use for the cache for a given template name. + * + * @param string $name string The name of the template to load + * + * @return string The cache key + */ + function getCacheKey($name); + + /** + * Returns true if the template is still fresh. + * + * @param string $name The template name + * @param timestamp $time The last modification time of the cached template + */ + function isFresh($name, $time); + } + +As an example, here is how the built-in ``Twig_Loader_String`` reads:: + + class Twig_Loader_String implements Twig_LoaderInterface + { + public function getSource($name) + { + return $name; + } + + public function getCacheKey($name) + { + return $name; + } + + public function isFresh($name, $time) + { + return false; + } + } + +The ``isFresh()`` method must return ``true`` if the current cached template +is still fresh, given the last modification time, or ``false`` otherwise. + +Using Extensions +---------------- + +Twig extensions are packages that add new features to Twig. Using an +extension is as simple as using the ``addExtension()`` method:: + + $twig->addExtension(new Twig_Extension_Sandbox()); + +Twig comes bundled with the following extensions: + +* *Twig_Extension_Core*: Defines all the core features of Twig. + +* *Twig_Extension_Escaper*: Adds automatic output-escaping and the possibility + to escape/unescape blocks of code. + +* *Twig_Extension_Sandbox*: Adds a sandbox mode to the default Twig + environment, making it safe to evaluated untrusted code. + +* *Twig_Extension_Optimizer*: Optimizers the node tree before compilation. + +The core, escaper, and optimizer extensions do not need to be added to the +Twig environment, as they are registered by default. You can disable an +already registered extension:: + + $twig->removeExtension('escaper'); + +Built-in Extensions +------------------- + +This section describes the features added by the built-in extensions. + +.. tip:: + + Read the chapter about extending Twig to learn how to create your own + extensions. + +Core Extension +~~~~~~~~~~~~~~ + +The ``core`` extension defines all the core features of Twig: + +* Tags: + + * ``for`` + * ``if`` + * ``extends`` + * ``include`` + * ``block`` + * ``filter`` + * ``macro`` + * ``import`` + * ``from`` + * ``set`` + * ``spaceless`` + +* Filters: + + * ``date`` + * ``format`` + * ``replace`` + * ``url_encode`` + * ``json_encode`` + * ``title`` + * ``capitalize`` + * ``upper`` + * ``lower`` + * ``striptags`` + * ``join`` + * ``reverse`` + * ``length`` + * ``sort`` + * ``merge`` + * ``default`` + * ``keys`` + * ``escape`` + * ``e`` + +* Functions: + + * ``range`` + * ``constant`` + * ``cycle`` + * ``parent`` + * ``block`` + +* Tests: + + * ``even`` + * ``odd`` + * ``defined`` + * ``sameas`` + * ``null`` + * ``divisibleby`` + * ``constant`` + * ``empty`` + +Escaper Extension +~~~~~~~~~~~~~~~~~ + +The ``escaper`` extension adds automatic output escaping to Twig. It defines a +tag, ``autoescape``, and a filter, ``raw``. + +When creating the escaper extension, you can switch on or off the global +output escaping strategy:: + + $escaper = new Twig_Extension_Escaper(true); + $twig->addExtension($escaper); + +If set to ``true``, all variables in templates are escaped (using the ``html`` +escaping strategy), except those using the ``raw`` filter: + +.. code-block:: jinja + + {{ article.to_html|raw }} + +You can also change the escaping mode locally by using the ``autoescape`` tag +(see the :doc:`autoescape<tags/autoescape>` doc for the syntax used before +Twig 1.8): + +.. code-block:: jinja + + {% autoescape 'html' %} + {{ var }} + {{ var|raw }} {# var won't be escaped #} + {{ var|escape }} {# var won't be double-escaped #} + {% endautoescape %} + +.. warning:: + + The ``autoescape`` tag has no effect on included files. + +The escaping rules are implemented as follows: + +* Literals (integers, booleans, arrays, ...) used in the template directly as + variables or filter arguments are never automatically escaped: + + .. code-block:: jinja + + {{ "Twig<br />" }} {# won't be escaped #} + + {% set text = "Twig<br />" %} + {{ text }} {# will be escaped #} + +* Expressions which the result is always a literal or a variable marked safe + are never automatically escaped: + + .. code-block:: jinja + + {{ foo ? "Twig<br />" : "<br />Twig" }} {# won't be escaped #} + + {% set text = "Twig<br />" %} + {{ foo ? text : "<br />Twig" }} {# will be escaped #} + + {% set text = "Twig<br />" %} + {{ foo ? text|raw : "<br />Twig" }} {# won't be escaped #} + + {% set text = "Twig<br />" %} + {{ foo ? text|escape : "<br />Twig" }} {# the result of the expression won't be escaped #} + +* Escaping is applied before printing, after any other filter is applied: + + .. code-block:: jinja + + {{ var|upper }} {# is equivalent to {{ var|upper|escape }} #} + +* The `raw` filter should only be used at the end of the filter chain: + + .. code-block:: jinja + + {{ var|raw|upper }} {# will be escaped #} + + {{ var|upper|raw }} {# won't be escaped #} + +* Automatic escaping is not applied if the last filter in the chain is marked + safe for the current context (e.g. ``html`` or ``js``). ``escaper`` and + ``escaper('html')`` are marked safe for html, ``escaper('js')`` is marked + safe for javascript, ``raw`` is marked safe for everything. + + .. code-block:: jinja + + {% autoescape true js %} + {{ var|escape('html') }} {# will be escaped for html and javascript #} + {{ var }} {# will be escaped for javascript #} + {{ var|escape('js') }} {# won't be double-escaped #} + {% endautoescape %} + +.. note:: + + Note that autoescaping has some limitations as escaping is applied on + expressions after evaluation. For instance, when working with + concatenation, ``{{ foo|raw ~ bar }}`` won't give the expected result as + escaping is applied on the result of the concatenation, not on the + individual variables (so, the ``raw`` filter won't have any effect here). + +Sandbox Extension +~~~~~~~~~~~~~~~~~ + +The ``sandbox`` extension can be used to evaluate untrusted code. Access to +unsafe attributes and methods is prohibited. The sandbox security is managed +by a policy instance. By default, Twig comes with one policy class: +``Twig_Sandbox_SecurityPolicy``. This class allows you to white-list some +tags, filters, properties, and methods:: + + $tags = array('if'); + $filters = array('upper'); + $methods = array( + 'Article' => array('getTitle', 'getBody'), + ); + $properties = array( + 'Article' => array('title', 'body'), + ); + $functions = array('range'); + $policy = new Twig_Sandbox_SecurityPolicy($tags, $filters, $methods, $properties, $functions); + +With the previous configuration, the security policy will only allow usage of +the ``if`` tag, and the ``upper`` filter. Moreover, the templates will only be +able to call the ``getTitle()`` and ``getBody()`` methods on ``Article`` +objects, and the ``title`` and ``body`` public properties. Everything else +won't be allowed and will generate a ``Twig_Sandbox_SecurityError`` exception. + +The policy object is the first argument of the sandbox constructor:: + + $sandbox = new Twig_Extension_Sandbox($policy); + $twig->addExtension($sandbox); + +By default, the sandbox mode is disabled and should be enabled when including +untrusted template code by using the ``sandbox`` tag: + +.. code-block:: jinja + + {% sandbox %} + {% include 'user.html' %} + {% endsandbox %} + +You can sandbox all templates by passing ``true`` as the second argument of +the extension constructor:: + + $sandbox = new Twig_Extension_Sandbox($policy, true); + +Optimizer Extension +~~~~~~~~~~~~~~~~~~~ + +The ``optimizer`` extension optimizes the node tree before compilation:: + + $twig->addExtension(new Twig_Extension_Optimizer()); + +By default, all optimizations are turned on. You can select the ones you want +to enable by passing them to the constructor:: + + $optimizer = new Twig_Extension_Optimizer(Twig_NodeVisitor_Optimizer::OPTIMIZE_FOR); + + $twig->addExtension($optimizer); + +Exceptions +---------- + +Twig can throw exceptions: + +* ``Twig_Error``: The base exception for all errors. + +* ``Twig_Error_Syntax``: Thrown to tell the user that there is a problem with + the template syntax. + +* ``Twig_Error_Runtime``: Thrown when an error occurs at runtime (when a filter + does not exist for instance). + +* ``Twig_Error_Loader``: Thrown when an error occurs during template loading. + +* ``Twig_Sandbox_SecurityError``: Thrown when an unallowed tag, filter, or + method is called in a sandboxed template. diff --git a/core/vendor/twig/twig/doc/coding_standards.rst b/core/vendor/twig/twig/doc/coding_standards.rst new file mode 100644 index 000000000000..e0aab35eaa91 --- /dev/null +++ b/core/vendor/twig/twig/doc/coding_standards.rst @@ -0,0 +1,101 @@ +Coding Standards +================ + +When writing Twig templates, we recommend you to follow these official coding +standards: + +* Put one (and only one) space after the start of a delimiter (``{{``, ``{%``, + and ``{#``) and before the end of a delimiter (``}}``, ``%}``, and ``#}``): + + .. code-block:: jinja + + {{ foo }} + {# comment #} + {% if foo %}{% endif %} + + When using the whitespace control character, do not put any spaces between + it and the delimiter: + + .. code-block:: jinja + + {{- foo -}} + {#- comment -#} + {%- if foo -%}{%- endif -%} + +* Put one (and only one) space before and after the following operators: + comparison operators (``==``, ``!=``, ``<``, ``>``, ``>=``, ``<=``), math + operators (``+``, ``-``, ``/``, ``*``, ``%``, ``//``, ``**``), logic + operators (``not``, ``and``, ``or``), ``~``, ``is``, ``in``, and the ternary + operator (``?:``): + + .. code-block:: jinja + + {{ 1 + 2 }} + {{ foo ~ bar }} + {{ true ? true : false }} + +* Put one (and only one) space after the ``:`` sign in hashes and ``,`` in + arrays and hashes: + + .. code-block:: jinja + + {{ [1, 2, 3] }} + {{ {'foo': 'bar'} }} + +* Do not put any spaces after an opening parenthesis and before a closing + parenthesis in expressions: + + .. code-block:: jinja + + {{ 1 + (2 * 3) }} + +* Do not put any spaces before and after string delimiters: + + .. code-block:: jinja + + {{ 'foo' }} + {{ "foo" }} + +* Do not put any spaces before and after the following operators: ``|``, + ``.``, ``..``, ``[]``: + + .. code-block:: jinja + + {{ foo|upper|lower }} + {{ user.name }} + {{ user[name] }} + {% for i in 1..12 %}{% endfor %} + +* Do not put any spaces before and after the parenthesis used for filter and + function calls: + + .. code-block:: jinja + + {{ foo|default('foo') }} + {{ range(1..10) }} + +* Do not put any spaces before and after the opening and the closing of arrays + and hashes: + + .. code-block:: jinja + + {{ [1, 2, 3] }} + {{ {'foo': 'bar'} }} + +* Use lower cased and underscored variable names: + + .. code-block:: jinja + + {% set foo = 'foo' %} + {% set foo_bar = 'foo' %} + +* Indent your code inside tags (use the same indentation as the one used for + the main language of the file): + + .. code-block:: jinja + + {% block foo %} + {% if true %} + true + {% endif %} + {% endblock %} diff --git a/core/vendor/twig/twig/doc/filters/abs.rst b/core/vendor/twig/twig/doc/filters/abs.rst new file mode 100644 index 000000000000..3a82f62e4a4c --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/abs.rst @@ -0,0 +1,18 @@ +``abs`` +======= + +The ``abs`` filter returns the absolute value. + +.. code-block:: jinja + + {# number = -5 #} + + {{ number|abs }} + + {# outputs 5 #} + +.. note:: + + Internally, Twig uses the PHP `abs`_ function. + +.. _`abs`: http://php.net/abs diff --git a/core/vendor/twig/twig/doc/filters/capitalize.rst b/core/vendor/twig/twig/doc/filters/capitalize.rst new file mode 100644 index 000000000000..10546a1f3ec8 --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/capitalize.rst @@ -0,0 +1,11 @@ +``capitalize`` +============== + +The ``capitalize`` filter capitalizes a value. The first character will be +uppercase, all others lowercase: + +.. code-block:: jinja + + {{ 'my first car'|capitalize }} + + {# outputs 'My first car' #} diff --git a/core/vendor/twig/twig/doc/filters/convert_encoding.rst b/core/vendor/twig/twig/doc/filters/convert_encoding.rst new file mode 100644 index 000000000000..2febab2ff7e9 --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/convert_encoding.rst @@ -0,0 +1,22 @@ +``convert_encoding`` +==================== + +.. versionadded:: 1.4 + The ``convert_encoding`` filter was added in Twig 1.4. + +The ``convert_encoding`` filter converts a string from one encoding to +another. The first argument is the expected output charset and the second one +is the input charset: + +.. code-block:: jinja + + {{ data|convert_encoding('UTF-8', 'iso-2022-jp') }} + +.. note:: + + This filter relies on the `iconv`_ or `mbstring`_ extension, so one of + them must be installed. In case both are installed, `mbstring`_ is used by + default (Twig before 1.8.1 uses `iconv`_ by default). + +.. _`iconv`: http://php.net/iconv +.. _`mbstring`: http://php.net/mbstring diff --git a/core/vendor/twig/twig/doc/filters/date.rst b/core/vendor/twig/twig/doc/filters/date.rst new file mode 100644 index 000000000000..9833f0342f27 --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/date.rst @@ -0,0 +1,65 @@ +``date`` +======== + +.. versionadded:: 1.1 + The timezone support has been added in Twig 1.1. + +.. versionadded:: 1.5 + The default date format support has been added in Twig 1.5. + +.. versionadded:: 1.6.1 + The default timezone support has been added in Twig 1.6.1. + +The ``date`` filter formats a date to a given format: + +.. code-block:: jinja + + {{ post.published_at|date("m/d/Y") }} + +The ``date`` filter accepts strings (it must be in a format supported by the +`date`_ function), `DateTime`_ instances, or `DateInterval`_ instances. For +instance, to display the current date, filter the word "now": + +.. code-block:: jinja + + {{ "now"|date("m/d/Y") }} + +To escape words and characters in the date format use ``\\`` in front of each character: + +.. code-block:: jinja + + {{ post.published_at|date("F jS \\a\\t g:ia") }} + +You can also specify a timezone: + +.. code-block:: jinja + + {{ post.published_at|date("m/d/Y", "Europe/Paris") }} + +If no format is provided, Twig will use the default one: ``F j, Y H:i``. This +default can be easily changed by calling the ``setDateFormat()`` method on the +``core`` extension instance. The first argument is the default format for +dates and the second one is the default format for date intervals: + +.. code-block:: php + + $twig = new Twig_Environment($loader); + $twig->getExtension('core')->setDateFormat('d/m/Y', '%d days'); + +The default timezone can also be set globally by calling ``setTimezone()``: + +.. code-block:: php + + $twig = new Twig_Environment($loader); + $twig->getExtension('core')->setTimezone('Europe/Paris'); + +.. _`date`: http://www.php.net/date +.. _`DateTime`: http://www.php.net/DateTime +.. _`DateInterval`: http://www.php.net/DateInterval + +If the value passed to the ``date`` filter is null, it will return the current date by default. +If an empty string is desired instead of the current date, use a ternary operator: + +.. code-block:: jinja + + {{ post.published_at is empty ? "" : post.published_at|date("m/d/Y") }} diff --git a/core/vendor/twig/twig/doc/filters/default.rst b/core/vendor/twig/twig/doc/filters/default.rst new file mode 100644 index 000000000000..4055ead81f71 --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/default.rst @@ -0,0 +1,28 @@ +``default`` +=========== + +The ``default`` filter returns the passed default value if the value is +undefined or empty, otherwise the value of the variable: + +.. code-block:: jinja + + {{ var|default('var is not defined') }} + + {{ var.foo|default('foo item on var is not defined') }} + + {{ var['foo']|default('foo item on var is not defined') }} + + {{ ''|default('passed var is empty') }} + +When using the ``default`` filter on an expression that uses variables in some +method calls, be sure to use the ``default`` filter whenever a variable can be +undefined: + +.. code-block:: jinja + + {{ var.method(foo|default('foo'))|default('foo') }} + +.. note:: + + Read the documentation for the :doc:`defined<../tests/defined>` and + :doc:`empty<../tests/empty>` tests to learn more about their semantics. diff --git a/core/vendor/twig/twig/doc/filters/escape.rst b/core/vendor/twig/twig/doc/filters/escape.rst new file mode 100644 index 000000000000..51429775c262 --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/escape.rst @@ -0,0 +1,39 @@ +``escape`` +========== + +The ``escape`` filter converts the characters ``&``, ``<``, ``>``, ``'``, and +``"`` in strings to HTML-safe sequences. Use this if you need to display text +that might contain such characters in HTML: + +.. code-block:: jinja + + {{ user.username|escape }} + +For convenience, the ``e`` filter is defined as an alias: + +.. code-block:: jinja + + {{ user.username|e }} + +The ``escape`` filter can also be used in other contexts than HTML thanks to +an optional argument which defines the escaping strategy to use: + +.. code-block:: jinja + + {{ user.username|e }} + {# is equivalent to #} + {{ user.username|e('html') }} + +And here is how to escape variables included in JavaScript code: + +.. code-block:: jinja + + {{ user.username|escape('js') }} + {{ user.username|e('js') }} + +.. note:: + + Internally, ``escape`` uses the PHP native `htmlspecialchars`_ function + for the HTML escaping strategy. + +.. _`htmlspecialchars`: http://php.net/htmlspecialchars diff --git a/core/vendor/twig/twig/doc/filters/format.rst b/core/vendor/twig/twig/doc/filters/format.rst new file mode 100644 index 000000000000..fd5b18d0e068 --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/format.rst @@ -0,0 +1,16 @@ +``format`` +========== + +The ``format`` filter formats a given string by replacing the placeholders +(placeholders follows the `printf`_ notation): + +.. code-block:: jinja + + {{ "I like %s and %s."|format(foo, "bar") }} + + {# returns I like foo and bar + if the foo parameter equals to the foo string. #} + +.. _`printf`: http://www.php.net/printf + +.. seealso:: :doc:`replace<replace>` diff --git a/core/vendor/twig/twig/doc/filters/index.rst b/core/vendor/twig/twig/doc/filters/index.rst new file mode 100644 index 000000000000..bd8f49513f5f --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/index.rst @@ -0,0 +1,30 @@ +Filters +======= + +.. toctree:: + :maxdepth: 1 + + date + format + replace + number_format + url_encode + json_encode + convert_encoding + title + capitalize + nl2br + upper + lower + striptags + join + reverse + length + sort + default + keys + escape + raw + merge + slice + trim diff --git a/core/vendor/twig/twig/doc/filters/join.rst b/core/vendor/twig/twig/doc/filters/join.rst new file mode 100644 index 000000000000..eec20454b024 --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/join.rst @@ -0,0 +1,18 @@ +``join`` +======== + +The ``join`` filter returns a string which is the concatenation of the items +of a sequence: + +.. code-block:: jinja + + {{ [1, 2, 3]|join }} + {# returns 123 #} + +The separator between elements is an empty string per default, but you can +define it with the optional first parameter: + +.. code-block:: jinja + + {{ [1, 2, 3]|join('|') }} + {# returns 1|2|3 #} diff --git a/core/vendor/twig/twig/doc/filters/json_encode.rst b/core/vendor/twig/twig/doc/filters/json_encode.rst new file mode 100644 index 000000000000..c7d19b39f11a --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/json_encode.rst @@ -0,0 +1,14 @@ +``json_encode`` +=============== + +The ``json_encode`` filter returns the JSON representation of a string: + +.. code-block:: jinja + + {{ data|json_encode() }} + +.. note:: + + Internally, Twig uses the PHP `json_encode`_ function. + +.. _`json_encode`: http://php.net/json_encode diff --git a/core/vendor/twig/twig/doc/filters/keys.rst b/core/vendor/twig/twig/doc/filters/keys.rst new file mode 100644 index 000000000000..e4f090c6b7a4 --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/keys.rst @@ -0,0 +1,11 @@ +``keys`` +======== + +The ``keys`` filter returns the keys of an array. It is useful when you want to +iterate over the keys of an array: + +.. code-block:: jinja + + {% for key in array|keys %} + ... + {% endfor %} diff --git a/core/vendor/twig/twig/doc/filters/length.rst b/core/vendor/twig/twig/doc/filters/length.rst new file mode 100644 index 000000000000..f79b9bdfd396 --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/length.rst @@ -0,0 +1,12 @@ +``length`` +========== + +The ``length`` filters returns the number of items of a sequence or mapping, or +the length of a string: + +.. code-block:: jinja + + {% if users|length > 10 %} + ... + {% endif %} + diff --git a/core/vendor/twig/twig/doc/filters/lower.rst b/core/vendor/twig/twig/doc/filters/lower.rst new file mode 100644 index 000000000000..ef9faa90a316 --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/lower.rst @@ -0,0 +1,10 @@ +``lower`` +========= + +The ``lower`` filter converts a value to lowercase: + +.. code-block:: jinja + + {{ 'WELCOME'|lower }} + + {# outputs 'welcome' #} diff --git a/core/vendor/twig/twig/doc/filters/merge.rst b/core/vendor/twig/twig/doc/filters/merge.rst new file mode 100644 index 000000000000..4348e7a163eb --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/merge.rst @@ -0,0 +1,41 @@ +``merge`` +========= + +The ``merge`` filter merges an array with the another array: + +.. code-block:: jinja + + {% set values = [1, 2] %} + + {% set values = values|merge(['apple', 'orange']) %} + + {# values now contains [1, 2, 'apple', 'orange'] #} + +New values are added at the end of the existing ones. + +The ``merge`` filter also works on hashes: + +.. code-block:: jinja + + {% set items = { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'unknown' } %} + + {% set items = items|merge({ 'peugeot': 'car', 'renault': 'car' }) %} + + {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car', 'renault': 'car' } #} + +For hashes, the merging process occurs on the keys: if the key does not +already exist, it is added but if the key already exists, its value is +overridden. + +.. tip:: + + If you want to ensure that some values are defined in an array (by given + default values), reverse the two elements in the call: + + .. code-block:: jinja + + {% set items = { 'apple': 'fruit', 'orange': 'fruit' } %} + + {% set items = { 'apple': 'unknown' }|merge(items) %} + + {# items now contains { 'apple': 'fruit', 'orange': 'fruit' } #} diff --git a/core/vendor/twig/twig/doc/filters/nl2br.rst b/core/vendor/twig/twig/doc/filters/nl2br.rst new file mode 100644 index 000000000000..694c672496ff --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/nl2br.rst @@ -0,0 +1,22 @@ +``nl2br`` +========= + +.. versionadded:: 1.5 + The nl2br filter was added in Twig 1.5. + +The ``nl2br`` filter inserts HTML line breaks before all newlines in a string: + +.. code-block:: jinja + + {{ "I like Twig.\nYou will like it too."|nl2br }} + {# outputs + + I like Twig.<br /> + You will like it too. + + #} + +.. note:: + + The ``nl2br`` filter pre-escapes the input before applying the + transformation. diff --git a/core/vendor/twig/twig/doc/filters/number_format.rst b/core/vendor/twig/twig/doc/filters/number_format.rst new file mode 100644 index 000000000000..ccc8f2f917ac --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/number_format.rst @@ -0,0 +1,38 @@ +``number_format`` +================= + +.. versionadded:: 1.5 + The number_format filter was added in Twig 1.5 + +The ``number_format`` filter formats numbers. It is a wrapper around PHP's +`number_format`_ function: + +.. code-block:: jinja + + {{ 200.35|number_format }} + +You can control the number of decimal places, decimal point, and thousands +separator using the additional arguments: + +.. code-block:: jinja + + {{ 9800.333|number_format(2, ',', '.') }} + +If no formatting options are provided then Twig will use the default formatting +options of: + +- 0 decimal places. +- ``.`` as the decimal point. +- ``,`` as the thousands separator. + +These defaults can be easily changed through the core extension: + +.. code-block:: php + + $twig = new Twig_Environment($loader); + $twig->getExtension('core')->setNumberFormat(3, ',', '.'); + +The defaults set for ``number_format`` can be over-ridden upon each call using the +additional parameters. + +.. _`number_format`: http://php.net/number_format diff --git a/core/vendor/twig/twig/doc/filters/raw.rst b/core/vendor/twig/twig/doc/filters/raw.rst new file mode 100644 index 000000000000..434dd246fe50 --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/raw.rst @@ -0,0 +1,12 @@ +``raw`` +======= + +The ``raw`` filter marks the value as being "safe", which means that in an +environment with automatic escaping enabled this variable will not be escaped +if ``raw`` is the last filter applied to it: + +.. code-block:: jinja + + {% autoescape true %} + {{ var|raw }} {# var won't be escaped #} + {% endautoescape %} diff --git a/core/vendor/twig/twig/doc/filters/replace.rst b/core/vendor/twig/twig/doc/filters/replace.rst new file mode 100644 index 000000000000..cc603fa37351 --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/replace.rst @@ -0,0 +1,14 @@ +``replace`` +=========== + +The ``replace`` filter formats a given string by replacing the placeholders +(placeholders are free-form): + +.. code-block:: jinja + + {{ "I like %this% and %that%."|replace({'%this%': foo, '%that%': "bar"}) }} + + {# returns I like foo and bar + if the foo parameter equals to the foo string. #} + +.. seealso:: :doc:`format<format>` diff --git a/core/vendor/twig/twig/doc/filters/reverse.rst b/core/vendor/twig/twig/doc/filters/reverse.rst new file mode 100644 index 000000000000..54fafb45d73f --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/reverse.rst @@ -0,0 +1,23 @@ +``reverse`` +=========== + +.. versionadded:: 1.6 + Support for strings has been added in Twig 1.6. + +The ``reverse`` filter reverses a sequence, a mapping, or a string: + +.. code-block:: jinja + + {% for use in users|reverse %} + ... + {% endfor %} + + {{ '1234'|reverse }} + + {# outputs 4321 #} + +.. note:: + + It also works with objects implementing the `Traversable`_ interface. + +.. _`Traversable`: http://php.net/Traversable diff --git a/core/vendor/twig/twig/doc/filters/slice.rst b/core/vendor/twig/twig/doc/filters/slice.rst new file mode 100644 index 000000000000..80a4293d8418 --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/slice.rst @@ -0,0 +1,57 @@ +``slice`` +=========== + +.. versionadded:: 1.6 + The slice filter was added in Twig 1.6. + +The ``slice`` filter extracts a slice of a sequence, a mapping, or a string: + +.. code-block:: jinja + + {% for i in [1, 2, 3, 4]|slice(1, 2) %} + {# will iterate over 2 and 3 #} + {% endfor %} + + {{ '1234'|slice(1, 2) }} + + {# outputs 23 #} + +You can use any valid expression for both the start and the length: + +.. code-block:: jinja + + {% for i in [1, 2, 3, 4]|slice(start, length) %} + {# ... #} + {% endfor %} + +As syntactic sugar, you can also use the ``[]`` notation: + +.. code-block:: jinja + + {% for i in [1, 2, 3, 4][start:length] %} + {# ... #} + {% endfor %} + + {{ '1234'[1:2] }} + +The ``slice`` filter works as the `array_slice`_ PHP function for arrays and +`substr`_ for strings. + +If the start is non-negative, the sequence will start at that start in the +variable. If start is negative, the sequence will start that far from the end +of the variable. + +If length is given and is positive, then the sequence will have up to that +many elements in it. If the variable is shorter than the length, then only the +available variable elements will be present. If length is given and is +negative then the sequence will stop that many elements from the end of the +variable. If it is omitted, then the sequence will have everything from offset +up until the end of the variable. + +.. note:: + + It also works with objects implementing the `Traversable`_ interface. + +.. _`Traversable`: http://php.net/manual/en/class.traversable.php +.. _`array_slice`: http://php.net/array_slice +.. _`substr`: http://php.net/substr diff --git a/core/vendor/twig/twig/doc/filters/sort.rst b/core/vendor/twig/twig/doc/filters/sort.rst new file mode 100644 index 000000000000..0e330d27307e --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/sort.rst @@ -0,0 +1,17 @@ +``sort`` +======== + +The ``sort`` filter sorts an array: + +.. code-block:: jinja + + {% for use in users|sort %} + ... + {% endfor %} + +.. note:: + + Internally, Twig uses the PHP `asort`_ function to maintain index + association. + +.. _`asort`: http://php.net/asort diff --git a/core/vendor/twig/twig/doc/filters/striptags.rst b/core/vendor/twig/twig/doc/filters/striptags.rst new file mode 100644 index 000000000000..5ccca45cccd2 --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/striptags.rst @@ -0,0 +1,15 @@ +``striptags`` +============= + +The ``striptags`` filter strips SGML/XML tags and replace adjacent whitespace +by one space: + +.. code-block:: jinja + + {% some_html|striptags %} + +.. note:: + + Internally, Twig uses the PHP `strip_tags`_ function. + +.. _`strip_tags`: http://php.net/strip_tags diff --git a/core/vendor/twig/twig/doc/filters/title.rst b/core/vendor/twig/twig/doc/filters/title.rst new file mode 100644 index 000000000000..c5a318e85d2c --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/title.rst @@ -0,0 +1,11 @@ +``title`` +========= + +The ``title`` filter returns a titlecased version of the value. Words will +start with uppercase letters, all remaining characters are lowercase: + +.. code-block:: jinja + + {{ 'my first car'|title }} + + {# outputs 'My First Car' #} diff --git a/core/vendor/twig/twig/doc/filters/trim.rst b/core/vendor/twig/twig/doc/filters/trim.rst new file mode 100644 index 000000000000..f1215f6ecdc9 --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/trim.rst @@ -0,0 +1,24 @@ +``trim`` +======== + +.. versionadded:: 1.6.2 + The trim filter was added in Twig 1.6.2. + +The ``trim`` filter strips whitespace (or other characters) from the beginning +and end of a string: + +.. code-block:: jinja + + {{ ' I like Twig. '|trim }} + + {# outputs 'I like Twig.' #} + + {{ ' I like Twig.'|trim('.') }} + + {# outputs ' I like Twig' #} + +.. note:: + + Internally, Twig uses the PHP `trim`_ function. + +.. _`trim`: http://php.net/trim diff --git a/core/vendor/twig/twig/doc/filters/upper.rst b/core/vendor/twig/twig/doc/filters/upper.rst new file mode 100644 index 000000000000..561cebe33091 --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/upper.rst @@ -0,0 +1,10 @@ +``upper`` +========= + +The ``upper`` filter converts a value to uppercase: + +.. code-block:: jinja + + {{ 'welcome'|upper }} + + {# outputs 'WELCOME' #} diff --git a/core/vendor/twig/twig/doc/filters/url_encode.rst b/core/vendor/twig/twig/doc/filters/url_encode.rst new file mode 100644 index 000000000000..c141f3b7318e --- /dev/null +++ b/core/vendor/twig/twig/doc/filters/url_encode.rst @@ -0,0 +1,14 @@ +``url_encode`` +============== + +The ``url_encode`` filter URL encodes a given string: + +.. code-block:: jinja + + {{ data|url_encode() }} + +.. note:: + + Internally, Twig uses the PHP `urlencode`_ function. + +.. _`urlencode`: http://php.net/urlencode diff --git a/core/vendor/twig/twig/doc/functions/attribute.rst b/core/vendor/twig/twig/doc/functions/attribute.rst new file mode 100644 index 000000000000..3051bdaa896a --- /dev/null +++ b/core/vendor/twig/twig/doc/functions/attribute.rst @@ -0,0 +1,18 @@ +``attribute`` +============= + +.. versionadded:: 1.2 + The ``attribute`` function was added in Twig 1.2. + +``attribute`` can be used to access a "dynamic" attribute of a variable: + +.. code-block:: jinja + + {{ attribute(object, method) }} + {{ attribute(object, method, arguments) }} + {{ attribute(array, item) }} + +.. note:: + + The resolution algorithm is the same as the one used for the ``.`` + notation, except that the item can be any valid expression. diff --git a/core/vendor/twig/twig/doc/functions/block.rst b/core/vendor/twig/twig/doc/functions/block.rst new file mode 100644 index 000000000000..fd571efbc6fa --- /dev/null +++ b/core/vendor/twig/twig/doc/functions/block.rst @@ -0,0 +1,15 @@ +``block`` +========= + +When a template uses inheritance and if you want to print a block multiple +times, use the ``block`` function: + +.. code-block:: jinja + + <title>{% block title %}{% endblock %}</title> + + <h1>{{ block('title') }}</h1> + + {% block body %}{% endblock %} + +.. seealso:: :doc:`extends<../tags/extends>`, :doc:`parent<../functions/parent>` diff --git a/core/vendor/twig/twig/doc/functions/constant.rst b/core/vendor/twig/twig/doc/functions/constant.rst new file mode 100644 index 000000000000..5b247b382b08 --- /dev/null +++ b/core/vendor/twig/twig/doc/functions/constant.rst @@ -0,0 +1,9 @@ +``constant`` +============ + +``constant`` returns the constant value for a given string: + +.. code-block:: jinja + + {{ some_date|date(constant('DATE_W3C')) }} + {{ constant('Namespace\\Classname::CONSTANT_NAME') }} diff --git a/core/vendor/twig/twig/doc/functions/cycle.rst b/core/vendor/twig/twig/doc/functions/cycle.rst new file mode 100644 index 000000000000..fe11d68e4969 --- /dev/null +++ b/core/vendor/twig/twig/doc/functions/cycle.rst @@ -0,0 +1,20 @@ +``cycle`` +========= + +The ``cycle`` function cycles on an array of values: + +.. code-block:: jinja + + {% for i in 0..10 %} + {{ cycle(['odd', 'even'], i) }} + {% endfor %} + +The array can contain any number of values: + +.. code-block:: jinja + + {% set fruits = ['apple', 'orange', 'citrus'] %} + + {% for i in 0..10 %} + {{ cycle(fruits, i) }} + {% endfor %} diff --git a/core/vendor/twig/twig/doc/functions/date.rst b/core/vendor/twig/twig/doc/functions/date.rst new file mode 100644 index 000000000000..c1a011c3f46c --- /dev/null +++ b/core/vendor/twig/twig/doc/functions/date.rst @@ -0,0 +1,46 @@ +``date`` +======== + +.. versionadded:: 1.6 + The date function has been added in Twig 1.6. + +.. versionadded:: 1.6.1 + The default timezone support has been added in Twig 1.6.1. + +Converts an argument to a date to allow date comparison: + +.. code-block:: jinja + + {% if date(user.created_at) < date('+2days') %} + {# do something #} + {% endif %} + +The argument must be in a format supported by the `date`_ function. + +You can pass a timezone as the second argument: + +.. code-block:: jinja + + {% if date(user.created_at) < date('+2days', 'Europe/Paris') %} + {# do something #} + {% endif %} + +If no argument is passed, the function returns the current date: + +.. code-block:: jinja + + {% if date(user.created_at) < date() %} + {# always! #} + {% endif %} + +.. note:: + + You can set the default timezone globally by calling ``setTimezone()`` on + the ``core`` extension instance: + + .. code-block:: php + + $twig = new Twig_Environment($loader); + $twig->getExtension('core')->setTimezone('Europe/Paris'); + +.. _`date`: http://www.php.net/date diff --git a/core/vendor/twig/twig/doc/functions/dump.rst b/core/vendor/twig/twig/doc/functions/dump.rst new file mode 100644 index 000000000000..8ff0c052d3c6 --- /dev/null +++ b/core/vendor/twig/twig/doc/functions/dump.rst @@ -0,0 +1,64 @@ +``dump`` +======== + +.. versionadded:: 1.5 + The dump function was added in Twig 1.5. + +The ``dump`` function dumps information about a template variable. This is +mostly useful to debug a template that does not behave as expected by +introspecting its variables: + +.. code-block:: jinja + + {{ dump(user) }} + +.. note:: + + The ``dump`` function is not available by default. You must add the + ``Twig_Extension_Debug`` extension explicitly when creating your Twig + environment:: + + $twig = new Twig_Environment($loader, array( + 'debug' => true, + // ... + )); + $twig->addExtension(new Twig_Extension_Debug()); + + Even when enabled, the ``dump`` function won't display anything if the + ``debug`` option on the environment is not enabled (to avoid leaking debug + information on a production server). + +In an HTML context, wrap the output with a ``pre`` tag to make it easier to +read: + +.. code-block:: jinja + + <pre> + {{ dump(user) }} + </pre> + +.. tip:: + + Using a ``pre`` tag is not needed when `XDebug`_ is enabled and + ``html_errors`` is ``on``; as a bonus, the output is also nicer with + XDebug enabled. + +You can debug several variables by passing them as additional arguments: + +.. code-block:: jinja + + {{ dump(user, categories) }} + +If you don't pass any value, all variables from the current context are +dumped: + +.. code-block:: jinja + + {{ dump() }} + +.. note:: + + Internally, Twig uses the PHP `var_dump`_ function. + +.. _`XDebug`: http://xdebug.org/docs/display +.. _`var_dump`: http://php.net/var_dump diff --git a/core/vendor/twig/twig/doc/functions/index.rst b/core/vendor/twig/twig/doc/functions/index.rst new file mode 100644 index 000000000000..331552809f82 --- /dev/null +++ b/core/vendor/twig/twig/doc/functions/index.rst @@ -0,0 +1,15 @@ +Functions +========= + +.. toctree:: + :maxdepth: 1 + + range + cycle + constant + random + attribute + block + parent + dump + date diff --git a/core/vendor/twig/twig/doc/functions/parent.rst b/core/vendor/twig/twig/doc/functions/parent.rst new file mode 100644 index 000000000000..f5bd200106ec --- /dev/null +++ b/core/vendor/twig/twig/doc/functions/parent.rst @@ -0,0 +1,20 @@ +``parent`` +========== + +When a template uses inheritance, it's possible to render the contents of the +parent block when overriding a block by using the ``parent`` function: + +.. code-block:: jinja + + {% extends "base.html" %} + + {% block sidebar %} + <h3>Table Of Contents</h3> + ... + {{ parent() }} + {% endblock %} + +The ``parent()`` call will return the content of the ``sidebar`` block as +defined in the ``base.html`` template. + +.. seealso:: :doc:`extends<../tags/extends>`, :doc:`block<../functions/block>`, :doc:`block<../tags/block>` diff --git a/core/vendor/twig/twig/doc/functions/random.rst b/core/vendor/twig/twig/doc/functions/random.rst new file mode 100644 index 000000000000..104493d93e97 --- /dev/null +++ b/core/vendor/twig/twig/doc/functions/random.rst @@ -0,0 +1,24 @@ +``random`` +========== + +.. versionadded:: 1.5 + The random function was added in Twig 1.5. + +.. versionadded:: 1.6 + String and integer handling was added in Twig 1.6. + +The ``random`` function returns a random value depending on the supplied +parameter type: + +* a random item from a sequence; +* a random character from a string; +* a random integer between 0 and the integer parameter (inclusive). + +.. code-block:: jinja + + {{ random(['apple', 'orange', 'citrus']) }} {# example output: orange #} + {{ random('ABC') }} {# example output: C #} + {{ random() }} {# example output: 15386094 (works as native PHP `mt_rand`_ function) #} + {{ random(5) }} {# example output: 3 #} + +.. _`mt_rand`: http://php.net/mt_rand diff --git a/core/vendor/twig/twig/doc/functions/range.rst b/core/vendor/twig/twig/doc/functions/range.rst new file mode 100644 index 000000000000..c9bdd960229b --- /dev/null +++ b/core/vendor/twig/twig/doc/functions/range.rst @@ -0,0 +1,38 @@ +``range`` +========= + +Returns a list containing an arithmetic progression of integers: + +.. code-block:: jinja + + {% for i in range(0, 3) %} + {{ i }}, + {% endfor %} + + {# returns 0, 1, 2, 3 #} + +When step is given (as the third parameter), it specifies the increment (or +decrement): + +.. code-block:: jinja + + {% for i in range(0, 6, 2) %} + {{ i }}, + {% endfor %} + + {# returns 0, 2, 4, 6 #} + +The Twig built-in ``..`` operator is just syntactic sugar for the ``range`` +function (with a step of 1): + +.. code-block:: jinja + + {% for i in 0..3 %} + {{ i }}, + {% endfor %} + +.. tip:: + + The ``range`` function works as the native PHP `range`_ function. + +.. _`range`: http://php.net/range diff --git a/core/vendor/twig/twig/doc/index.rst b/core/vendor/twig/twig/doc/index.rst new file mode 100644 index 000000000000..56012f7bf692 --- /dev/null +++ b/core/vendor/twig/twig/doc/index.rst @@ -0,0 +1,17 @@ +Twig +==== + +.. toctree:: + :maxdepth: 2 + + intro + templates + api + advanced + internals + recipes + coding_standards + tags/index + filters/index + functions/index + tests/index diff --git a/core/vendor/twig/twig/doc/internals.rst b/core/vendor/twig/twig/doc/internals.rst new file mode 100644 index 000000000000..79a3c8d5ade4 --- /dev/null +++ b/core/vendor/twig/twig/doc/internals.rst @@ -0,0 +1,140 @@ +Twig Internals +============== + +Twig is very extensible and you can easily hack it. Keep in mind that you +should probably try to create an extension before hacking the core, as most +features and enhancements can be done with extensions. This chapter is also +useful for people who want to understand how Twig works under the hood. + +How Twig works? +--------------- + +The rendering of a Twig template can be summarized into four key steps: + +* **Load** the template: If the template is already compiled, load it and go + to the *evaluation* step, otherwise: + + * First, the **lexer** tokenizes the template source code into small pieces + for easier processing; + * Then, the **parser** converts the token stream into a meaningful tree + of nodes (the Abstract Syntax Tree); + * Eventually, the *compiler* transforms the AST into PHP code; + +* **Evaluate** the template: It basically means calling the ``display()`` + method of the compiled template and passing it the context. + +The Lexer +--------- + +The lexer tokenizes a template source code into a token stream (each token is +an instance of ``Twig_Token``, and the stream is an instance of +``Twig_TokenStream``). The default lexer recognizes 13 different token types: + +* ``Twig_Token::BLOCK_START_TYPE``, ``Twig_Token::BLOCK_END_TYPE``: Delimiters for blocks (``{% %}``) +* ``Twig_Token::VAR_START_TYPE``, ``Twig_Token::VAR_END_TYPE``: Delimiters for variables (``{{ }}``) +* ``Twig_Token::TEXT_TYPE``: A text outside an expression; +* ``Twig_Token::NAME_TYPE``: A name in an expression; +* ``Twig_Token::NUMBER_TYPE``: A number in an expression; +* ``Twig_Token::STRING_TYPE``: A string in an expression; +* ``Twig_Token::OPERATOR_TYPE``: An operator; +* ``Twig_Token::PUNCTUATION_TYPE``: A punctuation sign; +* ``Twig_Token::INTERPOLATION_START_TYPE``, ``Twig_Token::INTERPOLATION_END_TYPE`` (as of Twig 1.5): Delimiters for string interpolation; +* ``Twig_Token::EOF_TYPE``: Ends of template. + +You can manually convert a source code into a token stream by calling the +``tokenize()`` of an environment:: + + $stream = $twig->tokenize($source, $identifier); + +As the stream has a ``__toString()`` method, you can have a textual +representation of it by echoing the object:: + + echo $stream."\n"; + +Here is the output for the ``Hello {{ name }}`` template: + +.. code-block:: text + + TEXT_TYPE(Hello ) + VAR_START_TYPE() + NAME_TYPE(name) + VAR_END_TYPE() + EOF_TYPE() + +.. note:: + + You can change the default lexer use by Twig (``Twig_Lexer``) by calling + the ``setLexer()`` method:: + + $twig->setLexer($lexer); + +The Parser +---------- + +The parser converts the token stream into an AST (Abstract Syntax Tree), or a +node tree (an instance of ``Twig_Node_Module``). The core extension defines +the basic nodes like: ``for``, ``if``, ... and the expression nodes. + +You can manually convert a token stream into a node tree by calling the +``parse()`` method of an environment:: + + $nodes = $twig->parse($stream); + +Echoing the node object gives you a nice representation of the tree:: + + echo $nodes."\n"; + +Here is the output for the ``Hello {{ name }}`` template: + +.. code-block:: text + + Twig_Node_Module( + Twig_Node_Text(Hello ) + Twig_Node_Print( + Twig_Node_Expression_Name(name) + ) + ) + +.. note:: + + The default parser (``Twig_TokenParser``) can be also changed by calling the + ``setParser()`` method:: + + $twig->setParser($parser); + +The Compiler +------------ + +The last step is done by the compiler. It takes a node tree as an input and +generates PHP code usable for runtime execution of the template. + +You can call the compiler by hand with the ``compile()`` method of an +environment:: + + $php = $twig->compile($nodes); + +The ``compile()`` method returns the PHP source code representing the node. + +The generated template for a ``Hello {{ name }}`` template reads as follows +(the actual output can differ depending on the version of Twig you are +using):: + + /* Hello {{ name }} */ + class __TwigTemplate_1121b6f109fe93ebe8c6e22e3712bceb extends Twig_Template + { + protected function doDisplay(array $context, array $blocks = array()) + { + // line 1 + echo "Hello "; + echo twig_escape_filter($this->env, $this->getContext($context, "name"), "ndex", null, true); + } + + // some more code + } + +.. note:: + + As for the lexer and the parser, the default compiler (``Twig_Compiler``) can + be changed by calling the ``setCompiler()`` method:: + + $twig->setCompiler($compiler); diff --git a/core/vendor/twig/twig/doc/intro.rst b/core/vendor/twig/twig/doc/intro.rst new file mode 100644 index 000000000000..f9dc2268d0fd --- /dev/null +++ b/core/vendor/twig/twig/doc/intro.rst @@ -0,0 +1,160 @@ +Introduction +============ + +This is the documentation for Twig, the flexible, fast, and secure template +engine for PHP. + +If you have any exposure to other text-based template languages, such as +Smarty, Django, or Jinja, you should feel right at home with Twig. It's both +designer and developer friendly by sticking to PHP's principles and adding +functionality useful for templating environments. + +The key-features are... + +* *Fast*: Twig compiles templates down to plain optimized PHP code. The + overhead compared to regular PHP code was reduced to the very minimum. + +* *Secure*: Twig has a sandbox mode to evaluate untrusted template code. This + allows Twig to be used as a template language for applications where users + may modify the template design. + +* *Flexible*: Twig is powered by a flexible lexer and parser. This allows the + developer to define its own custom tags and filters, and create its own DSL. + +Prerequisites +------------- + +Twig needs at least **PHP 5.2.4** to run. + +Installation +------------ + +You have multiple ways to install Twig. If you are unsure what to do, go with +the tarball. + +Installing from the tarball release +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +1. Download the most recent tarball from the `download page`_ +2. Unpack the tarball +3. Move the files somewhere in your project + +Installing the development version +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +1. Install Subversion or Git +2. For Git: ``git clone git://github.com/fabpot/Twig.git`` +3. For Subversion: ``svn co http://svn.twig-project.org/trunk/ twig`` + +Installing the PEAR package +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +1. Install PEAR +2. ``pear channel-discover pear.twig-project.org`` +3. ``pear install twig/Twig`` (or ``pear install twig/Twig-beta``) + +Installing via Composer +~~~~~~~~~~~~~~~~~~~~~~~ + +1. Install composer in your project: + +.. code-block:: bash + + curl -s http://getcomposer.org/installer | php + +2. Create a ``composer.json`` file in your project root: + +.. code-block:: javascript + + { + "require": { + "twig/twig": "1.*" + } + } + +3. Install via composer + +.. code-block:: bash + + php composer.phar install + +.. note:: + If you want to learn more about Composer, the ``composer.json`` file syntax + and its usage, you can read the `online documentation`_. + +Installing the C extension +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. versionadded:: 1.4 + The C extension was added in Twig 1.4. + +Twig comes with a C extension that enhances the performance of the Twig +runtime engine. You can install it like any other PHP extension: + +.. code-block:: bash + + $ cd ext/twig + $ phpize + $ ./configure + $ make + $ make install + +Finally, enable the extension in your ``php.ini`` configuration file: + +.. code-block:: ini + + extension=twig.so + +And from now on, Twig will automatically compile your templates to take +advantage of the C extension. Note that this extension does not replace the +PHP code but only provides an optimized version of the +``Twig_Template::getAttribute()`` method. + +.. tip:: + + On Windows, you can also simply download and install a `pre-build DLL`_. + +Basic API Usage +--------------- + +This section gives you a brief introduction to the PHP API for Twig. + +The first step to use Twig is to register its autoloader:: + + require_once '/path/to/lib/Twig/Autoloader.php'; + Twig_Autoloader::register(); + +Replace the ``/path/to/lib/`` path with the path you used for Twig +installation. + +.. note:: + + Twig follows the PEAR convention names for its classes, which means you + can easily integrate Twig classes loading in your own autoloader. + +.. code-block:: php + + $loader = new Twig_Loader_String(); + $twig = new Twig_Environment($loader); + + echo $twig->render('Hello {{ name }}!', array('name' => 'Fabien')); + +Twig uses a loader (``Twig_Loader_String``) to locate templates, and an +environment (``Twig_Environment``) to store the configuration. + +The ``render()`` method loads the template passed as a first argument and +renders it with the variables passed as a second argument. + +As templates are generally stored on the filesystem, Twig also comes with a +filesystem loader:: + + $loader = new Twig_Loader_Filesystem('/path/to/templates'); + $twig = new Twig_Environment($loader, array( + 'cache' => '/path/to/compilation_cache', + )); + + echo $twig->render('index.html', array('name' => 'Fabien')); + +.. _`download page`: https://github.com/fabpot/Twig/tags +.. _`online documentation`: http://getcomposer.org/doc +.. _`pre-build DLL`: https://github.com/stealth35/stealth35.github.com/downloads diff --git a/core/vendor/twig/twig/doc/recipes.rst b/core/vendor/twig/twig/doc/recipes.rst new file mode 100644 index 000000000000..59a6dfb926d5 --- /dev/null +++ b/core/vendor/twig/twig/doc/recipes.rst @@ -0,0 +1,362 @@ +Recipes +======= + +Making a Layout conditional +--------------------------- + +Working with Ajax means that the same content is sometimes displayed as is, +and sometimes decorated with a layout. As Twig layout template names can be +any valid expression, you can pass a variable that evaluates to ``true`` when +the request is made via Ajax and choose the layout accordingly: + +.. code-block:: jinja + + {% extends request.ajax ? "base_ajax.html" : "base.html" %} + + {% block content %} + This is the content to be displayed. + {% endblock %} + +Making an Include dynamic +------------------------- + +When including a template, its name does not need to be a string. For +instance, the name can depend on the value of a variable: + +.. code-block:: jinja + + {% include var ~ '_foo.html' %} + +If ``var`` evaluates to ``index``, the ``index_foo.html`` template will be +rendered. + +As a matter of fact, the template name can be any valid expression, such as +the following: + +.. code-block:: jinja + + {% include var|default('index') ~ '_foo.html' %} + +Overriding a Template that also extends itself +---------------------------------------------- + +A template can be customized in two different ways: + +* *Inheritance*: A template *extends* a parent template and overrides some + blocks; + +* *Replacement*: If you use the filesystem loader, Twig loads the first + template it finds in a list of configured directories; a template found in a + directory *replaces* another one from a directory further in the list. + +But how do you combine both: *replace* a template that also extends itself +(aka a template in a directory further in the list)? + +Let's say that your templates are loaded from both ``.../templates/mysite`` +and ``.../templates/default`` in this order. The ``page.twig`` template, +stored in ``.../templates/default`` reads as follows: + +.. code-block:: jinja + + {# page.twig #} + {% extends "layout.twig" %} + + {% block content %} + {% endblock %} + +You can replace this template by putting a file with the same name in +``.../templates/mysite``. And if you want to extend the original template, you +might be tempted to write the following: + +.. code-block:: jinja + + {# page.twig in .../templates/mysite #} + {% extends "page.twig" %} {# from .../templates/default #} + +Of course, this will not work as Twig will always load the template from +``.../templates/mysite``. + +It turns out it is possible to get this to work, by adding a directory right +at the end of your template directories, which is the parent of all of the +other directories: ``.../templates`` in our case. This has the effect of +making every template file within our system uniquely addressable. Most of the +time you will use the "normal" paths, but in the special case of wanting to +extend a template with an overriding version of itself we can reference its +parent's full, unambiguous template path in the extends tag: + +.. code-block:: jinja + + {# page.twig in .../templates/mysite #} + {% extends "default/page.twig" %} {# from .../templates #} + +.. note:: + + This recipe was inspired by the following Django wiki page: + http://code.djangoproject.com/wiki/ExtendingTemplates + +Customizing the Syntax +---------------------- + +Twig allows some syntax customization for the block delimiters. It's not +recommended to use this feature as templates will be tied with your custom +syntax. But for specific projects, it can make sense to change the defaults. + +To change the block delimiters, you need to create your own lexer object:: + + $twig = new Twig_Environment(); + + $lexer = new Twig_Lexer($twig, array( + 'tag_comment' => array('{#', '#}'), + 'tag_block' => array('{%', '%}'), + 'tag_variable' => array('{{', '}}'), + )); + $twig->setLexer($lexer); + +Here are some configuration example that simulates some other template engines +syntax:: + + // Ruby erb syntax + $lexer = new Twig_Lexer($twig, array( + 'tag_comment' => array('<%#', '%>'), + 'tag_block' => array('<%', '%>'), + 'tag_variable' => array('<%=', '%>'), + )); + + // SGML Comment Syntax + $lexer = new Twig_Lexer($twig, array( + 'tag_comment' => array('<!--#', '-->'), + 'tag_block' => array('<!--', '-->'), + 'tag_variable' => array('${', '}'), + )); + + // Smarty like + $lexer = new Twig_Lexer($twig, array( + 'tag_comment' => array('{*', '*}'), + 'tag_block' => array('{', '}'), + 'tag_variable' => array('{$', '}'), + )); + +Using dynamic Object Properties +------------------------------- + +When Twig encounters a variable like ``article.title``, it tries to find a +``title`` public property in the ``article`` object. + +It also works if the property does not exist but is rather defined dynamically +thanks to the magic ``__get()`` method; you just need to also implement the +``__isset()`` magic method like shown in the following snippet of code:: + + class Article + { + public function __get($name) + { + if ('title' == $name) { + return 'The title'; + } + + // throw some kind of error + } + + public function __isset($name) + { + if ('title' == $name) { + return true; + } + + return false; + } + } + +Accessing the parent Context in Nested Loops +-------------------------------------------- + +Sometimes, when using nested loops, you need to access the parent context. The +parent context is always accessible via the ``loop.parent`` variable. For +instance, if you have the following template data:: + + $data = array( + 'topics' => array( + 'topic1' => array('Message 1 of topic 1', 'Message 2 of topic 1'), + 'topic2' => array('Message 1 of topic 2', 'Message 2 of topic 2'), + ), + ); + +And the following template to display all messages in all topics: + +.. code-block:: jinja + + {% for topic, messages in topics %} + * {{ loop.index }}: {{ topic }} + {% for message in messages %} + - {{ loop.parent.loop.index }}.{{ loop.index }}: {{ message }} + {% endfor %} + {% endfor %} + +The output will be similar to: + +.. code-block:: text + + * 1: topic1 + - 1.1: The message 1 of topic 1 + - 1.2: The message 2 of topic 1 + * 2: topic2 + - 2.1: The message 1 of topic 2 + - 2.2: The message 2 of topic 2 + +In the inner loop, the ``loop.parent`` variable is used to access the outer +context. So, the index of the current ``topic`` defined in the outer for loop +is accessible via the ``loop.parent.loop.index`` variable. + +Defining undefined Functions and Filters on the Fly +--------------------------------------------------- + +When a function (or a filter) is not defined, Twig defaults to throw a +``Twig_Error_Syntax`` exception. However, it can also call a `callback`_ (any +valid PHP callable) which should return a function (or a filter). + +For filters, register callbacks with ``registerUndefinedFilterCallback()``. +For functions, use ``registerUndefinedFunctionCallback()``:: + + // auto-register all native PHP functions as Twig functions + // don't try this at home as it's not secure at all! + $twig->registerUndefinedFunctionCallback(function ($name) { + if (function_exists($name)) { + return new Twig_Function_Function($name); + } + + return false; + }); + +If the callable is not able to return a valid function (or filter), it must +return ``false``. + +If you register more than one callback, Twig will call them in turn until one +does not return ``false``. + +.. tip:: + + As the resolution of functions and filters is done during compilation, + there is no overhead when registering these callbacks. + +Validating the Template Syntax +------------------------------ + +When template code is providing by a third-party (through a web interface for +instance), it might be interesting to validate the template syntax before +saving it. If the template code is stored in a `$template` variable, here is +how you can do it:: + + try { + $twig->parse($twig->tokenize($template)); + + // the $template is valid + } catch (Twig_Error_Syntax $e) { + // $template contains one or more syntax errors + } + +If you iterate over a set of files, you can pass the filename to the +``tokenize()`` method to get the filename in the exception message:: + + foreach ($files as $file) { + try { + $twig->parse($twig->tokenize($template, $file)); + + // the $template is valid + } catch (Twig_Error_Syntax $e) { + // $template contains one or more syntax errors + } + } + +.. note:: + + This method won't catch any sandbox policy violations because the policy + is enforced during template rendering (as Twig needs the context for some + checks like allowed methods on objects). + +Refreshing modified Templates when APC is enabled and apc.stat = 0 +------------------------------------------------------------------ + +When using APC with ``apc.stat`` set to ``0`` and Twig cache enabled, clearing +the template cache won't update the APC cache. To get around this, one can +extend ``Twig_Environment`` and force the update of the APC cache when Twig +rewrites the cache:: + + class Twig_Environment_APC extends Twig_Environment + { + protected function writeCacheFile($file, $content) + { + parent::writeCacheFile($file, $content); + + // Compile cached file into bytecode cache + apc_compile_file($file); + } + } + +Reusing a stateful Node Visitor +------------------------------- + +When attaching a visitor to a ``Twig_Environment`` instance, Twig uses it to +visit *all* templates it compiles. If you need to keep some state information +around, you probably want to reset it when visiting a new template. + +This can be easily achieved with the following code:: + + protected $someTemplateState = array(); + + public function enterNode(Twig_NodeInterface $node, Twig_Environment $env) + { + if ($node instanceof Twig_Node_Module) { + // reset the state as we are entering a new template + $this->someTemplateState = array(); + } + + // ... + + return $node; + } + +Using the Template name to set the default Escaping Strategy +------------------------------------------------------------ + +.. versionadded:: 1.8 + This recipe requires Twig 1.8 or later. + +The ``autoescape`` option determines the default escaping strategy to use when +no escaping is applied on a variable. When Twig is used to mostly generate +HTML files, you can set it to ``html`` and explicitly change it to ``js`` when +you have some dynamic JavaScript files thanks to the ``autoescape`` tag: + +.. code-block:: jinja + + {% autoescape js %} + ... some JS ... + {% endautoescape %} + +But if you have many HTML and JS files, and if your template names follow some +conventions, you can instead determine the default escaping strategy to use +based on the template name. Let's say that your template names always ends +with ``.html`` for HTML files and ``.js`` for JavaScript ones, here is how you +can configure Twig:: + + function twig_escaping_guesser($filename) + { + // get the format + $format = substr($filename, strrpos($filename, '.') + 1); + + switch ($format) { + 'js': + return 'js'; + default: + return 'html'; + } + } + + $loader = new Twig_Loader_Filesystem('/path/to/templates'); + $twig = new Twig_Environment($loader, array( + 'autoescape' => 'twig_escaping_guesser', + )); + +This dynamic strategy does not incur any overhead at runtime as auto-escaping +is done at compilation time. + +.. _callback: http://www.php.net/manual/en/function.is-callable.php diff --git a/core/vendor/twig/twig/doc/tags/autoescape.rst b/core/vendor/twig/twig/doc/tags/autoescape.rst new file mode 100644 index 000000000000..c5ff0c2c3c55 --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/autoescape.rst @@ -0,0 +1,71 @@ +``autoescape`` +============== + +Whether automatic escaping is enabled or not, you can mark a section of a +template to be escaped or not by using the ``autoescape`` tag: + +.. code-block:: jinja + + {# The following syntax works as of Twig 1.8 -- see the note below for previous versions #} + + {% autoescape %} + Everything will be automatically escaped in this block + using the HTML strategy + {% endautoescape %} + + {% autoescape 'html' %} + Everything will be automatically escaped in this block + using the HTML strategy + {% endautoescape %} + + {% autoescape 'js' %} + Everything will be automatically escaped in this block + using the js escaping strategy + {% endautoescape %} + + {% autoescape false %} + Everything will be outputted as is in this block + {% endautoescape %} + +.. note:: + + Before Twig 1.8, the syntax was different: + + .. code-block:: jinja + + {% autoescape true %} + Everything will be automatically escaped in this block + using the HTML strategy + {% endautoescape %} + + {% autoescape false %} + Everything will be outputted as is in this block + {% endautoescape %} + + {% autoescape true js %} + Everything will be automatically escaped in this block + using the js escaping strategy + {% endautoescape %} + +When automatic escaping is enabled everything is escaped by default except for +values explicitly marked as safe. Those can be marked in the template by using +the :doc:`raw<../filters/raw>` filter: + +.. code-block:: jinja + + {% autoescape %} + {{ safe_value|raw }} + {% endautoescape %} + +Functions returning template data (like :doc:`macros<macro>` and +:doc:`parent<../functions/parent>`) always return safe markup. + +.. note:: + + Twig is smart enough to not escape an already escaped value by the + :doc:`escape<../filters/escape>` filter. + +.. note:: + + The chapter :doc:`Twig for Developers<../api>` gives more information + about when and how automatic escaping is applied. diff --git a/core/vendor/twig/twig/doc/tags/block.rst b/core/vendor/twig/twig/doc/tags/block.rst new file mode 100644 index 000000000000..e38048232503 --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/block.rst @@ -0,0 +1,11 @@ +``block`` +========= + +Blocks are used for inheritance and act as placeholders and replacements at +the same time. They are documented in detail in the documentation for the +:doc:`extends<../tags/extends>` tag. + +Block names should consist of alphanumeric characters, and underscores. Dashes +are not permitted. + +.. seealso:: :doc:`block<../functions/block>`, :doc:`parent<../functions/parent>`, :doc:`use<../tags/use>`, :doc:`extends<../tags/extends>` diff --git a/core/vendor/twig/twig/doc/tags/do.rst b/core/vendor/twig/twig/doc/tags/do.rst new file mode 100644 index 000000000000..eca63d0ad05f --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/do.rst @@ -0,0 +1,12 @@ +``do`` +====== + +.. versionadded:: 1.5 + The do tag was added in Twig 1.5. + +The ``do`` tag works exactly like the regular variable expression (``{{ ... +}}``) just that it doesn't print anything: + +.. code-block:: jinja + + {% do 1 + 2 %} diff --git a/core/vendor/twig/twig/doc/tags/embed.rst b/core/vendor/twig/twig/doc/tags/embed.rst new file mode 100644 index 000000000000..5a6a0299abf5 --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/embed.rst @@ -0,0 +1,178 @@ +``embed`` +========= + +.. versionadded:: 1.8 + The ``embed`` tag was added in Twig 1.8. + +The ``embed`` tag combines the behaviour of :doc:`include<include>` and +:doc:`extends<extends>`. +It allows you to include another template's contents, just like ``include`` +does. But it also allows you to override any block defined inside the +included template, like when extending a template. + +Think of an embedded template as a "micro layout skeleton". + +.. code-block:: jinja + + {% embed "teasers_skeleton.twig" %} + {# These blocks are defined in "teasers_skeleton.twig" #} + {# and we override them right here: #} + {% block left_teaser %} + Some content for the left teaser box + {% endblock %} + {% block right_teaser %} + Some content for the right teaser box + {% endblock %} + {% endembed %} + +The ``embed`` tag takes the idea of template inheritance to the level of +content fragments. While template inheritance allows for "document skeletons", +which are filled with life by child templates, the ``embed`` tag allows you to +create "skeletons" for smaller units of content and re-use and fill them +anywhere you like. + +Since the use case may not be obvious, let's look at a simplified example. +Imagine a base template shared by multiple HTML pages, defining a single block +named "content": + +.. code-block:: text + + ┌─── page layout ─────────────────────┠+ │ │ + │ ┌── block "content" ──┠│ + │ │ │ │ + │ │ │ │ + │ │ (child template to │ │ + │ │ put content here) │ │ + │ │ │ │ + │ │ │ │ + │ └─────────────────────┘ │ + │ │ + └─────────────────────────────────────┘ + +Some pages ("foo" and "bar") share the same content structure - +two vertically stacked boxes: + +.. code-block:: text + + ┌─── page layout ─────────────────────┠+ │ │ + │ ┌── block "content" ──┠│ + │ │ ┌─ block "top" ───┠│ │ + │ │ │ │ │ │ + │ │ └─────────────────┘ │ │ + │ │ ┌─ block "bottom" ┠│ │ + │ │ │ │ │ │ + │ │ └─────────────────┘ │ │ + │ └─────────────────────┘ │ + │ │ + └─────────────────────────────────────┘ + +While other pages ("boom" and "baz") share a different content structure - +two boxes side by side: + +.. code-block:: text + + ┌─── page layout ─────────────────────┠+ │ │ + │ ┌── block "content" ──┠│ + │ │ │ │ + │ │ ┌ block ┠┌ block ┠│ │ + │ │ │"left" │ │"right"│ │ │ + │ │ │ │ │ │ │ │ + │ │ │ │ │ │ │ │ + │ │ └───────┘ └───────┘ │ │ + │ └─────────────────────┘ │ + │ │ + └─────────────────────────────────────┘ + +Without the ``embed`` tag, you have two ways to design your templates: + + * Create two "intermediate" base templates that extend the master layout + template: one with vertically stacked boxes to be used by the "foo" and + "bar" pages and another one with side-by-side boxes for the "boom" and + "baz" pages. + + * Embed the markup for the top/bottom and left/right boxes into each page + template directly. + +These two solutions do not scale well because they each have a major drawback: + + * The first solution may indeed work for this simplified example. But imagine + we add a sidebar, which may again contain different, recurring structures + of content. Now we would need to create intermediate base templates for + all occurring combinations of content structure and sidebar structure... + and so on. + + * The second solution involves duplication of common code with all its negative + consequences: any change involves finding and editing all affected copies + of the structure, correctness has to be verified for each copy, copies may + go out of sync by careless modifications etc. + +In such a situation, the ``embed`` tag comes in handy. The common layout +code can live in a single base template, and the two different content structures, +let's call them "micro layouts" go into separate templates which are embedded +as necessary: + +Page template ``foo.twig``: + +.. code-block:: jinja + + {% extends "layout_skeleton.twig" %} + + {% block content %} + {% embed "vertical_boxes_skeleton.twig" %} + {% block top %} + Some content for the top box + {% endblock %} + + {% block bottom %} + Some content for the bottom box + {% endblock %} + {% endembed %} + {% endblock %} + +And here is the code for ``vertical_boxes_skeleton.twig``: + +.. code-block:: html+jinja + + <div class="top_box"> + {% block top %} + Top box default content + {% endblock %} + </div> + + <div class="bottom_box"> + {% block bottom %} + Bottom box default content + {% endblock %} + </div> + +The goal of the ``vertical_boxes_skeleton.twig`` template being to factor +out the HTML markup for the boxes. + +The ``embed`` tag takes the exact same arguments as the ``include`` tag: + +.. code-block:: jinja + + {% embed "base" with {'foo': 'bar'} %} + ... + {% endembed %} + + {% embed "base" with {'foo': 'bar'} only %} + ... + {% endembed %} + + {% embed "base" ignore missing %} + ... + {% endembed %} + +.. warning:: + + As embedded templates do not have "names", auto-escaping strategies based + on the template "filename" won't work as expected if you change the + context (for instance, if you embed a CSS/JavaScript template into an HTML + one). In that case, explicitly set the default auto-escaping strategy with + the ``autoescape`` tag. + +.. seealso:: :doc:`include<../tags/include>` diff --git a/core/vendor/twig/twig/doc/tags/extends.rst b/core/vendor/twig/twig/doc/tags/extends.rst new file mode 100644 index 000000000000..8d644369b239 --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/extends.rst @@ -0,0 +1,187 @@ +``extends`` +=========== + +The ``extends`` tag can be used to extend a template from another one. + +.. note:: + + Like PHP, Twig does not support multiple inheritance. So you can only have + one extends tag called per rendering. However, Twig supports horizontal + :doc:`reuse<use>`. + +Let's define a base template, ``base.html``, which defines a simple HTML +skeleton document: + +.. code-block:: html+jinja + + <!DOCTYPE html> + <html> + <head> + {% block head %} + <link rel="stylesheet" href="style.css" /> + <title>{% block title %}{% endblock %} - My Webpage</title> + {% endblock %} + </head> + <body> + <div id="content">{% block content %}{% endblock %}</div> + <div id="footer"> + {% block footer %} + © Copyright 2011 by <a href="http://domain.invalid/">you</a>. + {% endblock %} + </div> + </body> + </html> + +In this example, the :doc:`block<block>` tags define four blocks that child +templates can fill in. All the ``block`` tag does is to tell the template +engine that a child template may override those portions of the template. + +Child Template +-------------- + +A child template might look like this: + +.. code-block:: jinja + + {% extends "base.html" %} + + {% block title %}Index{% endblock %} + {% block head %} + {{ parent() }} + <style type="text/css"> + .important { color: #336699; } + </style> + {% endblock %} + {% block content %} + <h1>Index</h1> + <p class="important"> + Welcome on my awesome homepage. + </p> + {% endblock %} + +The ``extends`` tag is the key here. It tells the template engine that this +template "extends" another template. When the template system evaluates this +template, first it locates the parent. The extends tag should be the first tag +in the template. + +Note that since the child template doesn't define the ``footer`` block, the +value from the parent template is used instead. + +You can't define multiple ``block`` tags with the same name in the same +template. This limitation exists because a block tag works in "both" +directions. That is, a block tag doesn't just provide a hole to fill - it also +defines the content that fills the hole in the *parent*. If there were two +similarly-named ``block`` tags in a template, that template's parent wouldn't +know which one of the blocks' content to use. + +If you want to print a block multiple times you can however use the +``block`` function: + +.. code-block:: jinja + + <title>{% block title %}{% endblock %}</title> + <h1>{{ block('title') }}</h1> + {% block body %}{% endblock %} + +Parent Blocks +------------- + +It's possible to render the contents of the parent block by using the +:doc:`parent<../functions/parent>` function. This gives back the results of +the parent block: + +.. code-block:: jinja + + {% block sidebar %} + <h3>Table Of Contents</h3> + ... + {{ parent() }} + {% endblock %} + +Named Block End-Tags +-------------------- + +Twig allows you to put the name of the block after the end tag for better +readability: + +.. code-block:: jinja + + {% block sidebar %} + {% block inner_sidebar %} + ... + {% endblock inner_sidebar %} + {% endblock sidebar %} + +Of course, the name after the ``endblock`` word must match the block name. + +Block Nesting and Scope +----------------------- + +Blocks can be nested for more complex layouts. Per default, blocks have access +to variables from outer scopes: + +.. code-block:: jinja + + {% for item in seq %} + <li>{% block loop_item %}{{ item }}{% endblock %}</li> + {% endfor %} + +Block Shortcuts +--------------- + +For blocks with few content, it's possible to use a shortcut syntax. The +following constructs do the same: + +.. code-block:: jinja + + {% block title %} + {{ page_title|title }} + {% endblock %} + +.. code-block:: jinja + + {% block title page_title|title %} + +Dynamic Inheritance +------------------- + +Twig supports dynamic inheritance by using a variable as the base template: + +.. code-block:: jinja + + {% extends some_var %} + +If the variable evaluates to a ``Twig_Template`` object, Twig will use it as +the parent template:: + + // {% extends layout %} + + $layout = $twig->loadTemplate('some_layout_template.twig'); + + $twig->display('template.twig', array('layout' => $layout)); + +.. versionadded:: 1.2 + The possibility to pass an array of templates has been added in Twig 1.2. + +You can also provide a list of templates that are checked for existence. The +first template that exists will be used as a parent: + +.. code-block:: jinja + + {% extends ['layout.html', 'base_layout.html'] %} + +Conditional Inheritance +----------------------- + +As the template name for the parent can be any valid Twig expression, it's +possible to make the inheritance mechanism conditional: + +.. code-block:: jinja + + {% extends standalone ? "minimum.html" : "base.html" %} + +In this example, the template will extend the "minimum.html" layout template +if the ``standalone`` variable evaluates to ``true``, and "base.html" +otherwise. + +.. seealso:: :doc:`block<../functions/block>`, :doc:`block<../tags/block>`, :doc:`parent<../functions/parent>`, :doc:`use<../tags/use>` diff --git a/core/vendor/twig/twig/doc/tags/filter.rst b/core/vendor/twig/twig/doc/tags/filter.rst new file mode 100644 index 000000000000..82ca5c62f0f8 --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/filter.rst @@ -0,0 +1,21 @@ +``filter`` +========== + +Filter sections allow you to apply regular Twig filters on a block of template +data. Just wrap the code in the special ``filter`` section: + +.. code-block:: jinja + + {% filter upper %} + This text becomes uppercase + {% endfilter %} + +You can also chain filters: + +.. code-block:: jinja + + {% filter lower|escape %} + <strong>SOME TEXT</strong> + {% endfilter %} + + {# outputs "<strong>some text</strong>" #} diff --git a/core/vendor/twig/twig/doc/tags/flush.rst b/core/vendor/twig/twig/doc/tags/flush.rst new file mode 100644 index 000000000000..55ef593a9216 --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/flush.rst @@ -0,0 +1,17 @@ +``flush`` +========= + +.. versionadded:: 1.5 + The flush tag was added in Twig 1.5. + +The ``flush`` tag tells Twig to flush the output buffer: + +.. code-block:: jinja + + {% flush %} + +.. note:: + + Internally, Twig uses the PHP `flush`_ function. + +.. _`flush`: http://php.net/flush diff --git a/core/vendor/twig/twig/doc/tags/for.rst b/core/vendor/twig/twig/doc/tags/for.rst new file mode 100644 index 000000000000..722861ab57a7 --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/for.rst @@ -0,0 +1,157 @@ +``for`` +======= + +Loop over each item in a sequence. For example, to display a list of users +provided in a variable called ``users``: + +.. code-block:: jinja + + <h1>Members</h1> + <ul> + {% for user in users %} + <li>{{ user.username|e }}</li> + {% endfor %} + </ul> + +.. note:: + + A sequence can be either an array or an object implementing the + ``Traversable`` interface. + +If you do need to iterate over a sequence of numbers, you can use the ``..`` +operator: + +.. code-block:: jinja + + {% for i in 0..10 %} + * {{ i }} + {% endfor %} + +The above snippet of code would print all numbers from 0 to 10. + +It can be also useful with letters: + +.. code-block:: jinja + + {% for letter in 'a'..'z' %} + * {{ letter }} + {% endfor %} + +The ``..`` operator can take any expression at both sides: + +.. code-block:: jinja + + {% for letter in 'a'|upper..'z'|upper %} + * {{ letter }} + {% endfor %} + +.. tip: + + If you need a step different from 1, you can use the ``range`` function + instead. + +The `loop` variable +------------------- + +Inside of a ``for`` loop block you can access some special variables: + +===================== ============================================================= +Variable Description +===================== ============================================================= +``loop.index`` The current iteration of the loop. (1 indexed) +``loop.index0`` The current iteration of the loop. (0 indexed) +``loop.revindex`` The number of iterations from the end of the loop (1 indexed) +``loop.revindex0`` The number of iterations from the end of the loop (0 indexed) +``loop.first`` True if first iteration +``loop.last`` True if last iteration +``loop.length`` The number of items in the sequence +``loop.parent`` The parent context +===================== ============================================================= + +.. code-block:: jinja + + {% for user in users %} + {{ loop.index }} - {{ user.username }} + {% endfor %} + +.. note:: + + The ``loop.length``, ``loop.revindex``, ``loop.revindex0``, and + ``loop.last`` variables are only available for PHP arrays, or objects that + implement the ``Countable`` interface. They are also not available when + looping with a condition. + +.. versionadded:: 1.2 + The ``if`` modifier support has been added in Twig 1.2. + +Adding a condition +------------------ + +Unlike in PHP, it's not possible to ``break`` or ``continue`` in a loop. You +can however filter the sequence during iteration which allows you to skip +items. The following example skips all the users which are not active: + +.. code-block:: jinja + + <ul> + {% for user in users if user.active %} + <li>{{ user.username|e }}</li> + {% endfor %} + </ul> + +The advantage is that the special loop variable will count correctly thus not +counting the users not iterated over. Keep in mind that properties like +``loop.last`` will not be defined when using loop conditions. + +.. note:: + + Using the ``loop`` variable within the condition is not recommended as it + will probably not be doing what you expect it to. For instance, adding a + condition like ``loop.index > 4`` won't work as the index is only + incremented when the condition is true (so the condition will never + match). + +The `else` Clause +----------------- + +If no iteration took place because the sequence was empty, you can render a +replacement block by using ``else``: + +.. code-block:: jinja + + <ul> + {% for user in users %} + <li>{{ user.username|e }}</li> + {% else %} + <li><em>no user found</em></li> + {% endfor %} + </ul> + +Iterating over Keys +------------------- + +By default, a loop iterates over the values of the sequence. You can iterate +on keys by using the ``keys`` filter: + +.. code-block:: jinja + + <h1>Members</h1> + <ul> + {% for key in users|keys %} + <li>{{ key }}</li> + {% endfor %} + </ul> + +Iterating over Keys and Values +------------------------------ + +You can also access both keys and values: + +.. code-block:: jinja + + <h1>Members</h1> + <ul> + {% for key, user in users %} + <li>{{ key }}: {{ user.username|e }}</li> + {% endfor %} + </ul> diff --git a/core/vendor/twig/twig/doc/tags/from.rst b/core/vendor/twig/twig/doc/tags/from.rst new file mode 100644 index 000000000000..5337a2355acd --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/from.rst @@ -0,0 +1,8 @@ +``from`` +======== + +The ``from`` tags import :doc:`macro<../tags/macro>` names into the current +namespace. The tag is documented in detail in the documentation for the +:doc:`import<../tags/import>` tag. + +.. seealso:: :doc:`macro<../tags/macro>`, :doc:`import<../tags/import>` diff --git a/core/vendor/twig/twig/doc/tags/if.rst b/core/vendor/twig/twig/doc/tags/if.rst new file mode 100644 index 000000000000..14e12b1dfc76 --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/if.rst @@ -0,0 +1,43 @@ +``if`` +====== + +The ``if`` statement in Twig is comparable with the if statements of PHP. + +In the simplest form you can use it to test if an expression evaluates to +``true``: + +.. code-block:: jinja + + {% if online == false %} + <p>Our website is in maintenance mode. Please, come back later.</p> + {% endif %} + +You can also test if an array is not empty: + +.. code-block:: jinja + + {% if users %} + <ul> + {% for user in users %} + <li>{{ user.username|e }}</li> + {% endfor %} + </ul> + {% endif %} + +.. note:: + + If you want to test if the variable is defined, use ``if users is + defined`` instead. + +For multiple branches ``elseif`` and ``else`` can be used like in PHP. You can use +more complex ``expressions`` there too: + +.. code-block:: jinja + + {% if kenny.sick %} + Kenny is sick. + {% elseif kenny.dead %} + You killed Kenny! You bastard!!! + {% else %} + Kenny looks okay --- so far + {% endif %} diff --git a/core/vendor/twig/twig/doc/tags/import.rst b/core/vendor/twig/twig/doc/tags/import.rst new file mode 100644 index 000000000000..8d47b36b841c --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/import.rst @@ -0,0 +1,79 @@ +``import`` +========== + +Twig supports putting often used code into :doc:`macros<../tags/macro>`. These +macros can go into different templates and get imported from there. + +There are two ways to import templates. You can import the complete template +into a variable or request specific macros from it. + +Imagine we have a helper module that renders forms (called ``forms.html``): + +.. code-block:: jinja + + {% macro input(name, value, type, size) %} + <input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" /> + {% endmacro %} + + {% macro textarea(name, value, rows) %} + <textarea name="{{ name }}" rows="{{ rows|default(10) }}" cols="{{ cols|default(40) }}">{{ value|e }}</textarea> + {% endmacro %} + +The easiest and most flexible is importing the whole module into a variable. +That way you can access the attributes: + +.. code-block:: jinja + + {% import 'forms.html' as forms %} + + <dl> + <dt>Username</dt> + <dd>{{ forms.input('username') }}</dd> + <dt>Password</dt> + <dd>{{ forms.input('password', null, 'password') }}</dd> + </dl> + <p>{{ forms.textarea('comment') }}</p> + +Alternatively you can import names from the template into the current +namespace: + +.. code-block:: jinja + + {% from 'forms.html' import input as input_field, textarea %} + + <dl> + <dt>Username</dt> + <dd>{{ input_field('username') }}</dd> + <dt>Password</dt> + <dd>{{ input_field('password', '', 'password') }}</dd> + </dl> + <p>{{ textarea('comment') }}</p> + +Importing is not needed if the macros and the template are defined in the same +file; use the special ``_self`` variable instead: + +.. code-block:: jinja + + {# index.html template #} + + {% macro textarea(name, value, rows) %} + <textarea name="{{ name }}" rows="{{ rows|default(10) }}" cols="{{ cols|default(40) }}">{{ value|e }}</textarea> + {% endmacro %} + + <p>{{ _self.textarea('comment') }}</p> + +But you can still create an alias by importing from the ``_self`` variable: + +.. code-block:: jinja + + {# index.html template #} + + {% macro textarea(name, value, rows) %} + <textarea name="{{ name }}" rows="{{ rows|default(10) }}" cols="{{ cols|default(40) }}">{{ value|e }}</textarea> + {% endmacro %} + + {% import _self as forms %} + + <p>{{ forms.textarea('comment') }}</p> + +.. seealso:: :doc:`macro<../tags/macro>`, :doc:`from<../tags/from>` diff --git a/core/vendor/twig/twig/doc/tags/include.rst b/core/vendor/twig/twig/doc/tags/include.rst new file mode 100644 index 000000000000..1440c50a7e41 --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/include.rst @@ -0,0 +1,86 @@ +``include`` +=========== + +The ``include`` statement includes a template and return the rendered content +of that file into the current namespace: + +.. code-block:: jinja + + {% include 'header.html' %} + Body + {% include 'footer.html' %} + +Included templates have access to the variables of the active context. + +If you are using the filesystem loader, the templates are looked for in the +paths defined by it. + +You can add additional variables by passing them after the ``with`` keyword: + +.. code-block:: jinja + + {# the foo template will have access to the variables from the current context and the foo one #} + {% include 'foo' with {'foo': 'bar'} %} + + {% set vars = {'foo': 'bar'} %} + {% include 'foo' with vars %} + +You can disable access to the context by appending the ``only`` keyword: + +.. code-block:: jinja + + {# only the foo variable will be accessible #} + {% include 'foo' with {'foo': 'bar'} only %} + +.. code-block:: jinja + + {# no variable will be accessible #} + {% include 'foo' only %} + +.. tip:: + + When including a template created by an end user, you should consider + sandboxing it. More information in the :doc:`Twig for Developers<../api>` + chapter and in the :doc:`sandbox<../tags/sandbox>` tag documentation. + +The template name can be any valid Twig expression: + +.. code-block:: jinja + + {% include some_var %} + {% include ajax ? 'ajax.html' : 'not_ajax.html' %} + +And if the expression evaluates to a ``Twig_Template`` object, Twig will use it +directly:: + + // {% include template %} + + $template = $twig->loadTemplate('some_template.twig'); + + $twig->loadTemplate('template.twig')->display(array('template' => $template)); + +.. versionadded:: 1.2 + The ``ignore missing`` feature has been added in Twig 1.2. + +You can mark an include with ``ignore missing`` in which case Twig will ignore +the statement if the template to be ignored does not exist. It has to be +placed just after the template name. Here some valid examples: + +.. code-block:: jinja + + {% include "sidebar.html" ignore missing %} + {% include "sidebar.html" ignore missing with {'foo': 'bar} %} + {% include "sidebar.html" ignore missing only %} + +.. versionadded:: 1.2 + The possibility to pass an array of templates has been added in Twig 1.2. + +You can also provide a list of templates that are checked for existence before +inclusion. The first template that exists will be included: + +.. code-block:: jinja + + {% include ['page_detailed.html', 'page.html'] %} + +If ``ignore missing`` is given, it will fall back to rendering nothing if none +of the templates exist, otherwise it will throw an exception. diff --git a/core/vendor/twig/twig/doc/tags/index.rst b/core/vendor/twig/twig/doc/tags/index.rst new file mode 100644 index 000000000000..fe0a00f2f6f3 --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/index.rst @@ -0,0 +1,24 @@ +Tags +==== + +.. toctree:: + :maxdepth: 1 + + for + if + macro + filter + set + extends + block + include + import + from + use + spaceless + autoescape + raw + flush + do + sandbox + embed diff --git a/core/vendor/twig/twig/doc/tags/macro.rst b/core/vendor/twig/twig/doc/tags/macro.rst new file mode 100644 index 000000000000..3d920e31ccc6 --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/macro.rst @@ -0,0 +1,91 @@ +``macro`` +========= + +Macros are comparable with functions in regular programming languages. They +are useful to put often used HTML idioms into reusable elements to not repeat +yourself. + +Here is a small example of a macro that renders a form element: + +.. code-block:: jinja + + {% macro input(name, value, type, size) %} + <input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" /> + {% endmacro %} + +Macros differs from native PHP functions in a few ways: + +* Default argument values are defined by using the ``default`` filter in the + macro body; + +* Arguments of a macro are always optional. + +But as PHP functions, macros don't have access to the current template +variables. + +.. tip:: + + You can pass the whole context as an argument by using the special + ``_context`` variable. + +Macros can be defined in any template, and need to be "imported" before being +used (see the documentation for the :doc:`import<../tags/import>` tag for more +information): + +.. code-block:: jinja + + {% import "forms.html" as forms %} + +The above ``import`` call imports the "forms.html" file (which can contain only +macros, or a template and some macros), and import the functions as items of +the ``forms`` variable. + +The macro can then be called at will: + +.. code-block:: jinja + + <p>{{ forms.input('username') }}</p> + <p>{{ forms.input('password', null, 'password') }}</p> + +If macros are defined and used in the same template, you can use the +special ``_self`` variable, without importing them: + +.. code-block:: jinja + + <p>{{ _self.input('username') }}</p> + +When you want to use a macro in another one from the same file, use the ``_self`` +variable: + +.. code-block:: jinja + + {% macro input(name, value, type, size) %} + <input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" /> + {% endmacro %} + + {% macro wrapped_input(name, value, type, size) %} + <div class="field"> + {{ _self.input(name, value, type, size) }} + </div> + {% endmacro %} + +When the macro is defined in another file, you need to import it: + +.. code-block:: jinja + + {# forms.html #} + + {% macro input(name, value, type, size) %} + <input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" /> + {% endmacro %} + + {# shortcuts.html #} + + {% macro wrapped_input(name, value, type, size) %} + {% import "forms.html" as forms %} + <div class="field"> + {{ forms.input(name, value, type, size) }} + </div> + {% endmacro %} + +.. seealso:: :doc:`from<../tags/from>`, :doc:`import<../tags/import>` diff --git a/core/vendor/twig/twig/doc/tags/raw.rst b/core/vendor/twig/twig/doc/tags/raw.rst new file mode 100644 index 000000000000..4136c702e3b0 --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/raw.rst @@ -0,0 +1,16 @@ +``raw`` +======= + +The ``raw`` tag marks sections as being raw text that should not be parsed. +For example to put Twig syntax as example into a template you can use this +snippet: + +.. code-block:: jinja + + {% raw %} + <ul> + {% for item in seq %} + <li>{{ item }}</li> + {% endfor %} + </ul> + {% endraw %} diff --git a/core/vendor/twig/twig/doc/tags/sandbox.rst b/core/vendor/twig/twig/doc/tags/sandbox.rst new file mode 100644 index 000000000000..027553726933 --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/sandbox.rst @@ -0,0 +1,30 @@ +``sandbox`` +=========== + +The ``sandbox`` tag can be used to enable the sandboxing mode for an included +template, when sandboxing is not enabled globally for the Twig environment: + +.. code-block:: jinja + + {% sandbox %} + {% include 'user.html' %} + {% endsandbox %} + +.. warning:: + + The ``sandbox`` tag is only available when the sandbox extension is + enabled (see the :doc:`Twig for Developers<../api>` chapter). + +.. note:: + + The ``sandbox`` tag can only be used to sandbox an include tag and it + cannot be used to sandbox a section of a template. The following example + won't work for example: + + .. code-block:: jinja + + {% sandbox %} + {% for i in 1..2 %} + {{ i }} + {% endfor %} + {% endsandbox %} diff --git a/core/vendor/twig/twig/doc/tags/set.rst b/core/vendor/twig/twig/doc/tags/set.rst new file mode 100644 index 000000000000..15090e7755c2 --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/set.rst @@ -0,0 +1,32 @@ +``set`` +======= + +Inside code blocks you can also assign values to variables. Assignments use +the ``set`` tag and can have multiple targets: + +.. code-block:: jinja + + {% set foo = 'foo' %} + + {% set foo = [1, 2] %} + + {% set foo = {'foo': 'bar'} %} + + {% set foo = 'foo' ~ 'bar' %} + + {% set foo, bar = 'foo', 'bar' %} + +The ``set`` tag can also be used to 'capture' chunks of text: + +.. code-block:: jinja + + {% set foo %} + <div id="pagination"> + ... + </div> + {% endset %} + +.. caution:: + + If you enable automatic output escaping, Twig will only consider the + content to be safe when capturing chunks of text. diff --git a/core/vendor/twig/twig/doc/tags/spaceless.rst b/core/vendor/twig/twig/doc/tags/spaceless.rst new file mode 100644 index 000000000000..12e77b2575f0 --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/spaceless.rst @@ -0,0 +1,37 @@ +``spaceless`` +============= + +Use the ``spaceless`` tag to remove whitespace *between HTML tags*, not +whitespace within HTML tags or whitespace in plain text: + +.. code-block:: jinja + + {% spaceless %} + <div> + <strong>foo</strong> + </div> + {% endspaceless %} + + {# output will be <div><strong>foo</strong></div> #} + +This tag is not meant to "optimize" the size of the generated HTML content but +merely to avoid extra whitespace between HTML tags to avoid browser rendering +quirks under some circumstances. + +.. tip:: + + If you want to optimize the size of the generated HTML content, gzip + compress the output instead. + +.. tip:: + + If you want to create a tag that actually removes all extra whitespace in + an HTML string, be warned that this is not as easy as it seems to be + (think of ``textarea`` or ``pre`` tags for instance). Using a third-party + library like Tidy is probably a better idea. + +.. tip:: + + For more information on whitespace control, read the + :doc:`dedicated<../templates>` section of the documentation and learn how + you can also use the whitespace control modifier on your tags. diff --git a/core/vendor/twig/twig/doc/tags/use.rst b/core/vendor/twig/twig/doc/tags/use.rst new file mode 100644 index 000000000000..085f916108e4 --- /dev/null +++ b/core/vendor/twig/twig/doc/tags/use.rst @@ -0,0 +1,123 @@ +``use`` +======= + +.. versionadded:: 1.1 + Horizontal reuse was added in Twig 1.1. + +.. note:: + + Horizontal reuse is an advanced Twig feature that is hardly ever needed in + regular templates. It is mainly used by projects that need to make + template blocks reusable without using inheritance. + +Template inheritance is one of the most powerful Twig's feature but it is +limited to single inheritance; a template can only extend one other template. +This limitation makes template inheritance simple to understand and easy to +debug: + +.. code-block:: jinja + + {% extends "base.html" %} + + {% block title %}{% endblock %} + {% block content %}{% endblock %} + +Horizontal reuse is a way to achieve the same goal as multiple inheritance, +but without the associated complexity: + +.. code-block:: jinja + + {% extends "base.html" %} + + {% use "blocks.html" %} + + {% block title %}{% endblock %} + {% block content %}{% endblock %} + +The ``use`` statement tells Twig to import the blocks defined in +```blocks.html`` into the current template (it's like macros, but for blocks): + +.. code-block:: jinja + + # blocks.html + {% block sidebar %}{% endblock %} + +In this example, the ``use`` statement imports the ``sidebar`` block into the +main template. The code is mostly equivalent to the following one (the +imported blocks are not outputted automatically): + +.. code-block:: jinja + + {% extends "base.html" %} + + {% block sidebar %}{% endblock %} + {% block title %}{% endblock %} + {% block content %}{% endblock %} + +.. note:: + + The ``use`` tag only imports a template if it does not extend another + template, if it does not define macros, and if the body is empty. But it + can *use* other templates. + +.. note:: + + Because ``use`` statements are resolved independently of the context + passed to the template, the template reference cannot be an expression. + +The main template can also override any imported block. If the template +already defines the ``sidebar`` block, then the one defined in ``blocks.html`` +is ignored. To avoid name conflicts, you can rename imported blocks: + +.. code-block:: jinja + + {% extends "base.html" %} + + {% use "blocks.html" with sidebar as base_sidebar %} + + {% block sidebar %}{% endblock %} + {% block title %}{% endblock %} + {% block content %}{% endblock %} + +.. versionadded:: 1.3 + The ``parent()`` support was added in Twig 1.3. + +The ``parent()`` function automatically determines the correct inheritance +tree, so it can be used when overriding a block defined in an imported +template: + +.. code-block:: jinja + + {% extends "base.html" %} + + {% use "blocks.html" %} + + {% block sidebar %} + {{ parent() }} + {% endblock %} + + {% block title %}{% endblock %} + {% block content %}{% endblock %} + +In this example, ``parent()`` will correctly call the ``sidebar`` block from +the ``blocks.html`` template. + +.. tip:: + + In Twig 1.2, renaming allows you to simulate inheritance by calling the + "parent" block: + + .. code-block:: jinja + + {% extends "base.html" %} + + {% use "blocks.html" with sidebar as parent_sidebar %} + + {% block sidebar %} + {{ block('parent_sidebar') }} + {% endblock %} + +.. note:: + + You can use as many ``use`` statements as you want in any given template. + If two imported templates define the same block, the latest one wins. diff --git a/core/vendor/twig/twig/doc/templates.rst b/core/vendor/twig/twig/doc/templates.rst new file mode 100644 index 000000000000..278e56ddbe54 --- /dev/null +++ b/core/vendor/twig/twig/doc/templates.rst @@ -0,0 +1,727 @@ +Twig for Template Designers +=========================== + +This document describes the syntax and semantics of the template engine and +will be most useful as reference to those creating Twig templates. + +Synopsis +-------- + +A template is simply a text file. It can generate any text-based format (HTML, +XML, CSV, LaTeX, etc.). It doesn't have a specific extension, ``.html`` or +``.xml`` are just fine. + +A template contains **variables** or **expressions**, which get replaced with +values when the template is evaluated, and **tags**, which control the logic +of the template. + +Below is a minimal template that illustrates a few basics. We will cover the +details later on: + +.. code-block:: html+jinja + + <!DOCTYPE html> + <html> + <head> + <title>My Webpage</title> + </head> + <body> + <ul id="navigation"> + {% for item in navigation %} + <li><a href="{{ item.href }}">{{ item.caption }}</a></li> + {% endfor %} + </ul> + + <h1>My Webpage</h1> + {{ a_variable }} + </body> + </html> + +There are two kinds of delimiters: ``{% ... %}`` and ``{{ ... }}``. The first +one is used to execute statements such as for-loops, the latter prints the +result of an expression to the template. + +IDEs Integration +---------------- + +Many IDEs support syntax highlighting and auto-completion for Twig: + +* *Textmate* via the `Twig bundle`_ +* *Vim* via the `Jinja syntax plugin`_ +* *Netbeans* via the `Twig syntax plugin`_ +* *PhpStorm* (native as of 2.1) +* *Eclipse* via the `Twig plugin`_ +* *Sublime Text* via the `Twig bundle`_ +* *GtkSourceView* via the `Twig language definition`_ (used by gedit and other projects) +* *Coda* and *SubEthaEdit* via the `Twig syntax mode`_ +* *Coda 2* via the `other Twig syntax mode`_ +* *Komodo* and *Komodo Edit* via the Django highlight/syntax check mode + +Variables +--------- + +The application passes variables to the templates you can mess around in the +template. Variables may have attributes or elements on them you can access +too. How a variable looks like heavily depends on the application providing +those. + +You can use a dot (``.``) to access attributes of a variable (methods or +properties of a PHP object, or items of a PHP array), or the so-called +"subscript" syntax (``[]``): + +.. code-block:: jinja + + {{ foo.bar }} + {{ foo['bar'] }} + +.. note:: + + It's important to know that the curly braces are *not* part of the + variable but the print statement. If you access variables inside tags + don't put the braces around. + +If a variable or attribute does not exist, you will get back a ``null`` value +when the ``strict_variables`` option is set to ``false``, otherwise Twig will +throw an error (see :ref:`environment options<environment_options>`). + +.. sidebar:: Implementation + + For convenience sake ``foo.bar`` does the following things on the PHP + layer: + + * check if ``foo`` is an array and ``bar`` a valid element; + * if not, and if ``foo`` is an object, check that ``bar`` is a valid property; + * if not, and if ``foo`` is an object, check that ``bar`` is a valid method + (even if ``bar`` is the constructor - use ``__construct()`` instead); + * if not, and if ``foo`` is an object, check that ``getBar`` is a valid method; + * if not, and if ``foo`` is an object, check that ``isBar`` is a valid method; + * if not, return a ``null`` value. + + ``foo['bar']`` on the other hand only works with PHP arrays: + + * check if ``foo`` is an array and ``bar`` a valid element; + * if not, return a ``null`` value. + +.. note:: + + If you want to get a dynamic attribute on a variable, use the + :doc:`attribute<functions/attribute>` function instead. + +Global Variables +~~~~~~~~~~~~~~~~ + +The following variables are always available in templates: + +* ``_self``: references the current template; +* ``_context``: references the current context; +* ``_charset``: references the current charset. + +Setting Variables +~~~~~~~~~~~~~~~~~ + +You can assign values to variables inside code blocks. Assignments use the +:doc:`set<tags/set>` tag: + +.. code-block:: jinja + + {% set foo = 'foo' %} + {% set foo = [1, 2] %} + {% set foo = {'foo': 'bar'} %} + +Filters +------- + +Variables can be modified by **filters**. Filters are separated from the +variable by a pipe symbol (``|``) and may have optional arguments in +parentheses. Multiple filters can be chained. The output of one filter is +applied to the next. + +The following example removes all HTML tags from the ``name`` and title-cases +it: + +.. code-block:: jinja + + {{ name|striptags|title }} + +Filters that accept arguments have parentheses around the arguments. This +example will join a list by commas: + +.. code-block:: jinja + + {{ list|join(', ') }} + +To apply a filter on a section of code, wrap it with the +:doc:`filter<tags/filter>` tag: + +.. code-block:: jinja + + {% filter upper %} + This text becomes uppercase + {% endfilter %} + +Go to the :doc:`filters<filters/index>` page to learn more about the built-in +filters. + +Functions +--------- + +Functions can be called to generate content. Functions are called by their +name followed by parentheses (``()``) and may have arguments. + +For instance, the ``range`` function returns a list containing an arithmetic +progression of integers: + +.. code-block:: jinja + + {% for i in range(0, 3) %} + {{ i }}, + {% endfor %} + +Go to the :doc:`functions<functions/index>` page to learn more about the +built-in functions. + +Control Structure +----------------- + +A control structure refers to all those things that control the flow of a +program - conditionals (i.e. ``if``/``elseif``/``else``), ``for``-loops, as +well as things like blocks. Control structures appear inside ``{% ... %}`` +blocks. + +For example, to display a list of users provided in a variable called +``users``, use the :doc:`for<tags/for>` tag: + +.. code-block:: jinja + + <h1>Members</h1> + <ul> + {% for user in users %} + <li>{{ user.username|e }}</li> + {% endfor %} + </ul> + +The :doc:`if<tags/if>` tag can be used to test an expression: + +.. code-block:: jinja + + {% if users|length > 0 %} + <ul> + {% for user in users %} + <li>{{ user.username|e }}</li> + {% endfor %} + </ul> + {% endif %} + +Go to the :doc:`tags<tags/index>` page to learn more about the built-in tags. + +Comments +-------- + +To comment-out part of a line in a template, use the comment syntax ``{# ... +#}``. This is useful for debugging or to add information for other template +designers or yourself: + +.. code-block:: jinja + + {# note: disabled template because we no longer use this + {% for user in users %} + ... + {% endfor %} + #} + +Including other Templates +------------------------- + +The :doc:`include<tags/include>` tag is useful to include a template and +return the rendered content of that template into the current one: + +.. code-block:: jinja + + {% include 'sidebar.html' %} + +Per default included templates are passed the current context. + +The context that is passed to the included template includes variables defined +in the template: + +.. code-block:: jinja + + {% for box in boxes %} + {% include "render_box.html" %} + {% endfor %} + +The included template ``render_box.html`` is able to access ``box``. + +The filename of the template depends on the template loader. For instance, the +``Twig_Loader_Filesystem`` allows you to access other templates by giving the +filename. You can access templates in subdirectories with a slash: + +.. code-block:: jinja + + {% include "sections/articles/sidebar.html" %} + +This behavior depends on the application embedding Twig. + +Template Inheritance +-------------------- + +The most powerful part of Twig is template inheritance. Template inheritance +allows you to build a base "skeleton" template that contains all the common +elements of your site and defines **blocks** that child templates can +override. + +Sounds complicated but is very basic. It's easier to understand it by +starting with an example. + +Let's define a base template, ``base.html``, which defines a simple HTML +skeleton document that you might use for a simple two-column page: + +.. code-block:: html+jinja + + <!DOCTYPE html> + <html> + <head> + {% block head %} + <link rel="stylesheet" href="style.css" /> + <title>{% block title %}{% endblock %} - My Webpage</title> + {% endblock %} + </head> + <body> + <div id="content">{% block content %}{% endblock %}</div> + <div id="footer"> + {% block footer %} + © Copyright 2011 by <a href="http://domain.invalid/">you</a>. + {% endblock %} + </div> + </body> + </html> + +In this example, the :doc:`block<tags/block>` tags define four blocks that +child templates can fill in. All the ``block`` tag does is to tell the +template engine that a child template may override those portions of the +template. + +A child template might look like this: + +.. code-block:: jinja + + {% extends "base.html" %} + + {% block title %}Index{% endblock %} + {% block head %} + {{ parent() }} + <style type="text/css"> + .important { color: #336699; } + </style> + {% endblock %} + {% block content %} + <h1>Index</h1> + <p class="important"> + Welcome on my awesome homepage. + </p> + {% endblock %} + +The :doc:`extends<tags/extends>` tag is the key here. It tells the template +engine that this template "extends" another template. When the template system +evaluates this template, first it locates the parent. The extends tag should +be the first tag in the template. + +Note that since the child template doesn't define the ``footer`` block, the +value from the parent template is used instead. + +It's possible to render the contents of the parent block by using the +:doc:`parent<functions/parent>` function. This gives back the results of the +parent block: + +.. code-block:: jinja + + {% block sidebar %} + <h3>Table Of Contents</h3> + ... + {{ parent() }} + {% endblock %} + +.. tip:: + + The documentation page for the :doc:`extends<tags/extends>` tag describes + more advanced features like block nesting, scope, dynamic inheritance, and + conditional inheritance. + +.. note:: + + Twig also supports multiple inheritance with the so called horizontal reuse + with the help of the :doc:`use<tags/use>` tag. This is an advanced feature + hardly ever needed in regular templates. + +HTML Escaping +------------- + +When generating HTML from templates, there's always a risk that a variable +will include characters that affect the resulting HTML. There are two +approaches: manually escaping each variable or automatically escaping +everything by default. + +Twig supports both, automatic escaping is enabled by default. + +.. note:: + + Automatic escaping is only supported if the *escaper* extension has been + enabled (which is the default). + +Working with Manual Escaping +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If manual escaping is enabled it's **your** responsibility to escape variables +if needed. What to escape? If you have a variable that *may* include any of +the following chars (``>``, ``<``, ``&``, or ``"``) you **have to** escape it +unless the variable contains well-formed and trusted HTML. Escaping works by +piping the variable through the :doc:`escape<filters/escape>` or ``e`` filter: + +.. code-block:: jinja + + {{ user.username|e }} + {{ user.username|e('js') }} + +Working with Automatic Escaping +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Whether automatic escaping is enabled or not, you can mark a section of a +template to be escaped or not by using the :doc:`autoescape<tags/autoescape>` +tag: + +.. code-block:: jinja + + {% autoescape true %} + Everything will be automatically escaped in this block + {% endautoescape %} + +Escaping +-------- + +It is sometimes desirable or even necessary to have Twig ignore parts it would +otherwise handle as variables or blocks. For example if the default syntax is +used and you want to use ``{{`` as raw string in the template and not start a +variable you have to use a trick. + +The easiest way is to output the variable delimiter (``{{``) by using a variable +expression: + +.. code-block:: jinja + + {{ '{{' }} + +For bigger sections it makes sense to mark a block :doc:`raw<tags/raw>`. + +Macros +------ + +Macros are comparable with functions in regular programming languages. They +are useful to reuse often used HTML fragments to not repeat yourself. + +A macro is defined via the :doc:`macro<tags/macro>` tag. Here is a small example +(subsequently called ``forms.html``) of a macro that renders a form element: + +.. code-block:: jinja + + {% macro input(name, value, type, size) %} + <input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" /> + {% endmacro %} + +Macros can be defined in any template, and need to be "imported" via the +:doc:`import<tags/import>` tag before being used: + +.. code-block:: jinja + + {% import "forms.html" as forms %} + + <p>{{ forms.input('username') }}</p> + +Alternatively, you can import individual macro names from a template into the +current namespace via the :doc:`from<tags/from>` tag and optionally alias them: + +.. code-block:: jinja + + {% from 'forms.html' import input as input_field %} + + <dl> + <dt>Username</dt> + <dd>{{ input_field('username') }}</dd> + <dt>Password</dt> + <dd>{{ input_field('password', '', 'password') }}</dd> + </dl> + +Expressions +----------- + +Twig allows expressions everywhere. These work very similar to regular PHP and +even if you're not working with PHP you should feel comfortable with it. + +.. note:: + + The operator precedence is as follows, with the lowest-precedence + operators listed first: ``b-and``, ``b-xor``, ``b-or``, ``or``, ``and``, + ``==``, ``!=``, ``<``, ``>``, ``>=``, ``<=``, ``in``, ``..``, ``+``, + ``-``, ``~``, ``*``, ``/``, ``//``, ``%``, ``is``, and ``**``. + +Literals +~~~~~~~~ + +.. versionadded:: 1.5 + Support for hash keys as names and expressions was added in Twig 1.5. + +The simplest form of expressions are literals. Literals are representations +for PHP types such as strings, numbers, and arrays. The following literals +exist: + +* ``"Hello World"``: Everything between two double or single quotes is a + string. They are useful whenever you need a string in the template (for + example as arguments to function calls, filters or just to extend or + include a template). + +* ``42`` / ``42.23``: Integers and floating point numbers are created by just + writing the number down. If a dot is present the number is a float, + otherwise an integer. + +* ``["foo", "bar"]``: Arrays are defined by a sequence of expressions + separated by a comma (``,``) and wrapped with squared brackets (``[]``). + +* ``{"foo": "bar"}``: Hashes are defined by a list of keys and values + separated by a comma (``,``) and wrapped with curly braces (``{}``): + + .. code-block:: jinja + + {# keys as string #} + { 'foo': 'foo', 'bar': 'bar' } + + {# keys as names (equivalent to the previous hash) -- as of Twig 1.5 #} + { foo: 'foo', bar: 'bar' } + + {# keys as integer #} + { 2: 'foo', 4: 'bar' } + + {# keys as expressions (the expression must be enclosed into parentheses) -- as of Twig 1.5 #} + { (1 + 1): 'foo', (a ~ 'b'): 'bar' } + +* ``true`` / ``false``: ``true`` represents the true value, ``false`` + represents the false value. + +* ``null``: ``null`` represents no specific value. This is the value returned + when a variable does not exist. ``none`` is an alias for ``null``. + +Arrays and hashes can be nested: + +.. code-block:: jinja + + {% set foo = [1, {"foo": "bar"}] %} + +Math +~~~~ + +Twig allows you to calculate with values. This is rarely useful in templates +but exists for completeness' sake. The following operators are supported: + +* ``+``: Adds two objects together (the operands are casted to numbers). ``{{ + 1 + 1 }}`` is ``2``. + +* ``-``: Substracts the second number from the first one. ``{{ 3 - 2 }}`` is + ``1``. + +* ``/``: Divides two numbers. The returned value will be a floating point + number. ``{{ 1 / 2 }}`` is ``{{ 0.5 }}``. + +* ``%``: Calculates the remainder of an integer division. ``{{ 11 % 7 }}`` is + ``4``. + +* ``//``: Divides two numbers and returns the truncated integer result. ``{{ + 20 // 7 }}`` is ``2``. + +* ``*``: Multiplies the left operand with the right one. ``{{ 2 * 2 }}`` would + return ``4``. + +* ``**``: Raises the left operand to the power of the right operand. ``{{ 2 ** + 3 }}`` would return ``8``. + +Logic +~~~~~ + +You can combine multiple expressions with the following operators: + +* ``and``: Returns true if the left and the right operands are both true. + +* ``or``: Returns true if the left or the right operand is true. + +* ``not``: Negates a statement. + +* ``(expr)``: Groups an expression. + +.. note:: + + Twig also support bitwise operators (``b-and``, ``b-xor``, and ``b-or``). + +Comparisons +~~~~~~~~~~~ + +The following comparison operators are supported in any expression: ``==``, +``!=``, ``<``, ``>``, ``>=``, and ``<=``. + +Containment Operator +~~~~~~~~~~~~~~~~~~~~ + +The ``in`` operator performs containment test. + +It returns ``true`` if the left operand is contained in the right: + +.. code-block:: jinja + + {# returns true #} + + {{ 1 in [1, 2, 3] }} + + {{ 'cd' in 'abcde' }} + +.. tip:: + + You can use this filter to perform a containment test on strings, arrays, + or objects implementing the ``Traversable`` interface. + +To perform a negative test, use the ``not in`` operator: + +.. code-block:: jinja + + {% if 1 not in [1, 2, 3] %} + + {# is equivalent to #} + {% if not (1 in [1, 2, 3]) %} + +Test Operator +~~~~~~~~~~~~~ + +The ``is`` operator performs tests. Tests can be used to test a variable against +a common expression. The right operand is name of the test: + +.. code-block:: jinja + + {# find out if a variable is odd #} + + {{ name is odd }} + +Tests can accept arguments too: + +.. code-block:: jinja + + {% if loop.index is divisibleby(3) %} + +Tests can be negated by using the ``is not`` operator: + +.. code-block:: jinja + + {% if loop.index is not divisibleby(3) %} + + {# is equivalent to #} + {% if not (loop.index is divisibleby(3)) %} + +Go to the :doc:`tests<tests/index>` page to learn more about the built-in +tests. + +Other Operators +~~~~~~~~~~~~~~~ + +The following operators are very useful but don't fit into any of the other +categories: + +* ``..``: Creates a sequence based on the operand before and after the + operator (this is just syntactic sugar for the :doc:`range<functions/range>` + function). + +* ``|``: Applies a filter. + +* ``~``: Converts all operands into strings and concatenates them. ``{{ "Hello + " ~ name ~ "!" }}`` would return (assuming ``name`` is ``'John'``) ``Hello + John!``. + +* ``.``, ``[]``: Gets an attribute of an object. + +* ``?:``: The PHP ternary operator: ``{{ foo ? 'yes' : 'no' }}`` + +String Interpolation +~~~~~~~~~~~~~~~~~~~~ + +.. versionadded:: 1.5 + String interpolation was added in Twig 1.5. + +String interpolation (`#{expression}`) allows any valid expression to appear +within a string. The result of evaluating that expression is inserted into the +string: + +.. code-block:: jinja + + {{ "foo #{bar} baz" }} + {{ "foo #{1 + 2} baz" }} + +Whitespace Control +------------------ + +.. versionadded:: 1.1 + Tag level whitespace control was added in Twig 1.1. + +The first newline after a template tag is removed automatically (like in PHP.) +Whitespace is not further modified by the template engine, so each whitespace +(spaces, tabs, newlines etc.) is returned unchanged. + +Use the ``spaceless`` tag to remove whitespace *between HTML tags*: + +.. code-block:: jinja + + {% spaceless %} + <div> + <strong>foo</strong> + </div> + {% endspaceless %} + + {# output will be <div><strong>foo</strong></div> #} + +In addition to the spaceless tag you can also control whitespace on a per tag +level. By using the whitespace control modifier on your tags, you can trim +leading and or trailing whitespace: + +.. code-block:: jinja + + {% set value = 'no spaces' %} + {#- No leading/trailing whitespace -#} + {%- if true -%} + {{- value -}} + {%- endif -%} + + {# output 'no spaces' #} + +The above sample shows the default whitespace control modifier, and how you can +use it to remove whitespace around tags. Trimming space will consume all whitespace +for that side of the tag. It is possible to use whitespace trimming on one side +of a tag: + +.. code-block:: jinja + + {% set value = 'no spaces' %} + <li> {{- value }} </li> + + {# outputs '<li>no spaces </li>' #} + +Extensions +---------- + +Twig can be easily extended. + +If you are looking for new tags, filters, or functions, have a look at the Twig official +`extension repository`_. + +If you want to create your own, read the :ref:`Creating an +Extension<creating_extensions>` chapter. + +.. _`Twig bundle`: https://github.com/Anomareh/PHP-Twig.tmbundle +.. _`Jinja syntax plugin`: http://jinja.pocoo.org/2/documentation/integration +.. _`Twig syntax plugin`: http://plugins.netbeans.org/plugin/37069/php-twig +.. _`Twig plugin`: https://github.com/pulse00/Twig-Eclipse-Plugin +.. _`Twig language definition`: https://github.com/gabrielcorpse/gedit-twig-template-language +.. _`extension repository`: http://github.com/fabpot/Twig-extensions +.. _`Twig syntax mode`: https://github.com/bobthecow/Twig-HTML.mode +.. _`other Twig syntax mode`: https://github.com/muxx/Twig-HTML.mode diff --git a/core/vendor/twig/twig/doc/tests/constant.rst b/core/vendor/twig/twig/doc/tests/constant.rst new file mode 100644 index 000000000000..79709335d759 --- /dev/null +++ b/core/vendor/twig/twig/doc/tests/constant.rst @@ -0,0 +1,11 @@ +``constant`` +============ + +``constant`` checks if a variable has the exact same value as a constant. You +can use either global constants or class constants: + +.. code-block:: jinja + + {% if post.status is constant('Post::PUBLISHED') %} + the status attribute is exactly the same as Post::PUBLISHED + {% endif %} diff --git a/core/vendor/twig/twig/doc/tests/defined.rst b/core/vendor/twig/twig/doc/tests/defined.rst new file mode 100644 index 000000000000..702ce72565ea --- /dev/null +++ b/core/vendor/twig/twig/doc/tests/defined.rst @@ -0,0 +1,30 @@ +``defined`` +=========== + +``defined`` checks if a variable is defined in the current context. This is very +useful if you use the ``strict_variables`` option: + +.. code-block:: jinja + + {# defined works with variable names #} + {% if foo is defined %} + ... + {% endif %} + + {# and attributes on variables names #} + {% if foo.bar is defined %} + ... + {% endif %} + + {% if foo['bar'] is defined %} + ... + {% endif %} + +When using the ``defined`` test on an expression that uses variables in some +method calls, be sure that they are all defined first: + +.. code-block:: jinja + + {% if var is defined and foo.method(var) is defined %} + ... + {% endif %} diff --git a/core/vendor/twig/twig/doc/tests/divisibleby.rst b/core/vendor/twig/twig/doc/tests/divisibleby.rst new file mode 100644 index 000000000000..9b0b96440ac4 --- /dev/null +++ b/core/vendor/twig/twig/doc/tests/divisibleby.rst @@ -0,0 +1,10 @@ +``divisibleby`` +=============== + +``divisibleby`` checks if a variable is divisible by a number: + +.. code-block:: jinja + + {% if loop.index is divisibleby(3) %} + ... + {% endif %} diff --git a/core/vendor/twig/twig/doc/tests/empty.rst b/core/vendor/twig/twig/doc/tests/empty.rst new file mode 100644 index 000000000000..0d1eb3234406 --- /dev/null +++ b/core/vendor/twig/twig/doc/tests/empty.rst @@ -0,0 +1,11 @@ +``empty`` +========= + +``empty`` checks if a variable is empty: + +.. code-block:: jinja + + {# evaluates to true if the foo variable is null, false, or the empty string #} + {% if foo is empty %} + ... + {% endif %} diff --git a/core/vendor/twig/twig/doc/tests/even.rst b/core/vendor/twig/twig/doc/tests/even.rst new file mode 100644 index 000000000000..6ab5cc39a04d --- /dev/null +++ b/core/vendor/twig/twig/doc/tests/even.rst @@ -0,0 +1,10 @@ +``even`` +======== + +``even`` returns ``true`` if the given number is even: + +.. code-block:: jinja + + {{ var is even }} + +.. seealso:: :doc:`odd<../tests/odd>` diff --git a/core/vendor/twig/twig/doc/tests/index.rst b/core/vendor/twig/twig/doc/tests/index.rst new file mode 100644 index 000000000000..7b8c535657bc --- /dev/null +++ b/core/vendor/twig/twig/doc/tests/index.rst @@ -0,0 +1,15 @@ +Tests +===== + +.. toctree:: + :maxdepth: 1 + + divisibleby + null + even + odd + sameas + constant + defined + empty + iterable diff --git a/core/vendor/twig/twig/doc/tests/iterable.rst b/core/vendor/twig/twig/doc/tests/iterable.rst new file mode 100644 index 000000000000..89a172f7418e --- /dev/null +++ b/core/vendor/twig/twig/doc/tests/iterable.rst @@ -0,0 +1,19 @@ +``iterable`` +============ + +.. versionadded:: 1.7 + The iterable test was added in Twig 1.7. + +``iterable`` checks if a variable is an array or a traversable object: + +.. code-block:: jinja + + {# evaluates to true if the foo variable is iterable #} + {% if users is iterable %} + {% for user in users %} + Hello {{ user }}! + {% endfor %} + {% else %} + {# users is probably a string #} + Hello {{ users }}! + {% endif %} diff --git a/core/vendor/twig/twig/doc/tests/null.rst b/core/vendor/twig/twig/doc/tests/null.rst new file mode 100644 index 000000000000..44eec62e56b0 --- /dev/null +++ b/core/vendor/twig/twig/doc/tests/null.rst @@ -0,0 +1,12 @@ +``null`` +======== + +``null`` returns ``true`` if the variable is ``null``: + +.. code-block:: jinja + + {{ var is null }} + +.. note:: + + ``none`` is an alias for ``null``. diff --git a/core/vendor/twig/twig/doc/tests/odd.rst b/core/vendor/twig/twig/doc/tests/odd.rst new file mode 100644 index 000000000000..9eece777623c --- /dev/null +++ b/core/vendor/twig/twig/doc/tests/odd.rst @@ -0,0 +1,10 @@ +``odd`` +======= + +``odd`` returns ``true`` if the given number is odd: + +.. code-block:: jinja + + {{ var is odd }} + +.. seealso:: :doc:`even<../tests/even>` diff --git a/core/vendor/twig/twig/doc/tests/sameas.rst b/core/vendor/twig/twig/doc/tests/sameas.rst new file mode 100644 index 000000000000..efb15c35ef08 --- /dev/null +++ b/core/vendor/twig/twig/doc/tests/sameas.rst @@ -0,0 +1,11 @@ +``sameas`` +========== + +``sameas`` checks if a variable points to the same memory address than another +variable: + +.. code-block:: jinja + + {% if foo.attribute is sameas(false) %} + the foo attribute really is the ``false`` PHP value + {% endif %} diff --git a/core/vendor/twig/twig/ext/twig/.gitignore b/core/vendor/twig/twig/ext/twig/.gitignore new file mode 100644 index 000000000000..56ea76cc2634 --- /dev/null +++ b/core/vendor/twig/twig/ext/twig/.gitignore @@ -0,0 +1,30 @@ +*.sw* +.deps +Makefile +Makefile.fragments +Makefile.global +Makefile.objects +acinclude.m4 +aclocal.m4 +build/ +config.cache +config.guess +config.h +config.h.in +config.log +config.nice +config.status +config.sub +configure +configure.in +install-sh +libtool +ltmain.sh +missing +mkinstalldirs +run-tests.php +twig.loT +.libs/ +modules/ +twig.la +twig.lo diff --git a/core/vendor/twig/twig/ext/twig/LICENSE b/core/vendor/twig/twig/ext/twig/LICENSE new file mode 100644 index 000000000000..66b8bb4cbbc1 --- /dev/null +++ b/core/vendor/twig/twig/ext/twig/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2011, Derick Rethans <derick@derickrethans.nl> +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +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. diff --git a/core/vendor/twig/twig/ext/twig/config.m4 b/core/vendor/twig/twig/ext/twig/config.m4 new file mode 100644 index 000000000000..83486be4c27c --- /dev/null +++ b/core/vendor/twig/twig/ext/twig/config.m4 @@ -0,0 +1,8 @@ +dnl config.m4 for extension twig + +PHP_ARG_ENABLE(twig, whether to enable twig support, +[ --enable-twig Enable twig support]) + +if test "$PHP_TWIG" != "no"; then + PHP_NEW_EXTENSION(twig, twig.c, $ext_shared) +fi diff --git a/core/vendor/twig/twig/ext/twig/config.w32 b/core/vendor/twig/twig/ext/twig/config.w32 new file mode 100644 index 000000000000..cb287b99ba25 --- /dev/null +++ b/core/vendor/twig/twig/ext/twig/config.w32 @@ -0,0 +1,8 @@ +// vim:ft=javascript + +ARG_ENABLE("twig", "Twig support", "no"); + +if (PHP_TWIG != "no") { + AC_DEFINE('HAVE_TWIG', 1); + EXTENSION('twig', 'twig.c'); +} diff --git a/core/vendor/twig/twig/ext/twig/php_twig.h b/core/vendor/twig/twig/ext/twig/php_twig.h new file mode 100644 index 000000000000..13a0fc01bde9 --- /dev/null +++ b/core/vendor/twig/twig/ext/twig/php_twig.h @@ -0,0 +1,49 @@ +/* + +----------------------------------------------------------------------+ + | Twig Extension | + +----------------------------------------------------------------------+ + | Copyright (c) 2011 Derick Rethans | + +----------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted provided that the conditions mentioned | + | in the accompanying LICENSE file are met (BSD, revised). | + +----------------------------------------------------------------------+ + | Author: Derick Rethans <derick@derickrethans.nl> | + +----------------------------------------------------------------------+ + */ + +#ifndef PHP_TWIG_H +#define PHP_TWIG_H + +#define PHP_TWIG_VERSION "1.8.3" + +#include "php.h" + +extern zend_module_entry twig_module_entry; +#define phpext_twig_ptr &twig_module_entry + +#ifdef PHP_WIN32 +#define PHP_TWIG_API __declspec(dllexport) +#else +#define PHP_TWIG_API +#endif + +#ifdef ZTS +#include "TSRM.h" +#endif + +PHP_FUNCTION(twig_template_get_attributes); + +PHP_MINIT_FUNCTION(twig); +PHP_MSHUTDOWN_FUNCTION(twig); +PHP_RINIT_FUNCTION(twig); +PHP_RSHUTDOWN_FUNCTION(twig); +PHP_MINFO_FUNCTION(twig); + +#ifdef ZTS +#define TWIG_G(v) TSRMG(twig_globals_id, zend_twig_globals *, v) +#else +#define TWIG_G(v) (twig_globals.v) +#endif + +#endif diff --git a/core/vendor/twig/twig/ext/twig/twig.c b/core/vendor/twig/twig/ext/twig/twig.c new file mode 100644 index 000000000000..880b96445944 --- /dev/null +++ b/core/vendor/twig/twig/ext/twig/twig.c @@ -0,0 +1,1025 @@ +/* + +----------------------------------------------------------------------+ + | Twig Extension | + +----------------------------------------------------------------------+ + | Copyright (c) 2011 Derick Rethans | + +----------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted provided that the conditions mentioned | + | in the accompanying LICENSE file are met (BSD, revised). | + +----------------------------------------------------------------------+ + | Author: Derick Rethans <derick@derickrethans.nl> | + +----------------------------------------------------------------------+ + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "php.h" +#include "php_ini.h" +#include "ext/standard/info.h" +#include "php_twig.h" +#include "ext/standard/php_string.h" +#include "ext/standard/php_smart_str.h" + +#include "Zend/zend_object_handlers.h" +#include "Zend/zend_interfaces.h" +#include "Zend/zend_exceptions.h" + +#ifndef Z_ADDREF_P +#define Z_ADDREF_P(pz) (pz)->refcount++ +#endif + +ZEND_BEGIN_ARG_INFO_EX(twig_template_get_attribute_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 6) + ZEND_ARG_INFO(0, template) + ZEND_ARG_INFO(0, object) + ZEND_ARG_INFO(0, item) + ZEND_ARG_INFO(0, arguments) + ZEND_ARG_INFO(0, type) + ZEND_ARG_INFO(0, isDefinedTest) +ZEND_END_ARG_INFO() + +zend_function_entry twig_functions[] = { + PHP_FE(twig_template_get_attributes, twig_template_get_attribute_args) + {NULL, NULL, NULL} +}; + + +zend_module_entry twig_module_entry = { +#if ZEND_MODULE_API_NO >= 20010901 + STANDARD_MODULE_HEADER, +#endif + "twig", + twig_functions, + PHP_MINIT(twig), + PHP_MSHUTDOWN(twig), + PHP_RINIT(twig), + PHP_RSHUTDOWN(twig), + PHP_MINFO(twig), +#if ZEND_MODULE_API_NO >= 20010901 + PHP_TWIG_VERSION, +#endif + STANDARD_MODULE_PROPERTIES +}; + + +#ifdef COMPILE_DL_TWIG +ZEND_GET_MODULE(twig) +#endif + +PHP_INI_BEGIN() +PHP_INI_END() + +PHP_MINIT_FUNCTION(twig) +{ + REGISTER_INI_ENTRIES(); + + return SUCCESS; +} + + +PHP_MSHUTDOWN_FUNCTION(twig) +{ + UNREGISTER_INI_ENTRIES(); + + return SUCCESS; +} + + + +PHP_RINIT_FUNCTION(twig) +{ + return SUCCESS; +} + + + +PHP_RSHUTDOWN_FUNCTION(twig) +{ + return SUCCESS; +} + + +PHP_MINFO_FUNCTION(twig) +{ + php_info_print_table_start(); + php_info_print_table_header(2, "Twig support", "enabled"); + php_info_print_table_row(2, "Version", PHP_TWIG_VERSION); + php_info_print_table_end(); + + DISPLAY_INI_ENTRIES(); + +} + +int TWIG_ARRAY_KEY_EXISTS(zval *array, char* key, int key_len) +{ + if (Z_TYPE_P(array) != IS_ARRAY) { + return 0; + } + return zend_symtable_exists(Z_ARRVAL_P(array), key, key_len + 1); +} + +int TWIG_INSTANCE_OF(zval *object, zend_class_entry *interface TSRMLS_DC) +{ + if (Z_TYPE_P(object) != IS_OBJECT) { + return 0; + } + return instanceof_function(Z_OBJCE_P(object), interface TSRMLS_CC); +} + +int TWIG_INSTANCE_OF_USERLAND(zval *object, char *interface TSRMLS_DC) +{ + zend_class_entry **pce; + if (Z_TYPE_P(object) != IS_OBJECT) { + return 0; + } + if (zend_lookup_class(interface, strlen(interface), &pce TSRMLS_CC) == FAILURE) { + return 0; + } + return instanceof_function(Z_OBJCE_P(object), *pce TSRMLS_CC); +} + +zval *TWIG_GET_ARRAYOBJECT_ELEMENT(zval *object, zval *offset TSRMLS_DC) +{ + zend_class_entry *ce = Z_OBJCE_P(object); + zval *retval; + + if (Z_TYPE_P(object) == IS_OBJECT) { + SEPARATE_ARG_IF_REF(offset); + zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, offset); + + zval_ptr_dtor(&offset); + + if (!retval) { + if (!EG(exception)) { + zend_error(E_ERROR, "Undefined offset for object of type %s used as array", ce->name); + } + return NULL; + } + + return retval; + } + return NULL; +} + +int TWIG_ISSET_ARRAYOBJECT_ELEMENT(zval *object, zval *offset TSRMLS_DC) +{ + zend_class_entry *ce = Z_OBJCE_P(object); + zval *retval; + + if (Z_TYPE_P(object) == IS_OBJECT) { + SEPARATE_ARG_IF_REF(offset); + zend_call_method_with_1_params(&object, ce, NULL, "offsetexists", &retval, offset); + + zval_ptr_dtor(&offset); + + if (!retval) { + if (!EG(exception)) { + zend_error(E_ERROR, "Undefined offset for object of type %s used as array", ce->name); + } + return 0; + } + + return (retval && Z_TYPE_P(retval) == IS_BOOL && Z_LVAL_P(retval)); + } + return 0; +} + +char *TWIG_STRTOLOWER(const char *str, int str_len) +{ + char *item_dup; + + item_dup = estrndup(str, str_len); + php_strtolower(item_dup, str_len); + return item_dup; +} + +zval *TWIG_CALL_USER_FUNC_ARRAY(zval *object, char *function, zval *arguments TSRMLS_DC) +{ + zend_fcall_info fci; + zval ***args = NULL; + int arg_count = 0; + HashTable *table; + HashPosition pos; + int i = 0; + zval *retval_ptr; + zval *zfunction; + + if (arguments) { + table = HASH_OF(arguments); + args = safe_emalloc(sizeof(zval **), table->nNumOfElements, 0); + + zend_hash_internal_pointer_reset_ex(table, &pos); + + while (zend_hash_get_current_data_ex(table, (void **)&args[i], &pos) == SUCCESS) { + i++; + zend_hash_move_forward_ex(table, &pos); + } + arg_count = table->nNumOfElements; + } + + MAKE_STD_ZVAL(zfunction); + ZVAL_STRING(zfunction, function, 1); + fci.size = sizeof(fci); + fci.function_table = EG(function_table); + fci.function_name = zfunction; + fci.symbol_table = NULL; +#if PHP_VERSION_ID >= 50300 + fci.object_ptr = object; +#else + fci.object_pp = &object; +#endif + fci.retval_ptr_ptr = &retval_ptr; + fci.param_count = arg_count; + fci.params = args; + fci.no_separation = 0; + + if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE) { + zval_dtor(zfunction); + efree(zfunction); + zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Could not execute %s::%s()", zend_get_class_entry(object TSRMLS_CC)->name, function TSRMLS_CC); + } + + if (args) { + efree(fci.params); + } + zval_dtor(zfunction); + efree(zfunction); + return retval_ptr; +} + +int TWIG_CALL_BOOLEAN(zval *object, char *functionName TSRMLS_DC) +{ + zval *ret; + int res; + + ret = TWIG_CALL_USER_FUNC_ARRAY(object, functionName, NULL TSRMLS_CC); + res = Z_LVAL_P(ret); + zval_ptr_dtor(&ret); + return res; +} + +zval *TWIG_GET_STATIC_PROPERTY(zval *class, char *prop_name TSRMLS_DC) +{ + zval **tmp_zval; + zend_class_entry *ce; + + if (class == NULL || Z_TYPE_P(class) != IS_OBJECT) { + return NULL; + } + + ce = zend_get_class_entry(class TSRMLS_CC); +#if PHP_VERSION_ID >= 50400 + tmp_zval = zend_std_get_static_property(ce, prop_name, strlen(prop_name), 0, NULL TSRMLS_CC); +#else + tmp_zval = zend_std_get_static_property(ce, prop_name, strlen(prop_name), 0 TSRMLS_CC); +#endif + return *tmp_zval; +} + +zval *TWIG_GET_ARRAY_ELEMENT_ZVAL(zval *class, zval *prop_name TSRMLS_DC) +{ + zval **tmp_zval; + char *tmp_name; + + if (class == NULL || Z_TYPE_P(class) != IS_ARRAY || Z_TYPE_P(prop_name) != IS_STRING) { + if (class != NULL && Z_TYPE_P(class) == IS_OBJECT && TWIG_INSTANCE_OF(class, zend_ce_arrayaccess TSRMLS_CC)) { + // array access object + return TWIG_GET_ARRAYOBJECT_ELEMENT(class, prop_name TSRMLS_CC); + } + return NULL; + } + + convert_to_string(prop_name); + tmp_name = Z_STRVAL_P(prop_name); + if (zend_symtable_find(HASH_OF(class), tmp_name, strlen(tmp_name)+1, (void**) &tmp_zval) == SUCCESS) { + return *tmp_zval; + } + return NULL; +} + +zval *TWIG_GET_ARRAY_ELEMENT(zval *class, char *prop_name, int prop_name_length TSRMLS_DC) +{ + zval **tmp_zval; + + if (class == NULL/* || Z_TYPE_P(class) != IS_ARRAY*/) { + return NULL; + } + + if (class != NULL && Z_TYPE_P(class) == IS_OBJECT && TWIG_INSTANCE_OF(class, zend_ce_arrayaccess TSRMLS_CC)) { + // array access object + zval *tmp_name_zval; + zval *tmp_ret_zval; + + ALLOC_INIT_ZVAL(tmp_name_zval); + ZVAL_STRING(tmp_name_zval, prop_name, 1); + tmp_ret_zval = TWIG_GET_ARRAYOBJECT_ELEMENT(class, tmp_name_zval TSRMLS_CC); + zval_dtor(tmp_name_zval); + efree(tmp_name_zval); + return tmp_ret_zval; + } + + if (zend_symtable_find(HASH_OF(class), prop_name, prop_name_length+1, (void**)&tmp_zval) == SUCCESS) { + return *tmp_zval; + } + return NULL; +} + +zval *TWIG_PROPERTY(zval *object, zval *propname TSRMLS_DC) +{ + char *prot_name; + int prot_name_length; + zval *tmp = NULL; + + tmp = TWIG_GET_ARRAY_ELEMENT(object, Z_STRVAL_P(propname), Z_STRLEN_P(propname) TSRMLS_CC); + if (tmp) { + return tmp; + } + + zend_mangle_property_name(&prot_name, &prot_name_length, "*", 1, Z_STRVAL_P(propname), Z_STRLEN_P(propname), 0); + tmp = TWIG_GET_ARRAY_ELEMENT(object, prot_name, prot_name_length TSRMLS_CC); + efree(prot_name); + if (tmp) { + return tmp; + } + + if (Z_OBJ_HT_P(object)->read_property) { +#if PHP_VERSION_ID >= 50400 + tmp = Z_OBJ_HT_P(object)->read_property(object, propname, BP_VAR_IS, NULL TSRMLS_CC); +#else + tmp = Z_OBJ_HT_P(object)->read_property(object, propname, BP_VAR_IS TSRMLS_CC); +#endif + if (tmp != EG(uninitialized_zval_ptr)) { + return tmp; + } else { + return NULL; + } + } + return tmp; +} + +int TWIG_HAS_PROPERTY(zval *object, zval *propname TSRMLS_DC) +{ + if (Z_OBJ_HT_P(object)->has_property) { +#if PHP_VERSION_ID >= 50400 + return Z_OBJ_HT_P(object)->has_property(object, propname, 0, NULL TSRMLS_CC); +#else + return Z_OBJ_HT_P(object)->has_property(object, propname, 0 TSRMLS_CC); +#endif + } + return 0; +} + +zval *TWIG_PROPERTY_CHAR(zval *object, char *propname TSRMLS_DC) +{ + zval *tmp_name_zval, *tmp; + + ALLOC_INIT_ZVAL(tmp_name_zval); + ZVAL_STRING(tmp_name_zval, propname, 1); + tmp = TWIG_PROPERTY(object, tmp_name_zval TSRMLS_CC); + zval_dtor(tmp_name_zval); + efree(tmp_name_zval); + return tmp; +} + +int TWIG_CALL_B_0(zval *object, char *method) +{ + return 0; +} + +zval *TWIG_CALL_S(zval *object, char *method, char *arg0 TSRMLS_DC) +{ + zend_fcall_info fci; + zval **args[1]; + zval *argument; + zval *zfunction; + zval *retval_ptr; + + MAKE_STD_ZVAL(argument); + ZVAL_STRING(argument, arg0, 1); + args[0] = &argument; + + MAKE_STD_ZVAL(zfunction); + ZVAL_STRING(zfunction, method, 1); + fci.size = sizeof(fci); + fci.function_table = EG(function_table); + fci.function_name = zfunction; + fci.symbol_table = NULL; +#if PHP_VERSION_ID >= 50300 + fci.object_ptr = object; +#else + fci.object_pp = &object; +#endif + fci.retval_ptr_ptr = &retval_ptr; + fci.param_count = 1; + fci.params = args; + fci.no_separation = 0; + + if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE) { + zval_dtor(argument); + return 0; + } + zval_dtor(zfunction); + efree(zfunction); + zval_dtor(argument); + efree(argument); + return retval_ptr; +} + +int TWIG_CALL_SB(zval *object, char *method, char *arg0 TSRMLS_DC) +{ + zval *retval_ptr; + int success; + + retval_ptr = TWIG_CALL_S(object, method, arg0 TSRMLS_CC); + success = (retval_ptr && (Z_TYPE_P(retval_ptr) == IS_BOOL) && Z_LVAL_P(retval_ptr)); + + if (retval_ptr) { + zval_ptr_dtor(&retval_ptr); + } + + return success; +} + +int TWIG_CALL_Z(zval *object, char *method, zval *arg1 TSRMLS_DC) +{ + zend_fcall_info fci; + zval **args[1]; + zval *zfunction; + zval *retval_ptr; + int success; + + args[0] = &arg1; + + MAKE_STD_ZVAL(zfunction); + ZVAL_STRING(zfunction, method, 1); + fci.size = sizeof(fci); + fci.function_table = EG(function_table); + fci.function_name = zfunction; + fci.symbol_table = NULL; +#if PHP_VERSION_ID >= 50300 + fci.object_ptr = object; +#else + fci.object_pp = &object; +#endif + fci.retval_ptr_ptr = &retval_ptr; + fci.param_count = 1; + fci.params = args; + fci.no_separation = 0; + + if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE) { + zval_dtor(zfunction); + efree(zfunction); + if (retval_ptr) { + zval_ptr_dtor(&retval_ptr); + } + return 0; + } + + zval_dtor(zfunction); + efree(zfunction); + + success = (retval_ptr && (Z_TYPE_P(retval_ptr) == IS_BOOL) && Z_LVAL_P(retval_ptr)); + if (retval_ptr) { + zval_ptr_dtor(&retval_ptr); + } + + return success; +} + +int TWIG_CALL_ZZ(zval *object, char *method, zval *arg1, zval *arg2 TSRMLS_DC) +{ + zend_fcall_info fci; + zval **args[2]; + zval *zfunction; + zval *retval_ptr; + int success; + + args[0] = &arg1; + args[1] = &arg2; + + MAKE_STD_ZVAL(zfunction); + ZVAL_STRING(zfunction, method, 1); + fci.size = sizeof(fci); + fci.function_table = EG(function_table); + fci.function_name = zfunction; + fci.symbol_table = NULL; +#if PHP_VERSION_ID >= 50300 + fci.object_ptr = object; +#else + fci.object_pp = &object; +#endif + fci.retval_ptr_ptr = &retval_ptr; + fci.param_count = 2; + fci.params = args; + fci.no_separation = 0; + + if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE) { + zval_dtor(zfunction); + return 0; + } + + zval_dtor(zfunction); + + success = (retval_ptr && (Z_TYPE_P(retval_ptr) == IS_BOOL) && Z_LVAL_P(retval_ptr)); + if (retval_ptr) { + zval_ptr_dtor(&retval_ptr); + } + + return success; +} + +#ifndef Z_SET_REFCOUNT_P +# define Z_SET_REFCOUNT_P(pz, rc) pz->refcount = rc +# define Z_UNSET_ISREF_P(pz) pz->is_ref = 0 +#endif + +void TWIG_NEW(zval *object, char *class, zval *arg0, zval *arg1 TSRMLS_DC) +{ + zend_class_entry **pce; + + if (zend_lookup_class(class, strlen(class), &pce TSRMLS_CC) == FAILURE) { + return; + } + + Z_TYPE_P(object) = IS_OBJECT; + object_init_ex(object, *pce); + Z_SET_REFCOUNT_P(object, 1); + Z_UNSET_ISREF_P(object); + + TWIG_CALL_ZZ(object, "__construct", arg0, arg1 TSRMLS_CC); +} + +static int twig_add_array_key_to_string(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) +{ + smart_str *buf; + char *joiner; + + buf = va_arg(args, smart_str*); + joiner = va_arg(args, char*); + + if (buf->len != 0) { + smart_str_appends(buf, joiner); + } + + if (hash_key->nKeyLength == 0) { + smart_str_append_long(buf, (long) hash_key->h); + } else { + char *key, *tmp_str; + int key_len, tmp_len; + key = php_addcslashes(hash_key->arKey, hash_key->nKeyLength - 1, &key_len, 0, "'\\", 2 TSRMLS_CC); + tmp_str = php_str_to_str_ex(key, key_len, "\0", 1, "' . \"\\0\" . '", 12, &tmp_len, 0, NULL); + + smart_str_appendl(buf, tmp_str, tmp_len); + efree(key); + efree(tmp_str); + } + + return 0; +} + +char *TWIG_IMPLODE_ARRAY_KEYS(char *joiner, zval *array TSRMLS_DC) +{ + smart_str collector = { 0, 0, 0 }; + + smart_str_appendl(&collector, "", 0); + zend_hash_apply_with_arguments(HASH_OF(array) TSRMLS_CC, twig_add_array_key_to_string, 2, &collector, joiner); + smart_str_0(&collector); + + return collector.c; +} + +static void TWIG_THROW_EXCEPTION(char *exception_name TSRMLS_DC, char *message, ...) +{ + char *buffer; + va_list args; + zend_class_entry **pce; + + if (zend_lookup_class(exception_name, strlen(exception_name), &pce TSRMLS_CC) == FAILURE) + { + return; + } + + va_start(args, message); + vspprintf(&buffer, 0, message, args); + va_end(args); + + zend_throw_exception_ex(*pce, 0 TSRMLS_CC, buffer); +} + +char *TWIG_GET_CLASS_NAME(zval *object TSRMLS_DC) +{ + char *class_name; + zend_uint class_name_len; + + if (Z_TYPE_P(object) != IS_OBJECT) { + return ""; + } + zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC); + return class_name; +} + +static int twig_add_method_to_class(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) +{ + zval *retval; + char *item; + size_t item_len; + zend_function *mptr = (zend_function *) pDest; + + if (!(mptr->common.fn_flags & ZEND_ACC_PUBLIC)) { + return 0; + } + + retval = va_arg(args, zval*); + + item_len = strlen(mptr->common.function_name); + item = estrndup(mptr->common.function_name, item_len); + php_strtolower(item, item_len); + + add_assoc_stringl_ex(retval, item, item_len+1, item, item_len, 0); + + return 0; +} + +static int twig_add_property_to_class(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) +{ + zend_class_entry *ce; + zval *retval; + char *class_name, *prop_name; + zend_property_info *pptr = (zend_property_info *) pDest; + + if (!(pptr->flags & ZEND_ACC_PUBLIC)) { + return 0; + } + + ce = *va_arg(args, zend_class_entry**); + retval = va_arg(args, zval*); + + zend_unmangle_property_name(pptr->name, pptr->name_length, &class_name, &prop_name); + + add_assoc_string(retval, prop_name, prop_name, 1); + + return 0; +} + +/* {{{ _adddynproperty */ +static int twig_add_dyn_property_to_class(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) +{ + zend_class_entry *ce = *va_arg(args, zend_class_entry**); + zval *retval = va_arg(args, zval*), member; + char *class_name, *prop_name; + + if (hash_key->nKeyLength < 1 || hash_key->arKey[0] == '\0') { + return 0; /* non public cannot be dynamic */ + } + + ZVAL_STRINGL(&member, hash_key->arKey, hash_key->nKeyLength-1, 0); + if (zend_get_property_info(ce, &member, 1 TSRMLS_CC) == &EG(std_property_info)) { + zend_unmangle_property_name((&EG(std_property_info))->name, (&EG(std_property_info))->name_length, &class_name, &prop_name); + add_assoc_string(retval, prop_name, prop_name, 1); + } + return 0; +} + +static void twig_add_class_to_cache(zval *cache, zval *object, char *class_name TSRMLS_DC) +{ + zval *class_info, *class_methods, *class_properties; + zend_class_entry *class_ce; + + class_ce = zend_get_class_entry(object TSRMLS_CC); + + ALLOC_INIT_ZVAL(class_info); + ALLOC_INIT_ZVAL(class_methods); + ALLOC_INIT_ZVAL(class_properties); + array_init(class_info); + array_init(class_methods); + array_init(class_properties); + // add all methods to self::cache[$class]['methods'] + zend_hash_apply_with_arguments(&class_ce->function_table TSRMLS_CC, twig_add_method_to_class, 1, class_methods); + zend_hash_apply_with_arguments(&class_ce->properties_info TSRMLS_CC, twig_add_property_to_class, 2, &class_ce, class_properties); + + if (object && Z_OBJ_HT_P(object)->get_properties) { + HashTable *properties = Z_OBJ_HT_P(object)->get_properties(object TSRMLS_CC); + zend_hash_apply_with_arguments(properties TSRMLS_CC, twig_add_dyn_property_to_class, 2, &class_ce, class_properties); + } + add_assoc_zval(class_info, "methods", class_methods); + add_assoc_zval(class_info, "properties", class_properties); + add_assoc_zval(cache, class_name, class_info); +} + +/* {{{ proto mixed twig_template_get_attributes(TwigTemplate template, mixed object, mixed item, array arguments, string type, boolean isDefinedTest, boolean ignoreStrictCheck) + A C implementation of TwigTemplate::getAttribute() */ +PHP_FUNCTION(twig_template_get_attributes) +{ + zval *template; + zval *object; + char *item; + int item_len; + zval zitem; + zval *arguments = NULL; + zval *ret = NULL; + char *type = NULL; + int type_len = 0; + zend_bool isDefinedTest = 0; + zend_bool ignoreStrictCheck = 0; + int free_ret = 0; + zval *tmp_self_cache; + + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ozs|asbb", &template, &object, &item, &item_len, &arguments, &type, &type_len, &isDefinedTest, &ignoreStrictCheck) == FAILURE) { + return; + } + + INIT_PZVAL(&zitem); + ZVAL_STRINGL(&zitem, item, item_len, 0); + + if (!type) { + type = "any"; + } + +/* + // array + if (Twig_TemplateInterface::METHOD_CALL !== $type) { + if ((is_array($object) && array_key_exists($item, $object)) + || ($object instanceof ArrayAccess && isset($object[$item])) + ) { + if ($isDefinedTest) { + return true; + } + + return $object[$item]; + } +*/ + if (strcmp("method", type) != 0) { +// printf("XXXmethod: %s\n", type); + if ((TWIG_ARRAY_KEY_EXISTS(object, item, item_len)) + || (TWIG_INSTANCE_OF(object, zend_ce_arrayaccess TSRMLS_CC) && TWIG_ISSET_ARRAYOBJECT_ELEMENT(object, &zitem TSRMLS_CC)) + ) { + zval *ret; + + if (isDefinedTest) { + RETURN_TRUE; + } + + ret = TWIG_GET_ARRAY_ELEMENT(object, item, item_len TSRMLS_CC); + RETVAL_ZVAL(ret, 1, 0); + if (free_ret) { + zval_ptr_dtor(&ret); + } + return; + } +/* + if (Twig_TemplateInterface::ARRAY_CALL === $type) { + if ($isDefinedTest) { + return false; + } + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { + return null; + } +*/ + if (strcmp("array", type) == 0) { + if (isDefinedTest) { + RETURN_FALSE; + } + if (ignoreStrictCheck || !TWIG_CALL_BOOLEAN(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "isStrictVariables" TSRMLS_CC)) { + return; + } +/* + if (is_object($object)) { + throw new Twig_Error_Runtime(sprintf('Key "%s" in object (with ArrayAccess) of type "%s" does not exist', $item, get_class($object))); + // array + } else { + throw new Twig_Error_Runtime(sprintf('Key "%s" for array with keys "%s" does not exist', $item, implode(', ', array_keys($object)))); + } + } + } +*/ + if (Z_TYPE_P(object) == IS_OBJECT) { + TWIG_THROW_EXCEPTION("Twig_Error_Runtime" TSRMLS_CC, "Key \"%s\" in object (with ArrayAccess) of type \"%s\" does not exist", item, TWIG_GET_CLASS_NAME(object TSRMLS_CC)); + } else { + TWIG_THROW_EXCEPTION("Twig_Error_Runtime" TSRMLS_CC, "Key \"%s\" for array with keys \"%s\" does not exist", item, TWIG_IMPLODE_ARRAY_KEYS(", ", object TSRMLS_CC)); + } + return; + } + } + +/* + if (!is_object($object)) { + if ($isDefinedTest) { + return false; + } +*/ + + if (Z_TYPE_P(object) != IS_OBJECT) { + if (isDefinedTest) { + RETURN_FALSE; + } +/* + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { + return null; + } + throw new Twig_Error_Runtime(sprintf('Item "%s" for "%s" does not exist', $item, implode(', ', array_keys($object)))); + } +*/ + if (ignoreStrictCheck || !TWIG_CALL_BOOLEAN(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "isStrictVariables" TSRMLS_CC)) { + RETURN_FALSE; + } + if (Z_TYPE_P(object) == IS_ARRAY) { + TWIG_THROW_EXCEPTION("Twig_Error_Runtime" TSRMLS_CC, "Item \"%s\" for \"Array\" does not exist", item); + } else { + Z_ADDREF_P(object); + convert_to_string_ex(&object); + TWIG_THROW_EXCEPTION("Twig_Error_Runtime" TSRMLS_CC, "Item \"%s\" for \"%s\" does not exist", item, Z_STRVAL_P(object)); + zval_ptr_dtor(&object); + } + return; + } +/* + // get some information about the object + $class = get_class($object); + if (!isset(self::$cache[$class])) { + $r = new ReflectionClass($class); + self::$cache[$class] = array('methods' => array(), 'properties' => array()); + foreach ($r->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { + self::$cache[$class]['methods'][strtolower($method->getName())] = true; + } + + foreach ($r->getProperties(ReflectionProperty::IS_PUBLIC) as $property) { + self::$cache[$class]['properties'][$property->getName()] = true; + } + } +*/ + if (Z_TYPE_P(object) == IS_OBJECT) { + char *class_name = NULL; + + class_name = TWIG_GET_CLASS_NAME(object TSRMLS_CC); + tmp_self_cache = TWIG_GET_STATIC_PROPERTY(template, "cache" TSRMLS_CC); + + if (!TWIG_GET_ARRAY_ELEMENT(tmp_self_cache, class_name, strlen(class_name) TSRMLS_CC)) { + twig_add_class_to_cache(tmp_self_cache, object, class_name TSRMLS_CC); + } + efree(class_name); + } + +/* + // object property + if (Twig_TemplateInterface::METHOD_CALL !== $type) { + if (isset(self::$cache[$class]['properties'][$item]) + || isset($object->$item) || array_key_exists($item, $object) + ) { + if ($isDefinedTest) { + return true; + } + if ($this->env->hasExtension('sandbox')) { + $this->env->getExtension('sandbox')->checkPropertyAllowed($object, $item); + } + + return $object->$item; + } + } +*/ + if (strcmp("method", type) != 0) { + zval *tmp_class, *tmp_properties, *tmp_item; + char *class_name = NULL; + + class_name = TWIG_GET_CLASS_NAME(object TSRMLS_CC); + tmp_class = TWIG_GET_ARRAY_ELEMENT(tmp_self_cache, class_name, strlen(class_name) TSRMLS_CC); + tmp_properties = TWIG_GET_ARRAY_ELEMENT(tmp_class, "properties", strlen("properties") TSRMLS_CC); + tmp_item = TWIG_GET_ARRAY_ELEMENT(tmp_properties, item, item_len TSRMLS_CC); + + efree(class_name); + + if (tmp_item || TWIG_HAS_PROPERTY(object, &zitem TSRMLS_CC) || TWIG_ARRAY_KEY_EXISTS(object, item, item_len) // FIXME: Array key? is that array access here? + ) { + if (isDefinedTest) { + RETURN_TRUE; + } + if (TWIG_CALL_SB(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "hasExtension", "sandbox" TSRMLS_CC)) { + TWIG_CALL_ZZ(TWIG_CALL_S(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "getExtension", "sandbox" TSRMLS_CC), "checkPropertyAllowed", object, &zitem TSRMLS_CC); + } + if (EG(exception)) { + return; + } + + ret = TWIG_PROPERTY(object, &zitem TSRMLS_CC); + RETURN_ZVAL(ret, 1, 0); + } + } +/* + // object method + $lcItem = strtolower($item); + if (isset(self::$cache[$class]['methods'][$lcItem])) { + $method = $item; + } elseif (isset(self::$cache[$class]['methods']['get'.$lcItem])) { + $method = 'get'.$item; + } elseif (isset(self::$cache[$class]['methods']['is'.$lcItem])) { + $method = 'is'.$item; + } elseif (isset(self::$cache[$class]['methods']['__call'])) { + $method = $item; +*/ + { + char *lcItem = TWIG_STRTOLOWER(item, item_len); + int lcItem_length; + char *method = NULL; + char *tmp_method_name_get; + char *tmp_method_name_is; + zval *tmp_class, *tmp_methods; + char *class_name = NULL; + + class_name = TWIG_GET_CLASS_NAME(object TSRMLS_CC); + lcItem_length = strlen(lcItem); + tmp_method_name_get = emalloc(4 + lcItem_length); + tmp_method_name_is = emalloc(3 + lcItem_length); + + sprintf(tmp_method_name_get, "get%s", lcItem); + sprintf(tmp_method_name_is, "is%s", lcItem); + + tmp_class = TWIG_GET_ARRAY_ELEMENT(tmp_self_cache, class_name, strlen(class_name) TSRMLS_CC); + tmp_methods = TWIG_GET_ARRAY_ELEMENT(tmp_class, "methods", strlen("methods") TSRMLS_CC); + efree(class_name); + + if (TWIG_GET_ARRAY_ELEMENT(tmp_methods, lcItem, lcItem_length TSRMLS_CC)) { + method = item; + } else if (TWIG_GET_ARRAY_ELEMENT(tmp_methods, tmp_method_name_get, lcItem_length + 3 TSRMLS_CC)) { + method = tmp_method_name_get; + } else if (TWIG_GET_ARRAY_ELEMENT(tmp_methods, tmp_method_name_is, lcItem_length + 2 TSRMLS_CC)) { + method = tmp_method_name_is; + } else if (TWIG_GET_ARRAY_ELEMENT(tmp_methods, "__call", 6 TSRMLS_CC)) { + method = item; +/* + } else { + if ($isDefinedTest) { + return false; + } + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { + return null; + } + throw new Twig_Error_Runtime(sprintf('Method "%s" for object "%s" does not exist', $item, get_class($object))); + } + if ($isDefinedTest) { + return true; + } +*/ + } else { + if (isDefinedTest) { + RETURN_FALSE; + } + if (ignoreStrictCheck || !TWIG_CALL_BOOLEAN(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "isStrictVariables" TSRMLS_CC)) { + return; + } + TWIG_THROW_EXCEPTION("Twig_Error_Runtime" TSRMLS_CC, "Method \"%s\" for object \"%s\" does not exist", item, TWIG_GET_CLASS_NAME(object TSRMLS_CC)); + return; + } + if (isDefinedTest) { + efree(tmp_method_name_get); + efree(tmp_method_name_is); + efree(lcItem); + RETURN_TRUE; + } +/* + if ($this->env->hasExtension('sandbox')) { + $this->env->getExtension('sandbox')->checkMethodAllowed($object, $method); + } +*/ + if (TWIG_CALL_SB(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "hasExtension", "sandbox" TSRMLS_CC)) { + TWIG_CALL_ZZ(TWIG_CALL_S(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "getExtension", "sandbox" TSRMLS_CC), "checkMethodAllowed", object, &zitem TSRMLS_CC); + } + if (EG(exception)) { + return; + } +/* + $ret = call_user_func_array(array($object, $method), $arguments); +*/ + if (Z_TYPE_P(object) == IS_OBJECT) { + ret = TWIG_CALL_USER_FUNC_ARRAY(object, method, arguments TSRMLS_CC); + free_ret = 1; + } + efree(tmp_method_name_get); + efree(tmp_method_name_is); + efree(lcItem); + } +/* + if ($object instanceof Twig_TemplateInterface) { + return new Twig_Markup($ret, $this->env->getCharset()); + } +*/ + if (TWIG_INSTANCE_OF_USERLAND(object, "Twig_TemplateInterface" TSRMLS_CC)) { + zval *charset = TWIG_CALL_USER_FUNC_ARRAY(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "getCharset", NULL TSRMLS_CC); + TWIG_NEW(return_value, "Twig_Markup", ret, charset TSRMLS_CC); + zval_ptr_dtor(&charset); + if (ret) { + zval_ptr_dtor(&ret); + } + return; + } +/* + return $ret; +*/ + if (ret) { + RETVAL_ZVAL(ret, 1, 0); + if (free_ret) { + zval_ptr_dtor(&ret); + } + } +} diff --git a/core/vendor/Twig/Autoloader.php b/core/vendor/twig/twig/lib/Twig/Autoloader.php similarity index 93% rename from core/vendor/Twig/Autoloader.php rename to core/vendor/twig/twig/lib/Twig/Autoloader.php index 0f62884c1509..59f28f72fe0f 100644 --- a/core/vendor/Twig/Autoloader.php +++ b/core/vendor/twig/twig/lib/Twig/Autoloader.php @@ -30,8 +30,6 @@ static public function register() * Handles autoloading of classes. * * @param string $class A class name. - * - * @return boolean Returns true if the class has been loaded */ static public function autoload($class) { diff --git a/core/vendor/Twig/Compiler.php b/core/vendor/twig/twig/lib/Twig/Compiler.php similarity index 95% rename from core/vendor/Twig/Compiler.php rename to core/vendor/twig/twig/lib/Twig/Compiler.php index 5cd1b31c3e49..d03dfa09eb13 100644 --- a/core/vendor/Twig/Compiler.php +++ b/core/vendor/twig/twig/lib/Twig/Compiler.php @@ -119,6 +119,11 @@ public function write() return $this; } + /** + * Appends an indentation to the current PHP code after compilation. + * + * @return Twig_Compiler The current compiler instance + */ public function addIndentation() { $this->source .= str_repeat(' ', $this->indentation * 4); @@ -239,12 +244,13 @@ public function indent($step = 1) */ public function outdent($step = 1) { - $this->indentation -= $step; - - if ($this->indentation < 0) { + // can't outdent by more steps that the current indentation level + if ($this->indentation < $step) { throw new Twig_Error('Unable to call outdent() as the indentation would become negative'); } + $this->indentation -= $step; + return $this; } } diff --git a/core/vendor/Twig/CompilerInterface.php b/core/vendor/twig/twig/lib/Twig/CompilerInterface.php similarity index 100% rename from core/vendor/Twig/CompilerInterface.php rename to core/vendor/twig/twig/lib/Twig/CompilerInterface.php diff --git a/core/vendor/Twig/Environment.php b/core/vendor/twig/twig/lib/Twig/Environment.php similarity index 99% rename from core/vendor/Twig/Environment.php rename to core/vendor/twig/twig/lib/Twig/Environment.php index 333d6676ed19..00ebcbae50e2 100644 --- a/core/vendor/Twig/Environment.php +++ b/core/vendor/twig/twig/lib/Twig/Environment.php @@ -17,7 +17,7 @@ */ class Twig_Environment { - const VERSION = '1.8.3-DEV'; + const VERSION = '1.8.3'; protected $charset; protected $loader; @@ -1094,7 +1094,7 @@ protected function writeCacheFile($file, $content) if (false !== @file_put_contents($tmpFile, $content)) { // rename does not work on Win32 before 5.2.6 if (@rename($tmpFile, $file) || (@copy($tmpFile, $file) && unlink($tmpFile))) { - @chmod($file, 0644); + @chmod($file, 0666 & ~umask()); return; } diff --git a/core/vendor/Twig/Error.php b/core/vendor/twig/twig/lib/Twig/Error.php similarity index 100% rename from core/vendor/Twig/Error.php rename to core/vendor/twig/twig/lib/Twig/Error.php diff --git a/core/vendor/Twig/Error/Loader.php b/core/vendor/twig/twig/lib/Twig/Error/Loader.php similarity index 100% rename from core/vendor/Twig/Error/Loader.php rename to core/vendor/twig/twig/lib/Twig/Error/Loader.php diff --git a/core/vendor/Twig/Error/Runtime.php b/core/vendor/twig/twig/lib/Twig/Error/Runtime.php similarity index 100% rename from core/vendor/Twig/Error/Runtime.php rename to core/vendor/twig/twig/lib/Twig/Error/Runtime.php diff --git a/core/vendor/Twig/Error/Syntax.php b/core/vendor/twig/twig/lib/Twig/Error/Syntax.php similarity index 100% rename from core/vendor/Twig/Error/Syntax.php rename to core/vendor/twig/twig/lib/Twig/Error/Syntax.php diff --git a/core/vendor/Twig/ExpressionParser.php b/core/vendor/twig/twig/lib/Twig/ExpressionParser.php similarity index 100% rename from core/vendor/Twig/ExpressionParser.php rename to core/vendor/twig/twig/lib/Twig/ExpressionParser.php diff --git a/core/vendor/Twig/Extension.php b/core/vendor/twig/twig/lib/Twig/Extension.php similarity index 100% rename from core/vendor/Twig/Extension.php rename to core/vendor/twig/twig/lib/Twig/Extension.php diff --git a/core/vendor/Twig/Extension/Core.php b/core/vendor/twig/twig/lib/Twig/Extension/Core.php similarity index 100% rename from core/vendor/Twig/Extension/Core.php rename to core/vendor/twig/twig/lib/Twig/Extension/Core.php diff --git a/core/vendor/Twig/Extension/Debug.php b/core/vendor/twig/twig/lib/Twig/Extension/Debug.php similarity index 100% rename from core/vendor/Twig/Extension/Debug.php rename to core/vendor/twig/twig/lib/Twig/Extension/Debug.php diff --git a/core/vendor/Twig/Extension/Escaper.php b/core/vendor/twig/twig/lib/Twig/Extension/Escaper.php similarity index 91% rename from core/vendor/Twig/Extension/Escaper.php rename to core/vendor/twig/twig/lib/Twig/Extension/Escaper.php index b0aa8b1c6c14..c02c3a86c1b0 100644 --- a/core/vendor/Twig/Extension/Escaper.php +++ b/core/vendor/twig/twig/lib/Twig/Extension/Escaper.php @@ -76,7 +76,9 @@ public function setDefaultStrategy($defaultStrategy) */ public function getDefaultStrategy($filename) { - if (is_callable($this->defaultStrategy)) { + // disable string callables to avoid calling a function named html or js, + // or any other upcoming escaping strategy + if (!is_string($this->defaultStrategy) && is_callable($this->defaultStrategy)) { return call_user_func($this->defaultStrategy, $filename); } diff --git a/core/vendor/Twig/Extension/Optimizer.php b/core/vendor/twig/twig/lib/Twig/Extension/Optimizer.php similarity index 100% rename from core/vendor/Twig/Extension/Optimizer.php rename to core/vendor/twig/twig/lib/Twig/Extension/Optimizer.php diff --git a/core/vendor/Twig/Extension/Sandbox.php b/core/vendor/twig/twig/lib/Twig/Extension/Sandbox.php similarity index 100% rename from core/vendor/Twig/Extension/Sandbox.php rename to core/vendor/twig/twig/lib/Twig/Extension/Sandbox.php diff --git a/core/vendor/Twig/ExtensionInterface.php b/core/vendor/twig/twig/lib/Twig/ExtensionInterface.php similarity index 100% rename from core/vendor/Twig/ExtensionInterface.php rename to core/vendor/twig/twig/lib/Twig/ExtensionInterface.php diff --git a/core/vendor/Twig/Filter.php b/core/vendor/twig/twig/lib/Twig/Filter.php similarity index 100% rename from core/vendor/Twig/Filter.php rename to core/vendor/twig/twig/lib/Twig/Filter.php diff --git a/core/vendor/Twig/Filter/Function.php b/core/vendor/twig/twig/lib/Twig/Filter/Function.php similarity index 100% rename from core/vendor/Twig/Filter/Function.php rename to core/vendor/twig/twig/lib/Twig/Filter/Function.php diff --git a/core/vendor/Twig/Filter/Method.php b/core/vendor/twig/twig/lib/Twig/Filter/Method.php similarity index 100% rename from core/vendor/Twig/Filter/Method.php rename to core/vendor/twig/twig/lib/Twig/Filter/Method.php diff --git a/core/vendor/Twig/Filter/Node.php b/core/vendor/twig/twig/lib/Twig/Filter/Node.php similarity index 100% rename from core/vendor/Twig/Filter/Node.php rename to core/vendor/twig/twig/lib/Twig/Filter/Node.php diff --git a/core/vendor/Twig/FilterInterface.php b/core/vendor/twig/twig/lib/Twig/FilterInterface.php similarity index 100% rename from core/vendor/Twig/FilterInterface.php rename to core/vendor/twig/twig/lib/Twig/FilterInterface.php diff --git a/core/vendor/Twig/Function.php b/core/vendor/twig/twig/lib/Twig/Function.php similarity index 100% rename from core/vendor/Twig/Function.php rename to core/vendor/twig/twig/lib/Twig/Function.php diff --git a/core/vendor/Twig/Function/Function.php b/core/vendor/twig/twig/lib/Twig/Function/Function.php similarity index 100% rename from core/vendor/Twig/Function/Function.php rename to core/vendor/twig/twig/lib/Twig/Function/Function.php diff --git a/core/vendor/Twig/Function/Method.php b/core/vendor/twig/twig/lib/Twig/Function/Method.php similarity index 100% rename from core/vendor/Twig/Function/Method.php rename to core/vendor/twig/twig/lib/Twig/Function/Method.php diff --git a/core/vendor/Twig/Function/Node.php b/core/vendor/twig/twig/lib/Twig/Function/Node.php similarity index 100% rename from core/vendor/Twig/Function/Node.php rename to core/vendor/twig/twig/lib/Twig/Function/Node.php diff --git a/core/vendor/Twig/FunctionInterface.php b/core/vendor/twig/twig/lib/Twig/FunctionInterface.php similarity index 100% rename from core/vendor/Twig/FunctionInterface.php rename to core/vendor/twig/twig/lib/Twig/FunctionInterface.php diff --git a/core/vendor/Twig/Lexer.php b/core/vendor/twig/twig/lib/Twig/Lexer.php similarity index 100% rename from core/vendor/Twig/Lexer.php rename to core/vendor/twig/twig/lib/Twig/Lexer.php diff --git a/core/vendor/Twig/LexerInterface.php b/core/vendor/twig/twig/lib/Twig/LexerInterface.php similarity index 100% rename from core/vendor/Twig/LexerInterface.php rename to core/vendor/twig/twig/lib/Twig/LexerInterface.php diff --git a/core/vendor/Twig/Loader/Array.php b/core/vendor/twig/twig/lib/Twig/Loader/Array.php similarity index 100% rename from core/vendor/Twig/Loader/Array.php rename to core/vendor/twig/twig/lib/Twig/Loader/Array.php diff --git a/core/vendor/Twig/Loader/Chain.php b/core/vendor/twig/twig/lib/Twig/Loader/Chain.php similarity index 100% rename from core/vendor/Twig/Loader/Chain.php rename to core/vendor/twig/twig/lib/Twig/Loader/Chain.php diff --git a/core/vendor/Twig/Loader/Filesystem.php b/core/vendor/twig/twig/lib/Twig/Loader/Filesystem.php similarity index 98% rename from core/vendor/Twig/Loader/Filesystem.php rename to core/vendor/twig/twig/lib/Twig/Loader/Filesystem.php index fd93219cbff4..18104a5d1070 100644 --- a/core/vendor/Twig/Loader/Filesystem.php +++ b/core/vendor/twig/twig/lib/Twig/Loader/Filesystem.php @@ -71,7 +71,7 @@ public function addPath($path) throw new Twig_Error_Loader(sprintf('The "%s" directory does not exist.', $path)); } - $this->paths[] = $path; + $this->paths[] = rtrim($path, '/\\'); } /** diff --git a/core/vendor/Twig/Loader/String.php b/core/vendor/twig/twig/lib/Twig/Loader/String.php similarity index 100% rename from core/vendor/Twig/Loader/String.php rename to core/vendor/twig/twig/lib/Twig/Loader/String.php diff --git a/core/vendor/Twig/LoaderInterface.php b/core/vendor/twig/twig/lib/Twig/LoaderInterface.php similarity index 100% rename from core/vendor/Twig/LoaderInterface.php rename to core/vendor/twig/twig/lib/Twig/LoaderInterface.php diff --git a/core/vendor/Twig/Markup.php b/core/vendor/twig/twig/lib/Twig/Markup.php similarity index 100% rename from core/vendor/Twig/Markup.php rename to core/vendor/twig/twig/lib/Twig/Markup.php diff --git a/core/vendor/Twig/Node.php b/core/vendor/twig/twig/lib/Twig/Node.php similarity index 100% rename from core/vendor/Twig/Node.php rename to core/vendor/twig/twig/lib/Twig/Node.php diff --git a/core/vendor/Twig/Node/AutoEscape.php b/core/vendor/twig/twig/lib/Twig/Node/AutoEscape.php similarity index 100% rename from core/vendor/Twig/Node/AutoEscape.php rename to core/vendor/twig/twig/lib/Twig/Node/AutoEscape.php diff --git a/core/vendor/Twig/Node/Block.php b/core/vendor/twig/twig/lib/Twig/Node/Block.php similarity index 100% rename from core/vendor/Twig/Node/Block.php rename to core/vendor/twig/twig/lib/Twig/Node/Block.php diff --git a/core/vendor/Twig/Node/BlockReference.php b/core/vendor/twig/twig/lib/Twig/Node/BlockReference.php similarity index 100% rename from core/vendor/Twig/Node/BlockReference.php rename to core/vendor/twig/twig/lib/Twig/Node/BlockReference.php diff --git a/core/vendor/Twig/Node/Body.php b/core/vendor/twig/twig/lib/Twig/Node/Body.php similarity index 100% rename from core/vendor/Twig/Node/Body.php rename to core/vendor/twig/twig/lib/Twig/Node/Body.php diff --git a/core/vendor/Twig/Node/Do.php b/core/vendor/twig/twig/lib/Twig/Node/Do.php similarity index 100% rename from core/vendor/Twig/Node/Do.php rename to core/vendor/twig/twig/lib/Twig/Node/Do.php diff --git a/core/vendor/Twig/Node/Embed.php b/core/vendor/twig/twig/lib/Twig/Node/Embed.php similarity index 100% rename from core/vendor/Twig/Node/Embed.php rename to core/vendor/twig/twig/lib/Twig/Node/Embed.php diff --git a/core/vendor/Twig/Node/Expression.php b/core/vendor/twig/twig/lib/Twig/Node/Expression.php similarity index 100% rename from core/vendor/Twig/Node/Expression.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression.php diff --git a/core/vendor/Twig/Node/Expression/Array.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Array.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Array.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Array.php diff --git a/core/vendor/Twig/Node/Expression/AssignName.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php similarity index 100% rename from core/vendor/Twig/Node/Expression/AssignName.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php diff --git a/core/vendor/Twig/Node/Expression/Binary.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php diff --git a/core/vendor/Twig/Node/Expression/Binary/Add.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/Add.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php diff --git a/core/vendor/Twig/Node/Expression/Binary/And.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/And.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php diff --git a/core/vendor/Twig/Node/Expression/Binary/BitwiseAnd.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/BitwiseAnd.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php diff --git a/core/vendor/Twig/Node/Expression/Binary/BitwiseOr.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/BitwiseOr.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php diff --git a/core/vendor/Twig/Node/Expression/Binary/BitwiseXor.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/BitwiseXor.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php diff --git a/core/vendor/Twig/Node/Expression/Binary/Concat.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/Concat.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php diff --git a/core/vendor/Twig/Node/Expression/Binary/Div.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/Div.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php diff --git a/core/vendor/Twig/Node/Expression/Binary/Equal.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/Equal.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php diff --git a/core/vendor/Twig/Node/Expression/Binary/FloorDiv.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/FloorDiv.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php diff --git a/core/vendor/Twig/Node/Expression/Binary/Greater.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/Greater.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php diff --git a/core/vendor/Twig/Node/Expression/Binary/GreaterEqual.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/GreaterEqual.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php diff --git a/core/vendor/Twig/Node/Expression/Binary/In.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/In.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php diff --git a/core/vendor/Twig/Node/Expression/Binary/Less.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/Less.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php diff --git a/core/vendor/Twig/Node/Expression/Binary/LessEqual.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/LessEqual.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php diff --git a/core/vendor/Twig/Node/Expression/Binary/Mod.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/Mod.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php diff --git a/core/vendor/Twig/Node/Expression/Binary/Mul.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/Mul.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php diff --git a/core/vendor/Twig/Node/Expression/Binary/NotEqual.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/NotEqual.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php diff --git a/core/vendor/Twig/Node/Expression/Binary/NotIn.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/NotIn.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php diff --git a/core/vendor/Twig/Node/Expression/Binary/Or.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/Or.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php diff --git a/core/vendor/Twig/Node/Expression/Binary/Power.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/Power.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php diff --git a/core/vendor/Twig/Node/Expression/Binary/Range.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/Range.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php diff --git a/core/vendor/Twig/Node/Expression/Binary/Sub.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Binary/Sub.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php diff --git a/core/vendor/Twig/Node/Expression/BlockReference.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php similarity index 100% rename from core/vendor/Twig/Node/Expression/BlockReference.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php diff --git a/core/vendor/Twig/Node/Expression/Conditional.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Conditional.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php diff --git a/core/vendor/Twig/Node/Expression/Constant.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Constant.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Constant.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Constant.php diff --git a/core/vendor/Twig/Node/Expression/ExtensionReference.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php similarity index 100% rename from core/vendor/Twig/Node/Expression/ExtensionReference.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php diff --git a/core/vendor/Twig/Node/Expression/Filter.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Filter.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Filter.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Filter.php diff --git a/core/vendor/Twig/Node/Expression/Filter/Default.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Filter/Default.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php diff --git a/core/vendor/Twig/Node/Expression/Function.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Function.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Function.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Function.php diff --git a/core/vendor/Twig/Node/Expression/GetAttr.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php similarity index 100% rename from core/vendor/Twig/Node/Expression/GetAttr.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php diff --git a/core/vendor/Twig/Node/Expression/MethodCall.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php similarity index 100% rename from core/vendor/Twig/Node/Expression/MethodCall.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php diff --git a/core/vendor/Twig/Node/Expression/Name.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Name.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Name.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Name.php diff --git a/core/vendor/Twig/Node/Expression/Parent.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Parent.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php diff --git a/core/vendor/Twig/Node/Expression/TempName.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/TempName.php similarity index 100% rename from core/vendor/Twig/Node/Expression/TempName.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/TempName.php diff --git a/core/vendor/Twig/Node/Expression/Test.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Test.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Test.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Test.php diff --git a/core/vendor/Twig/Node/Expression/Test/Constant.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Test/Constant.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php diff --git a/core/vendor/Twig/Node/Expression/Test/Defined.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Test/Defined.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php diff --git a/core/vendor/Twig/Node/Expression/Test/Divisibleby.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Test/Divisibleby.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php diff --git a/core/vendor/Twig/Node/Expression/Test/Even.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Test/Even.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php diff --git a/core/vendor/Twig/Node/Expression/Test/Null.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Test/Null.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php diff --git a/core/vendor/Twig/Node/Expression/Test/Odd.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Test/Odd.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php diff --git a/core/vendor/Twig/Node/Expression/Test/Sameas.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Test/Sameas.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php diff --git a/core/vendor/Twig/Node/Expression/Unary.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Unary.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php diff --git a/core/vendor/Twig/Node/Expression/Unary/Neg.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Unary/Neg.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php diff --git a/core/vendor/Twig/Node/Expression/Unary/Not.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Unary/Not.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php diff --git a/core/vendor/Twig/Node/Expression/Unary/Pos.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php similarity index 100% rename from core/vendor/Twig/Node/Expression/Unary/Pos.php rename to core/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php diff --git a/core/vendor/Twig/Node/Flush.php b/core/vendor/twig/twig/lib/Twig/Node/Flush.php similarity index 100% rename from core/vendor/Twig/Node/Flush.php rename to core/vendor/twig/twig/lib/Twig/Node/Flush.php diff --git a/core/vendor/Twig/Node/For.php b/core/vendor/twig/twig/lib/Twig/Node/For.php similarity index 100% rename from core/vendor/Twig/Node/For.php rename to core/vendor/twig/twig/lib/Twig/Node/For.php diff --git a/core/vendor/Twig/Node/ForLoop.php b/core/vendor/twig/twig/lib/Twig/Node/ForLoop.php similarity index 100% rename from core/vendor/Twig/Node/ForLoop.php rename to core/vendor/twig/twig/lib/Twig/Node/ForLoop.php diff --git a/core/vendor/Twig/Node/If.php b/core/vendor/twig/twig/lib/Twig/Node/If.php similarity index 100% rename from core/vendor/Twig/Node/If.php rename to core/vendor/twig/twig/lib/Twig/Node/If.php diff --git a/core/vendor/Twig/Node/Import.php b/core/vendor/twig/twig/lib/Twig/Node/Import.php similarity index 100% rename from core/vendor/Twig/Node/Import.php rename to core/vendor/twig/twig/lib/Twig/Node/Import.php diff --git a/core/vendor/Twig/Node/Include.php b/core/vendor/twig/twig/lib/Twig/Node/Include.php similarity index 100% rename from core/vendor/Twig/Node/Include.php rename to core/vendor/twig/twig/lib/Twig/Node/Include.php diff --git a/core/vendor/Twig/Node/Macro.php b/core/vendor/twig/twig/lib/Twig/Node/Macro.php similarity index 100% rename from core/vendor/Twig/Node/Macro.php rename to core/vendor/twig/twig/lib/Twig/Node/Macro.php diff --git a/core/vendor/Twig/Node/Module.php b/core/vendor/twig/twig/lib/Twig/Node/Module.php similarity index 100% rename from core/vendor/Twig/Node/Module.php rename to core/vendor/twig/twig/lib/Twig/Node/Module.php diff --git a/core/vendor/Twig/Node/Print.php b/core/vendor/twig/twig/lib/Twig/Node/Print.php similarity index 100% rename from core/vendor/Twig/Node/Print.php rename to core/vendor/twig/twig/lib/Twig/Node/Print.php diff --git a/core/vendor/Twig/Node/Sandbox.php b/core/vendor/twig/twig/lib/Twig/Node/Sandbox.php similarity index 100% rename from core/vendor/Twig/Node/Sandbox.php rename to core/vendor/twig/twig/lib/Twig/Node/Sandbox.php diff --git a/core/vendor/Twig/Node/SandboxedModule.php b/core/vendor/twig/twig/lib/Twig/Node/SandboxedModule.php similarity index 100% rename from core/vendor/Twig/Node/SandboxedModule.php rename to core/vendor/twig/twig/lib/Twig/Node/SandboxedModule.php diff --git a/core/vendor/Twig/Node/SandboxedPrint.php b/core/vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php similarity index 100% rename from core/vendor/Twig/Node/SandboxedPrint.php rename to core/vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php diff --git a/core/vendor/Twig/Node/Set.php b/core/vendor/twig/twig/lib/Twig/Node/Set.php similarity index 100% rename from core/vendor/Twig/Node/Set.php rename to core/vendor/twig/twig/lib/Twig/Node/Set.php diff --git a/core/vendor/Twig/Node/SetTemp.php b/core/vendor/twig/twig/lib/Twig/Node/SetTemp.php similarity index 100% rename from core/vendor/Twig/Node/SetTemp.php rename to core/vendor/twig/twig/lib/Twig/Node/SetTemp.php diff --git a/core/vendor/Twig/Node/Spaceless.php b/core/vendor/twig/twig/lib/Twig/Node/Spaceless.php similarity index 100% rename from core/vendor/Twig/Node/Spaceless.php rename to core/vendor/twig/twig/lib/Twig/Node/Spaceless.php diff --git a/core/vendor/Twig/Node/Text.php b/core/vendor/twig/twig/lib/Twig/Node/Text.php similarity index 100% rename from core/vendor/Twig/Node/Text.php rename to core/vendor/twig/twig/lib/Twig/Node/Text.php diff --git a/core/vendor/Twig/NodeInterface.php b/core/vendor/twig/twig/lib/Twig/NodeInterface.php similarity index 100% rename from core/vendor/Twig/NodeInterface.php rename to core/vendor/twig/twig/lib/Twig/NodeInterface.php diff --git a/core/vendor/Twig/NodeOutputInterface.php b/core/vendor/twig/twig/lib/Twig/NodeOutputInterface.php similarity index 100% rename from core/vendor/Twig/NodeOutputInterface.php rename to core/vendor/twig/twig/lib/Twig/NodeOutputInterface.php diff --git a/core/vendor/Twig/NodeTraverser.php b/core/vendor/twig/twig/lib/Twig/NodeTraverser.php similarity index 100% rename from core/vendor/Twig/NodeTraverser.php rename to core/vendor/twig/twig/lib/Twig/NodeTraverser.php diff --git a/core/vendor/Twig/NodeVisitor/Escaper.php b/core/vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php similarity index 100% rename from core/vendor/Twig/NodeVisitor/Escaper.php rename to core/vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php diff --git a/core/vendor/Twig/NodeVisitor/Optimizer.php b/core/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php similarity index 100% rename from core/vendor/Twig/NodeVisitor/Optimizer.php rename to core/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php diff --git a/core/vendor/Twig/NodeVisitor/SafeAnalysis.php b/core/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php similarity index 100% rename from core/vendor/Twig/NodeVisitor/SafeAnalysis.php rename to core/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php diff --git a/core/vendor/Twig/NodeVisitor/Sandbox.php b/core/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php similarity index 100% rename from core/vendor/Twig/NodeVisitor/Sandbox.php rename to core/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php diff --git a/core/vendor/Twig/NodeVisitorInterface.php b/core/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php similarity index 100% rename from core/vendor/Twig/NodeVisitorInterface.php rename to core/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php diff --git a/core/vendor/Twig/Parser.php b/core/vendor/twig/twig/lib/Twig/Parser.php similarity index 100% rename from core/vendor/Twig/Parser.php rename to core/vendor/twig/twig/lib/Twig/Parser.php diff --git a/core/vendor/Twig/ParserInterface.php b/core/vendor/twig/twig/lib/Twig/ParserInterface.php similarity index 100% rename from core/vendor/Twig/ParserInterface.php rename to core/vendor/twig/twig/lib/Twig/ParserInterface.php diff --git a/core/vendor/Twig/Sandbox/SecurityError.php b/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php similarity index 100% rename from core/vendor/Twig/Sandbox/SecurityError.php rename to core/vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php diff --git a/core/vendor/Twig/Sandbox/SecurityPolicy.php b/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php similarity index 100% rename from core/vendor/Twig/Sandbox/SecurityPolicy.php rename to core/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php diff --git a/core/vendor/Twig/Sandbox/SecurityPolicyInterface.php b/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php similarity index 100% rename from core/vendor/Twig/Sandbox/SecurityPolicyInterface.php rename to core/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php diff --git a/core/vendor/Twig/Template.php b/core/vendor/twig/twig/lib/Twig/Template.php similarity index 100% rename from core/vendor/Twig/Template.php rename to core/vendor/twig/twig/lib/Twig/Template.php diff --git a/core/vendor/Twig/TemplateInterface.php b/core/vendor/twig/twig/lib/Twig/TemplateInterface.php similarity index 100% rename from core/vendor/Twig/TemplateInterface.php rename to core/vendor/twig/twig/lib/Twig/TemplateInterface.php diff --git a/core/vendor/Twig/Test/Function.php b/core/vendor/twig/twig/lib/Twig/Test/Function.php similarity index 100% rename from core/vendor/Twig/Test/Function.php rename to core/vendor/twig/twig/lib/Twig/Test/Function.php diff --git a/core/vendor/Twig/Test/Method.php b/core/vendor/twig/twig/lib/Twig/Test/Method.php similarity index 100% rename from core/vendor/Twig/Test/Method.php rename to core/vendor/twig/twig/lib/Twig/Test/Method.php diff --git a/core/vendor/Twig/Test/Node.php b/core/vendor/twig/twig/lib/Twig/Test/Node.php similarity index 100% rename from core/vendor/Twig/Test/Node.php rename to core/vendor/twig/twig/lib/Twig/Test/Node.php diff --git a/core/vendor/Twig/TestInterface.php b/core/vendor/twig/twig/lib/Twig/TestInterface.php similarity index 100% rename from core/vendor/Twig/TestInterface.php rename to core/vendor/twig/twig/lib/Twig/TestInterface.php diff --git a/core/vendor/Twig/Token.php b/core/vendor/twig/twig/lib/Twig/Token.php similarity index 100% rename from core/vendor/Twig/Token.php rename to core/vendor/twig/twig/lib/Twig/Token.php diff --git a/core/vendor/Twig/TokenParser.php b/core/vendor/twig/twig/lib/Twig/TokenParser.php similarity index 100% rename from core/vendor/Twig/TokenParser.php rename to core/vendor/twig/twig/lib/Twig/TokenParser.php diff --git a/core/vendor/Twig/TokenParser/AutoEscape.php b/core/vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php similarity index 100% rename from core/vendor/Twig/TokenParser/AutoEscape.php rename to core/vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php diff --git a/core/vendor/Twig/TokenParser/Block.php b/core/vendor/twig/twig/lib/Twig/TokenParser/Block.php similarity index 100% rename from core/vendor/Twig/TokenParser/Block.php rename to core/vendor/twig/twig/lib/Twig/TokenParser/Block.php diff --git a/core/vendor/Twig/TokenParser/Do.php b/core/vendor/twig/twig/lib/Twig/TokenParser/Do.php similarity index 100% rename from core/vendor/Twig/TokenParser/Do.php rename to core/vendor/twig/twig/lib/Twig/TokenParser/Do.php diff --git a/core/vendor/Twig/TokenParser/Embed.php b/core/vendor/twig/twig/lib/Twig/TokenParser/Embed.php similarity index 100% rename from core/vendor/Twig/TokenParser/Embed.php rename to core/vendor/twig/twig/lib/Twig/TokenParser/Embed.php diff --git a/core/vendor/Twig/TokenParser/Extends.php b/core/vendor/twig/twig/lib/Twig/TokenParser/Extends.php similarity index 100% rename from core/vendor/Twig/TokenParser/Extends.php rename to core/vendor/twig/twig/lib/Twig/TokenParser/Extends.php diff --git a/core/vendor/Twig/TokenParser/Filter.php b/core/vendor/twig/twig/lib/Twig/TokenParser/Filter.php similarity index 100% rename from core/vendor/Twig/TokenParser/Filter.php rename to core/vendor/twig/twig/lib/Twig/TokenParser/Filter.php diff --git a/core/vendor/Twig/TokenParser/Flush.php b/core/vendor/twig/twig/lib/Twig/TokenParser/Flush.php similarity index 100% rename from core/vendor/Twig/TokenParser/Flush.php rename to core/vendor/twig/twig/lib/Twig/TokenParser/Flush.php diff --git a/core/vendor/Twig/TokenParser/For.php b/core/vendor/twig/twig/lib/Twig/TokenParser/For.php similarity index 100% rename from core/vendor/Twig/TokenParser/For.php rename to core/vendor/twig/twig/lib/Twig/TokenParser/For.php diff --git a/core/vendor/Twig/TokenParser/From.php b/core/vendor/twig/twig/lib/Twig/TokenParser/From.php similarity index 100% rename from core/vendor/Twig/TokenParser/From.php rename to core/vendor/twig/twig/lib/Twig/TokenParser/From.php diff --git a/core/vendor/Twig/TokenParser/If.php b/core/vendor/twig/twig/lib/Twig/TokenParser/If.php similarity index 100% rename from core/vendor/Twig/TokenParser/If.php rename to core/vendor/twig/twig/lib/Twig/TokenParser/If.php diff --git a/core/vendor/Twig/TokenParser/Import.php b/core/vendor/twig/twig/lib/Twig/TokenParser/Import.php similarity index 100% rename from core/vendor/Twig/TokenParser/Import.php rename to core/vendor/twig/twig/lib/Twig/TokenParser/Import.php diff --git a/core/vendor/Twig/TokenParser/Include.php b/core/vendor/twig/twig/lib/Twig/TokenParser/Include.php similarity index 100% rename from core/vendor/Twig/TokenParser/Include.php rename to core/vendor/twig/twig/lib/Twig/TokenParser/Include.php diff --git a/core/vendor/Twig/TokenParser/Macro.php b/core/vendor/twig/twig/lib/Twig/TokenParser/Macro.php similarity index 100% rename from core/vendor/Twig/TokenParser/Macro.php rename to core/vendor/twig/twig/lib/Twig/TokenParser/Macro.php diff --git a/core/vendor/Twig/TokenParser/Sandbox.php b/core/vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php similarity index 100% rename from core/vendor/Twig/TokenParser/Sandbox.php rename to core/vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php diff --git a/core/vendor/Twig/TokenParser/Set.php b/core/vendor/twig/twig/lib/Twig/TokenParser/Set.php similarity index 100% rename from core/vendor/Twig/TokenParser/Set.php rename to core/vendor/twig/twig/lib/Twig/TokenParser/Set.php diff --git a/core/vendor/Twig/TokenParser/Spaceless.php b/core/vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php similarity index 100% rename from core/vendor/Twig/TokenParser/Spaceless.php rename to core/vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php diff --git a/core/vendor/Twig/TokenParser/Use.php b/core/vendor/twig/twig/lib/Twig/TokenParser/Use.php similarity index 100% rename from core/vendor/Twig/TokenParser/Use.php rename to core/vendor/twig/twig/lib/Twig/TokenParser/Use.php diff --git a/core/vendor/Twig/TokenParserBroker.php b/core/vendor/twig/twig/lib/Twig/TokenParserBroker.php similarity index 100% rename from core/vendor/Twig/TokenParserBroker.php rename to core/vendor/twig/twig/lib/Twig/TokenParserBroker.php diff --git a/core/vendor/Twig/TokenParserBrokerInterface.php b/core/vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php similarity index 100% rename from core/vendor/Twig/TokenParserBrokerInterface.php rename to core/vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php diff --git a/core/vendor/Twig/TokenParserInterface.php b/core/vendor/twig/twig/lib/Twig/TokenParserInterface.php similarity index 100% rename from core/vendor/Twig/TokenParserInterface.php rename to core/vendor/twig/twig/lib/Twig/TokenParserInterface.php diff --git a/core/vendor/Twig/TokenStream.php b/core/vendor/twig/twig/lib/Twig/TokenStream.php similarity index 100% rename from core/vendor/Twig/TokenStream.php rename to core/vendor/twig/twig/lib/Twig/TokenStream.php diff --git a/core/vendor/twig/twig/package.xml.tpl b/core/vendor/twig/twig/package.xml.tpl new file mode 100644 index 000000000000..f9a9b892ea95 --- /dev/null +++ b/core/vendor/twig/twig/package.xml.tpl @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<package packagerversion="1.8.0" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 + http://pear.php.net/dtd/tasks-1.0.xsd + http://pear.php.net/dtd/package-2.0 + http://pear.php.net/dtd/package-2.0.xsd"> + <name>Twig</name> + <channel>pear.twig-project.org</channel> + <summary>Twig is a PHP template engine.</summary> + <description> + Twig is a template language for PHP, released under the new BSD license + (code and documentation). + + Twig uses a syntax similar to the Django and Jinja template languages which + inspired the Twig runtime environment. + </description> + <lead> + <name>Fabien Potencier</name> + <user>fabpot</user> + <email>fabien.potencier@symfony-project.org</email> + <active>yes</active> + </lead> + <lead> + <name>Armin Ronacher</name> + <user>armin</user> + <email>armin.ronacher@active-4.com</email> + <active>no</active> + </lead> + <date>{{ date }}</date> + <time>{{ time }}</time> + <version> + <release>{{ version }}</release> + <api>{{ api_version }}</api> + </version> + <stability> + <release>{{ stability }}</release> + <api>{{ stability }}</api> + </stability> + <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD Style</license> + <notes>-</notes> + <contents> + <dir name="/"> + <file name="AUTHORS" role="doc" /> + <file name="CHANGELOG" role="doc" /> + <file name="LICENSE" role="doc" /> + <file name="README.markdown" role="doc" /> + <dir name="lib"> + <dir name="Twig"> +{{ files }} + </dir> + </dir> + </dir> + </contents> + <dependencies> + <required> + <php> + <min>5.2.4</min> + </php> + <pearinstaller> + <min>1.4.0</min> + </pearinstaller> + </required> + </dependencies> + <phprelease /> +</package> diff --git a/core/vendor/twig/twig/phpunit.xml.dist b/core/vendor/twig/twig/phpunit.xml.dist new file mode 100644 index 000000000000..6c5046f11e5b --- /dev/null +++ b/core/vendor/twig/twig/phpunit.xml.dist @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<phpunit backupGlobals="false" + backupStaticAttributes="false" + colors="true" + convertErrorsToExceptions="true" + convertNoticesToExceptions="true" + convertWarningsToExceptions="true" + processIsolation="false" + stopOnFailure="false" + syntaxCheck="false" + bootstrap="test/bootstrap.php" +> + <testsuites> + <testsuite name="Twig Test Suite"> + <directory>./test/Twig/</directory> + </testsuite> + </testsuites> + + <filter> + <whitelist> + <directory suffix=".php">./lib/Twig/</directory> + </whitelist> + </filter> +</phpunit> diff --git a/core/vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php b/core/vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php new file mode 100644 index 000000000000..c8b7999aafff --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php @@ -0,0 +1,21 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +class Twig_Tests_AutoloaderTest extends PHPUnit_Framework_TestCase +{ + public function testAutoload() + { + $this->assertFalse(class_exists('FooBarFoo'), '->autoload() does not try to load classes that does not begin with Twig'); + + $autoloader = new Twig_Autoloader(); + $this->assertNull($autoloader->autoload('Foo'), '->autoload() returns false if it is not able to load a class'); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/CompilerTest.php b/core/vendor/twig/twig/test/Twig/Tests/CompilerTest.php new file mode 100644 index 000000000000..ebe79aef593b --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/CompilerTest.php @@ -0,0 +1,33 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +class Twig_Tests_CompilerTest extends PHPUnit_Framework_TestCase +{ + public function testReprNumericValueWithLocale() + { + $compiler = new Twig_Compiler(new Twig_Environment()); + + $locale = setlocale(LC_NUMERIC, 0); + if (false === $locale) { + $this->markTestSkipped('Your platform does not support locales.'); + } + + $required_locales = array('fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252'); + if (false === setlocale(LC_ALL, $required_locales)) { + $this->markTestSkipped('Could not set any of required locales: ' . implode(", ", $required_locales)); + } + + $this->assertEquals('1.2', $compiler->repr(1.2)->getSource()); + $this->assertContains('fr', strtolower(setlocale(LC_NUMERIC, 0))); + + setlocale(LC_ALL, $locale); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php b/core/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php new file mode 100644 index 000000000000..bb316906fdc4 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php @@ -0,0 +1,35 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +class Twig_Tests_EnvironmentTest extends PHPUnit_Framework_TestCase +{ + public function testAutoescapeOption() + { + $loader = new Twig_Loader_Array(array( + 'html' => '{{ foo }} {{ foo }}', + 'js' => '{{ bar }} {{ bar }}', + )); + + $twig = new Twig_Environment($loader, array( + 'debug' => true, + 'cache' => false, + 'autoescape' => array($this, 'escapingStrategyCallback'), + )); + + $this->assertEquals('foo<br/ > foo<br/ >', $twig->render('html', array('foo' => 'foo<br/ >'))); + $this->assertEquals('foo\x3cbr\x2f \x3e foo\x3cbr\x2f \x3e', $twig->render('js', array('bar' => 'foo<br/ >'))); + } + + public function escapingStrategyCallback($filename) + { + return $filename; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/ErrorTest.php b/core/vendor/twig/twig/test/Twig/Tests/ErrorTest.php new file mode 100644 index 000000000000..d0e48bedd6ed --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/ErrorTest.php @@ -0,0 +1,100 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +class Twig_Tests_ErrorTest extends PHPUnit_Framework_TestCase +{ + public function testErrorWithObjectFilename() + { + $error = new Twig_Error('foo'); + $error->setTemplateFile(new SplFileInfo(__FILE__)); + + $this->assertContains('test'.DIRECTORY_SEPARATOR.'Twig'.DIRECTORY_SEPARATOR.'Tests'.DIRECTORY_SEPARATOR.'ErrorTest.php', $error->getMessage()); + } + + public function testErrorWithArrayFilename() + { + $error = new Twig_Error('foo'); + $error->setTemplateFile(array('foo' => 'bar')); + + $this->assertEquals('foo in {"foo":"bar"}', $error->getMessage()); + } + + public function testTwigExceptionAddsFileAndLineWhenMissing() + { + $loader = new Twig_Loader_Array(array('index' => "\n\n{{ foo.bar }}\n\n\n{{ 'foo' }}")); + $twig = new Twig_Environment($loader, array('strict_variables' => true, 'debug' => true, 'cache' => false)); + + $template = $twig->loadTemplate('index'); + + try { + $template->render(array()); + + $this->fail(); + } catch (Twig_Error_Runtime $e) { + $this->assertEquals('Variable "foo" does not exist in "index" at line 3', $e->getMessage()); + $this->assertEquals(3, $e->getTemplateLine()); + $this->assertEquals('index', $e->getTemplateFile()); + } + } + + public function testRenderWrapsExceptions() + { + $loader = new Twig_Loader_Array(array('index' => "\n\n\n{{ foo.bar }}\n\n\n\n{{ 'foo' }}")); + $twig = new Twig_Environment($loader, array('strict_variables' => true, 'debug' => true, 'cache' => false)); + + $template = $twig->loadTemplate('index'); + + try { + $template->render(array('foo' => new Twig_Tests_ErrorTest_Foo())); + + $this->fail(); + } catch (Twig_Error_Runtime $e) { + $this->assertEquals('An exception has been thrown during the rendering of a template ("Runtime error...") in "index" at line 4.', $e->getMessage()); + $this->assertEquals(4, $e->getTemplateLine()); + $this->assertEquals('index', $e->getTemplateFile()); + } + } + + public function testTwigExceptionAddsFileAndLineWhenMissingWithInheritance() + { + $loader = new Twig_Loader_Array(array( + 'index' => "{% extends 'base' %} + {% block content %} + {{ foo.bar }} + {% endblock %} + {% block foo %} + {{ foo.bar }} + {% endblock %}", + 'base' => '{% block content %}{% endblock %}' + )); + $twig = new Twig_Environment($loader, array('strict_variables' => true, 'debug' => true, 'cache' => false)); + + $template = $twig->loadTemplate('index'); + + try { + $template->render(array()); + + $this->fail(); + } catch (Twig_Error_Runtime $e) { + $this->assertEquals('Variable "foo" does not exist in "index" at line 3', $e->getMessage()); + $this->assertEquals(3, $e->getTemplateLine()); + $this->assertEquals('index', $e->getTemplateFile()); + } + } +} + +class Twig_Tests_ErrorTest_Foo +{ + public function bar() + { + throw new Exception('Runtime error...'); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php b/core/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php new file mode 100644 index 000000000000..b3f300fae6b5 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php @@ -0,0 +1,217 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +class Twig_Tests_ExpressionParserTest extends PHPUnit_Framework_TestCase +{ + /** + * @expectedException Twig_Error_Syntax + * @dataProvider getFailingTestsForAssignment + */ + public function testCanOnlyAssignToNames($template) + { + $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); + $parser = new Twig_Parser($env); + + $parser->parse($env->tokenize($template, 'index')); + } + + public function getFailingTestsForAssignment() + { + return array( + array('{% set false = "foo" %}'), + array('{% set true = "foo" %}'), + array('{% set none = "foo" %}'), + array('{% set 3 = "foo" %}'), + array('{% set 1 + 2 = "foo" %}'), + array('{% set "bar" = "foo" %}'), + array('{% set %}{% endset %}') + ); + } + + /** + * @dataProvider getTestsForArray + */ + public function testArrayExpression($template, $expected) + { + $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); + $stream = $env->tokenize($template, 'index'); + $parser = new Twig_Parser($env); + + $this->assertEquals($expected, $parser->parse($stream)->getNode('body')->getNode(0)->getNode('expr')); + } + + /** + * @expectedException Twig_Error_Syntax + * @dataProvider getFailingTestsForArray + */ + public function testArraySyntaxError($template) + { + $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); + $parser = new Twig_Parser($env); + + $parser->parse($env->tokenize($template, 'index')); + } + + public function getFailingTestsForArray() + { + return array( + array('{{ [1, "a": "b"] }}'), + array('{{ {"a": "b", 2} }}'), + ); + } + + public function getTestsForArray() + { + return array( + // simple array + array('{{ [1, 2] }}', new Twig_Node_Expression_Array(array( + new Twig_Node_Expression_Constant(0, 1), + new Twig_Node_Expression_Constant(1, 1), + + new Twig_Node_Expression_Constant(1, 1), + new Twig_Node_Expression_Constant(2, 1), + ), 1), + ), + + // array with trailing , + array('{{ [1, 2, ] }}', new Twig_Node_Expression_Array(array( + new Twig_Node_Expression_Constant(0, 1), + new Twig_Node_Expression_Constant(1, 1), + + new Twig_Node_Expression_Constant(1, 1), + new Twig_Node_Expression_Constant(2, 1), + ), 1), + ), + + // simple hash + array('{{ {"a": "b", "b": "c"} }}', new Twig_Node_Expression_Array(array( + new Twig_Node_Expression_Constant('a', 1), + new Twig_Node_Expression_Constant('b', 1), + + new Twig_Node_Expression_Constant('b', 1), + new Twig_Node_Expression_Constant('c', 1), + ), 1), + ), + + // hash with trailing , + array('{{ {"a": "b", "b": "c", } }}', new Twig_Node_Expression_Array(array( + new Twig_Node_Expression_Constant('a', 1), + new Twig_Node_Expression_Constant('b', 1), + + new Twig_Node_Expression_Constant('b', 1), + new Twig_Node_Expression_Constant('c', 1), + ), 1), + ), + + // hash in an array + array('{{ [1, {"a": "b", "b": "c"}] }}', new Twig_Node_Expression_Array(array( + new Twig_Node_Expression_Constant(0, 1), + new Twig_Node_Expression_Constant(1, 1), + + new Twig_Node_Expression_Constant(1, 1), + new Twig_Node_Expression_Array(array( + new Twig_Node_Expression_Constant('a', 1), + new Twig_Node_Expression_Constant('b', 1), + + new Twig_Node_Expression_Constant('b', 1), + new Twig_Node_Expression_Constant('c', 1), + ), 1), + ), 1), + ), + + // array in a hash + array('{{ {"a": [1, 2], "b": "c"} }}', new Twig_Node_Expression_Array(array( + new Twig_Node_Expression_Constant('a', 1), + new Twig_Node_Expression_Array(array( + new Twig_Node_Expression_Constant(0, 1), + new Twig_Node_Expression_Constant(1, 1), + + new Twig_Node_Expression_Constant(1, 1), + new Twig_Node_Expression_Constant(2, 1), + ), 1), + new Twig_Node_Expression_Constant('b', 1), + new Twig_Node_Expression_Constant('c', 1), + ), 1), + ), + ); + } + + /** + * @expectedException Twig_Error_Syntax + */ + public function testStringExpressionDoesNotConcatenateTwoConsecutiveStrings() + { + $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false, 'optimizations' => 0)); + $stream = $env->tokenize('{{ "a" "b" }}', 'index'); + $parser = new Twig_Parser($env); + + $parser->parse($stream); + } + + /** + * @dataProvider getTestsForString + */ + public function testStringExpression($template, $expected) + { + $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false, 'optimizations' => 0)); + $stream = $env->tokenize($template, 'index'); + $parser = new Twig_Parser($env); + + $this->assertEquals($expected, $parser->parse($stream)->getNode('body')->getNode(0)->getNode('expr')); + } + + public function getTestsForString() + { + return array( + array( + '{{ "foo" }}', new Twig_Node_Expression_Constant('foo', 1), + ), + array( + '{{ "foo #{bar}" }}', new Twig_Node_Expression_Binary_Concat( + new Twig_Node_Expression_Constant('foo ', 1), + new Twig_Node_Expression_Name('bar', 1), + 1 + ), + ), + array( + '{{ "foo #{bar} baz" }}', new Twig_Node_Expression_Binary_Concat( + new Twig_Node_Expression_Binary_Concat( + new Twig_Node_Expression_Constant('foo ', 1), + new Twig_Node_Expression_Name('bar', 1), + 1 + ), + new Twig_Node_Expression_Constant(' baz', 1), + 1 + ) + ), + + array( + '{{ "foo #{"foo #{bar} baz"} baz" }}', new Twig_Node_Expression_Binary_Concat( + new Twig_Node_Expression_Binary_Concat( + new Twig_Node_Expression_Constant('foo ', 1), + new Twig_Node_Expression_Binary_Concat( + new Twig_Node_Expression_Binary_Concat( + new Twig_Node_Expression_Constant('foo ', 1), + new Twig_Node_Expression_Name('bar', 1), + 1 + ), + new Twig_Node_Expression_Constant(' baz', 1), + 1 + ), + 1 + ), + new Twig_Node_Expression_Constant(' baz', 1), + 1 + ), + ), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php b/core/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php new file mode 100644 index 000000000000..77a8101293ab --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php @@ -0,0 +1,115 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +class Twig_Tests_Extension_CoreTest extends PHPUnit_Framework_TestCase +{ + /** + * @dataProvider getRandomFunctionTestData + */ + public function testRandomFunction($value, $expectedInArray) + { + for ($i = 0; $i < 100; $i++) { + $this->assertTrue(in_array(twig_random(new Twig_Environment(), $value), $expectedInArray, true)); // assertContains() would not consider the type + } + } + + public function getRandomFunctionTestData() + { + return array( + array( // array + array('apple', 'orange', 'citrus'), + array('apple', 'orange', 'citrus'), + ), + array( // Traversable + new ArrayObject(array('apple', 'orange', 'citrus')), + array('apple', 'orange', 'citrus'), + ), + array( // unicode string + 'Ä€é', + array('Ä', '€', 'é'), + ), + array( // numeric but string + '123', + array('1', '2', '3'), + ), + array( // integer + 5, + range(0, 5, 1), + ), + array( // float + 5.9, + range(0, 5, 1), + ), + array( // negative + -2, + array(0, -1, -2), + ), + ); + } + + public function testRandomFunctionWithoutParameter() + { + $max = mt_getrandmax(); + + for ($i = 0; $i < 100; $i++) { + $val = twig_random(new Twig_Environment()); + $this->assertTrue(is_int($val) && $val >= 0 && $val <= $max); + } + } + + public function testRandomFunctionReturnsAsIs() + { + $this->assertSame('', twig_random(new Twig_Environment(), '')); + $this->assertSame('', twig_random(new Twig_Environment(null, array('charset' => null)), '')); + + $instance = new stdClass(); + $this->assertSame($instance, twig_random(new Twig_Environment(), $instance)); + } + + /** + * @expectedException Twig_Error_Runtime + */ + public function testRandomFunctionOfEmptyArrayThrowsException() + { + twig_random(new Twig_Environment(), array()); + } + + public function testRandomFunctionOnNonUTF8String() + { + if (!function_exists('iconv') && !function_exists('mb_convert_encoding')) { + $this->markTestSkipped('needs iconv or mbstring'); + } + + $twig = new Twig_Environment(); + $twig->setCharset('ISO-8859-1'); + + $text = twig_convert_encoding('Äé', 'ISO-8859-1', 'UTF-8'); + for ($i = 0; $i < 30; $i++) { + $rand = twig_random($twig, $text); + $this->assertTrue(in_array(twig_convert_encoding($rand, 'UTF-8', 'ISO-8859-1'), array('Ä', 'é'), true)); + } + } + + public function testReverseFilterOnNonUTF8String() + { + if (!function_exists('iconv') && !function_exists('mb_convert_encoding')) { + $this->markTestSkipped('needs iconv or mbstring'); + } + + $twig = new Twig_Environment(); + $twig->setCharset('ISO-8859-1'); + + $input = twig_convert_encoding('Äé', 'ISO-8859-1', 'UTF-8'); + $output = twig_convert_encoding(twig_reverse_filter($twig, $input), 'UTF-8', 'ISO-8859-1'); + + $this->assertEquals($output, 'éÄ'); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php b/core/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php new file mode 100644 index 000000000000..0768c65c1b26 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php @@ -0,0 +1,209 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +class Twig_Tests_Extension_SandboxTest extends PHPUnit_Framework_TestCase +{ + static protected $params, $templates; + + public function setUp() + { + self::$params = array( + 'name' => 'Fabien', + 'obj' => new FooObject(), + 'arr' => array('obj' => new FooObject()), + ); + + self::$templates = array( + '1_basic1' => '{{ obj.foo }}', + '1_basic2' => '{{ name|upper }}', + '1_basic3' => '{% if name %}foo{% endif %}', + '1_basic4' => '{{ obj.bar }}', + '1_basic5' => '{{ obj }}', + '1_basic6' => '{{ arr.obj }}', + '1_basic7' => '{{ cycle(["foo","bar"], 1) }}', + '1_basic8' => '{{ obj.getfoobar }}{{ obj.getFooBar }}', + '1_basic' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', + '1_layout' => '{% block content %}{% endblock %}', + '1_child' => '{% extends "1_layout" %}{% block content %}{{ "a"|json_encode }}{% endblock %}', + ); + } + + /** + * @expectedException Twig_Sandbox_SecurityError + * @expectedExceptionMessage Filter "json_encode" is not allowed in "1_child". + */ + public function testSandboxWithInheritance() + { + $twig = $this->getEnvironment(true, array(), self::$templates, array('block')); + $twig->loadTemplate('1_child')->render(array()); + } + + public function testSandboxGloballySet() + { + $twig = $this->getEnvironment(false, array(), self::$templates); + $this->assertEquals('FOO', $twig->loadTemplate('1_basic')->render(self::$params), 'Sandbox does nothing if it is disabled globally'); + + $twig = $this->getEnvironment(true, array(), self::$templates); + try { + $twig->loadTemplate('1_basic1')->render(self::$params); + $this->fail('Sandbox throws a SecurityError exception if an unallowed method is called'); + } catch (Twig_Sandbox_SecurityError $e) { + } + + $twig = $this->getEnvironment(true, array(), self::$templates); + try { + $twig->loadTemplate('1_basic2')->render(self::$params); + $this->fail('Sandbox throws a SecurityError exception if an unallowed filter is called'); + } catch (Twig_Sandbox_SecurityError $e) { + } + + $twig = $this->getEnvironment(true, array(), self::$templates); + try { + $twig->loadTemplate('1_basic3')->render(self::$params); + $this->fail('Sandbox throws a SecurityError exception if an unallowed tag is used in the template'); + } catch (Twig_Sandbox_SecurityError $e) { + } + + $twig = $this->getEnvironment(true, array(), self::$templates); + try { + $twig->loadTemplate('1_basic4')->render(self::$params); + $this->fail('Sandbox throws a SecurityError exception if an unallowed property is called in the template'); + } catch (Twig_Sandbox_SecurityError $e) { + } + + $twig = $this->getEnvironment(true, array(), self::$templates); + try { + $twig->loadTemplate('1_basic5')->render(self::$params); + $this->fail('Sandbox throws a SecurityError exception if an unallowed method (__toString()) is called in the template'); + } catch (Twig_Sandbox_SecurityError $e) { + } + + $twig = $this->getEnvironment(true, array(), self::$templates); + try { + $twig->loadTemplate('1_basic6')->render(self::$params); + $this->fail('Sandbox throws a SecurityError exception if an unallowed method (__toString()) is called in the template'); + } catch (Twig_Sandbox_SecurityError $e) { + } + + $twig = $this->getEnvironment(true, array(), self::$templates); + try { + $twig->loadTemplate('1_basic7')->render(self::$params); + $this->fail('Sandbox throws a SecurityError exception if an unallowed function is called in the template'); + } catch (Twig_Sandbox_SecurityError $e) { + } + + $twig = $this->getEnvironment(true, array(), self::$templates, array(), array(), array('FooObject' => 'foo')); + FooObject::reset(); + $this->assertEquals('foo', $twig->loadTemplate('1_basic1')->render(self::$params), 'Sandbox allow some methods'); + $this->assertEquals(1, FooObject::$called['foo'], 'Sandbox only calls method once'); + + $twig = $this->getEnvironment(true, array(), self::$templates, array(), array(), array('FooObject' => '__toString')); + FooObject::reset(); + $this->assertEquals('foo', $twig->loadTemplate('1_basic5')->render(self::$params), 'Sandbox allow some methods'); + $this->assertEquals(1, FooObject::$called['__toString'], 'Sandbox only calls method once'); + + $twig = $this->getEnvironment(true, array(), self::$templates, array(), array('upper')); + $this->assertEquals('FABIEN', $twig->loadTemplate('1_basic2')->render(self::$params), 'Sandbox allow some filters'); + + $twig = $this->getEnvironment(true, array(), self::$templates, array('if')); + $this->assertEquals('foo', $twig->loadTemplate('1_basic3')->render(self::$params), 'Sandbox allow some tags'); + + $twig = $this->getEnvironment(true, array(), self::$templates, array(), array(), array(), array('FooObject' => 'bar')); + $this->assertEquals('bar', $twig->loadTemplate('1_basic4')->render(self::$params), 'Sandbox allow some properties'); + + $twig = $this->getEnvironment(true, array(), self::$templates, array(), array(), array(), array(), array('cycle')); + $this->assertEquals('bar', $twig->loadTemplate('1_basic7')->render(self::$params), 'Sandbox allow some functions'); + + foreach (array('getfoobar', 'getFoobar', 'getFooBar') as $name) { + $twig = $this->getEnvironment(true, array(), self::$templates, array(), array(), array('FooObject' => $name)); + FooObject::reset(); + $this->assertEquals('foobarfoobar', $twig->loadTemplate('1_basic8')->render(self::$params), 'Sandbox allow methods in a case-insensitive way'); + $this->assertEquals(2, FooObject::$called['getFooBar'], 'Sandbox only calls method once'); + } + } + + public function testSandboxLocallySetForAnInclude() + { + self::$templates = array( + '2_basic' => '{{ obj.foo }}{% include "2_included" %}{{ obj.foo }}', + '2_included' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', + ); + + $twig = $this->getEnvironment(false, array(), self::$templates); + $this->assertEquals('fooFOOfoo', $twig->loadTemplate('2_basic')->render(self::$params), 'Sandbox does nothing if disabled globally and sandboxed not used for the include'); + + self::$templates = array( + '3_basic' => '{{ obj.foo }}{% sandbox %}{% include "3_included" %}{% endsandbox %}{{ obj.foo }}', + '3_included' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', + ); + + $twig = $this->getEnvironment(true, array(), self::$templates); + try { + $twig->loadTemplate('3_basic')->render(self::$params); + $this->fail('Sandbox throws a SecurityError exception when the included file is sandboxed'); + } catch (Twig_Sandbox_SecurityError $e) { + } + } + + public function testMacrosInASandbox() + { + $twig = $this->getEnvironment(true, array('autoescape' => true), array('index' => <<<EOF +{% macro test(text) %}<p>{{ text }}</p>{% endmacro %} +{{ _self.test('username') }} +EOF + ), array('macro'), array('escape')); + + $this->assertEquals('<p>username</p>', $twig->loadTemplate('index')->render(array())); + } + + protected function getEnvironment($sandboxed, $options, $templates, $tags = array(), $filters = array(), $methods = array(), $properties = array(), $functions = array()) + { + $loader = new Twig_Loader_Array($templates); + $twig = new Twig_Environment($loader, array_merge(array('debug' => true, 'cache' => false, 'autoescape' => false), $options)); + $policy = new Twig_Sandbox_SecurityPolicy($tags, $filters, $methods, $properties, $functions); + $twig->addExtension(new Twig_Extension_Sandbox($policy, $sandboxed)); + + return $twig; + } +} + +class FooObject +{ + static public $called = array('__toString' => 0, 'foo' => 0, 'getFooBar' => 0); + + public $bar = 'bar'; + + static public function reset() + { + self::$called = array('__toString' => 0, 'foo' => 0, 'getFooBar' => 0); + } + + public function __toString() + { + ++self::$called['__toString']; + + return 'foo'; + } + + public function foo() + { + ++self::$called['foo']; + + return 'foo'; + } + + public function getFooBar() + { + ++self::$called['getFooBar']; + + return 'foobar'; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php b/core/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php new file mode 100644 index 000000000000..2c77c06a631a --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php @@ -0,0 +1,70 @@ +<?php + +class Twig_Tests_FileCachingTest extends PHPUnit_Framework_TestCase +{ + protected $fileName; + protected $env; + protected $tmpDir; + + public function setUp() + { + $this->tmpDir = sys_get_temp_dir().'/TwigTests'; + if (!file_exists($this->tmpDir)) { + @mkdir($this->tmpDir, 0777, true);; + } + + if (!is_writable($this->tmpDir)) { + $this->markTestSkipped(sprintf('Unable to run the tests as "%s" is not writable.', $this->tmpDir)); + } + + $this->env = new Twig_Environment(new Twig_Loader_String(), array('cache' => $this->tmpDir)); + } + + public function tearDown() + { + if ($this->fileName) { + unlink($this->fileName); + } + + $this->removeDir($this->tmpDir); + } + + public function testWritingCacheFiles() + { + $name = 'This is just text.'; + $template = $this->env->loadTemplate($name); + $cacheFileName = $this->env->getCacheFilename($name); + + $this->assertTrue(file_exists($cacheFileName), 'Cache file does not exist.'); + $this->fileName = $cacheFileName; + } + + public function testClearingCacheFiles() + { + $name = 'I will be deleted.'; + $template = $this->env->loadTemplate($name); + $cacheFileName = $this->env->getCacheFilename($name); + + $this->assertTrue(file_exists($cacheFileName), 'Cache file does not exist.'); + $this->env->clearCacheFiles(); + $this->assertFalse(file_exists($cacheFileName), 'Cache file was not cleared.'); + } + + private function removeDir($target) + { + $fp = opendir($target); + while (false !== $file = readdir($fp)) { + if (in_array($file, array('.', '..'))) { + continue; + } + + if (is_dir($target.'/'.$file)) { + self::removeDir($target.'/'.$file); + } else { + unlink($target.'/'.$file); + } + } + closedir($fp); + rmdir($target); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test new file mode 100644 index 000000000000..02245e931f36 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test @@ -0,0 +1,20 @@ +--TEST-- +Exception for an unclosed tag +--TEMPLATE-- +{% block foo %} + {% if foo %} + + + + + {% for i in fo %} + + + + {% endfor %} + + + +{% endblock %} +--EXCEPTION-- +Twig_Error_Syntax: Unexpected tag name "endblock" (expecting closing tag for the "if" tag defined near line 4) in "index.twig" at line 16 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test new file mode 100644 index 000000000000..c69b1192fbab --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test @@ -0,0 +1,61 @@ +--TEST-- +Twig supports array notation +--TEMPLATE-- +{# empty array #} +{{ []|join(',') }} + +{{ [1, 2]|join(',') }} +{{ ['foo', "bar"]|join(',') }} +{{ {0: 1, 'foo': 'bar'}|join(',') }} +{{ {0: 1, 'foo': 'bar'}|keys|join(',') }} + +{{ {0: 1, foo: 'bar'}|join(',') }} +{{ {0: 1, foo: 'bar'}|keys|join(',') }} + +{# nested arrays #} +{% set a = [1, 2, [1, 2], {'foo': {'foo': 'bar'}}] %} +{{ a[2]|join(',') }} +{{ a[3]["foo"]|join(',') }} + +{# works even if [] is used inside the array #} +{{ [foo[bar]]|join(',') }} + +{# elements can be any expression #} +{{ ['foo'|upper, bar|upper, bar == foo]|join(',') }} + +{# arrays can have a trailing , like in PHP #} +{{ + [ + 1, + 2, + ]|join(',') +}} + +{# keys can be any expression #} +{% set a = 1 %} +{% set b = "foo" %} +{% set ary = { (a): 'a', (b): 'b', 'c': 'c', (a ~ b): 'd' } %} +{{ ary|keys|join(',') }} +{{ ary|join(',') }} +--DATA-- +return array('bar' => 'bar', 'foo' => array('bar' => 'bar')) +--EXPECT-- +1,2 +foo,bar +1,bar +0,foo + +1,bar +0,foo + +1,2 +bar + +bar + +FOO,BAR, + +1,2 + +1,foo,c,1foo +a,b,c,d diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test new file mode 100644 index 000000000000..f3df328fe3c7 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test @@ -0,0 +1,14 @@ +--TEST-- +Twig supports method calls +--TEMPLATE-- +{{ items.foo }} +{{ items['foo'] }} +{{ items[foo] }} +{{ items[items[foo]] }} +--DATA-- +return array('foo' => 'bar', 'items' => array('foo' => 'bar', 'bar' => 'foo')) +--EXPECT-- +bar +bar +foo +bar diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test new file mode 100644 index 000000000000..f5e68456d78a --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test @@ -0,0 +1,46 @@ +--TEST-- +Twig supports binary operations (+, -, *, /, ~, %, and, or) +--TEMPLATE-- +{{ 1 + 1 }} +{{ 2 - 1 }} +{{ 2 * 2 }} +{{ 2 / 2 }} +{{ 3 % 2 }} +{{ 1 and 1 }} +{{ 1 and 0 }} +{{ 0 and 1 }} +{{ 0 and 0 }} +{{ 1 or 1 }} +{{ 1 or 0 }} +{{ 0 or 1 }} +{{ 0 or 0 }} +{{ 0 or 1 and 0 }} +{{ 1 or 0 and 1 }} +{{ "foo" ~ "bar" }} +{{ foo ~ "bar" }} +{{ "foo" ~ bar }} +{{ foo ~ bar }} +{{ 20 // 7 }} +--DATA-- +return array('foo' => 'bar', 'bar' => 'foo') +--EXPECT-- +2 +1 +4 +1 +1 +1 + + + +1 +1 +1 + + +1 +foobar +barbar +foofoo +barfoo +2 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test new file mode 100644 index 000000000000..911094c06730 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test @@ -0,0 +1,12 @@ +--TEST-- +Twig supports bitwise operations +--TEMPLATE-- +{{ 1 b-and 5 }} +{{ 1 b-or 5 }} +{{ 1 b-xor 5 }} +--DATA-- +return array() +--EXPECT-- +1 +5 +4 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test new file mode 100644 index 000000000000..726b85075d4f --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test @@ -0,0 +1,14 @@ +--TEST-- +Twig supports comparison operators (==, !=, <, >, >=, <=) +--TEMPLATE-- +{{ 1 > 2 }}/{{ 1 > 1 }}/{{ 1 >= 2 }}/{{ 1 >= 1 }} +{{ 1 < 2 }}/{{ 1 < 1 }}/{{ 1 <= 2 }}/{{ 1 <= 1 }} +{{ 1 == 1 }}/{{ 1 == 2 }} +{{ 1 != 1 }}/{{ 1 != 2 }} +--DATA-- +return array() +--EXPECT-- +///1 +1//1/1 +1/ +/1 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test new file mode 100644 index 000000000000..9cd0676ce735 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test @@ -0,0 +1,20 @@ +--TEST-- +Twig supports the .. operator +--TEMPLATE-- +{% for i in 0..10 %}{{ i }} {% endfor %} + +{% for letter in 'a'..'z' %}{{ letter }} {% endfor %} + +{% for letter in 'a'|upper..'z'|upper %}{{ letter }} {% endfor %} + +{% for i in foo[0]..foo[1] %}{{ i }} {% endfor %} + +{% for i in 0 + 1 .. 10 - 1 %}{{ i }} {% endfor %} +--DATA-- +return array('foo' => array(1, 10)) +--EXPECT-- +0 1 2 3 4 5 6 7 8 9 10 +a b c d e f g h i j k l m n o p q r s t u v w x y z +A B C D E F G H I J K L M N O P Q R S T U V W X Y Z +1 2 3 4 5 6 7 8 9 10 +1 2 3 4 5 6 7 8 9 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test new file mode 100644 index 000000000000..79f8e0b0d35e --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test @@ -0,0 +1,8 @@ +--TEST-- +Twig supports grouping of expressions +--TEMPLATE-- +{{ (2 + 2) / 2 }} +--DATA-- +return array() +--EXPECT-- +2 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test new file mode 100644 index 000000000000..7ae3bae95987 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test @@ -0,0 +1,22 @@ +--TEST-- +Twig supports literals +--TEMPLATE-- +1 {{ true }} +2 {{ TRUE }} +3 {{ false }} +4 {{ FALSE }} +5 {{ none }} +6 {{ NONE }} +7 {{ null }} +8 {{ NULL }} +--DATA-- +return array() +--EXPECT-- +1 1 +2 1 +3 +4 +5 +6 +7 +8 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test new file mode 100644 index 000000000000..159db96f5086 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test @@ -0,0 +1,27 @@ +--TEST-- +Twig supports __call() for attributes +--TEMPLATE-- +{{ foo.foo }} +{{ foo.bar }} +--DATA-- +class TestClassForMagicCallAttributes +{ + public function getBar() + { + return 'bar_from_getbar'; + } + + public function __call($method, $arguments) + { + if ('foo' === $method) + { + return 'foo_from_call'; + } + + return false; + } +} +return array('foo' => new TestClassForMagicCallAttributes()) +--EXPECT-- +foo_from_call +bar_from_getbar diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test new file mode 100644 index 000000000000..9d84a4c053bb --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test @@ -0,0 +1,28 @@ +--TEST-- +Twig supports method calls +--TEMPLATE-- +{{ items.foo.foo }} +{{ items.foo.getFoo() }} +{{ items.foo.bar }} +{{ items.foo['bar'] }} +{{ items.foo.bar('a', 43) }} +{{ items.foo.bar(foo) }} +{{ items.foo.self.foo() }} +{{ items.foo.is }} +{{ items.foo.in }} +{{ items.foo.not }} +--DATA-- +return array('foo' => 'bar', 'items' => array('foo' => new Foo(), 'bar' => 'foo')) +--CONFIG-- +return array('strict_variables' => false) +--EXPECT-- +foo +foo +bar + +bar_a-43 +bar_bar +foo +is +in +not diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test new file mode 100644 index 000000000000..db047c00503f --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test @@ -0,0 +1,21 @@ +--TEST-- +Twig parses postfix expressions +--TEMPLATE-- + +{% macro foo() %}foo{% endmacro %} + +{{ 'a' }} +{{ 'a'|upper }} +{{ ('a')|upper }} +{{ -1|upper }} +{{ _self.foo() }} +{{ (_self).foo() }} +--DATA-- +return array(); +--EXPECT-- +a +A +A +-1 +foo +foo diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test new file mode 100644 index 000000000000..a9116613e942 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test @@ -0,0 +1,10 @@ +--TEST-- +Twig supports string interpolation +--TEMPLATE-- +{{ "foo #{"foo #{bar} baz"} baz" }} +{{ "foo #{bar}#{bar} baz" }} +--DATA-- +return array('bar' => 'BAR'); +--EXPECT-- +foo foo BAR baz baz +foo BARBAR baz diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test new file mode 100644 index 000000000000..0e6fa96e254f --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test @@ -0,0 +1,18 @@ +--TEST-- +Twig supports the ternary operator +--TEMPLATE-- +{{ 1 ? 'YES' : 'NO' }} +{{ 0 ? 'YES' : 'NO' }} +{{ 0 ? 'YES' : (1 ? 'YES1' : 'NO1') }} +{{ 0 ? 'YES' : (0 ? 'YES1' : 'NO1') }} +{{ 1 == 1 ? 'foo<br />':'' }} +{{ foo ~ (bar ? ('-' ~ bar) : '') }} +--DATA-- +return array('foo' => 'foo', 'bar' => 'bar') +--EXPECT-- +YES +NO +YES1 +NO1 +foo<br /> +foo-bar diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test new file mode 100644 index 000000000000..b79219a2aa51 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test @@ -0,0 +1,12 @@ +--TEST-- +Twig supports unary operators (not, -, +) +--TEMPLATE-- +{{ not 1 }}/{{ not 0 }} +{{ +1 + 1 }}/{{ -1 - 1 }} +{{ not (false or true) }} +--DATA-- +return array() +--EXPECT-- +/1 +2/-2 + diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test new file mode 100644 index 000000000000..cc6eef8d2a07 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test @@ -0,0 +1,14 @@ +--TEST-- +Twig unary operators precedence +--TEMPLATE-- +{{ -1 - 1 }} +{{ -1 - -1 }} +{{ -1 * -1 }} +{{ 4 / -1 * 5 }} +--DATA-- +return array() +--EXPECT-- +-2 +0 +1 +-20 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test new file mode 100644 index 000000000000..27e93fd63812 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test @@ -0,0 +1,30 @@ +--TEST-- +"abs" filter +--TEMPLATE-- +{{ (-5.5)|abs }} +{{ (-5)|abs }} +{{ (-0)|abs }} +{{ 0|abs }} +{{ 5|abs }} +{{ 5.5|abs }} +{{ number1|abs }} +{{ number2|abs }} +{{ number3|abs }} +{{ number4|abs }} +{{ number5|abs }} +{{ number6|abs }} +--DATA-- +return array('number1' => -5.5, 'number2' => -5, 'number3' => -0, 'number4' => 0, 'number5' => 5, 'number6' => 5.5) +--EXPECT-- +5.5 +5 +0 +0 +5 +5.5 +5.5 +5 +0 +0 +5 +5.5 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test new file mode 100644 index 000000000000..380b04bb8698 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test @@ -0,0 +1,10 @@ +--TEST-- +"convert_encoding" filter +--CONDITION-- +function_exists('iconv') || function_exists('mb_convert_encoding') +--TEMPLATE-- +{{ "æ„›ã—ã¦ã„ã¾ã™ã‹ï¼Ÿ"|convert_encoding('ISO-2022-JP', 'UTF-8')|convert_encoding('UTF-8', 'ISO-2022-JP') }} +--DATA-- +return array() +--EXPECT-- +æ„›ã—ã¦ã„ã¾ã™ã‹ï¼Ÿ diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test new file mode 100644 index 000000000000..ae6d0daf5e3a --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test @@ -0,0 +1,56 @@ +--TEST-- +"date" filter +--TEMPLATE-- +{{ date1|date }} +{{ date1|date('d/m/Y') }} +{{ date1|date('d/m/Y H:i:s', 'Europe/Paris') }} +{{ date1|date('d/m/Y H:i:s P', 'Europe/Paris') }} +{{ date1|date('d/m/Y H:i:s P', 'America/Chicago') }} +{{ date1|date('e') }} +{{ date1|date('d/m/Y H:i:s') }} +{{ date2|date }} +{{ date2|date('d/m/Y') }} +{{ date2|date('d/m/Y H:i:s', 'Europe/Paris') }} +{{ date2|date('d/m/Y H:i:s') }} +{{ date3|date }} +{{ date3|date('d/m/Y') }} +{{ date4|date }} +{{ date4|date('d/m/Y') }} +{{ date5|date }} +{{ date5|date('d/m/Y') }} +{{ date6|date('d/m/Y H:i:s P', 'Europe/Paris') }} +{{ date6|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }} +{{ date6|date('e', 'Europe/Paris') }} +{{ date6|date('e') }} +--DATA-- +date_default_timezone_set('UTC'); +return array( + 'date1' => mktime(13, 45, 0, 10, 4, 2010), + 'date2' => new DateTime('2010-10-04 13:45'), + 'date3' => '2010-10-04 13:45', + 'date4' => 1286199900, + 'date5' => -86410, + 'date6' => new DateTime('2010-10-04 13:45', new DateTimeZone('America/New_York')), +) +--EXPECT-- +October 4, 2010 13:45 +04/10/2010 +04/10/2010 15:45:00 +04/10/2010 15:45:00 +02:00 +04/10/2010 08:45:00 -05:00 +UTC +04/10/2010 13:45:00 +October 4, 2010 13:45 +04/10/2010 +04/10/2010 15:45:00 +04/10/2010 13:45:00 +October 4, 2010 13:45 +04/10/2010 +October 4, 2010 13:45 +04/10/2010 +December 30, 1969 23:59 +30/12/1969 +04/10/2010 19:45:00 +02:00 +05/10/2010 01:45:00 +08:00 +Europe/Paris +America/New_York \ No newline at end of file diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test new file mode 100644 index 000000000000..11a1ef4bd662 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test @@ -0,0 +1,14 @@ +--TEST-- +"date" filter +--TEMPLATE-- +{{ date1|date }} +{{ date1|date('d/m/Y') }} +--DATA-- +date_default_timezone_set('UTC'); +$twig->getExtension('core')->setDateFormat('Y-m-d', '%d days %h hours'); +return array( + 'date1' => mktime(13, 45, 0, 10, 4, 2010), +) +--EXPECT-- +2010-10-04 +04/10/2010 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test new file mode 100644 index 000000000000..e6d3707d9048 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test @@ -0,0 +1,16 @@ +--TEST-- +"date" filter (interval support as of PHP 5.3) +--CONDITION-- +version_compare(phpversion(), '5.3.0', '>=') +--TEMPLATE-- +{{ date2|date }} +{{ date2|date('%d days') }} +--DATA-- +date_default_timezone_set('UTC'); +$twig->getExtension('core')->setDateFormat('Y-m-d', '%d days %h hours'); +return array( + 'date2' => new DateInterval('P2D'), +) +--EXPECT-- +2 days 0 hours +2 days diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test new file mode 100644 index 000000000000..2d5adc11721f --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test @@ -0,0 +1,16 @@ +--TEST-- +"date" filter (interval support as of PHP 5.3) +--CONDITION-- +version_compare(phpversion(), '5.3.0', '>=') +--TEMPLATE-- +{{ date6|date }} +{{ date6|date('%d days %h hours') }} +--DATA-- +date_default_timezone_set('UTC'); +return array( + 'date5' => -86410, + 'date6' => new DateInterval('P2D'), +) +--EXPECT-- +2 days +2 days 0 hours diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test new file mode 100644 index 000000000000..22e86e46b1d3 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test @@ -0,0 +1,150 @@ +--TEST-- +"default" filter +--TEMPLATE-- +Variable: +{{ definedVar |default('default') is sameas('default') ? 'ko' : 'ok' }} +{{ zeroVar |default('default') is sameas('default') ? 'ko' : 'ok' }} +{{ emptyVar |default('default') is sameas('default') ? 'ok' : 'ko' }} +{{ nullVar |default('default') is sameas('default') ? 'ok' : 'ko' }} +{{ undefinedVar |default('default') is sameas('default') ? 'ok' : 'ko' }} +Array access: +{{ nested.definedVar |default('default') is sameas('default') ? 'ko' : 'ok' }} +{{ nested['definedVar'] |default('default') is sameas('default') ? 'ko' : 'ok' }} +{{ nested.zeroVar |default('default') is sameas('default') ? 'ko' : 'ok' }} +{{ nested.emptyVar |default('default') is sameas('default') ? 'ok' : 'ko' }} +{{ nested.nullVar |default('default') is sameas('default') ? 'ok' : 'ko' }} +{{ nested.undefinedVar |default('default') is sameas('default') ? 'ok' : 'ko' }} +{{ nested['undefinedVar'] |default('default') is sameas('default') ? 'ok' : 'ko' }} +{{ undefinedVar.foo |default('default') is sameas('default') ? 'ok' : 'ko' }} +Plain values: +{{ 'defined' |default('default') is sameas('default') ? 'ko' : 'ok' }} +{{ 0 |default('default') is sameas('default') ? 'ko' : 'ok' }} +{{ '' |default('default') is sameas('default') ? 'ok' : 'ko' }} +{{ null |default('default') is sameas('default') ? 'ok' : 'ko' }} +Precedence: +{{ 'o' ~ nullVar |default('k') }} +{{ 'o' ~ nested.nullVar |default('k') }} +Object methods: +{{ object.foo |default('default') is sameas('default') ? 'ko' : 'ok' }} +{{ object.undefinedMethod |default('default') is sameas('default') ? 'ok' : 'ko' }} +{{ object.getFoo() |default('default') is sameas('default') ? 'ko' : 'ok' }} +{{ object.getFoo('a') |default('default') is sameas('default') ? 'ko' : 'ok' }} +{{ object.undefinedMethod() |default('default') is sameas('default') ? 'ok' : 'ko' }} +{{ object.undefinedMethod('a') |default('default') is sameas('default') ? 'ok' : 'ko' }} +Deep nested: +{{ nested.undefinedVar.foo.bar |default('default') is sameas('default') ? 'ok' : 'ko' }} +{{ nested.definedArray.0 |default('default') is sameas('default') ? 'ko' : 'ok' }} +{{ nested['definedArray'][0] |default('default') is sameas('default') ? 'ko' : 'ok' }} +{{ object.self.foo |default('default') is sameas('default') ? 'ko' : 'ok' }} +{{ object.self.undefinedMethod |default('default') is sameas('default') ? 'ok' : 'ko' }} +{{ object.undefinedMethod.self |default('default') is sameas('default') ? 'ok' : 'ko' }} +--DATA-- +return array( + 'definedVar' => 'defined', + 'zeroVar' => 0, + 'emptyVar' => '', + 'nullVar' => null, + 'nested' => array( + 'definedVar' => 'defined', + 'zeroVar' => 0, + 'emptyVar' => '', + 'nullVar' => null, + 'definedArray' => array(0), + ), + 'object' => new Foo(), +) +--CONFIG-- +return array('strict_variables' => false) +--EXPECT-- +Variable: +ok +ok +ok +ok +ok +Array access: +ok +ok +ok +ok +ok +ok +ok +ok +Plain values: +ok +ok +ok +ok +Precedence: +ok +ok +Object methods: +ok +ok +ok +ok +ok +ok +Deep nested: +ok +ok +ok +ok +ok +ok +--DATA-- +return array( + 'definedVar' => 'defined', + 'zeroVar' => 0, + 'emptyVar' => '', + 'nullVar' => null, + 'nested' => array( + 'definedVar' => 'defined', + 'zeroVar' => 0, + 'emptyVar' => '', + 'nullVar' => null, + 'definedArray' => array(0), + ), + 'object' => new Foo(), +) +--CONFIG-- +return array('strict_variables' => true) +--EXPECT-- +Variable: +ok +ok +ok +ok +ok +Array access: +ok +ok +ok +ok +ok +ok +ok +ok +Plain values: +ok +ok +ok +ok +Precedence: +ok +ok +Object methods: +ok +ok +ok +ok +ok +ok +Deep nested: +ok +ok +ok +ok +ok +ok diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test new file mode 100644 index 000000000000..93c5913f2beb --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test @@ -0,0 +1,10 @@ +--TEST-- +dynamic filter +--TEMPLATE-- +{{ 'bar'|foo_path }} +{{ 'bar'|a_foo_b_bar }} +--DATA-- +return array() +--EXPECT-- +foo/bar +a/b/bar diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test new file mode 100644 index 000000000000..a606c10650d7 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test @@ -0,0 +1,8 @@ +--TEST-- +"escape" filter +--TEMPLATE-- +{{ "foo <br />"|e }} +--DATA-- +return array() +--EXPECT-- +foo <br /> diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test new file mode 100644 index 000000000000..bba26a0df424 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test @@ -0,0 +1,8 @@ +--TEST-- +"escape" filter +--TEMPLATE-- +{{ "æ„›ã—ã¦ã„ã¾ã™ã‹ï¼Ÿ <br />"|e }} +--DATA-- +return array() +--EXPECT-- +æ„›ã—ã¦ã„ã¾ã™ã‹ï¼Ÿ <br /> diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test new file mode 100644 index 000000000000..3690e71516d8 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test @@ -0,0 +1,18 @@ +--TEST-- +"escape" filter +--TEMPLATE-- +{% set foo %} + foo<br /> +{% endset %} + +{{ foo|e('html') -}} +{{ foo|e('js') }} +{% autoescape true %} + {{ foo }} +{% endautoescape %} +--DATA-- +return array() +--EXPECT-- + foo<br /> + foo\x3cbr \x2f\x3e\x0a + foo<br /> diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test new file mode 100644 index 000000000000..97221ff80ee2 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test @@ -0,0 +1,8 @@ +--TEST-- +"format" filter +--TEMPLATE-- +{{ string|format(foo, 3) }} +--DATA-- +return array('string' => '%s/%d', 'foo' => 'bar') +--EXPECT-- +bar/3 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test new file mode 100644 index 000000000000..8feef6356955 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test @@ -0,0 +1,12 @@ +--TEST-- +"join" filter +--TEMPLATE-- +{{ ["foo", "bar"]|join(', ') }} +{{ foo|join(', ') }} +{{ bar|join(', ') }} +--DATA-- +return array('foo' => new Foo(), 'bar' => new ArrayObject(array(3, 4))) +--EXPECT-- +foo, bar +1, 2 +3, 4 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test new file mode 100644 index 000000000000..1738d40cdfb7 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test @@ -0,0 +1,12 @@ +--TEST-- +"json_encode" filter +--TEMPLATE-- +{{ "foo"|json_encode|raw }} +{{ foo|json_encode|raw }} +{{ [foo, "foo"]|json_encode|raw }} +--DATA-- +return array('foo' => new Twig_Markup('foo', 'UTF-8')) +--EXPECT-- +"foo" +"foo" +["foo","foo"] diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test new file mode 100644 index 000000000000..3347474d5605 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test @@ -0,0 +1,14 @@ +--TEST-- +"length" filter +--TEMPLATE-- +{{ array|length }} +{{ string|length }} +{{ number|length }} +{{ markup|length }} +--DATA-- +return array('array' => array(1, 4), 'string' => 'foo', 'number' => 1000, 'markup' => new Twig_Markup('foo', 'UTF-8')) +--EXPECT-- +2 +3 +4 +3 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test new file mode 100644 index 000000000000..5d5e243616d7 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test @@ -0,0 +1,12 @@ +--TEST-- +"length" filter +--CONDITION-- +function_exists('mb_get_info') +--TEMPLATE-- +{{ string|length }} +{{ markup|length }} +--DATA-- +return array('string' => 'été', 'markup' => new Twig_Markup('foo', 'UTF-8')) +--EXPECT-- +3 +3 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test new file mode 100644 index 000000000000..357b3522e1b8 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test @@ -0,0 +1,14 @@ +--TEST-- +"merge" filter +--TEMPLATE-- +{{ items|merge({'bar': 'foo'})|join }} +{{ items|merge({'bar': 'foo'})|keys|join }} +{{ {'bar': 'foo'}|merge(items)|join }} +{{ {'bar': 'foo'}|merge(items)|keys|join }} +--DATA-- +return array('items' => array('foo' => 'bar')) +--EXPECT-- +barfoo +foobar +foobar +barfoo diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test new file mode 100644 index 000000000000..6545a9bb0104 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test @@ -0,0 +1,14 @@ +--TEST-- +"nl2br" filter +--TEMPLATE-- +{{ "I like Twig.\nYou will like it too.\n\nEverybody like it!"|nl2br }} +{{ text|nl2br }} +--DATA-- +return array('text' => "If you have some <strong>HTML</strong>\nit will be escaped.") +--EXPECT-- +I like Twig.<br /> +You will like it too.<br /> +<br /> +Everybody like it! +If you have some <strong>HTML</strong><br /> +it will be escaped. diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test new file mode 100644 index 000000000000..639a8659f0d4 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test @@ -0,0 +1,18 @@ +--TEST-- +"number_format" filter +--TEMPLATE-- +{{ 20|number_format }} +{{ 20.25|number_format }} +{{ 20.25|number_format(2) }} +{{ 20.25|number_format(2, ',') }} +{{ 1020.25|number_format(2, ',') }} +{{ 1020.25|number_format(2, ',', '.') }} +--DATA-- +return array(); +--EXPECT-- +20 +20 +20.25 +20,25 +1,020,25 +1.020,25 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test new file mode 100644 index 000000000000..c6903cc7321c --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test @@ -0,0 +1,21 @@ +--TEST-- +"number_format" filter with defaults. +--TEMPLATE-- +{{ 20|number_format }} +{{ 20.25|number_format }} +{{ 20.25|number_format(1) }} +{{ 20.25|number_format(2, ',') }} +{{ 1020.25|number_format }} +{{ 1020.25|number_format(2, ',') }} +{{ 1020.25|number_format(2, ',', '.') }} +--DATA-- +$twig->getExtension('core')->setNumberFormat(2, '!', '='); +return array(); +--EXPECT-- +20!00 +20!25 +20!3 +20,25 +1=020!25 +1=020,25 +1.020,25 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test new file mode 100644 index 000000000000..4021660beddc --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test @@ -0,0 +1,8 @@ +--TEST-- +"replace" filter +--TEMPLATE-- +{{ "I like %this% and %that%."|replace({'%this%': "foo", '%that%': "bar"}) }} +--DATA-- +return array() +--EXPECT-- +I like foo and bar. diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test new file mode 100644 index 000000000000..3c5f410a2395 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test @@ -0,0 +1,12 @@ +--TEST-- +"reverse" filter +--TEMPLATE-- +{{ [1, 2, 3, 4]|reverse|join('') }} +{{ '1234évènement'|reverse }} +{{ arr|reverse|join('') }} +--DATA-- +return array('arr' => new ArrayObject(array(1, 2, 3, 4))) +--EXPECT-- +4321 +tnemenèvé4321 +4321 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test new file mode 100644 index 000000000000..bb32dfbc59eb --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test @@ -0,0 +1,40 @@ +--TEST-- +"slice" filter +--TEMPLATE-- +{{ [1, 2, 3, 4][1:2]|join('') }} +{{ {a: 1, b: 2, c: 3, d: 4}[1:2]|join('') }} +{{ [1, 2, 3, 4][start:length]|join('') }} +{{ [1, 2, 3, 4]|slice(1, 2)|join('') }} +{{ [1, 2, 3, 4]|slice(1, 2)|keys|join('') }} +{{ [1, 2, 3, 4]|slice(1, 2, true)|keys|join('') }} +{{ {a: 1, b: 2, c: 3, d: 4}|slice(1, 2)|join('') }} +{{ {a: 1, b: 2, c: 3, d: 4}|slice(1, 2)|keys|join('') }} +{{ '1234'|slice(1, 2) }} +{{ '1234'[1:2] }} +{{ arr|slice(1, 2)|join('') }} +{{ arr[1:2]|join('') }} + +{{ [1, 2, 3, 4]|slice(1)|join('') }} +{{ [1, 2, 3, 4][1:]|join('') }} +{{ '1234'|slice(1) }} +{{ '1234'[1:] }} +--DATA-- +return array('start' => 1, 'length' => 2, 'arr' => new ArrayObject(array(1, 2, 3, 4))) +--EXPECT-- +23 +23 +23 +23 +01 +12 +23 +bc +23 +23 +23 +23 + +234 +234 +234 +234 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test new file mode 100644 index 000000000000..21d575f18cc9 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test @@ -0,0 +1,10 @@ +--TEST-- +"sort" filter +--TEMPLATE-- +{{ array1|sort|join }} +{{ array2|sort|join }} +--DATA-- +return array('array1' => array(4, 1), 'array2' => array('foo', 'bar')) +--EXPECT-- +14 +barfoo diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test new file mode 100644 index 000000000000..cc919000cae2 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test @@ -0,0 +1,8 @@ +--TEST-- +"☃" custom filter +--TEMPLATE-- +{{ 'foo'|☃ }} +--DATA-- +return array() +--EXPECT-- +☃foo☃ diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test new file mode 100644 index 000000000000..3192062582d3 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test @@ -0,0 +1,12 @@ +--TEST-- +"trim" filter +--TEMPLATE-- +{{ " I like Twig. "|trim }} +{{ text|trim }} +{{ " foo/"|trim("/") }} +--DATA-- +return array('text' => " If you have some <strong>HTML</strong> it will be escaped. ") +--EXPECT-- +I like Twig. +If you have some <strong>HTML</strong> it will be escaped. + foo diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test new file mode 100644 index 000000000000..ba7d5e82ed70 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test @@ -0,0 +1,12 @@ +--TEST-- +"attribute" function +--TEMPLATE-- +{{ attribute(obj, method) }} +{{ attribute(array, item) }} +{{ attribute(obj, "bar", ["a", "b"]) }} +--DATA-- +return array('obj' => new Foo(), 'method' => 'foo', 'array' => array('foo' => 'bar'), 'item' => 'foo') +--EXPECT-- +foo +bar +bar_a-b diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test new file mode 100644 index 000000000000..8e54059aee1b --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test @@ -0,0 +1,12 @@ +--TEST-- +"block" function +--TEMPLATE-- +{% extends 'base.twig' %} +{% block bar %}BAR{% endblock %} +--TEMPLATE(base.twig)-- +{% block foo %}{{ block('bar') }}{% endblock %} +{% block bar %}BAR_BASE{% endblock %} +--DATA-- +return array() +--EXPECT-- +BARBAR diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test new file mode 100644 index 000000000000..6d4b374c41ba --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test @@ -0,0 +1,12 @@ +--TEST-- +"constant" function +--TEMPLATE-- +{% if constant('DATE_W3C') == expect %} +true +{% else %} +false +{% endif %} +--DATA-- +return array('expect' => DATE_W3C); +--EXPECT-- +true diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test new file mode 100644 index 000000000000..522a63b85f5a --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test @@ -0,0 +1,16 @@ +--TEST-- +"cycle" function +--TEMPLATE-- +{% for i in 0..6 %} +{{ cycle(array1, i) }}-{{ cycle(array2, i) }} +{% endfor %} +--DATA-- +return array('array1' => array('odd', 'even'), 'array2' => array('apple', 'orange', 'citrus')) +--EXPECT-- +odd-apple +even-orange +odd-citrus +even-apple +odd-orange +even-citrus +odd-apple diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test new file mode 100644 index 000000000000..caeee7a28eca --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test @@ -0,0 +1,25 @@ +--TEST-- +"date" function +--TEMPLATE-- +{{ date() == date('now') ? 'OK' : 'KO' }} +{{ date() > date('-1day') ? 'OK' : 'KO' }} +{{ date(date1) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} +{{ date(date2) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} +{{ date(date3) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} +{{ date(date4) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} +--DATA-- +date_default_timezone_set('UTC'); +return array( + 'date1' => mktime(13, 45, 0, 10, 4, 2010), + 'date2' => new DateTime('2010-10-04 13:45'), + 'date3' => '2010-10-04 13:45', + 'date4' => 1286199900, + 'date5' => -86410, +) +--EXPECT-- +OK +OK +OK +OK +OK +OK diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test new file mode 100644 index 000000000000..371a587758f4 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test @@ -0,0 +1,14 @@ +--TEST-- +"dump" function +--TEMPLATE-- +{{ dump('foo') }} +{{ dump('foo', 'bar') }} +--DATA-- +return array('foo' => 'foo', 'bar' => 'bar') +--CONFIG-- +return array('debug' => true, 'autoescape' => false); +--EXPECT-- +string(3) "foo" + +string(3) "foo" +string(3) "bar" diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test new file mode 100644 index 000000000000..889b7a922e60 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test @@ -0,0 +1,19 @@ +--TEST-- +"dump" function, xdebug is not loaded or xdebug <2.2-dev is loaded +--CONDITION-- +!extension_loaded('xdebug') || (($r = new ReflectionExtension('xdebug')) && version_compare($r->getVersion(), '2.2-dev', '<')) +--TEMPLATE-- +{{ dump() }} +--DATA-- +return array('foo' => 'foo', 'bar' => 'bar') +--CONFIG-- +return array('debug' => true, 'autoescape' => false); +--EXPECT-- +array(3) { + ["foo"]=> + string(3) "foo" + ["bar"]=> + string(3) "bar" + ["global"]=> + string(6) "global" +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test new file mode 100644 index 000000000000..913fbc99595a --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test @@ -0,0 +1,10 @@ +--TEST-- +dynamic function +--TEMPLATE-- +{{ foo_path('bar') }} +{{ a_foo_b_bar('bar') }} +--DATA-- +return array() +--EXPECT-- +foo/bar +a/b/bar diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test new file mode 100644 index 000000000000..f602b0df6c5d --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test @@ -0,0 +1,8 @@ +--TEST-- +"☃" custom function +--TEMPLATE-- +{{ ☃('foo') }} +--DATA-- +return array() +--EXPECT-- +☃foo☃ diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test new file mode 100644 index 000000000000..6a366cdf1b39 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test @@ -0,0 +1,22 @@ +--TEST-- +macro +--TEMPLATE-- +{% import _self as test %} +{% from _self import test %} + +{% macro test(a, b) -%} + {{ a|default('a') }}<br /> + {{- b|default('b') }}<br /> +{%- endmacro %} + +{{ test.test() }} +{{ test() }} +{{ test.test(1, "c") }} +{{ test(1, "c") }} +--DATA-- +return array(); +--EXPECT-- +a<br />b<br /> +a<br />b<br /> +1<br />c<br /> +1<br />c<br /> diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test new file mode 100644 index 000000000000..685626f2aca4 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test @@ -0,0 +1,14 @@ +--TEST-- +macro with a filter +--TEMPLATE-- +{% import _self as test %} + +{% macro test() %} + {% filter escape %}foo<br />{% endfilter %} +{% endmacro %} + +{{ test.test() }} +--DATA-- +return array(); +--EXPECT-- +foo<br /> diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test new file mode 100644 index 000000000000..65f6cd2b8618 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test @@ -0,0 +1,8 @@ +--TEST-- +Twig outputs 0 nodes correctly +--TEMPLATE-- +{{ foo }}0{{ foo }} +--DATA-- +return array('foo' => 'foo') +--EXPECT-- +foo0foo diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test new file mode 100644 index 000000000000..110aef82313c --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test @@ -0,0 +1,17 @@ +--TEST-- +Twig is able to deal with SimpleXMLElement instances as variables +--CONDITION-- +version_compare(phpversion(), '5.3.0', '>=') +--TEMPLATE-- +Hello '{{ images.image.0.group }}'! +{{ images.children().count() }} +{% for image in images %} + - {{ image.group }} +{% endfor %} +--DATA-- +return array('images' => new SimpleXMLElement('<images><image><group>foo</group></image><image><group>bar</group></image></images>')) +--EXPECT-- +Hello 'foo'! +2 + - foo + - bar diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test new file mode 100644 index 000000000000..e18e110792db --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test @@ -0,0 +1,8 @@ +--TEST-- +Twig does not confuse strings with integers in getAttribute() +--TEMPLATE-- +{{ hash['2e2'] }} +--DATA-- +return array('hash' => array('2e2' => 'works')) +--EXPECT-- +works diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test new file mode 100644 index 000000000000..2f6a3e1a0648 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test @@ -0,0 +1,26 @@ +--TEST-- +"autoescape" tag applies escaping on its children +--TEMPLATE-- +{% autoescape %} +{{ var }}<br /> +{% endautoescape %} +{% autoescape 'html' %} +{{ var }}<br /> +{% endautoescape %} +{% autoescape false %} +{{ var }}<br /> +{% endautoescape %} +{% autoescape true %} +{{ var }}<br /> +{% endautoescape %} +{% autoescape false %} +{{ var }}<br /> +{% endautoescape %} +--DATA-- +return array('var' => '<br />') +--EXPECT-- +<br /><br /> +<br /><br /> +<br /><br /> +<br /><br /> +<br /><br /> diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test new file mode 100644 index 000000000000..05ab83ce39e3 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test @@ -0,0 +1,12 @@ +--TEST-- +"autoescape" tag applies escaping on embedded blocks +--TEMPLATE-- +{% autoescape 'html' %} + {% block foo %} + {{ var }} + {% endblock %} +{% endautoescape %} +--DATA-- +return array('var' => '<br />') +--EXPECT-- +<br /> diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test new file mode 100644 index 000000000000..9c0972462b3d --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test @@ -0,0 +1,10 @@ +--TEST-- +"autoescape" tag does not double-escape +--TEMPLATE-- +{% autoescape 'html' %} +{{ var|escape }} +{% endautoescape %} +--DATA-- +return array('var' => '<br />') +--EXPECT-- +<br /> diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test new file mode 100644 index 000000000000..864655ced2bd --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test @@ -0,0 +1,83 @@ +--TEST-- +"autoescape" tag applies escaping after calling functions +--TEMPLATE-- + +autoescape false +{% autoescape false %} + +safe_br +{{ safe_br() }} + +unsafe_br +{{ unsafe_br() }} + +{% endautoescape %} + +autoescape 'html' +{% autoescape 'html' %} + +safe_br +{{ safe_br() }} + +unsafe_br +{{ unsafe_br() }} + +unsafe_br()|raw +{{ (unsafe_br())|raw }} + +safe_br()|escape +{{ (safe_br())|escape }} + +safe_br()|raw +{{ (safe_br())|raw }} + +unsafe_br()|escape +{{ (unsafe_br())|escape }} + +{% endautoescape %} + +autoescape js +{% autoescape 'js' %} + +safe_br +{{ safe_br() }} + +{% endautoescape %} +--DATA-- +return array() +--EXPECT-- + +autoescape false + +safe_br +<br /> + +unsafe_br +<br /> + + +autoescape 'html' + +safe_br +<br /> + +unsafe_br +<br /> + +unsafe_br()|raw +<br /> + +safe_br()|escape +<br /> + +safe_br()|raw +<br /> + +unsafe_br()|escape +<br /> + + +autoescape js + +safe_br +\x3cbr \x2f\x3e diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test new file mode 100644 index 000000000000..775bfd091cd4 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test @@ -0,0 +1,45 @@ +--TEST-- +"autoescape" tag does not apply escaping on literals +--TEMPLATE-- +{% autoescape 'html' %} + +1. Simple literal +{{ "<br />" }} + +2. Conditional expression with only literals +{{ true ? "<br />" : "<br>" }} + +3. Conditonal expression with a variable +{{ true ? "<br />" : someVar }} + +4. Nested conditionals with only literals +{{ true ? (true ? "<br />" : "<br>") : "\n" }} + +5. Nested conditionals with a variable +{{ true ? (true ? "<br />" : someVar) : "\n" }} + +6. Nested conditionals with a variable marked safe +{{ true ? (true ? "<br />" : someVar|raw) : "\n" }} + +{% endautoescape %} +--DATA-- +return array() +--EXPECT-- + +1. Simple literal +<br /> + +2. Conditional expression with only literals +<br /> + +3. Conditonal expression with a variable +<br /> + +4. Nested conditionals with only literals +<br /> + +5. Nested conditionals with a variable +<br /> + +6. Nested conditionals with a variable marked safe +<br /> diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test new file mode 100644 index 000000000000..798e6feaf022 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test @@ -0,0 +1,26 @@ +--TEST-- +"autoescape" tags can be nested at will +--TEMPLATE-- +{{ var }} +{% autoescape 'html' %} + {{ var }} + {% autoescape false %} + {{ var }} + {% autoescape 'html' %} + {{ var }} + {% endautoescape %} + {{ var }} + {% endautoescape %} + {{ var }} +{% endautoescape %} +{{ var }} +--DATA-- +return array('var' => '<br />') +--EXPECT-- +<br /> + <br /> + <br /> + <br /> + <br /> + <br /> +<br /> diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test new file mode 100644 index 000000000000..e896aa41cadd --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test @@ -0,0 +1,26 @@ +--TEST-- +"autoescape" tag applies escaping to object method calls +--TEMPLATE-- +{% autoescape 'html' %} +{{ user.name }} +{{ user.name|lower }} +{{ user }} +{% endautoescape %} +--DATA-- +class UserForAutoEscapeTest +{ + public function getName() + { + return 'Fabien<br />'; + } + + public function __toString() + { + return 'Fabien<br />'; + } +} +return array('user' => new UserForAutoEscapeTest()) +--EXPECT-- +Fabien<br /> +fabien<br /> +Fabien<br /> diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test new file mode 100644 index 000000000000..9f1cedd3abf1 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test @@ -0,0 +1,10 @@ +--TEST-- +"autoescape" tag does not escape when raw is used as a filter +--TEMPLATE-- +{% autoescape 'html' %} +{{ var|raw }} +{% endautoescape %} +--DATA-- +return array('var' => '<br />') +--EXPECT-- +<br /> diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test new file mode 100644 index 000000000000..101d5afe5d04 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test @@ -0,0 +1,17 @@ +--TEST-- +"autoescape" tag accepts an escaping strategy +--TEMPLATE-- +{% autoescape true js %}{{ var }}{% endautoescape %} + +{% autoescape true html %}{{ var }}{% endautoescape %} + +{% autoescape 'js' %}{{ var }}{% endautoescape %} + +{% autoescape 'html' %}{{ var }}{% endautoescape %} +--DATA-- +return array('var' => '<br />"') +--EXPECT-- +\x3cbr \x2f\x3e\x22 +<br />" +\x3cbr \x2f\x3e\x22 +<br />" diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test new file mode 100644 index 000000000000..10fd63f91d76 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test @@ -0,0 +1,69 @@ +--TEST-- +escape types +--TEMPLATE-- + +1. autoescape 'html' |escape('js') + +{% autoescape 'html' %} +<a onclick="alert("{{ msg|escape('js') }}")"></a> +{% endautoescape %} + +2. autoescape 'html' |escape('js') + +{% autoescape 'html' %} +<a onclick="alert("{{ msg|escape('js') }}")"></a> +{% endautoescape %} + +3. autoescape 'js' |escape('js') + +{% autoescape 'js' %} +<a onclick="alert("{{ msg|escape('js') }}")"></a> +{% endautoescape %} + +4. no escape + +{% autoescape false %} +<a onclick="alert("{{ msg }}")"></a> +{% endautoescape %} + +5. |escape('js')|escape('html') + +{% autoescape false %} +<a onclick="alert("{{ msg|escape('js')|escape('html') }}")"></a> +{% endautoescape %} + +6. autoescape 'html' |escape('js')|escape('html') + +{% autoescape 'html' %} +<a onclick="alert("{{ msg|escape('js')|escape('html') }}")"></a> +{% endautoescape %} + +--DATA-- +return array('msg' => "<>\n'\"") +--EXPECT-- + +1. autoescape 'html' |escape('js') + +<a onclick="alert("\x3c\x3e\x0a\x27\x22")"></a> + +2. autoescape 'html' |escape('js') + +<a onclick="alert("\x3c\x3e\x0a\x27\x22")"></a> + +3. autoescape 'js' |escape('js') + +<a onclick="alert("\x3c\x3e\x0a\x27\x22")"></a> + +4. no escape + +<a onclick="alert("<> +'"")"></a> + +5. |escape('js')|escape('html') + +<a onclick="alert("\x3c\x3e\x0a\x27\x22")"></a> + +6. autoescape 'html' |escape('js')|escape('html') + +<a onclick="alert("\x3c\x3e\x0a\x27\x22")"></a> + diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test new file mode 100644 index 000000000000..7821a9aafd7e --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test @@ -0,0 +1,131 @@ +--TEST-- +"autoescape" tag applies escaping after calling filters +--TEMPLATE-- +{% autoescape 'html' %} + +(escape_and_nl2br is an escaper filter) + +1. Don't escape escaper filter output +( var is escaped by |escape_and_nl2br, line-breaks are added, + the output is not escaped ) +{{ var|escape_and_nl2br }} + +2. Don't escape escaper filter output +( var is escaped by |escape_and_nl2br, line-breaks are added, + the output is not escaped, |raw is redundant ) +{{ var|escape_and_nl2br|raw }} + +3. Explicit escape +( var is escaped by |escape_and_nl2br, line-breaks are added, + the output is explicitly escaped by |escape ) +{{ var|escape_and_nl2br|escape }} + +4. Escape non-escaper filter output +( var is upper-cased by |upper, + the output is auto-escaped ) +{{ var|upper }} + +5. Escape if last filter is not an escaper +( var is escaped by |escape_and_nl2br, line-breaks are added, + the output is upper-cased by |upper, + the output is auto-escaped as |upper is not an escaper ) +{{ var|escape_and_nl2br|upper }} + +6. Don't escape escaper filter output +( var is upper cased by upper, + the output is escaped by |escape_and_nl2br, line-breaks are added, + the output is not escaped as |escape_and_nl2br is an escaper ) +{{ var|upper|escape_and_nl2br }} + +7. Escape if last filter is not an escaper +( the output of |format is "<b>" ~ var ~ "</b>", + the output is auto-escaped ) +{{ "<b>%s</b>"|format(var) }} + +8. Escape if last filter is not an escaper +( the output of |format is "<b>" ~ var ~ "</b>", + |raw is redundant, + the output is auto-escaped ) +{{ "<b>%s</b>"|raw|format(var) }} + +9. Don't escape escaper filter output +( the output of |format is "<b>" ~ var ~ "</b>", + the output is not escaped due to |raw filter at the end ) +{{ "<b>%s</b>"|format(var)|raw }} + +10. Don't escape escaper filter output +( the output of |format is "<b>" ~ var ~ "</b>", + the output is not escaped due to |raw filter at the end, + the |raw filter on var is redundant ) +{{ "<b>%s</b>"|format(var|raw)|raw }} + +{% endautoescape %} +--DATA-- +return array('var' => "<Fabien>\nTwig") +--EXPECT-- + +(escape_and_nl2br is an escaper filter) + +1. Don't escape escaper filter output +( var is escaped by |escape_and_nl2br, line-breaks are added, + the output is not escaped ) +<Fabien><br /> +Twig + +2. Don't escape escaper filter output +( var is escaped by |escape_and_nl2br, line-breaks are added, + the output is not escaped, |raw is redundant ) +<Fabien><br /> +Twig + +3. Explicit escape +( var is escaped by |escape_and_nl2br, line-breaks are added, + the output is explicitly escaped by |escape ) +&lt;Fabien&gt;<br /> +Twig + +4. Escape non-escaper filter output +( var is upper-cased by |upper, + the output is auto-escaped ) +<FABIEN> +TWIG + +5. Escape if last filter is not an escaper +( var is escaped by |escape_and_nl2br, line-breaks are added, + the output is upper-cased by |upper, + the output is auto-escaped as |upper is not an escaper ) +&LT;FABIEN&GT;<BR /> +TWIG + +6. Don't escape escaper filter output +( var is upper cased by upper, + the output is escaped by |escape_and_nl2br, line-breaks are added, + the output is not escaped as |escape_and_nl2br is an escaper ) +<FABIEN><br /> +TWIG + +7. Escape if last filter is not an escaper +( the output of |format is "<b>" ~ var ~ "</b>", + the output is auto-escaped ) +<b><Fabien> +Twig</b> + +8. Escape if last filter is not an escaper +( the output of |format is "<b>" ~ var ~ "</b>", + |raw is redundant, + the output is auto-escaped ) +<b><Fabien> +Twig</b> + +9. Don't escape escaper filter output +( the output of |format is "<b>" ~ var ~ "</b>", + the output is not escaped due to |raw filter at the end ) +<b><Fabien> +Twig</b> + +10. Don't escape escaper filter output +( the output of |format is "<b>" ~ var ~ "</b>", + the output is not escaped due to |raw filter at the end, + the |raw filter on var is redundant ) +<b><Fabien> +Twig</b> diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test new file mode 100644 index 000000000000..f58a1e09c69a --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test @@ -0,0 +1,23 @@ +--TEST-- +"autoescape" tag do not applies escaping on filter arguments +--TEMPLATE-- +{% autoescape 'html' %} +{{ var|nl2br("<br />") }} +{{ var|nl2br("<br />"|escape) }} +{{ var|nl2br(sep) }} +{{ var|nl2br(sep|raw) }} +{{ var|nl2br(sep|escape) }} +{% endautoescape %} +--DATA-- +return array('var' => "<Fabien>\nTwig", 'sep' => '<br />') +--EXPECT-- +<Fabien><br /> +Twig +<Fabien><br /> +Twig +<Fabien><br /> +Twig +<Fabien><br /> +Twig +<Fabien><br /> +Twig diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test new file mode 100644 index 000000000000..134c77ea815b --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test @@ -0,0 +1,68 @@ +--TEST-- +"autoescape" tag applies escaping after calling filters, and before calling pre_escape filters +--TEMPLATE-- +{% autoescape 'html' %} + +(nl2br is pre_escaped for "html" and declared safe for "html") + +1. Pre-escape and don't post-escape +( var|escape|nl2br ) +{{ var|nl2br }} + +2. Don't double-pre-escape +( var|escape|nl2br ) +{{ var|escape|nl2br }} + +3. Don't escape safe values +( var|raw|nl2br ) +{{ var|raw|nl2br }} + +4. Don't escape safe values +( var|escape|nl2br|nl2br ) +{{ var|nl2br|nl2br }} + +5. Re-escape values that are escaped for an other contexts +( var|escape_something|escape|nl2br ) +{{ var|escape_something|nl2br }} + +6. Still escape when using filters not declared safe +( var|escape|nl2br|upper|escape ) +{{ var|nl2br|upper }} + +{% endautoescape %} +--DATA-- +return array('var' => "<Fabien>\nTwig") +--EXPECT-- + +(nl2br is pre_escaped for "html" and declared safe for "html") + +1. Pre-escape and don't post-escape +( var|escape|nl2br ) +<Fabien><br /> +Twig + +2. Don't double-pre-escape +( var|escape|nl2br ) +<Fabien><br /> +Twig + +3. Don't escape safe values +( var|raw|nl2br ) +<Fabien><br /> +Twig + +4. Don't escape safe values +( var|escape|nl2br|nl2br ) +<Fabien><br /><br /> +Twig + +5. Re-escape values that are escaped for an other contexts +( var|escape_something|escape|nl2br ) +<FABIEN><br /> +TWIG + +6. Still escape when using filters not declared safe +( var|escape|nl2br|upper|escape ) +&LT;FABIEN&GT;<BR /> +TWIG + diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test new file mode 100644 index 000000000000..32d3943b5733 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test @@ -0,0 +1,50 @@ +--TEST-- +"autoescape" tag handles filters preserving the safety +--TEMPLATE-- +{% autoescape 'html' %} + +(preserves_safety is preserving safety for "html") + +1. Unsafe values are still unsafe +( var|preserves_safety|escape ) +{{ var|preserves_safety }} + +2. Safe values are still safe +( var|escape|preserves_safety ) +{{ var|escape|preserves_safety }} + +3. Re-escape values that are escaped for an other contexts +( var|escape_something|preserves_safety|escape ) +{{ var|escape_something|preserves_safety }} + +4. Still escape when using filters not declared safe +( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape ) +{{ var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'}) }} + +{% endautoescape %} +--DATA-- +return array('var' => "<Fabien>\nTwig") +--EXPECT-- + +(preserves_safety is preserving safety for "html") + +1. Unsafe values are still unsafe +( var|preserves_safety|escape ) +<FABIEN> +TWIG + +2. Safe values are still safe +( var|escape|preserves_safety ) +<FABIEN> +TWIG + +3. Re-escape values that are escaped for an other contexts +( var|escape_something|preserves_safety|escape ) +<FABIEN> +TWIG + +4. Still escape when using filters not declared safe +( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape ) +&LT;FABPOT&GT; +TWIG + diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test new file mode 100644 index 000000000000..360dcf0302ee --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test @@ -0,0 +1,11 @@ +--TEST-- +"block" tag +--TEMPLATE-- +{% block title1 %}FOO{% endblock %} +{% block title2 foo|lower %} +--TEMPLATE(foo.twig)-- +{% block content %}{% endblock %} +--DATA-- +return array('foo' => 'bar') +--EXPECT-- +FOObar diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test new file mode 100644 index 000000000000..5c205c0aa98e --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test @@ -0,0 +1,11 @@ +--TEST-- +"block" tag +--TEMPLATE-- +{% block content %} + {% block content %} + {% endblock %} +{% endblock %} +--DATA-- +return array() +--EXCEPTION-- +Twig_Error_Syntax: The block 'content' has already been defined line 2 in "index.twig" at line 3 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test new file mode 100644 index 000000000000..441570cddc4e --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test @@ -0,0 +1,10 @@ +--TEST-- +"☃" special chars in a block name +--TEMPLATE-- +{% block ☃ %} +☃ +{% endblock ☃ %} +--DATA-- +return array() +--EXPECT-- +☃ diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test new file mode 100644 index 000000000000..f44296ea0174 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test @@ -0,0 +1,35 @@ +--TEST-- +"embed" tag +--TEMPLATE-- +FOO +{% embed "foo.twig" %} + {% block c1 %} + {{ parent() }} + block1extended + {% endblock %} +{% endembed %} + +BAR +--TEMPLATE(foo.twig)-- +A +{% block c1 %} + block1 +{% endblock %} +B +{% block c2 %} + block2 +{% endblock %} +C +--DATA-- +return array() +--EXPECT-- +FOO + +A + block1 + + block1extended + B + block2 +C +BAR diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test new file mode 100644 index 000000000000..da161e6d4387 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test @@ -0,0 +1,50 @@ +--TEST-- +"embed" tag +--TEMPLATE-- +FOO +{% embed "foo.twig" %} + {% block c1 %} + {{ parent() }} + block1extended + {% endblock %} +{% endembed %} + +{% embed "foo.twig" %} + {% block c1 %} + {{ parent() }} + block1extended + {% endblock %} +{% endembed %} + +BAR +--TEMPLATE(foo.twig)-- +A +{% block c1 %} + block1 +{% endblock %} +B +{% block c2 %} + block2 +{% endblock %} +C +--DATA-- +return array() +--EXPECT-- +FOO + +A + block1 + + block1extended + B + block2 +C + +A + block1 + + block1extended + B + block2 +C +BAR diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test new file mode 100644 index 000000000000..cf7953d3ef15 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test @@ -0,0 +1,57 @@ +--TEST-- +"embed" tag +--TEMPLATE-- +{% extends "base.twig" %} + +{% block c1 %} + {{ parent() }} + blockc1baseextended +{% endblock %} + +{% block c2 %} + {{ parent() }} + + {% embed "foo.twig" %} + {% block c1 %} + {{ parent() }} + block1extended + {% endblock %} + {% endembed %} +{% endblock %} +--TEMPLATE(base.twig)-- +A +{% block c1 %} + blockc1base +{% endblock %} +{% block c2 %} + blockc2base +{% endblock %} +B +--TEMPLATE(foo.twig)-- +A +{% block c1 %} + block1 +{% endblock %} +B +{% block c2 %} + block2 +{% endblock %} +C +--DATA-- +return array() +--EXPECT-- +A + blockc1base + + blockc1baseextended + blockc2base + + + +A + block1 + + block1extended + B + block2 +CB \ No newline at end of file diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.test new file mode 100644 index 000000000000..82094f2f02c7 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.test @@ -0,0 +1,10 @@ +--TEST-- +"filter" tag applies a filter on its children +--TEMPLATE-- +{% filter upper %} +Some text with a {{ var }} +{% endfilter %} +--DATA-- +return array('var' => 'var') +--EXPECT-- +SOME TEXT WITH A VAR diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.test new file mode 100644 index 000000000000..3e7148bf41ba --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.test @@ -0,0 +1,8 @@ +--TEST-- +"filter" tag applies a filter on its children +--TEMPLATE-- +{% filter json_encode|raw %}test{% endfilter %} +--DATA-- +return array() +--EXPECT-- +"test" diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.test new file mode 100644 index 000000000000..75512ef96564 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.test @@ -0,0 +1,10 @@ +--TEST-- +"filter" tags accept multiple chained filters +--TEMPLATE-- +{% filter lower|title %} + {{ var }} +{% endfilter %} +--DATA-- +return array('var' => 'VAR') +--EXPECT-- + Var diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.test new file mode 100644 index 000000000000..7e4e4eb33b2f --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.test @@ -0,0 +1,16 @@ +--TEST-- +"filter" tags can be nested at will +--TEMPLATE-- +{% filter lower|title %} + {{ var }} + {% filter upper %} + {{ var }} + {% endfilter %} + {{ var }} +{% endfilter %} +--DATA-- +return array('var' => 'var') +--EXPECT-- + Var + Var + Var diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.test new file mode 100644 index 000000000000..22745eadf322 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.test @@ -0,0 +1,13 @@ +--TEST-- +"filter" tag applies the filter on "for" tags +--TEMPLATE-- +{% filter upper %} +{% for item in items %} +{{ item }} +{% endfor %} +{% endfilter %} +--DATA-- +return array('items' => array('a', 'b')) +--EXPECT-- +A +B diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.test new file mode 100644 index 000000000000..afd95b296219 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.test @@ -0,0 +1,29 @@ +--TEST-- +"filter" tag applies the filter on "if" tags +--TEMPLATE-- +{% filter upper %} +{% if items %} +{{ items|join(', ') }} +{% endif %} + +{% if items.3 is defined %} +FOO +{% else %} +{{ items.1 }} +{% endif %} + +{% if items.3 is defined %} +FOO +{% elseif items.1 %} +{{ items.0 }} +{% endif %} + +{% endfilter %} +--DATA-- +return array('items' => array('a', 'b')) +--EXPECT-- +A, B + +B + +A diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.test new file mode 100644 index 000000000000..9e4eb9b2d1c9 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.test @@ -0,0 +1,14 @@ +--TEST-- +"for" tag takes a condition +--TEMPLATE-- +{% for i in 1..5 if i is odd -%} + {{ loop.index }}.{{ i }} +{% endfor %} +--DATA-- +return array() +--CONFIG-- +return array('strict_variables' => false) +--EXPECT-- +1.1 +2.3 +3.5 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test new file mode 100644 index 000000000000..ddc69307b33c --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test @@ -0,0 +1,18 @@ +--TEST-- +"for" tag keeps the context safe +--TEMPLATE-- +{% for item in items %} + {% for item in items %} + * {{ item }} + {% endfor %} + * {{ item }} +{% endfor %} +--DATA-- +return array('items' => array('a', 'b')) +--EXPECT-- + * a + * b + * a + * a + * b + * b diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test new file mode 100644 index 000000000000..20ccc880c5ed --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test @@ -0,0 +1,23 @@ +--TEST-- +"for" tag can use an "else" clause +--TEMPLATE-- +{% for item in items %} + * {{ item }} +{% else %} + no item +{% endfor %} +--DATA-- +return array('items' => array('a', 'b')) +--EXPECT-- + * a + * b +--DATA-- +return array('items' => array()) +--EXPECT-- + no item +--DATA-- +return array() +--CONFIG-- +return array('strict_variables' => false) +--EXPECT-- + no item diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test new file mode 100644 index 000000000000..49fb9ca6f6f4 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test @@ -0,0 +1,17 @@ +--TEST-- +"for" tag does not reset inner variables +--TEMPLATE-- +{% for i in 1..2 %} + {% for j in 0..2 %} + {{k}}{% set k = k+1 %} {{ loop.parent.loop.index }} + {% endfor %} +{% endfor %} +--DATA-- +return array('k' => 0) +--EXPECT-- + 0 1 + 1 1 + 2 1 + 3 2 + 4 2 + 5 2 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test new file mode 100644 index 000000000000..4e22cb473f9c --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test @@ -0,0 +1,11 @@ +--TEST-- +"for" tag can iterate over keys +--TEMPLATE-- +{% for key in items|keys %} + * {{ key }} +{% endfor %} +--DATA-- +return array('items' => array('a', 'b')) +--EXPECT-- + * 0 + * 1 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test new file mode 100644 index 000000000000..4c211689d7ec --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test @@ -0,0 +1,11 @@ +--TEST-- +"for" tag can iterate over keys and values +--TEMPLATE-- +{% for key, item in items %} + * {{ key }}/{{ item }} +{% endfor %} +--DATA-- +return array('items' => array('a', 'b')) +--EXPECT-- + * 0/a + * 1/b diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test new file mode 100644 index 000000000000..93bc76a1f805 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test @@ -0,0 +1,19 @@ +--TEST-- +"for" tag adds a loop variable to the context +--TEMPLATE-- +{% for item in items %} + * {{ loop.index }}/{{ loop.index0 }} + * {{ loop.revindex }}/{{ loop.revindex0 }} + * {{ loop.first }}/{{ loop.last }}/{{ loop.length }} + +{% endfor %} +--DATA-- +return array('items' => array('a', 'b')) +--EXPECT-- + * 1/0 + * 2/1 + * 1//2 + + * 2/1 + * 1/0 + * /1/2 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test new file mode 100644 index 000000000000..58af2c3269ee --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test @@ -0,0 +1,10 @@ +--TEST-- +"for" tag adds a loop variable to the context locally +--TEMPLATE-- +{% for item in items %} +{% endfor %} +{% if loop is not defined %}WORKS{% endif %} +--DATA-- +return array('items' => array()) +--EXPECT-- +WORKS diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test new file mode 100644 index 000000000000..f8b9f6bc181c --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test @@ -0,0 +1,17 @@ +--TEST-- +"for" tag can use an "else" clause +--TEMPLATE-- +{% for item in items %} + {% for item in items1 %} + * {{ item }} + {% else %} + no {{ item }} + {% endfor %} +{% else %} + no item1 +{% endfor %} +--DATA-- +return array('items' => array('a', 'b'), 'items1' => array()) +--EXPECT-- +no a + no b diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test new file mode 100644 index 000000000000..503443792156 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test @@ -0,0 +1,43 @@ +--TEST-- +"for" tag iterates over iterable objects +--TEMPLATE-- +{% for item in items %} + * {{ item }} + * {{ loop.index }}/{{ loop.index0 }} + * {{ loop.first }} + +{% endfor %} + +{% for key, value in items %} + * {{ key }}/{{ value }} +{% endfor %} + +{% for key in items|keys %} + * {{ key }} +{% endfor %} +--DATA-- +class ItemsIterator implements Iterator +{ + protected $values = array('foo' => 'bar', 'bar' => 'foo'); + public function current() { return current($this->values); } + public function key() { return key($this->values); } + public function next() { return next($this->values); } + public function rewind() { return reset($this->values); } + public function valid() { return false !== current($this->values); } +} +return array('items' => new ItemsIterator()) +--EXPECT-- + * bar + * 1/0 + * 1 + + * foo + * 2/1 + * + + + * foo/bar + * bar/foo + + * foo + * bar diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test new file mode 100644 index 000000000000..4a1ff6119088 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test @@ -0,0 +1,47 @@ +--TEST-- +"for" tag iterates over iterable and countable objects +--TEMPLATE-- +{% for item in items %} + * {{ item }} + * {{ loop.index }}/{{ loop.index0 }} + * {{ loop.revindex }}/{{ loop.revindex0 }} + * {{ loop.first }}/{{ loop.last }}/{{ loop.length }} + +{% endfor %} + +{% for key, value in items %} + * {{ key }}/{{ value }} +{% endfor %} + +{% for key in items|keys %} + * {{ key }} +{% endfor %} +--DATA-- +class ItemsIteratorCountable implements Iterator, Countable +{ + protected $values = array('foo' => 'bar', 'bar' => 'foo'); + public function current() { return current($this->values); } + public function key() { return key($this->values); } + public function next() { return next($this->values); } + public function rewind() { return reset($this->values); } + public function valid() { return false !== current($this->values); } + public function count() { return count($this->values); } +} +return array('items' => new ItemsIteratorCountable()) +--EXPECT-- + * bar + * 1/0 + * 2/1 + * 1//2 + + * foo + * 2/1 + * 1/0 + * /1/2 + + + * foo/bar + * bar/foo + + * foo + * bar diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test new file mode 100644 index 000000000000..17b2e222390d --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test @@ -0,0 +1,18 @@ +--TEST-- +"for" tags can be nested +--TEMPLATE-- +{% for key, item in items %} +* {{ key }} ({{ loop.length }}): +{% for value in item %} + * {{ value }} ({{ loop.length }}) +{% endfor %} +{% endfor %} +--DATA-- +return array('items' => array('a' => array('a1', 'a2', 'a3'), 'b' => array('b1'))) +--EXPECT-- +* a (2): + * a1 (3) + * a2 (3) + * a3 (3) +* b (2): + * b1 (1) diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test new file mode 100644 index 000000000000..82f2ae8a44d4 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test @@ -0,0 +1,11 @@ +--TEST-- +"for" tag iterates over item values +--TEMPLATE-- +{% for item in items %} + * {{ item }} +{% endfor %} +--DATA-- +return array('items' => array('a', 'b')) +--EXPECT-- + * a + * b diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test new file mode 100644 index 000000000000..5f5da0ec158f --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test @@ -0,0 +1,14 @@ +--TEST-- +global variables +--TEMPLATE-- +{% include "included.twig" %} +{% from "included.twig" import foobar %} +{{ foobar() }} +--TEMPLATE(included.twig)-- +{% macro foobar() %} +called foobar +{% endmacro %} +--DATA-- +return array(); +--EXPECT-- +called foobar diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test new file mode 100644 index 000000000000..c1c3d27681fc --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test @@ -0,0 +1,22 @@ +--TEST-- +"if" creates a condition +--TEMPLATE-- +{% if a is defined %} + {{ a }} +{% elseif b is defined %} + {{ b }} +{% else %} + NOTHING +{% endif %} +--DATA-- +return array('a' => 'a') +--EXPECT-- + a +--DATA-- +return array('b' => 'b') +--EXPECT-- + b +--DATA-- +return array() +--EXPECT-- + NOTHING diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test new file mode 100644 index 000000000000..edfb73df4fec --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test @@ -0,0 +1,22 @@ +--TEST-- +"if" takes an expression as a test +--TEMPLATE-- +{% if a < 2 %} + A1 +{% elseif a > 10 %} + A2 +{% else %} + A3 +{% endif %} +--DATA-- +return array('a' => 1) +--EXPECT-- + A1 +--DATA-- +return array('a' => 12) +--EXPECT-- + A2 +--DATA-- +return array('a' => 7) +--EXPECT-- + A3 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test new file mode 100644 index 000000000000..8fe1a6c1355b --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test @@ -0,0 +1,16 @@ +--TEST-- +"include" tag +--TEMPLATE-- +FOO +{% include "foo.twig" %} + +BAR +--TEMPLATE(foo.twig)-- +FOOBAR +--DATA-- +return array() +--EXPECT-- +FOO + +FOOBAR +BAR diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test new file mode 100644 index 000000000000..eaeeb112e95f --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test @@ -0,0 +1,16 @@ +--TEST-- +"include" tag allows expressions for the template to include +--TEMPLATE-- +FOO +{% include foo %} + +BAR +--TEMPLATE(foo.twig)-- +FOOBAR +--DATA-- +return array('foo' => 'foo.twig') +--EXPECT-- +FOO + +FOOBAR +BAR diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test new file mode 100644 index 000000000000..24aed06de2c1 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test @@ -0,0 +1,10 @@ +--TEST-- +"include" tag +--TEMPLATE-- +{% include ["foo.twig", "bar.twig"] ignore missing %} +{% include "foo.twig" ignore missing %} +{% include "foo.twig" ignore missing with {} %} +{% include "foo.twig" ignore missing with {} only %} +--DATA-- +return array() +--EXPECT-- diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/only.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/only.test new file mode 100644 index 000000000000..77760a09eb9f --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/only.test @@ -0,0 +1,16 @@ +--TEST-- +"include" tag accept variables and only +--TEMPLATE-- +{% include "foo.twig" %} +{% include "foo.twig" only %} +{% include "foo.twig" with {'foo1': 'bar'} %} +{% include "foo.twig" with {'foo1': 'bar'} only %} +--TEMPLATE(foo.twig)-- +{% for k, v in _context %}{{ k }},{% endfor %} +--DATA-- +return array('foo' => 'bar') +--EXPECT-- +foo,global,_parent, +global,_parent, +foo,global,foo1,_parent, +foo1,global,_parent, diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/template_instance.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/template_instance.test new file mode 100644 index 000000000000..6ba064a38839 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/template_instance.test @@ -0,0 +1,10 @@ +--TEST-- +"include" tag accepts Twig_Template instance +--TEMPLATE-- +{% include foo %} FOO +--TEMPLATE(foo.twig)-- +BAR +--DATA-- +return array('foo' => $twig->loadTemplate('foo.twig')) +--EXPECT-- +BAR FOO diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/templates_as_array.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/templates_as_array.test new file mode 100644 index 000000000000..ab670ee06d04 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/templates_as_array.test @@ -0,0 +1,12 @@ +--TEST-- +"include" tag +--TEMPLATE-- +{% include ["foo.twig", "bar.twig"] %} +{% include ["bar.twig", "foo.twig"] %} +--TEMPLATE(foo.twig)-- +foo +--DATA-- +return array() +--EXPECT-- +foo +foo diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/with_variables.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/with_variables.test new file mode 100644 index 000000000000..41384ac7c4a3 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/with_variables.test @@ -0,0 +1,12 @@ +--TEST-- +"include" tag accept variables +--TEMPLATE-- +{% include "foo.twig" with {'foo': 'bar'} %} +{% include "foo.twig" with vars %} +--TEMPLATE(foo.twig)-- +{{ foo }} +--DATA-- +return array('vars' => array('foo' => 'bar')) +--EXPECT-- +bar +bar diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/basic.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/basic.test new file mode 100644 index 000000000000..0778a4b49be1 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/basic.test @@ -0,0 +1,14 @@ +--TEST-- +"extends" tag +--TEMPLATE-- +{% extends "foo.twig" %} + +{% block content %} +FOO +{% endblock %} +--TEMPLATE(foo.twig)-- +{% block content %}{% endblock %} +--DATA-- +return array() +--EXPECT-- +FOO diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test new file mode 100644 index 000000000000..8576e773a9f9 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test @@ -0,0 +1,14 @@ +--TEST-- +"extends" tag +--TEMPLATE-- +{% extends standalone ? foo : 'bar.twig' %} + +{% block content %}{{ parent() }}FOO{% endblock %} +--TEMPLATE(foo.twig)-- +{% block content %}FOO{% endblock %} +--TEMPLATE(bar.twig)-- +{% block content %}BAR{% endblock %} +--DATA-- +return array('foo' => 'foo.twig', 'standalone' => true) +--EXPECT-- +FOOFOO diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test new file mode 100644 index 000000000000..ee06ddce3118 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test @@ -0,0 +1,14 @@ +--TEST-- +"extends" tag +--TEMPLATE-- +{% extends foo %} + +{% block content %} +FOO +{% endblock %} +--TEMPLATE(foo.twig)-- +{% block content %}{% endblock %} +--DATA-- +return array('foo' => 'foo.twig') +--EXPECT-- +FOO diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test new file mode 100644 index 000000000000..784f35718c95 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test @@ -0,0 +1,10 @@ +--TEST-- +"extends" tag +--TEMPLATE-- +{% extends "foo.twig" %} +--TEMPLATE(foo.twig)-- +{% block content %}FOO{% endblock %} +--DATA-- +return array() +--EXPECT-- +FOO diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test new file mode 100644 index 000000000000..a1cb1ce8a345 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test @@ -0,0 +1,12 @@ +--TEST-- +"extends" tag +--TEMPLATE-- +{% extends ["foo.twig", "bar.twig"] %} +--TEMPLATE(bar.twig)-- +{% block content %} +foo +{% endblock %} +--DATA-- +return array() +--EXPECT-- +foo diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test new file mode 100644 index 000000000000..dfc2b6c4943b --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test @@ -0,0 +1,12 @@ +--TEST-- +"extends" tag +--TEMPLATE-- +{% extends "layout.twig" %}{% block content %}{{ parent() }}index {% endblock %} +--TEMPLATE(layout.twig)-- +{% extends "base.twig" %}{% block content %}{{ parent() }}layout {% endblock %} +--TEMPLATE(base.twig)-- +{% block content %}base {% endblock %} +--DATA-- +return array() +--EXPECT-- +base layout index diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test new file mode 100644 index 000000000000..faca92591391 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test @@ -0,0 +1,22 @@ +--TEST-- +"block" tag +--TEMPLATE-- +{% extends "foo.twig" %} + +{% block content %} + {% block subcontent %} + {% block subsubcontent %} + SUBSUBCONTENT + {% endblock %} + {% endblock %} +{% endblock %} +--TEMPLATE(foo.twig)-- +{% block content %} + {% block subcontent %} + SUBCONTENT + {% endblock %} +{% endblock %} +--DATA-- +return array() +--EXPECT-- +SUBSUBCONTENT diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test new file mode 100644 index 000000000000..0ad11d0c025e --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test @@ -0,0 +1,15 @@ +--TEST-- +"block" tag +--TEMPLATE-- +{% block content %} + CONTENT + {%- block subcontent -%} + SUBCONTENT + {%- endblock -%} + ENDCONTENT +{% endblock %} +--TEMPLATE(foo.twig)-- +--DATA-- +return array() +--EXPECT-- +CONTENTSUBCONTENTENDCONTENT diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test new file mode 100644 index 000000000000..71e3cdfd4f90 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test @@ -0,0 +1,16 @@ +--TEST-- +"extends" tag +--TEMPLATE-- +{% extends "layout.twig" %} +{% block inside %}INSIDE{% endblock inside %} +--TEMPLATE(layout.twig)-- +{% extends "base.twig" %} +{% block body %} + {% block inside '' %} +{% endblock body %} +--TEMPLATE(base.twig)-- +{% block body '' %} +--DATA-- +return array() +--EXPECT-- +INSIDE diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test new file mode 100644 index 000000000000..4f975db80d4c --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test @@ -0,0 +1,12 @@ +--TEST-- +"extends" tag +--TEMPLATE-- +{% extends "foo.twig" %} + +{% block content %}{{ parent() }}FOO{{ parent() }}{% endblock %} +--TEMPLATE(foo.twig)-- +{% block content %}BAR{% endblock %} +--DATA-- +return array() +--EXPECT-- +BARFOOBAR diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test new file mode 100644 index 000000000000..a8bc90cefd17 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test @@ -0,0 +1,16 @@ +--TEST-- +"extends" tag +--TEMPLATE-- +{% extends foo ? 'foo.twig' : 'bar.twig' %} +--TEMPLATE(foo.twig)-- +FOO +--TEMPLATE(bar.twig)-- +BAR +--DATA-- +return array('foo' => true) +--EXPECT-- +FOO +--DATA-- +return array('foo' => false) +--EXPECT-- +BAR diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_in_a_block.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_in_a_block.test new file mode 100644 index 000000000000..c9e86b1ae704 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_in_a_block.test @@ -0,0 +1,8 @@ +--TEST-- +"extends" tag +--TEMPLATE-- +{% block content %} + {% extends "foo.twig" %} +{% endblock %} +--EXCEPTION-- +Twig_Error_Syntax: Cannot extend from a block in "index.twig" at line 3 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test new file mode 100644 index 000000000000..628167135220 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test @@ -0,0 +1,20 @@ +--TEST-- +"extends" tag +--TEMPLATE-- +{% extends "base.twig" %} +{% block content %}{% include "included.twig" %}{% endblock %} + +{% block footer %}Footer{% endblock %} +--TEMPLATE(included.twig)-- +{% extends "base.twig" %} +{% block content %}Included Content{% endblock %} +--TEMPLATE(base.twig)-- +{% block content %}Default Content{% endblock %} + +{% block footer %}Default Footer{% endblock %} +--DATA-- +return array() +--EXPECT-- +Included Content +Default Footer +Footer diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test new file mode 100644 index 000000000000..71e7c2080ab2 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test @@ -0,0 +1,28 @@ +--TEST-- +"extends" tag +--TEMPLATE-- +{% extends "foo.twig" %} + +{% block content %} + {% block inside %} + INSIDE OVERRIDDEN + {% endblock %} + + BEFORE + {{ parent() }} + AFTER +{% endblock %} +--TEMPLATE(foo.twig)-- +{% block content %} + BAR +{% endblock %} +--DATA-- +return array() +--EXPECT-- + +INSIDE OVERRIDDEN + + BEFORE + BAR + + AFTER diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test new file mode 100644 index 000000000000..a9eaa4c139ac --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test @@ -0,0 +1,8 @@ +--TEST-- +"parent" tag +--TEMPLATE-- +{% block content %} + {{ parent() }} +{% endblock %} +--EXCEPTION-- +Twig_Error_Syntax: Calling "parent" on a template that does not extend nor "use" another template is forbidden in "index.twig" at line 3 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test new file mode 100644 index 000000000000..63c730550b8b --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test @@ -0,0 +1,14 @@ +--TEST-- +"parent" tag +--TEMPLATE-- +{% use 'foo.twig' %} + +{% block content %} + {{ parent() }} +{% endblock %} +--TEMPLATE(foo.twig)-- +{% block content %}BAR{% endblock %} +--DATA-- +return array() +--EXPECT-- +BAR diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test new file mode 100644 index 000000000000..d1876a52df65 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test @@ -0,0 +1,14 @@ +--TEST-- +"extends" tag accepts Twig_Template instance +--TEMPLATE-- +{% extends foo %} + +{% block content %} +{{ parent() }}FOO +{% endblock %} +--TEMPLATE(foo.twig)-- +{% block content %}BAR{% endblock %} +--DATA-- +return array('foo' => $twig->loadTemplate('foo.twig')) +--EXPECT-- +BARFOO diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test new file mode 100644 index 000000000000..8f9ece7ce91f --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test @@ -0,0 +1,44 @@ +--TEST-- +"parent" function +--TEMPLATE-- +{% extends "parent.twig" %} + +{% use "use1.twig" %} +{% use "use2.twig" %} + +{% block content_parent %} + {{ parent() }} +{% endblock %} + +{% block content_use1 %} + {{ parent() }} +{% endblock %} + +{% block content_use2 %} + {{ parent() }} +{% endblock %} + +{% block content %} + {{ block('content_use1_only') }} + {{ block('content_use2_only') }} +{% endblock %} +--TEMPLATE(parent.twig)-- +{% block content_parent 'content_parent' %} +{% block content_use1 'content_parent' %} +{% block content_use2 'content_parent' %} +{% block content '' %} +--TEMPLATE(use1.twig)-- +{% block content_use1 'content_use1' %} +{% block content_use2 'content_use1' %} +{% block content_use1_only 'content_use1_only' %} +--TEMPLATE(use2.twig)-- +{% block content_use2 'content_use2' %} +{% block content_use2_only 'content_use2_only' %} +--DATA-- +return array() +--EXPECT-- + content_parent + content_use1 + content_use2 + content_use1_only + content_use2_only diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test new file mode 100644 index 000000000000..ef59a57c47fa --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test @@ -0,0 +1,15 @@ +--TEST-- +"macro" tag +--TEMPLATE-- +{{ _self.input('username') }} +{{ _self.input('password', null, 'password', 1) }} + +{% macro input(name, value, type, size) %} + <input type="{{ type|default("text") }}" name="{{ name }}" value="{{ value|e|default('') }}" size="{{ size|default(20) }}"> +{% endmacro %} +--DATA-- +return array() +--EXPECT-- + <input type="text" name="username" value="" size="20"> + + <input type="password" name="password" value="" size="1"> diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test new file mode 100644 index 000000000000..fa811892ab51 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test @@ -0,0 +1,14 @@ +--TEST-- +"macro" tag supports name for endmacro +--TEMPLATE-- +{{ _self.foo() }} +{{ _self.bar() }} + +{% macro foo() %}foo{% endmacro %} +{% macro bar() %}bar{% endmacro bar %} +--DATA-- +return array() +--EXPECT-- +foo +bar + diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test new file mode 100644 index 000000000000..5cd3dae66e66 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test @@ -0,0 +1,17 @@ +--TEST-- +"macro" tag +--TEMPLATE-- +{% import 'forms.twig' as forms %} + +{{ forms.input('username') }} +{{ forms.input('password', null, 'password', 1) }} +--TEMPLATE(forms.twig)-- +{% macro input(name, value, type, size) %} + <input type="{{ type|default("text") }}" name="{{ name }}" value="{{ value|e|default('') }}" size="{{ size|default(20) }}"> +{% endmacro %} +--DATA-- +return array() +--EXPECT-- + <input type="text" name="username" value="" size="20"> + + <input type="password" name="password" value="" size="1"> diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test new file mode 100644 index 000000000000..205f59182aa9 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test @@ -0,0 +1,18 @@ +--TEST-- +"macro" tag +--TEMPLATE-- +{% from 'forms.twig' import foo %} +{% from 'forms.twig' import foo as foobar, bar %} + +{{ foo('foo') }} +{{ foobar('foo') }} +{{ bar('foo') }} +--TEMPLATE(forms.twig)-- +{% macro foo(name) %}foo{{ name }}{% endmacro %} +{% macro bar(name) %}bar{{ name }}{% endmacro %} +--DATA-- +return array() +--EXPECT-- +foofoo +foofoo +barfoo diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test new file mode 100644 index 000000000000..6b371768e0ac --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test @@ -0,0 +1,14 @@ +--TEST-- +"macro" tag +--TEMPLATE-- +{% from 'forms.twig' import foo %} + +{{ foo('foo') }} +{{ foo() }} +--TEMPLATE(forms.twig)-- +{% macro foo(name) %}{{ name|default('foo') }}{{ global }}{% endmacro %} +--DATA-- +return array() +--EXPECT-- +fooglobal +fooglobal diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test new file mode 100644 index 000000000000..17756cb6c6a4 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test @@ -0,0 +1,17 @@ +--TEST-- +"macro" tag +--TEMPLATE-- +{% import _self as forms %} + +{{ forms.input('username') }} +{{ forms.input('password', null, 'password', 1) }} + +{% macro input(name, value, type, size) %} + <input type="{{ type|default("text") }}" name="{{ name }}" value="{{ value|e|default('') }}" size="{{ size|default(20) }}"> +{% endmacro %} +--DATA-- +return array() +--EXPECT-- + <input type="text" name="username" value="" size="20"> + + <input type="password" name="password" value="" size="1"> diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test new file mode 100644 index 000000000000..e61716eee47f --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test @@ -0,0 +1,12 @@ +--TEST-- +"☃" as a macro name +--TEMPLATE-- +{{ _self.☃('foo') }} + +{% macro ☃(foo) %} + ☃{{ foo }}☃ +{% endmacro %} +--DATA-- +return array() +--EXPECT-- +☃foo☃ diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.test new file mode 100644 index 000000000000..0445e853057d --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.test @@ -0,0 +1,10 @@ +--TEST-- +"raw" tag +--TEMPLATE-- +{% raw %} +{{ foo }} +{% endraw %} +--DATA-- +return array() +--EXPECT-- +{{ foo }} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.test new file mode 100644 index 000000000000..352bb1876e67 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.test @@ -0,0 +1,56 @@ +--TEST-- +"raw" tag +--TEMPLATE-- +1*** + +{%- raw %} + {{ 'bla' }} +{% endraw %} + +1*** +2*** + +{%- raw -%} + {{ 'bla' }} +{% endraw %} + +2*** +3*** + +{%- raw -%} + {{ 'bla' }} +{% endraw -%} + +3*** +4*** + +{%- raw -%} + {{ 'bla' }} +{%- endraw %} + +4*** +5*** + +{%- raw -%} + {{ 'bla' }} +{%- endraw -%} + +5*** +--DATA-- +return array() +--EXPECT-- +1*** + {{ 'bla' }} + + +1*** +2***{{ 'bla' }} + + +2*** +3***{{ 'bla' }} +3*** +4***{{ 'bla' }} + +4*** +5***{{ 'bla' }}5*** diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test new file mode 100644 index 000000000000..683c59a0e059 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test @@ -0,0 +1,11 @@ +--TEST-- +sandbox tag +--TEMPLATE-- +{%- sandbox %} + {%- include "foo.twig" %} + a +{%- endsandbox %} +--TEMPLATE(foo.twig)-- +foo +--EXCEPTION-- +Twig_Error_Syntax: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 4 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test new file mode 100644 index 000000000000..3dcfa88c7898 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test @@ -0,0 +1,14 @@ +--TEST-- +sandbox tag +--TEMPLATE-- +{%- sandbox %} + {%- include "foo.twig" %} + + {% if 1 %} + {%- include "foo.twig" %} + {% endif %} +{%- endsandbox %} +--TEMPLATE(foo.twig)-- +foo +--EXCEPTION-- +Twig_Error_Syntax: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 5 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test new file mode 100644 index 000000000000..de20f3dba711 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test @@ -0,0 +1,22 @@ +--TEST-- +sandbox tag +--TEMPLATE-- +{%- sandbox %} + {%- include "foo.twig" %} +{%- endsandbox %} + +{%- sandbox %} + {%- include "foo.twig" %} + {%- include "foo.twig" %} +{%- endsandbox %} + +{%- sandbox %}{% include "foo.twig" %}{% endsandbox %} +--TEMPLATE(foo.twig)-- +foo +--DATA-- +return array() +--EXPECT-- +foo +foo +foo +foo diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test new file mode 100644 index 000000000000..a5a9f830ec5a --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test @@ -0,0 +1,20 @@ +--TEST-- +"set" tag +--TEMPLATE-- +{% set foo = 'foo' %} +{% set bar = 'foo<br />' %} + +{{ foo }} +{{ bar }} + +{% set foo, bar = 'foo', 'bar' %} + +{{ foo }}{{ bar }} +--DATA-- +return array() +--EXPECT-- +foo +foo<br /> + + +foobar diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test new file mode 100644 index 000000000000..ec657f0058a0 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test @@ -0,0 +1,9 @@ +--TEST-- +"set" tag block empty capture +--TEMPLATE-- +{% set foo %}{% endset %} + +{% if foo %}FAIL{% endif %} +--DATA-- +return array() +--EXPECT-- diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test new file mode 100644 index 000000000000..f156a1a7f3c3 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test @@ -0,0 +1,10 @@ +--TEST-- +"set" tag block capture +--TEMPLATE-- +{% set foo %}f<br />o<br />o{% endset %} + +{{ foo }} +--DATA-- +return array() +--EXPECT-- +f<br />o<br />o diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test new file mode 100644 index 000000000000..8ff434a013c4 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test @@ -0,0 +1,12 @@ +--TEST-- +"set" tag +--TEMPLATE-- +{% set foo, bar = 'foo' ~ 'bar', 'bar' ~ 'foo' %} + +{{ foo }} +{{ bar }} +--DATA-- +return array() +--EXPECT-- +foobar +barfoo diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test new file mode 100644 index 000000000000..dd06dec25a04 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test @@ -0,0 +1,12 @@ +--TEST-- +"spaceless" tag removes whites between HTML tags +--TEMPLATE-- +{% spaceless %} + + <div> <div> foo </div> </div> + +{% endspaceless %} +--DATA-- +return array() +--EXPECT-- +<div><div> foo </div></div> diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test new file mode 100644 index 000000000000..d584d9ed64b3 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test @@ -0,0 +1,8 @@ +--TEST-- +"☃" custom tag +--TEMPLATE-- +{% ☃ %} +--DATA-- +return array() +--EXPECT-- +☃ diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/trim_block.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/trim_block.test new file mode 100644 index 000000000000..1d2273f88a7e --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/trim_block.test @@ -0,0 +1,74 @@ +--TEST-- +Whitespace trimming on tags. +--TEMPLATE-- +{{ 5 * '{#-'|length }} +{{ '{{-'|length * 5 + '{%-'|length }} + +Trim on control tag: +{% for i in range(1, 9) -%} + {{ i }} +{%- endfor %} + + +Trim on output tag: +{% for i in range(1, 9) %} + {{- i -}} +{% endfor %} + + +Trim comments: + +{#- Invisible -#} + +After the comment. + +Trim leading space: +{% if leading %} + + {{- leading }} +{% endif %} + +{%- if leading %} + {{- leading }} + +{%- endif %} + + +Trim trailing space: +{% if trailing -%} + {{ trailing -}} + +{% endif -%} + +Combined: + +{%- if both -%} +<ul> + <li> {{- both -}} </li> +</ul> + +{%- endif -%} + +end +--DATA-- +return array('leading' => 'leading space', 'trailing' => 'trailing space', 'both' => 'both') +--EXPECT-- +15 +18 + +Trim on control tag: +123456789 + +Trim on output tag: +123456789 + +Trim comments:After the comment. + +Trim leading space: +leading space +leading space + +Trim trailing space: +trailing spaceCombined:<ul> + <li>both</li> +</ul>end diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test new file mode 100644 index 000000000000..f887006f6663 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test @@ -0,0 +1,12 @@ +--TEST-- +"use" tag +--TEMPLATE-- +{% use "blocks.twig" with content as foo %} + +{{ block('foo') }} +--TEMPLATE(blocks.twig)-- +{% block content 'foo' %} +--DATA-- +return array() +--EXPECT-- +foo diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test new file mode 100644 index 000000000000..7364d76de2de --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test @@ -0,0 +1,12 @@ +--TEST-- +"use" tag +--TEMPLATE-- +{% use "blocks.twig" %} + +{{ block('content') }} +--TEMPLATE(blocks.twig)-- +{% block content 'foo' %} +--DATA-- +return array() +--EXPECT-- +foo diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test new file mode 100644 index 000000000000..b551a1e60d3c --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test @@ -0,0 +1,22 @@ +--TEST-- +"use" tag +--TEMPLATE-- +{% use "foo.twig" %} + +{{ block('content') }} +{{ block('foo') }} +{{ block('bar') }} +--TEMPLATE(foo.twig)-- +{% use "bar.twig" %} + +{% block content 'foo' %} +{% block foo 'foo' %} +--TEMPLATE(bar.twig)-- +{% block content 'bar' %} +{% block bar 'bar' %} +--DATA-- +return array() +--EXPECT-- +foo +foo +bar diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test new file mode 100644 index 000000000000..05cca682effc --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test @@ -0,0 +1,10 @@ +--TEST-- +"use" tag +--TEMPLATE-- +{% use "foo.twig" %} +--TEMPLATE(foo.twig)-- +{% use "bar.twig" %} +--TEMPLATE(bar.twig)-- +--DATA-- +return array() +--EXPECT-- diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test new file mode 100644 index 000000000000..198be0c5cda3 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test @@ -0,0 +1,21 @@ +--TEST-- +"use" tag +--TEMPLATE-- +{% use "foo.twig" %} +{% use "bar.twig" %} + +{{ block('content') }} +{{ block('foo') }} +{{ block('bar') }} +--TEMPLATE(foo.twig)-- +{% block content 'foo' %} +{% block foo 'foo' %} +--TEMPLATE(bar.twig)-- +{% block content 'bar' %} +{% block bar 'bar' %} +--DATA-- +return array() +--EXPECT-- +bar +foo +bar diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test new file mode 100644 index 000000000000..8de871a8a555 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test @@ -0,0 +1,23 @@ +--TEST-- +"use" tag +--TEMPLATE-- +{% use "foo.twig" with content as foo_content %} +{% use "bar.twig" %} + +{{ block('content') }} +{{ block('foo') }} +{{ block('bar') }} +{{ block('foo_content') }} +--TEMPLATE(foo.twig)-- +{% block content 'foo' %} +{% block foo 'foo' %} +--TEMPLATE(bar.twig)-- +{% block content 'bar' %} +{% block bar 'bar' %} +--DATA-- +return array() +--EXPECT-- +bar +foo +bar +foo diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test new file mode 100644 index 000000000000..1429d3753c97 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test @@ -0,0 +1,24 @@ +--TEST-- +array index test +--TEMPLATE-- +{% for key, value in days %} +{{ key }} +{% endfor %} +--DATA-- +return array('days' => array( + 1 => array('money' => 9), + 2 => array('money' => 21), + 3 => array('money' => 38), + 4 => array('money' => 6), + 18 => array('money' => 6), + 19 => array('money' => 3), + 31 => array('money' => 11), +)); +--EXPECT-- +1 +2 +3 +4 +18 +19 +31 diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test new file mode 100644 index 000000000000..fb3d288554ce --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test @@ -0,0 +1,12 @@ +--TEST-- +"const" test +--TEMPLATE-- +{{ 8 is constant('E_NOTICE') ? 'ok' : 'no' }} +{{ 'bar' is constant('Foo::BAR_NAME') ? 'ok' : 'no' }} +{{ value is constant('Foo::BAR_NAME') ? 'ok' : 'no' }} +--DATA-- +return array('value' => 'bar'); +--EXPECT-- +ok +ok +ok \ No newline at end of file diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test new file mode 100644 index 000000000000..2fbaa86dca52 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test @@ -0,0 +1,108 @@ +--TEST-- +"defined" test +--TEMPLATE-- +{{ definedVar is defined ? 'ok' : 'ko' }} +{{ definedVar is not defined ? 'ko' : 'ok' }} +{{ undefinedVar is defined ? 'ko' : 'ok' }} +{{ undefinedVar is not defined ? 'ok' : 'ko' }} +{{ zeroVar is defined ? 'ok' : 'ko' }} +{{ nullVar is defined ? 'ok' : 'ko' }} +{{ nested.definedVar is defined ? 'ok' : 'ko' }} +{{ nested['definedVar'] is defined ? 'ok' : 'ko' }} +{{ nested.definedVar is not defined ? 'ko' : 'ok' }} +{{ nested.undefinedVar is defined ? 'ko' : 'ok' }} +{{ nested['undefinedVar'] is defined ? 'ko' : 'ok' }} +{{ nested.undefinedVar is not defined ? 'ok' : 'ko' }} +{{ nested.zeroVar is defined ? 'ok' : 'ko' }} +{{ nested.nullVar is defined ? 'ok' : 'ko' }} +{{ nested.definedArray.0 is defined ? 'ok' : 'ko' }} +{{ nested['definedArray'][0] is defined ? 'ok' : 'ko' }} +{{ object.foo is defined ? 'ok' : 'ko' }} +{{ object.undefinedMethod is defined ? 'ko' : 'ok' }} +{{ object.getFoo() is defined ? 'ok' : 'ko' }} +{{ object.getFoo('a') is defined ? 'ok' : 'ko' }} +{{ object.undefinedMethod() is defined ? 'ko' : 'ok' }} +{{ object.undefinedMethod('a') is defined ? 'ko' : 'ok' }} +{{ object.self.foo is defined ? 'ok' : 'ko' }} +{{ object.self.undefinedMethod is defined ? 'ko' : 'ok' }} +{{ object.undefinedMethod.self is defined ? 'ko' : 'ok' }} +--DATA-- +return array( + 'definedVar' => 'defined', + 'zeroVar' => 0, + 'nullVar' => null, + 'nested' => array( + 'definedVar' => 'defined', + 'zeroVar' => 0, + 'nullVar' => null, + 'definedArray' => array(0), + ), + 'object' => new Foo(), +); +--EXPECT-- +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +--DATA-- +return array( + 'definedVar' => 'defined', + 'zeroVar' => 0, + 'nullVar' => null, + 'nested' => array( + 'definedVar' => 'defined', + 'zeroVar' => 0, + 'nullVar' => null, + 'definedArray' => array(0), + ), + 'object' => new Foo(), +); +--CONFIG-- +return array('strict_variables' => false) +--EXPECT-- +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test new file mode 100644 index 000000000000..a776d032b200 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test @@ -0,0 +1,45 @@ +--TEST-- +"empty" test +--TEMPLATE-- +{{ foo is empty ? 'ok' : 'ko' }} +{{ bar is empty ? 'ok' : 'ko' }} +{{ foobar is empty ? 'ok' : 'ko' }} +{{ array is empty ? 'ok' : 'ko' }} +{{ zero is empty ? 'ok' : 'ko' }} +{{ string is empty ? 'ok' : 'ko' }} +{{ countable_empty is empty ? 'ok' : 'ko' }} +{{ countable_not_empty is empty ? 'ok' : 'ko' }} +{{ markup_empty is empty ? 'ok' : 'ko' }} +{{ markup_not_empty is empty ? 'ok' : 'ko' }} +--DATA-- + +class CountableStub implements Countable +{ + private $items; + + public function __construct(array $items) + { + $this->items = $items; + } + + public function count() + { + return count($this->items); + } +} +return array( + 'foo' => '', 'bar' => null, 'foobar' => false, 'array' => array(), 'zero' => 0, 'string' => '0', + 'countable_empty' => new CountableStub(array()), 'countable_not_empty' => new CountableStub(array(1, 2)), + 'markup_empty' => new Twig_Markup('', 'UTF-8'), 'markup_not_empty' => new Twig_Markup('test', 'UTF-8'), +); +--EXPECT-- +ok +ok +ok +ok +ko +ko +ok +ko +ok +ko diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test new file mode 100644 index 000000000000..695b4c2f8430 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test @@ -0,0 +1,14 @@ +--TEST-- +"even" test +--TEMPLATE-- +{{ 1 is even ? 'ko' : 'ok' }} +{{ 2 is even ? 'ok' : 'ko' }} +{{ 1 is not even ? 'ok' : 'ko' }} +{{ 2 is not even ? 'ko' : 'ok' }} +--DATA-- +return array() +--EXPECT-- +ok +ok +ok +ok diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test new file mode 100644 index 000000000000..45c72fd2cb8c --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test @@ -0,0 +1,48 @@ +--TEST-- +Twig supports the in operator +--TEMPLATE-- +{% if bar in foo %} +TRUE +{% endif %} +{% if not (bar in foo) %} +{% else %} +TRUE +{% endif %} +{% if bar not in foo %} +{% else %} +TRUE +{% endif %} +{% if 'a' in bar %} +TRUE +{% endif %} +{% if 'c' not in bar %} +TRUE +{% endif %} +{% if '' not in bar %} +TRUE +{% endif %} +{% if '' in '' %} +TRUE +{% endif %} +{% if '0' not in '' %} +TRUE +{% endif %} +{% if 'a' not in '0' %} +TRUE +{% endif %} +{% if '0' in '0' %} +TRUE +{% endif %} +--DATA-- +return array('bar' => 'bar', 'foo' => array('bar' => 'bar')) +--EXPECT-- +TRUE +TRUE +TRUE +TRUE +TRUE +TRUE +TRUE +TRUE +TRUE +TRUE diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test new file mode 100644 index 000000000000..ec5255013480 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test @@ -0,0 +1,19 @@ +--TEST-- +"iterable" test +--TEMPLATE-- +{{ foo is iterable ? 'ok' : 'ko' }} +{{ traversable is iterable ? 'ok' : 'ko' }} +{{ obj is iterable ? 'ok' : 'ko' }} +{{ val is iterable ? 'ok' : 'ko' }} +--DATA-- +return array( + 'foo' => array(), + 'traversable' => new ArrayIterator(array()), + 'obj' => new stdClass(), + 'val' => 'test', +); +--EXPECT-- +ok +ok +ko +ko \ No newline at end of file diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test new file mode 100644 index 000000000000..1b8311e3dc35 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test @@ -0,0 +1,10 @@ +--TEST-- +"odd" test +--TEMPLATE-- +{{ 1 is odd ? 'ok' : 'ko' }} +{{ 2 is odd ? 'ko' : 'ok' }} +--DATA-- +return array() +--EXPECT-- +ok +ok \ No newline at end of file diff --git a/core/vendor/twig/twig/test/Twig/Tests/LexerTest.php b/core/vendor/twig/twig/test/Twig/Tests/LexerTest.php new file mode 100644 index 000000000000..ce878988d88e --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/LexerTest.php @@ -0,0 +1,249 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +class Twig_Tests_LexerTest extends PHPUnit_Framework_TestCase +{ + public function testNameLabelForTag() + { + $template = '{% ☃ %}'; + + $lexer = new Twig_Lexer(new Twig_Environment()); + $stream = $lexer->tokenize($template); + + $stream->expect(Twig_Token::BLOCK_START_TYPE); + $this->assertSame('☃', $stream->expect(Twig_Token::NAME_TYPE)->getValue()); + } + + public function testNameLabelForFunction() + { + $template = '{{ ☃() }}'; + + $lexer = new Twig_Lexer(new Twig_Environment()); + $stream = $lexer->tokenize($template); + + $stream->expect(Twig_Token::VAR_START_TYPE); + $this->assertSame('☃', $stream->expect(Twig_Token::NAME_TYPE)->getValue()); + } + + public function testBracketsNesting() + { + $template = '{{ {"a":{"b":"c"}} }}'; + + $this->assertEquals(2, $this->countToken($template, Twig_Token::PUNCTUATION_TYPE, '{')); + $this->assertEquals(2, $this->countToken($template, Twig_Token::PUNCTUATION_TYPE, '}')); + } + + protected function countToken($template, $type, $value = null) + { + $lexer = new Twig_Lexer(new Twig_Environment()); + $stream = $lexer->tokenize($template); + + $count = 0; + $tokens = array(); + while (!$stream->isEOF()) { + $token = $stream->next(); + if ($type === $token->getType()) { + if (null === $value || $value === $token->getValue()) { + ++$count; + } + } + } + + return $count; + } + + public function testLineDirective() + { + $template = "foo\n" + . "bar\n" + . "{% line 10 %}\n" + . "{{\n" + . "baz\n" + . "}}\n"; + + $lexer = new Twig_Lexer(new Twig_Environment()); + $stream = $lexer->tokenize($template); + + // foo\nbar\n + $this->assertSame(1, $stream->expect(Twig_Token::TEXT_TYPE)->getLine()); + // \n (after {% line %}) + $this->assertSame(10, $stream->expect(Twig_Token::TEXT_TYPE)->getLine()); + // {{ + $this->assertSame(11, $stream->expect(Twig_Token::VAR_START_TYPE)->getLine()); + // baz + $this->assertSame(12, $stream->expect(Twig_Token::NAME_TYPE)->getLine()); + } + + public function testLineDirectiveInline() + { + $template = "foo\n" + . "bar{% line 10 %}{{\n" + . "baz\n" + . "}}\n"; + + $lexer = new Twig_Lexer(new Twig_Environment()); + $stream = $lexer->tokenize($template); + + // foo\nbar + $this->assertSame(1, $stream->expect(Twig_Token::TEXT_TYPE)->getLine()); + // {{ + $this->assertSame(10, $stream->expect(Twig_Token::VAR_START_TYPE)->getLine()); + // baz + $this->assertSame(11, $stream->expect(Twig_Token::NAME_TYPE)->getLine()); + } + + public function testLongComments() + { + $template = '{# '.str_repeat('*', 100000).' #}'; + + $lexer = new Twig_Lexer(new Twig_Environment()); + $lexer->tokenize($template); + + // should not throw an exception + } + + public function testLongRaw() + { + $template = '{% raw %}'.str_repeat('*', 100000).'{% endraw %}'; + + $lexer = new Twig_Lexer(new Twig_Environment()); + $stream = $lexer->tokenize($template); + + // should not throw an exception + } + + public function testLongVar() + { + $template = '{{ '.str_repeat('x', 100000).' }}'; + + $lexer = new Twig_Lexer(new Twig_Environment()); + $stream = $lexer->tokenize($template); + + // should not throw an exception + } + + public function testLongBlock() + { + $template = '{% '.str_repeat('x', 100000).' %}'; + + $lexer = new Twig_Lexer(new Twig_Environment()); + $stream = $lexer->tokenize($template); + + // should not throw an exception + } + + public function testBigNumbers() + { + $template = '{{ 922337203685477580700 }}'; + + $lexer = new Twig_Lexer(new Twig_Environment()); + $stream = $lexer->tokenize($template); + $node = $stream->next(); + $node = $stream->next(); + $this->assertEquals(922337203685477580700, $node->getValue()); + } + + public function testString() + { + $template = 'foo {{ "bar #{ baz + 1 }" }}'; + + $lexer = new Twig_Lexer(new Twig_Environment()); + $stream = $lexer->tokenize($template); + $stream->expect(Twig_Token::TEXT_TYPE, 'foo '); + $stream->expect(Twig_Token::VAR_START_TYPE); + $stream->expect(Twig_Token::STRING_TYPE, 'bar '); + $stream->expect(Twig_Token::INTERPOLATION_START_TYPE); + $stream->expect(Twig_Token::NAME_TYPE, 'baz'); + $stream->expect(Twig_Token::OPERATOR_TYPE, '+'); + $stream->expect(Twig_Token::NUMBER_TYPE, '1'); + $stream->expect(Twig_Token::INTERPOLATION_END_TYPE); + $stream->expect(Twig_Token::VAR_END_TYPE); + } + + public function testStringWithEscapedInterpolation() + { + $template = '{{ "bar \#{baz+1}" }}'; + + $lexer = new Twig_Lexer(new Twig_Environment()); + $stream = $lexer->tokenize($template); + $stream->expect(Twig_Token::VAR_START_TYPE); + $stream->expect(Twig_Token::STRING_TYPE, 'bar #{baz+1}'); + $stream->expect(Twig_Token::VAR_END_TYPE); + } + + public function testStringWithHash() + { + $template = '{{ "bar # baz" }}'; + + $lexer = new Twig_Lexer(new Twig_Environment()); + $stream = $lexer->tokenize($template); + $stream->expect(Twig_Token::VAR_START_TYPE); + $stream->expect(Twig_Token::STRING_TYPE, 'bar # baz'); + $stream->expect(Twig_Token::VAR_END_TYPE); + } + + /** + * @expectedException Twig_Error_Syntax + * @expectedExceptionMessage Unclosed """ + */ + public function testStringWithUnterminatedInterpolation() + { + $template = '{{ "bar #{x" }}'; + + $lexer = new Twig_Lexer(new Twig_Environment()); + $stream = $lexer->tokenize($template); + } + + public function testStringWithNestedInterpolations() + { + $template = '{{ "bar #{ "foo#{bar}" }" }}'; + + $lexer = new Twig_Lexer(new Twig_Environment()); + $stream = $lexer->tokenize($template); + $stream->expect(Twig_Token::VAR_START_TYPE); + $stream->expect(Twig_Token::STRING_TYPE, 'bar '); + $stream->expect(Twig_Token::INTERPOLATION_START_TYPE); + $stream->expect(Twig_Token::STRING_TYPE, 'foo'); + $stream->expect(Twig_Token::INTERPOLATION_START_TYPE); + $stream->expect(Twig_Token::NAME_TYPE, 'bar'); + $stream->expect(Twig_Token::INTERPOLATION_END_TYPE); + $stream->expect(Twig_Token::INTERPOLATION_END_TYPE); + $stream->expect(Twig_Token::VAR_END_TYPE); + } + + public function testStringWithNestedInterpolationsInBlock() + { + $template = '{% foo "bar #{ "foo#{bar}" }" %}'; + + $lexer = new Twig_Lexer(new Twig_Environment()); + $stream = $lexer->tokenize($template); + $stream->expect(Twig_Token::BLOCK_START_TYPE); + $stream->expect(Twig_Token::NAME_TYPE, 'foo'); + $stream->expect(Twig_Token::STRING_TYPE, 'bar '); + $stream->expect(Twig_Token::INTERPOLATION_START_TYPE); + $stream->expect(Twig_Token::STRING_TYPE, 'foo'); + $stream->expect(Twig_Token::INTERPOLATION_START_TYPE); + $stream->expect(Twig_Token::NAME_TYPE, 'bar'); + $stream->expect(Twig_Token::INTERPOLATION_END_TYPE); + $stream->expect(Twig_Token::INTERPOLATION_END_TYPE); + $stream->expect(Twig_Token::BLOCK_END_TYPE); + } + + public function testOperatorEndingWithALetterAtTheEndOfALine() + { + $template = "{{ 1 and\n0}}"; + + $lexer = new Twig_Lexer(new Twig_Environment()); + $stream = $lexer->tokenize($template); + $stream->expect(Twig_Token::VAR_START_TYPE); + $stream->expect(Twig_Token::NUMBER_TYPE, 1); + $stream->expect(Twig_Token::OPERATOR_TYPE, 'and'); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php b/core/vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php new file mode 100644 index 000000000000..1369a6bd0c1e --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php @@ -0,0 +1,97 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +class Twig_Tests_Loader_ArrayTest extends PHPUnit_Framework_TestCase +{ + public function testGetSource() + { + $loader = new Twig_Loader_Array(array('foo' => 'bar')); + + $this->assertEquals('bar', $loader->getSource('foo')); + } + + /** + * @expectedException Twig_Error_Loader + */ + public function testGetSourceWhenTemplateDoesNotExist() + { + $loader = new Twig_Loader_Array(array()); + + $loader->getSource('foo'); + } + + public function testGetCacheKey() + { + $loader = new Twig_Loader_Array(array('foo' => 'bar')); + + $this->assertEquals('bar', $loader->getCacheKey('foo')); + } + + /** + * @expectedException Twig_Error_Loader + */ + public function testGetCacheKeyWhenTemplateDoesNotExist() + { + $loader = new Twig_Loader_Array(array()); + + $loader->getCacheKey('foo'); + } + + public function testSetTemplate() + { + $loader = new Twig_Loader_Array(array()); + $loader->setTemplate('foo', 'bar'); + + $this->assertEquals('bar', $loader->getSource('foo')); + } + + public function testIsFresh() + { + $loader = new Twig_Loader_Array(array('foo' => 'bar')); + $this->assertTrue($loader->isFresh('foo', time())); + } + + /** + * @expectedException Twig_Error_Loader + */ + public function testIsFreshWhenTemplateDoesNotExist() + { + $loader = new Twig_Loader_Array(array()); + + $loader->isFresh('foo', time()); + } + + public function testTemplateReference() + { + $name = new Twig_Test_Loader_TemplateReference('foo'); + $loader = new Twig_Loader_Array(array('foo' => 'bar')); + + $loader->getCacheKey($name); + $loader->getSource($name); + $loader->isFresh($name, time()); + $loader->setTemplate($name, 'foobar'); + } +} + +class Twig_Test_Loader_TemplateReference +{ + private $name; + + public function __construct($name) + { + $this->name = $name; + } + + public function __toString() + { + return $this->name; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php b/core/vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php new file mode 100644 index 000000000000..580ae10508e5 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php @@ -0,0 +1,63 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +class Twig_Tests_Loader_ChainTest extends PHPUnit_Framework_TestCase +{ + public function testGetSource() + { + $loader = new Twig_Loader_Chain(array( + new Twig_Loader_Array(array('foo' => 'bar')), + new Twig_Loader_Array(array('foo' => 'foobar', 'bar' => 'foo')), + )); + + $this->assertEquals('bar', $loader->getSource('foo')); + $this->assertEquals('foo', $loader->getSource('bar')); + } + + /** + * @expectedException Twig_Error_Loader + */ + public function testGetSourceWhenTemplateDoesNotExist() + { + $loader = new Twig_Loader_Chain(array()); + + $loader->getSource('foo'); + } + + public function testGetCacheKey() + { + $loader = new Twig_Loader_Chain(array( + new Twig_Loader_Array(array('foo' => 'bar')), + new Twig_Loader_Array(array('foo' => 'foobar', 'bar' => 'foo')), + )); + + $this->assertEquals('bar', $loader->getCacheKey('foo')); + $this->assertEquals('foo', $loader->getCacheKey('bar')); + } + + /** + * @expectedException Twig_Error_Loader + */ + public function testGetCacheKeyWhenTemplateDoesNotExist() + { + $loader = new Twig_Loader_Chain(array()); + + $loader->getCacheKey('foo'); + } + + public function testAddLoader() + { + $loader = new Twig_Loader_Chain(); + $loader->addLoader(new Twig_Loader_Array(array('foo' => 'bar'))); + + $this->assertEquals('bar', $loader->getSource('foo')); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php b/core/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php new file mode 100644 index 000000000000..22ae5aa0afb8 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php @@ -0,0 +1,52 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +class Twig_Tests_Loader_FilesystemTest extends PHPUnit_Framework_TestCase +{ + /** + * @dataProvider getSecurityTests + */ + public function testSecurity($template) + { + $loader = new Twig_Loader_Filesystem(array(dirname(__FILE__).'/../Fixtures')); + + try { + $loader->getCacheKey($template); + $this->fail(); + } catch (Twig_Error_Loader $e) { + $this->assertNotContains('Unable to find template', $e->getMessage()); + } + } + + public function getSecurityTests() + { + return array( + array("AutoloaderTest\0.php"), + array('..\\AutoloaderTest.php'), + array('..\\\\\\AutoloaderTest.php'), + array('../AutoloaderTest.php'), + array('..////AutoloaderTest.php'), + array('./../AutoloaderTest.php'), + array('.\\..\\AutoloaderTest.php'), + array('././././././../AutoloaderTest.php'), + array('.\\./.\\./.\\./../AutoloaderTest.php'), + array('foo/../../AutoloaderTest.php'), + array('foo\\..\\..\\AutoloaderTest.php'), + array('foo/../bar/../../AutoloaderTest.php'), + array('foo/bar/../../../AutoloaderTest.php'), + array('filters/../../AutoloaderTest.php'), + array('filters//..//..//AutoloaderTest.php'), + array('filters\\..\\..\\AutoloaderTest.php'), + array('filters\\\\..\\\\..\\\\AutoloaderTest.php'), + array('filters\\//../\\/\\..\\AutoloaderTest.php'), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php new file mode 100644 index 000000000000..ebfcb48952ff --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php @@ -0,0 +1,46 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/TestCase.php'; + +class Twig_Tests_Node_AutoEscapeTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_AutoEscape::__construct + */ + public function testConstructor() + { + $body = new Twig_Node(array(new Twig_Node_Text('foo', 0))); + $node = new Twig_Node_AutoEscape(true, $body, 0); + + $this->assertEquals($body, $node->getNode('body')); + $this->assertEquals(true, $node->getAttribute('value')); + } + + /** + * @covers Twig_Node_AutoEscape::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $body = new Twig_Node(array(new Twig_Node_Text('foo', 0))); + $node = new Twig_Node_AutoEscape(true, $body, 0); + + return array( + array($node, 'echo "foo";'), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php new file mode 100644 index 000000000000..f1c5ab1a1cba --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php @@ -0,0 +1,41 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/TestCase.php'; + +class Twig_Tests_Node_BlockReferenceTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_BlockReference::__construct + */ + public function testConstructor() + { + $node = new Twig_Node_BlockReference('foo', 0); + + $this->assertEquals('foo', $node->getAttribute('name')); + } + + /** + * @covers Twig_Node_BlockReference::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + return array( + array(new Twig_Node_BlockReference('foo', 0), '$this->displayBlock(\'foo\', $context, $blocks);'), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php new file mode 100644 index 000000000000..6bc5e79158e4 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php @@ -0,0 +1,52 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/TestCase.php'; + +class Twig_Tests_Node_BlockTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Block::__construct + */ + public function testConstructor() + { + $body = new Twig_Node_Text('foo', 0); + $node = new Twig_Node_Block('foo', $body, 0); + + $this->assertEquals($body, $node->getNode('body')); + $this->assertEquals('foo', $node->getAttribute('name')); + } + + /** + * @covers Twig_Node_Block::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $body = new Twig_Node_Text('foo', 0); + $node = new Twig_Node_Block('foo', $body, 0); + + return array( + array($node, <<<EOF +public function block_foo(\$context, array \$blocks = array()) +{ + echo "foo"; +} +EOF + ), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/DoTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/DoTest.php new file mode 100644 index 000000000000..49c2a595c70b --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/DoTest.php @@ -0,0 +1,46 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/TestCase.php'; + +class Twig_Tests_Node_DoTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Do::__construct + */ + public function testConstructor() + { + $expr = new Twig_Node_Expression_Constant('foo', 0); + $node = new Twig_Node_Do($expr, 0); + + $this->assertEquals($expr, $node->getNode('expr')); + } + + /** + * @covers Twig_Node_Do::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $tests = array(); + + $expr = new Twig_Node_Expression_Constant('foo', 0); + $node = new Twig_Node_Do($expr, 0); + $tests[] = array($node, '"foo";'); + + return $tests; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php new file mode 100644 index 000000000000..06b30e94862f --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php @@ -0,0 +1,51 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../TestCase.php'; + +class Twig_Tests_Node_Expression_ArrayTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Array::__construct + */ + public function testConstructor() + { + $elements = array(new Twig_Node_Expression_Constant('foo', 0), $foo = new Twig_Node_Expression_Constant('bar', 0)); + $node = new Twig_Node_Expression_Array($elements, 0); + + $this->assertEquals($foo, $node->getNode(1)); + } + + /** + * @covers Twig_Node_Expression_Array::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $elements = array( + new Twig_Node_Expression_Constant('foo', 0), + new Twig_Node_Expression_Constant('bar', 0), + + new Twig_Node_Expression_Constant('bar', 0), + new Twig_Node_Expression_Constant('foo', 0), + ); + $node = new Twig_Node_Expression_Array($elements, 0); + + return array( + array($node, 'array("foo" => "bar", "bar" => "foo")'), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php new file mode 100644 index 000000000000..fc92b0dcc1e3 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php @@ -0,0 +1,43 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../TestCase.php'; + +class Twig_Tests_Node_Expression_AssignNameTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_AssignName::__construct + */ + public function testConstructor() + { + $node = new Twig_Node_Expression_AssignName('foo', 0); + + $this->assertEquals('foo', $node->getAttribute('name')); + } + + /** + * @covers Twig_Node_Expression_AssignName::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $node = new Twig_Node_Expression_AssignName('foo', 0); + + return array( + array($node, '$context["foo"]'), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php new file mode 100644 index 000000000000..80d318f3aa0b --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php @@ -0,0 +1,49 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../../TestCase.php'; + +class Twig_Tests_Node_Expression_Binary_AddTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Binary_Add::__construct + */ + public function testConstructor() + { + $left = new Twig_Node_Expression_Constant(1, 0); + $right = new Twig_Node_Expression_Constant(2, 0); + $node = new Twig_Node_Expression_Binary_Add($left, $right, 0); + + $this->assertEquals($left, $node->getNode('left')); + $this->assertEquals($right, $node->getNode('right')); + } + + /** + * @covers Twig_Node_Expression_Binary_Add::compile + * @covers Twig_Node_Expression_Binary_Add::operator + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $left = new Twig_Node_Expression_Constant(1, 0); + $right = new Twig_Node_Expression_Constant(2, 0); + $node = new Twig_Node_Expression_Binary_Add($left, $right, 0); + + return array( + array($node, '(1 + 2)'), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php new file mode 100644 index 000000000000..a6ed4f236ebb --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php @@ -0,0 +1,49 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../../TestCase.php'; + +class Twig_Tests_Node_Expression_Binary_AndTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Binary_And::__construct + */ + public function testConstructor() + { + $left = new Twig_Node_Expression_Constant(1, 0); + $right = new Twig_Node_Expression_Constant(2, 0); + $node = new Twig_Node_Expression_Binary_And($left, $right, 0); + + $this->assertEquals($left, $node->getNode('left')); + $this->assertEquals($right, $node->getNode('right')); + } + + /** + * @covers Twig_Node_Expression_Binary_And::compile + * @covers Twig_Node_Expression_Binary_And::operator + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $left = new Twig_Node_Expression_Constant(1, 0); + $right = new Twig_Node_Expression_Constant(2, 0); + $node = new Twig_Node_Expression_Binary_And($left, $right, 0); + + return array( + array($node, '(1 && 2)'), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php new file mode 100644 index 000000000000..a04edc976edb --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php @@ -0,0 +1,49 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../../TestCase.php'; + +class Twig_Tests_Node_Expression_Binary_ConcatTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Binary_Concat::__construct + */ + public function testConstructor() + { + $left = new Twig_Node_Expression_Constant(1, 0); + $right = new Twig_Node_Expression_Constant(2, 0); + $node = new Twig_Node_Expression_Binary_Concat($left, $right, 0); + + $this->assertEquals($left, $node->getNode('left')); + $this->assertEquals($right, $node->getNode('right')); + } + + /** + * @covers Twig_Node_Expression_Binary_Concat::compile + * @covers Twig_Node_Expression_Binary_Concat::operator + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $left = new Twig_Node_Expression_Constant(1, 0); + $right = new Twig_Node_Expression_Constant(2, 0); + $node = new Twig_Node_Expression_Binary_Concat($left, $right, 0); + + return array( + array($node, '(1 . 2)'), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php new file mode 100644 index 000000000000..42002fc13f1c --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php @@ -0,0 +1,49 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../../TestCase.php'; + +class Twig_Tests_Node_Expression_Binary_DivTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Binary_Div::__construct + */ + public function testConstructor() + { + $left = new Twig_Node_Expression_Constant(1, 0); + $right = new Twig_Node_Expression_Constant(2, 0); + $node = new Twig_Node_Expression_Binary_Div($left, $right, 0); + + $this->assertEquals($left, $node->getNode('left')); + $this->assertEquals($right, $node->getNode('right')); + } + + /** + * @covers Twig_Node_Expression_Binary_Div::compile + * @covers Twig_Node_Expression_Binary_Div::operator + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $left = new Twig_Node_Expression_Constant(1, 0); + $right = new Twig_Node_Expression_Constant(2, 0); + $node = new Twig_Node_Expression_Binary_Div($left, $right, 0); + + return array( + array($node, '(1 / 2)'), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php new file mode 100644 index 000000000000..94ff2f644a7d --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php @@ -0,0 +1,49 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../../TestCase.php'; + +class Twig_Tests_Node_Expression_Binary_FloorDivTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Binary_FloorDiv::__construct + */ + public function testConstructor() + { + $left = new Twig_Node_Expression_Constant(1, 0); + $right = new Twig_Node_Expression_Constant(2, 0); + $node = new Twig_Node_Expression_Binary_FloorDiv($left, $right, 0); + + $this->assertEquals($left, $node->getNode('left')); + $this->assertEquals($right, $node->getNode('right')); + } + + /** + * @covers Twig_Node_Expression_Binary_FloorDiv::compile + * @covers Twig_Node_Expression_Binary_FloorDiv::operator + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $left = new Twig_Node_Expression_Constant(1, 0); + $right = new Twig_Node_Expression_Constant(2, 0); + $node = new Twig_Node_Expression_Binary_FloorDiv($left, $right, 0); + + return array( + array($node, 'intval(floor((1 / 2)))'), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php new file mode 100644 index 000000000000..67612a547141 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php @@ -0,0 +1,49 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../../TestCase.php'; + +class Twig_Tests_Node_Expression_Binary_ModTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Binary_Mod::__construct + */ + public function testConstructor() + { + $left = new Twig_Node_Expression_Constant(1, 0); + $right = new Twig_Node_Expression_Constant(2, 0); + $node = new Twig_Node_Expression_Binary_Mod($left, $right, 0); + + $this->assertEquals($left, $node->getNode('left')); + $this->assertEquals($right, $node->getNode('right')); + } + + /** + * @covers Twig_Node_Expression_Binary_Mod::compile + * @covers Twig_Node_Expression_Binary_Mod::operator + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $left = new Twig_Node_Expression_Constant(1, 0); + $right = new Twig_Node_Expression_Constant(2, 0); + $node = new Twig_Node_Expression_Binary_Mod($left, $right, 0); + + return array( + array($node, '(1 % 2)'), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php new file mode 100644 index 000000000000..c817d0246a58 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php @@ -0,0 +1,49 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../../TestCase.php'; + +class Twig_Tests_Node_Expression_Binary_MulTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Binary_Mul::__construct + */ + public function testConstructor() + { + $left = new Twig_Node_Expression_Constant(1, 0); + $right = new Twig_Node_Expression_Constant(2, 0); + $node = new Twig_Node_Expression_Binary_Mul($left, $right, 0); + + $this->assertEquals($left, $node->getNode('left')); + $this->assertEquals($right, $node->getNode('right')); + } + + /** + * @covers Twig_Node_Expression_Binary_Mul::compile + * @covers Twig_Node_Expression_Binary_Mul::operator + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $left = new Twig_Node_Expression_Constant(1, 0); + $right = new Twig_Node_Expression_Constant(2, 0); + $node = new Twig_Node_Expression_Binary_Mul($left, $right, 0); + + return array( + array($node, '(1 * 2)'), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php new file mode 100644 index 000000000000..d8e2f8da0c98 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php @@ -0,0 +1,49 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../../TestCase.php'; + +class Twig_Tests_Node_Expression_Binary_OrTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Binary_Or::__construct + */ + public function testConstructor() + { + $left = new Twig_Node_Expression_Constant(1, 0); + $right = new Twig_Node_Expression_Constant(2, 0); + $node = new Twig_Node_Expression_Binary_Or($left, $right, 0); + + $this->assertEquals($left, $node->getNode('left')); + $this->assertEquals($right, $node->getNode('right')); + } + + /** + * @covers Twig_Node_Expression_Binary_Or::compile + * @covers Twig_Node_Expression_Binary_Or::operator + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $left = new Twig_Node_Expression_Constant(1, 0); + $right = new Twig_Node_Expression_Constant(2, 0); + $node = new Twig_Node_Expression_Binary_Or($left, $right, 0); + + return array( + array($node, '(1 || 2)'), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php new file mode 100644 index 000000000000..6583d09f113d --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php @@ -0,0 +1,49 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../../TestCase.php'; + +class Twig_Tests_Node_Expression_Binary_SubTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Binary_Sub::__construct + */ + public function testConstructor() + { + $left = new Twig_Node_Expression_Constant(1, 0); + $right = new Twig_Node_Expression_Constant(2, 0); + $node = new Twig_Node_Expression_Binary_Sub($left, $right, 0); + + $this->assertEquals($left, $node->getNode('left')); + $this->assertEquals($right, $node->getNode('right')); + } + + /** + * @covers Twig_Node_Expression_Binary_Sub::compile + * @covers Twig_Node_Expression_Binary_Sub::operator + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $left = new Twig_Node_Expression_Constant(1, 0); + $right = new Twig_Node_Expression_Constant(2, 0); + $node = new Twig_Node_Expression_Binary_Sub($left, $right, 0); + + return array( + array($node, '(1 - 2)'), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php new file mode 100644 index 000000000000..4a05e4e7ef79 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php @@ -0,0 +1,52 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../TestCase.php'; + +class Twig_Tests_Node_Expression_ConditionalTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Conditional::__construct + */ + public function testConstructor() + { + $expr1 = new Twig_Node_Expression_Constant(1, 0); + $expr2 = new Twig_Node_Expression_Constant(2, 0); + $expr3 = new Twig_Node_Expression_Constant(3, 0); + $node = new Twig_Node_Expression_Conditional($expr1, $expr2, $expr3, 0); + + $this->assertEquals($expr1, $node->getNode('expr1')); + $this->assertEquals($expr2, $node->getNode('expr2')); + $this->assertEquals($expr3, $node->getNode('expr3')); + } + + /** + * @covers Twig_Node_Expression_Conditional::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $tests = array(); + + $expr1 = new Twig_Node_Expression_Constant(1, 0); + $expr2 = new Twig_Node_Expression_Constant(2, 0); + $expr3 = new Twig_Node_Expression_Constant(3, 0); + $node = new Twig_Node_Expression_Conditional($expr1, $expr2, $expr3, 0); + $tests[] = array($node, '((1) ? (2) : (3))'); + + return $tests; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php new file mode 100644 index 000000000000..0cf38672b4de --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php @@ -0,0 +1,44 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../TestCase.php'; + +class Twig_Tests_Node_Expression_ConstantTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Constant::__construct + */ + public function testConstructor() + { + $node = new Twig_Node_Expression_Constant('foo', 0); + + $this->assertEquals('foo', $node->getAttribute('value')); + } + + /** + * @covers Twig_Node_Expression_Constant::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $tests = array(); + + $node = new Twig_Node_Expression_Constant('foo', 0); + $tests[] = array($node, '"foo"'); + + return $tests; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php new file mode 100644 index 000000000000..2c524824e7a1 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php @@ -0,0 +1,85 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../TestCase.php'; + +class Twig_Tests_Node_Expression_FilterTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Filter::__construct + */ + public function testConstructor() + { + $expr = new Twig_Node_Expression_Constant('foo', 0); + $name = new Twig_Node_Expression_Constant('upper', 0); + $args = new Twig_Node(); + $node = new Twig_Node_Expression_Filter($expr, $name, $args, 0); + + $this->assertEquals($expr, $node->getNode('node')); + $this->assertEquals($name, $node->getNode('filter')); + $this->assertEquals($args, $node->getNode('arguments')); + } + + /** + * @covers Twig_Node_Expression_Filter::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + + $expr = new Twig_Node_Expression_Constant('foo', 0); + $node = $this->createFilter($expr, 'foobar', array(new Twig_Node_Expression_Constant('bar', 0), new Twig_Node_Expression_Constant('foobar', 0))); + + try { + $node->compile($this->getCompiler()); + $this->fail(); + } catch (Exception $e) { + $this->assertEquals('Twig_Error_Syntax', get_class($e)); + } + } + + public function getTests() + { + $tests = array(); + + $expr = new Twig_Node_Expression_Constant('foo', 0); + $node = $this->createFilter($expr, 'upper'); + $node = $this->createFilter($node, 'lower', array(new Twig_Node_Expression_Constant('bar', 0), new Twig_Node_Expression_Constant('foobar', 0))); + + if (function_exists('mb_get_info')) { + $tests[] = array($node, 'twig_lower_filter($this->env, twig_upper_filter($this->env, "foo"), "bar", "foobar")'); + } else { + $tests[] = array($node, 'strtolower(strtoupper("foo"), "bar", "foobar")'); + } + + return $tests; + } + + /** + * @covers Twig_Node_Expression_Filter::compile + * @expectedException Twig_Error_Syntax + * @expectedExceptionMessage The filter "uppe" does not exist. Did you mean "upper" at line 0 + */ + public function testUnknownFilter() + { + $node = $this->createFilter(new Twig_Node_Expression_Constant('foo', 0), 'uppe'); + $node->compile($this->getCompiler()); + } + + protected function createFilter($node, $name, array $arguments = array()) + { + $name = new Twig_Node_Expression_Constant($name, 0); + $arguments = new Twig_Node($arguments); + + return new Twig_Node_Expression_Filter($node, $name, $arguments, 0); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php new file mode 100644 index 000000000000..68c5c6177422 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php @@ -0,0 +1,90 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../TestCase.php'; + +class Twig_Tests_Node_Expression_FunctionTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Function::__construct + */ + public function testConstructor() + { + $name = 'function'; + $args = new Twig_Node(); + $node = new Twig_Node_Expression_Function($name, $args, 0); + + $this->assertEquals($name, $node->getAttribute('name')); + $this->assertEquals($args, $node->getNode('arguments')); + } + + /** + * @covers Twig_Node_Expression_Function::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + /** + * @covers Twig_Node_Expression_Filter::compile + * @expectedException Twig_Error_Syntax + * @expectedExceptionMessage The function "cycl" does not exist. Did you mean "cycle" at line 0 + */ + public function testUnknownFunction() + { + $node = $this->createFunction('cycl', array()); + $node->compile($this->getCompiler()); + } + + public function getTests() + { + $environment = new Twig_Environment(); + $environment->addFunction('foo', new Twig_Function_Function('foo', array())); + $environment->addFunction('bar', new Twig_Function_Function('bar', array('needs_environment' => true))); + $environment->addFunction('foofoo', new Twig_Function_Function('foofoo', array('needs_context' => true))); + $environment->addFunction('foobar', new Twig_Function_Function('foobar', array('needs_environment' => true, 'needs_context' => true))); + + $tests = array(); + + $node = $this->createFunction('foo'); + $tests[] = array($node, 'foo()', $environment); + + $node = $this->createFunction('foo', array(new Twig_Node_Expression_Constant('bar', 0), new Twig_Node_Expression_Constant('foobar', 0))); + $tests[] = array($node, 'foo("bar", "foobar")', $environment); + + $node = $this->createFunction('bar'); + $tests[] = array($node, 'bar($this->env)', $environment); + + $node = $this->createFunction('bar', array(new Twig_Node_Expression_Constant('bar', 0))); + $tests[] = array($node, 'bar($this->env, "bar")', $environment); + + $node = $this->createFunction('foofoo'); + $tests[] = array($node, 'foofoo($context)', $environment); + + $node = $this->createFunction('foofoo', array(new Twig_Node_Expression_Constant('bar', 0))); + $tests[] = array($node, 'foofoo($context, "bar")', $environment); + + $node = $this->createFunction('foobar'); + $tests[] = array($node, 'foobar($this->env, $context)', $environment); + + $node = $this->createFunction('foobar', array(new Twig_Node_Expression_Constant('bar', 0))); + $tests[] = array($node, 'foobar($this->env, $context, "bar")', $environment); + + return $tests; + } + + protected function createFunction($name, array $arguments = array()) + { + return new Twig_Node_Expression_Function($name, new Twig_Node($arguments), 0); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php new file mode 100644 index 000000000000..6df143de622b --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php @@ -0,0 +1,64 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../TestCase.php'; + +class Twig_Tests_Node_Expression_GetAttrTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_GetAttr::__construct + */ + public function testConstructor() + { + $expr = new Twig_Node_Expression_Name('foo', 0); + $attr = new Twig_Node_Expression_Constant('bar', 0); + $args = new Twig_Node_Expression_Array(array(), 0); + $args->addElement(new Twig_Node_Expression_Name('foo', 0)); + $args->addElement(new Twig_Node_Expression_Constant('bar', 0)); + $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_TemplateInterface::ARRAY_CALL, 0); + + $this->assertEquals($expr, $node->getNode('node')); + $this->assertEquals($attr, $node->getNode('attribute')); + $this->assertEquals($args, $node->getNode('arguments')); + $this->assertEquals(Twig_TemplateInterface::ARRAY_CALL, $node->getAttribute('type')); + } + + /** + * @covers Twig_Node_Expression_GetAttr::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $tests = array(); + + $expr = new Twig_Node_Expression_Name('foo', 0); + $attr = new Twig_Node_Expression_Constant('bar', 0); + $args = new Twig_Node_Expression_Array(array(), 0); + $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_TemplateInterface::ANY_CALL, 0); + $tests[] = array($node, sprintf('%s%s, "bar")', $this->getAttributeGetter(), $this->getVariableGetter('foo'))); + + $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_TemplateInterface::ARRAY_CALL, 0); + $tests[] = array($node, sprintf('%s%s, "bar", array(), "array")', $this->getAttributeGetter(), $this->getVariableGetter('foo'))); + + $args = new Twig_Node_Expression_Array(array(), 0); + $args->addElement(new Twig_Node_Expression_Name('foo', 0)); + $args->addElement(new Twig_Node_Expression_Constant('bar', 0)); + $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_TemplateInterface::METHOD_CALL, 0); + $tests[] = array($node, sprintf('%s%s, "bar", array(0 => %s, 1 => "bar"), "method")', $this->getAttributeGetter(), $this->getVariableGetter('foo'), $this->getVariableGetter('foo'))); + + return $tests; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php new file mode 100644 index 000000000000..e77b432e2fa7 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php @@ -0,0 +1,51 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../TestCase.php'; + +class Twig_Tests_Node_Expression_NameTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Name::__construct + */ + public function testConstructor() + { + $node = new Twig_Node_Expression_Name('foo', 0); + + $this->assertEquals('foo', $node->getAttribute('name')); + } + + /** + * @covers Twig_Node_Expression_Name::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $node = new Twig_Node_Expression_Name('foo', 0); + $self = new Twig_Node_Expression_Name('_self', 0); + $context = new Twig_Node_Expression_Name('_context', 0); + + $env = new Twig_Environment(null, array('strict_variables' => true)); + $env1 = new Twig_Environment(null, array('strict_variables' => false)); + + return array( + array($node, '$this->getContext($context, "foo")', $env), + array($node, $this->getVariableGetter('foo'), $env1), + array($self, '$this'), + array($context, '$context'), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php new file mode 100644 index 000000000000..7efbe03180b6 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php @@ -0,0 +1,42 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../TestCase.php'; + +class Twig_Tests_Node_Expression_ParentTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Parent::__construct + */ + public function testConstructor() + { + $node = new Twig_Node_Expression_Parent('foo', 0); + + $this->assertEquals('foo', $node->getAttribute('name')); + } + + /** + * @covers Twig_Node_Expression_Parent::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $tests = array(); + $tests[] = array(new Twig_Node_Expression_Parent('foo', 0), '$this->renderParentBlock("foo", $context, $blocks)'); + + return $tests; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php new file mode 100644 index 000000000000..08668c037294 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php @@ -0,0 +1,67 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../TestCase.php'; + +class Twig_Tests_Node_Expression_TestTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Test::__construct + */ + public function testConstructor() + { + $expr = new Twig_Node_Expression_Constant('foo', 0); + $name = new Twig_Node_Expression_Constant('null', 0); + $args = new Twig_Node(); + $node = new Twig_Node_Expression_Test($expr, $name, $args, 0); + + $this->assertEquals($expr, $node->getNode('node')); + $this->assertEquals($args, $node->getNode('arguments')); + $this->assertEquals($name, $node->getAttribute('name')); + } + + /** + * @covers Twig_Node_Expression_Test::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $tests = array(); + + $expr = new Twig_Node_Expression_Constant('foo', 0); + $node = new Twig_Node_Expression_Test_Null($expr, 'null', new Twig_Node(array()), 0); + + $tests[] = array($node, '(null === "foo")'); + + return $tests; + } + + /** + * @covers Twig_Node_Expression_Filter::compile + * @expectedException Twig_Error_Syntax + * @expectedExceptionMessage The test "nul" does not exist. Did you mean "null" at line 0 + */ + public function testUnknownTest() + { + $node = $this->createTest(new Twig_Node_Expression_Constant('foo', 0), 'nul'); + $node->compile($this->getCompiler()); + } + + protected function createTest($node, $name, array $arguments = array()) + { + return new Twig_Node_Expression_Test($node, $name, new Twig_Node($arguments), 0); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php new file mode 100644 index 000000000000..218de6eb873f --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php @@ -0,0 +1,46 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../../TestCase.php'; + +class Twig_Tests_Node_Expression_Unary_NegTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Unary_Neg::__construct + */ + public function testConstructor() + { + $expr = new Twig_Node_Expression_Constant(1, 0); + $node = new Twig_Node_Expression_Unary_Neg($expr, 0); + + $this->assertEquals($expr, $node->getNode('node')); + } + + /** + * @covers Twig_Node_Expression_Unary_Neg::compile + * @covers Twig_Node_Expression_Unary_Neg::operator + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $node = new Twig_Node_Expression_Constant(1, 0); + $node = new Twig_Node_Expression_Unary_Neg($node, 0); + + return array( + array($node, '(-1)'), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php new file mode 100644 index 000000000000..ed6349c3655a --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php @@ -0,0 +1,46 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../../TestCase.php'; + +class Twig_Tests_Node_Expression_Unary_NotTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Unary_Not::__construct + */ + public function testConstructor() + { + $expr = new Twig_Node_Expression_Constant(1, 0); + $node = new Twig_Node_Expression_Unary_Not($expr, 0); + + $this->assertEquals($expr, $node->getNode('node')); + } + + /** + * @covers Twig_Node_Expression_Unary_Not::compile + * @covers Twig_Node_Expression_Unary_Not::operator + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $node = new Twig_Node_Expression_Constant(1, 0); + $node = new Twig_Node_Expression_Unary_Not($node, 0); + + return array( + array($node, '(!1)'), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php new file mode 100644 index 000000000000..6a414bcacb8e --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php @@ -0,0 +1,46 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../../TestCase.php'; + +class Twig_Tests_Node_Expression_Unary_PosTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Expression_Unary_Pos::__construct + */ + public function testConstructor() + { + $expr = new Twig_Node_Expression_Constant(1, 0); + $node = new Twig_Node_Expression_Unary_Pos($expr, 0); + + $this->assertEquals($expr, $node->getNode('node')); + } + + /** + * @covers Twig_Node_Expression_Unary_Pos::compile + * @covers Twig_Node_Expression_Unary_Pos::operator + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $node = new Twig_Node_Expression_Constant(1, 0); + $node = new Twig_Node_Expression_Unary_Pos($node, 0); + + return array( + array($node, '(+1)'), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php new file mode 100644 index 000000000000..ef3be8262ce2 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php @@ -0,0 +1,201 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/TestCase.php'; + +class Twig_Tests_Node_ForTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_For::__construct + */ + public function testConstructor() + { + $keyTarget = new Twig_Node_Expression_AssignName('key', 0); + $valueTarget = new Twig_Node_Expression_AssignName('item', 0); + $seq = new Twig_Node_Expression_Name('items', 0); + $ifexpr = new Twig_Node_Expression_Constant(true, 0); + $body = new Twig_Node(array(new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 0), 0)), array(), 0); + $else = null; + $node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 0); + $node->setAttribute('with_loop', false); + + $this->assertEquals($keyTarget, $node->getNode('key_target')); + $this->assertEquals($valueTarget, $node->getNode('value_target')); + $this->assertEquals($seq, $node->getNode('seq')); + $this->assertTrue($node->getAttribute('ifexpr')); + $this->assertEquals('Twig_Node_If', get_class($node->getNode('body'))); + $this->assertEquals($body, $node->getNode('body')->getNode('tests')->getNode(1)->getNode(0)); + $this->assertEquals(null, $node->getNode('else')); + + $else = new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 0), 0); + $node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 0); + $node->setAttribute('with_loop', false); + $this->assertEquals($else, $node->getNode('else')); + } + + /** + * @covers Twig_Node_For::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $tests = array(); + + $keyTarget = new Twig_Node_Expression_AssignName('key', 0); + $valueTarget = new Twig_Node_Expression_AssignName('item', 0); + $seq = new Twig_Node_Expression_Name('items', 0); + $ifexpr = null; + $body = new Twig_Node(array(new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 0), 0)), array(), 0); + $else = null; + $node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 0); + $node->setAttribute('with_loop', false); + + $tests[] = array($node, <<<EOF +\$context['_parent'] = (array) \$context; +\$context['_seq'] = twig_ensure_traversable({$this->getVariableGetter('items')}); +foreach (\$context['_seq'] as \$context["key"] => \$context["item"]) { + echo {$this->getVariableGetter('foo')}; +} +\$_parent = \$context['_parent']; +unset(\$context['_seq'], \$context['_iterated'], \$context['key'], \$context['item'], \$context['_parent'], \$context['loop']); +\$context = array_merge(\$_parent, array_intersect_key(\$context, \$_parent)); +EOF + ); + + $keyTarget = new Twig_Node_Expression_AssignName('k', 0); + $valueTarget = new Twig_Node_Expression_AssignName('v', 0); + $seq = new Twig_Node_Expression_Name('values', 0); + $ifexpr = null; + $body = new Twig_Node(array(new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 0), 0)), array(), 0); + $else = null; + $node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 0); + $node->setAttribute('with_loop', true); + + $tests[] = array($node, <<<EOF +\$context['_parent'] = (array) \$context; +\$context['_seq'] = twig_ensure_traversable({$this->getVariableGetter('values')}); +\$context['loop'] = array( + 'parent' => \$context['_parent'], + 'index0' => 0, + 'index' => 1, + 'first' => true, +); +if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof Countable)) { + \$length = count(\$context['_seq']); + \$context['loop']['revindex0'] = \$length - 1; + \$context['loop']['revindex'] = \$length; + \$context['loop']['length'] = \$length; + \$context['loop']['last'] = 1 === \$length; +} +foreach (\$context['_seq'] as \$context["k"] => \$context["v"]) { + echo {$this->getVariableGetter('foo')}; + ++\$context['loop']['index0']; + ++\$context['loop']['index']; + \$context['loop']['first'] = false; + if (isset(\$context['loop']['length'])) { + --\$context['loop']['revindex0']; + --\$context['loop']['revindex']; + \$context['loop']['last'] = 0 === \$context['loop']['revindex0']; + } +} +\$_parent = \$context['_parent']; +unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']); +\$context = array_merge(\$_parent, array_intersect_key(\$context, \$_parent)); +EOF + ); + + $keyTarget = new Twig_Node_Expression_AssignName('k', 0); + $valueTarget = new Twig_Node_Expression_AssignName('v', 0); + $seq = new Twig_Node_Expression_Name('values', 0); + $ifexpr = new Twig_Node_Expression_Constant(true, 0); + $body = new Twig_Node(array(new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 0), 0)), array(), 0); + $else = null; + $node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 0); + $node->setAttribute('with_loop', true); + + $tests[] = array($node, <<<EOF +\$context['_parent'] = (array) \$context; +\$context['_seq'] = twig_ensure_traversable({$this->getVariableGetter('values')}); +\$context['loop'] = array( + 'parent' => \$context['_parent'], + 'index0' => 0, + 'index' => 1, + 'first' => true, +); +foreach (\$context['_seq'] as \$context["k"] => \$context["v"]) { + if (true) { + echo {$this->getVariableGetter('foo')}; + ++\$context['loop']['index0']; + ++\$context['loop']['index']; + \$context['loop']['first'] = false; + } +} +\$_parent = \$context['_parent']; +unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']); +\$context = array_merge(\$_parent, array_intersect_key(\$context, \$_parent)); +EOF + ); + + $keyTarget = new Twig_Node_Expression_AssignName('k', 0); + $valueTarget = new Twig_Node_Expression_AssignName('v', 0); + $seq = new Twig_Node_Expression_Name('values', 0); + $ifexpr = null; + $body = new Twig_Node(array(new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 0), 0)), array(), 0); + $else = new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 0), 0); + $node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 0); + $node->setAttribute('with_loop', true); + + $tests[] = array($node, <<<EOF +\$context['_parent'] = (array) \$context; +\$context['_seq'] = twig_ensure_traversable({$this->getVariableGetter('values')}); +\$context['_iterated'] = false; +\$context['loop'] = array( + 'parent' => \$context['_parent'], + 'index0' => 0, + 'index' => 1, + 'first' => true, +); +if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof Countable)) { + \$length = count(\$context['_seq']); + \$context['loop']['revindex0'] = \$length - 1; + \$context['loop']['revindex'] = \$length; + \$context['loop']['length'] = \$length; + \$context['loop']['last'] = 1 === \$length; +} +foreach (\$context['_seq'] as \$context["k"] => \$context["v"]) { + echo {$this->getVariableGetter('foo')}; + \$context['_iterated'] = true; + ++\$context['loop']['index0']; + ++\$context['loop']['index']; + \$context['loop']['first'] = false; + if (isset(\$context['loop']['length'])) { + --\$context['loop']['revindex0']; + --\$context['loop']['revindex']; + \$context['loop']['last'] = 0 === \$context['loop']['revindex0']; + } +} +if (!\$context['_iterated']) { + echo {$this->getVariableGetter('foo')}; +} +\$_parent = \$context['_parent']; +unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']); +\$context = array_merge(\$_parent, array_intersect_key(\$context, \$_parent)); +EOF + ); + + return $tests; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php new file mode 100644 index 000000000000..04b92e761a07 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php @@ -0,0 +1,99 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/TestCase.php'; + +class Twig_Tests_Node_IfTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_If::__construct + */ + public function testConstructor() + { + $t = new Twig_Node(array( + new Twig_Node_Expression_Constant(true, 0), + new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 0), 0), + ), array(), 0); + $else = null; + $node = new Twig_Node_If($t, $else, 0); + + $this->assertEquals($t, $node->getNode('tests')); + $this->assertEquals(null, $node->getNode('else')); + + $else = new Twig_Node_Print(new Twig_Node_Expression_Name('bar', 0), 0); + $node = new Twig_Node_If($t, $else, 0); + $this->assertEquals($else, $node->getNode('else')); + } + + /** + * @covers Twig_Node_If::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $tests = array(); + + $t = new Twig_Node(array( + new Twig_Node_Expression_Constant(true, 0), + new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 0), 0), + ), array(), 0); + $else = null; + $node = new Twig_Node_If($t, $else, 0); + + $tests[] = array($node, <<<EOF +if (true) { + echo {$this->getVariableGetter('foo')}; +} +EOF + ); + + $t = new Twig_Node(array( + new Twig_Node_Expression_Constant(true, 0), + new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 0), 0), + new Twig_Node_Expression_Constant(false, 0), + new Twig_Node_Print(new Twig_Node_Expression_Name('bar', 0), 0), + ), array(), 0); + $else = null; + $node = new Twig_Node_If($t, $else, 0); + + $tests[] = array($node, <<<EOF +if (true) { + echo {$this->getVariableGetter('foo')}; +} elseif (false) { + echo {$this->getVariableGetter('bar')}; +} +EOF + ); + + $t = new Twig_Node(array( + new Twig_Node_Expression_Constant(true, 0), + new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 0), 0), + ), array(), 0); + $else = new Twig_Node_Print(new Twig_Node_Expression_Name('bar', 0), 0); + $node = new Twig_Node_If($t, $else, 0); + + $tests[] = array($node, <<<EOF +if (true) { + echo {$this->getVariableGetter('foo')}; +} else { + echo {$this->getVariableGetter('bar')}; +} +EOF + ); + + return $tests; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php new file mode 100644 index 000000000000..6a8919542ced --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php @@ -0,0 +1,50 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/TestCase.php'; + +class Twig_Tests_Node_ImportTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Import::__construct + */ + public function testConstructor() + { + $macro = new Twig_Node_Expression_Constant('foo.twig', 0); + $var = new Twig_Node_Expression_AssignName('macro', 0); + $node = new Twig_Node_Import($macro, $var, 0); + + $this->assertEquals($macro, $node->getNode('expr')); + $this->assertEquals($var, $node->getNode('var')); + } + + /** + * @covers Twig_Node_Import::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $tests = array(); + + $macro = new Twig_Node_Expression_Constant('foo.twig', 0); + $var = new Twig_Node_Expression_AssignName('macro', 0); + $node = new Twig_Node_Import($macro, $var, 0); + + $tests[] = array($node, '$context["macro"] = $this->env->loadTemplate("foo.twig");'); + + return $tests; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php new file mode 100644 index 000000000000..d0683924b1fd --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php @@ -0,0 +1,84 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/TestCase.php'; + +class Twig_Tests_Node_IncludeTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Include::__construct + */ + public function testConstructor() + { + $expr = new Twig_Node_Expression_Constant('foo.twig', 0); + $node = new Twig_Node_Include($expr, null, false, false, 0); + + $this->assertEquals(null, $node->getNode('variables')); + $this->assertEquals($expr, $node->getNode('expr')); + $this->assertFalse($node->getAttribute('only')); + + $vars = new Twig_Node_Expression_Array(array(new Twig_Node_Expression_Constant('foo', 0), new Twig_Node_Expression_Constant(true, 0)), 0); + $node = new Twig_Node_Include($expr, $vars, true, false, 0); + $this->assertEquals($vars, $node->getNode('variables')); + $this->assertTrue($node->getAttribute('only')); + } + + /** + * @covers Twig_Node_Include::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $tests = array(); + + $expr = new Twig_Node_Expression_Constant('foo.twig', 0); + $node = new Twig_Node_Include($expr, null, false, false, 0); + $tests[] = array($node, '$this->env->loadTemplate("foo.twig")->display($context);'); + + $expr = new Twig_Node_Expression_Conditional( + new Twig_Node_Expression_Constant(true, 0), + new Twig_Node_Expression_Constant('foo', 0), + new Twig_Node_Expression_Constant('foo', 0), + 0 + ); + $node = new Twig_Node_Include($expr, null, false, false, 0); + $tests[] = array($node, <<<EOF +\$template = \$this->env->resolveTemplate(((true) ? ("foo") : ("foo"))); +\$template->display(\$context); +EOF + ); + + $expr = new Twig_Node_Expression_Constant('foo.twig', 0); + $vars = new Twig_Node_Expression_Array(array(new Twig_Node_Expression_Constant('foo', 0), new Twig_Node_Expression_Constant(true, 0)), 0); + $node = new Twig_Node_Include($expr, $vars, false, false, 0); + $tests[] = array($node, '$this->env->loadTemplate("foo.twig")->display(array_merge($context, array("foo" => true)));'); + + $node = new Twig_Node_Include($expr, $vars, true, false, 0); + $tests[] = array($node, '$this->env->loadTemplate("foo.twig")->display(array("foo" => true));'); + + $node = new Twig_Node_Include($expr, $vars, true, true, 0); + $tests[] = array($node, <<<EOF +try { + \$this->env->loadTemplate("foo.twig")->display(array("foo" => true)); +} catch (Twig_Error_Loader \$e) { + // ignore missing template +} +EOF + ); + + return $tests; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php new file mode 100644 index 000000000000..3dd57a6d5c79 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php @@ -0,0 +1,70 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/TestCase.php'; + +class Twig_Tests_Node_MacroTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Macro::__construct + */ + public function testConstructor() + { + $body = new Twig_Node_Text('foo', 0); + $arguments = new Twig_Node(array(new Twig_Node_Expression_Name('foo', 0)), array(), 0); + $node = new Twig_Node_Macro('foo', $body, $arguments, 0); + + $this->assertEquals($body, $node->getNode('body')); + $this->assertEquals($arguments, $node->getNode('arguments')); + $this->assertEquals('foo', $node->getAttribute('name')); + } + + /** + * @covers Twig_Node_Macro::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $body = new Twig_Node_Text('foo', 0); + $arguments = new Twig_Node(array(new Twig_Node_Expression_Name('foo', 0)), array(), 0); + $node = new Twig_Node_Macro('foo', $body, $arguments, 0); + + return array( + array($node, <<<EOF +public function getfoo(\$foo = null) +{ + \$context = \$this->env->mergeGlobals(array( + "foo" => \$foo, + )); + + \$blocks = array(); + + ob_start(); + try { + echo "foo"; + } catch(Exception \$e) { + ob_end_clean(); + + throw \$e; + } + + return ob_get_clean(); +} +EOF + ), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php new file mode 100644 index 000000000000..592949b43b1a --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php @@ -0,0 +1,196 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/TestCase.php'; + +class Twig_Tests_Node_ModuleTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Module::__construct + */ + public function testConstructor() + { + $body = new Twig_Node_Text('foo', 0); + $parent = new Twig_Node_Expression_Constant('layout.twig', 0); + $blocks = new Twig_Node(); + $macros = new Twig_Node(); + $traits = new Twig_Node(); + $filename = 'foo.twig'; + $node = new Twig_Node_Module($body, $parent, $blocks, $macros, $traits, new Twig_Node(array()), $filename); + + $this->assertEquals($body, $node->getNode('body')); + $this->assertEquals($blocks, $node->getNode('blocks')); + $this->assertEquals($macros, $node->getNode('macros')); + $this->assertEquals($parent, $node->getNode('parent')); + $this->assertEquals($filename, $node->getAttribute('filename')); + } + + /** + * @covers Twig_Node_Module::compile + * @covers Twig_Node_Module::compileTemplate + * @covers Twig_Node_Module::compileMacros + * @covers Twig_Node_Module::compileClassHeader + * @covers Twig_Node_Module::compileDisplayHeader + * @covers Twig_Node_Module::compileDisplayBody + * @covers Twig_Node_Module::compileDisplayFooter + * @covers Twig_Node_Module::compileClassFooter + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $twig = new Twig_Environment(new Twig_Loader_String()); + + $tests = array(); + + $body = new Twig_Node_Text('foo', 0); + $extends = null; + $blocks = new Twig_Node(); + $macros = new Twig_Node(); + $traits = new Twig_Node(); + $filename = 'foo.twig'; + + $node = new Twig_Node_Module($body, $extends, $blocks, $macros, $traits, new Twig_Node(array()), $filename); + $tests[] = array($node, <<<EOF +<?php + +/* foo.twig */ +class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template +{ + public function __construct(Twig_Environment \$env) + { + parent::__construct(\$env); + + \$this->parent = false; + + \$this->blocks = array( + ); + } + + protected function doDisplay(array \$context, array \$blocks = array()) + { + echo "foo"; + } + + public function getTemplateName() + { + return "foo.twig"; + } + + public function getDebugInfo() + { + return array (); + } +} +EOF + , $twig); + + $import = new Twig_Node_Import(new Twig_Node_Expression_Constant('foo.twig', 0), new Twig_Node_Expression_AssignName('macro', 0), 0); + + $body = new Twig_Node(array($import)); + $extends = new Twig_Node_Expression_Constant('layout.twig', 0); + + $node = new Twig_Node_Module($body, $extends, $blocks, $macros, $traits, new Twig_Node(array()), $filename); + $tests[] = array($node, <<<EOF +<?php + +/* foo.twig */ +class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template +{ + public function __construct(Twig_Environment \$env) + { + parent::__construct(\$env); + + \$this->parent = \$this->env->loadTemplate("layout.twig"); + + \$this->blocks = array( + ); + } + + protected function doGetParent(array \$context) + { + return "layout.twig"; + } + + protected function doDisplay(array \$context, array \$blocks = array()) + { + \$context["macro"] = \$this->env->loadTemplate("foo.twig"); + \$this->parent->display(\$context, array_merge(\$this->blocks, \$blocks)); + } + + public function getTemplateName() + { + return "foo.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array (); + } +} +EOF + , $twig); + + $body = new Twig_Node(); + $extends = new Twig_Node_Expression_Conditional( + new Twig_Node_Expression_Constant(true, 0), + new Twig_Node_Expression_Constant('foo', 0), + new Twig_Node_Expression_Constant('foo', 0), + 0 + ); + + $node = new Twig_Node_Module($body, $extends, $blocks, $macros, $traits, new Twig_Node(array()), $filename); + $tests[] = array($node, <<<EOF +<?php + +/* foo.twig */ +class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template +{ + protected function doGetParent(array \$context) + { + return \$this->env->resolveTemplate(((true) ? ("foo") : ("foo"))); + } + + protected function doDisplay(array \$context, array \$blocks = array()) + { + \$this->getParent(\$context)->display(\$context, array_merge(\$this->blocks, \$blocks)); + } + + public function getTemplateName() + { + return "foo.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array (); + } +} +EOF + , $twig); + + return $tests; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php new file mode 100644 index 000000000000..168663c68354 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php @@ -0,0 +1,43 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/TestCase.php'; + +class Twig_Tests_Node_PrintTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Print::__construct + */ + public function testConstructor() + { + $expr = new Twig_Node_Expression_Constant('foo', 0); + $node = new Twig_Node_Print($expr, 0); + + $this->assertEquals($expr, $node->getNode('expr')); + } + + /** + * @covers Twig_Node_Print::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $tests = array(); + $tests[] = array(new Twig_Node_Print(new Twig_Node_Expression_Constant('foo', 0), 0), 'echo "foo";'); + + return $tests; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php new file mode 100644 index 000000000000..161087381c98 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php @@ -0,0 +1,57 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/TestCase.php'; + +class Twig_Tests_Node_SandboxTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Sandbox::__construct + */ + public function testConstructor() + { + $body = new Twig_Node_Text('foo', 0); + $node = new Twig_Node_Sandbox($body, 0); + + $this->assertEquals($body, $node->getNode('body')); + } + + /** + * @covers Twig_Node_Sandbox::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $tests = array(); + + $body = new Twig_Node_Text('foo', 0); + $node = new Twig_Node_Sandbox($body, 0); + + $tests[] = array($node, <<<EOF +\$sandbox = \$this->env->getExtension('sandbox'); +if (!\$alreadySandboxed = \$sandbox->isSandboxed()) { + \$sandbox->enableSandbox(); +} +echo "foo"; +if (!\$alreadySandboxed) { + \$sandbox->disableSandbox(); +} +EOF + ); + + return $tests; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/SandboxedModuleTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/SandboxedModuleTest.php new file mode 100644 index 000000000000..2ce0584e5949 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/SandboxedModuleTest.php @@ -0,0 +1,172 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/TestCase.php'; + +class Twig_Tests_Node_SandboxedModuleTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_SandboxedModule::__construct + */ + public function testConstructor() + { + $body = new Twig_Node_Text('foo', 0); + $parent = new Twig_Node_Expression_Constant('layout.twig', 0); + $blocks = new Twig_Node(); + $macros = new Twig_Node(); + $traits = new Twig_Node(); + $filename = 'foo.twig'; + $node = new Twig_Node_Module($body, $parent, $blocks, $macros, $traits, new Twig_Node(array()), $filename); + $node = new Twig_Node_SandboxedModule($node, array('for'), array('upper'), array('cycle')); + + $this->assertEquals($body, $node->getNode('body')); + $this->assertEquals($blocks, $node->getNode('blocks')); + $this->assertEquals($macros, $node->getNode('macros')); + $this->assertEquals($parent, $node->getNode('parent')); + $this->assertEquals($filename, $node->getAttribute('filename')); + } + + /** + * @covers Twig_Node_SandboxedModule::compile + * @covers Twig_Node_SandboxedModule::compileDisplayBody + * @covers Twig_Node_SandboxedModule::compileDisplayFooter + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $twig = new Twig_Environment(new Twig_Loader_String()); + + $tests = array(); + + $body = new Twig_Node_Text('foo', 0); + $extends = null; + $blocks = new Twig_Node(); + $macros = new Twig_Node(); + $traits = new Twig_Node(); + $filename = 'foo.twig'; + + $node = new Twig_Node_Module($body, $extends, $blocks, $macros, $traits, new Twig_Node(array()), $filename); + $node = new Twig_Node_SandboxedModule($node, array('for'), array('upper'), array('cycle')); + + $tests[] = array($node, <<<EOF +<?php + +/* foo.twig */ +class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template +{ + public function __construct(Twig_Environment \$env) + { + parent::__construct(\$env); + + \$this->parent = false; + + \$this->blocks = array( + ); + } + + protected function doDisplay(array \$context, array \$blocks = array()) + { + \$this->checkSecurity(); + echo "foo"; + } + + protected function checkSecurity() { + \$this->env->getExtension('sandbox')->checkSecurity( + array('upper'), + array('for'), + array('cycle') + ); + } + + public function getTemplateName() + { + return "foo.twig"; + } + + public function getDebugInfo() + { + return array (); + } +} +EOF + , $twig); + + $body = new Twig_Node(); + $extends = new Twig_Node_Expression_Constant('layout.twig', 0); + $blocks = new Twig_Node(); + $macros = new Twig_Node(); + $traits = new Twig_Node(); + $filename = 'foo.twig'; + + $node = new Twig_Node_Module($body, $extends, $blocks, $macros, $traits, new Twig_Node(array()), $filename); + $node = new Twig_Node_SandboxedModule($node, array('for'), array('upper'), array('cycle')); + + $tests[] = array($node, <<<EOF +<?php + +/* foo.twig */ +class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template +{ + public function __construct(Twig_Environment \$env) + { + parent::__construct(\$env); + + \$this->parent = \$this->env->loadTemplate("layout.twig"); + + \$this->blocks = array( + ); + } + + protected function doGetParent(array \$context) + { + return "layout.twig"; + } + + protected function doDisplay(array \$context, array \$blocks = array()) + { + \$this->checkSecurity(); + \$this->parent->display(\$context, array_merge(\$this->blocks, \$blocks)); + } + + protected function checkSecurity() { + \$this->env->getExtension('sandbox')->checkSecurity( + array('upper'), + array('for'), + array('cycle') + ); + } + + public function getTemplateName() + { + return "foo.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array (); + } +} +EOF + , $twig); + + return $tests; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/SandboxedPrintTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/SandboxedPrintTest.php new file mode 100644 index 000000000000..85adddfa53fd --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/SandboxedPrintTest.php @@ -0,0 +1,46 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/TestCase.php'; + +class Twig_Tests_Node_SandboxedPrintTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_SandboxedPrint::__construct + */ + public function testConstructor() + { + $node = new Twig_Node_SandboxedPrint($expr = new Twig_Node_Expression_Constant('foo', 0), 0); + + $this->assertEquals($expr, $node->getNode('expr')); + } + + /** + * @covers Twig_Node_SandboxedPrint::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $tests = array(); + + $tests[] = array(new Twig_Node_SandboxedPrint(new Twig_Node_Expression_Constant('foo', 0), 0), <<<EOF +echo \$this->env->getExtension('sandbox')->ensureToStringAllowed("foo"); +EOF + ); + + return $tests; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php new file mode 100644 index 000000000000..6319fb6bfab1 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php @@ -0,0 +1,73 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/TestCase.php'; + +class Twig_Tests_Node_SetTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Set::__construct + */ + public function testConstructor() + { + $names = new Twig_Node(array(new Twig_Node_Expression_AssignName('foo', 0)), array(), 0); + $values = new Twig_Node(array(new Twig_Node_Expression_Constant('foo', 0)), array(), 0); + $node = new Twig_Node_Set(false, $names, $values, 0); + + $this->assertEquals($names, $node->getNode('names')); + $this->assertEquals($values, $node->getNode('values')); + $this->assertEquals(false, $node->getAttribute('capture')); + } + + /** + * @covers Twig_Node_Set::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $tests = array(); + + $names = new Twig_Node(array(new Twig_Node_Expression_AssignName('foo', 0)), array(), 0); + $values = new Twig_Node(array(new Twig_Node_Expression_Constant('foo', 0)), array(), 0); + $node = new Twig_Node_Set(false, $names, $values, 0); + $tests[] = array($node, '$context["foo"] = "foo";'); + + $names = new Twig_Node(array(new Twig_Node_Expression_AssignName('foo', 0)), array(), 0); + $values = new Twig_Node(array(new Twig_Node_Print(new Twig_Node_Expression_Constant('foo', 0), 0)), array(), 0); + $node = new Twig_Node_Set(true, $names, $values, 0); + $tests[] = array($node, <<<EOF +ob_start(); +echo "foo"; +\$context["foo"] = ('' === \$tmp = ob_get_clean()) ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset()); +EOF + ); + + $names = new Twig_Node(array(new Twig_Node_Expression_AssignName('foo', 0)), array(), 0); + $values = new Twig_Node_Text('foo', 0); + $node = new Twig_Node_Set(true, $names, $values, 0); + $tests[] = array($node, '$context["foo"] = (\'\' === $tmp = "foo") ? \'\' : new Twig_Markup($tmp, $this->env->getCharset());'); + + $names = new Twig_Node(array(new Twig_Node_Expression_AssignName('foo', 0), new Twig_Node_Expression_AssignName('bar', 0)), array(), 0); + $values = new Twig_Node(array(new Twig_Node_Expression_Constant('foo', 0), new Twig_Node_Expression_Name('bar', 0)), array(), 0); + $node = new Twig_Node_Set(false, $names, $values, 0); + $tests[] = array($node, <<<EOF +list(\$context["foo"], \$context["bar"]) = array("foo", {$this->getVariableGetter('bar')}); +EOF + ); + + return $tests; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php new file mode 100644 index 000000000000..55892f461f6e --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php @@ -0,0 +1,50 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/TestCase.php'; + +class Twig_Tests_Node_SpacelessTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Spaceless::__construct + */ + public function testConstructor() + { + $body = new Twig_Node(array(new Twig_Node_Text('<div> <div> foo </div> </div>', 0))); + $node = new Twig_Node_Spaceless($body, 0); + + $this->assertEquals($body, $node->getNode('body')); + } + + /** + * @covers Twig_Node_Spaceless::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $body = new Twig_Node(array(new Twig_Node_Text('<div> <div> foo </div> </div>', 0))); + $node = new Twig_Node_Spaceless($body, 0); + + return array( + array($node, <<<EOF +ob_start(); +echo "<div> <div> foo </div> </div>"; +echo trim(preg_replace('/>\s+</', '><', ob_get_clean())); +EOF + ), + ); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/TestCase.php b/core/vendor/twig/twig/test/Twig/Tests/Node/TestCase.php new file mode 100644 index 000000000000..f142529c5d45 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/TestCase.php @@ -0,0 +1,58 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +abstract class Twig_Tests_Node_TestCase extends PHPUnit_Framework_TestCase +{ + abstract public function getTests(); + + /** + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + $this->assertNodeCompilation($source, $node, $environment); + } + + public function assertNodeCompilation($source, Twig_Node $node, Twig_Environment $environment = null) + { + $compiler = $this->getCompiler($environment); + $compiler->compile($node); + + $this->assertEquals($source, trim($compiler->getSource())); + } + + protected function getCompiler(Twig_Environment $environment = null) + { + return new Twig_Compiler(null === $environment ? $this->getEnvironment() : $environment); + } + + protected function getEnvironment() + { + return new Twig_Environment(); + } + + protected function getVariableGetter($name) + { + if (version_compare(phpversion(), '5.4.0RC1', '>=')) { + return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name); + } + + return sprintf('$this->getContext($context, "%s")', $name); + } + + protected function getAttributeGetter() + { + if (function_exists('twig_template_get_attributes')) { + return 'twig_template_get_attributes($this, '; + } + + return '$this->getAttribute('; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php new file mode 100644 index 000000000000..87e0337f7231 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php @@ -0,0 +1,42 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/TestCase.php'; + +class Twig_Tests_Node_TextTest extends Twig_Tests_Node_TestCase +{ + /** + * @covers Twig_Node_Text::__construct + */ + public function testConstructor() + { + $node = new Twig_Node_Text('foo', 0); + + $this->assertEquals('foo', $node->getAttribute('data')); + } + + /** + * @covers Twig_Node_Text::compile + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + parent::testCompile($node, $source, $environment); + } + + public function getTests() + { + $tests = array(); + $tests[] = array(new Twig_Node_Text('foo', 0), 'echo "foo";'); + + return $tests; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php b/core/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php new file mode 100644 index 000000000000..a55d98eeb4eb --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php @@ -0,0 +1,118 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +class Twig_Tests_NodeVisitor_OptimizerTest extends PHPUnit_Framework_TestCase +{ + public function testRenderBlockOptimizer() + { + $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); + $env->addExtension(new Twig_Extension_Optimizer()); + + $stream = $env->parse($env->tokenize('{{ block("foo") }}', 'index')); + + $node = $stream->getNode('body')->getNode(0); + + $this->assertEquals('Twig_Node_Expression_BlockReference', get_class($node)); + $this->assertTrue($node->getAttribute('output')); + } + + public function testRenderParentBlockOptimizer() + { + $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); + $env->addExtension(new Twig_Extension_Optimizer()); + + $stream = $env->parse($env->tokenize('{% extends "foo" %}{% block content %}{{ parent() }}{% endblock %}', 'index')); + + $node = $stream->getNode('blocks')->getNode('content')->getNode(0)->getNode('body'); + + $this->assertEquals('Twig_Node_Expression_Parent', get_class($node)); + $this->assertTrue($node->getAttribute('output')); + } + + public function testRenderVariableBlockOptimizer() + { + if (version_compare(phpversion(), '5.4.0RC1', '>=')) { + return; + } + + $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); + $env->addExtension(new Twig_Extension_Optimizer()); + $stream = $env->parse($env->tokenize('{{ block(name|lower) }}', 'index')); + + $node = $stream->getNode('body')->getNode(0)->getNode(1); + + $this->assertEquals('Twig_Node_Expression_BlockReference', get_class($node)); + $this->assertTrue($node->getAttribute('output')); + } + + /** + * @dataProvider getTestsForForOptimizer + */ + public function testForOptimizer($template, $expected) + { + $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false)); + $env->addExtension(new Twig_Extension_Optimizer()); + + $stream = $env->parse($env->tokenize($template, 'index')); + + foreach ($expected as $target => $withLoop) { + $this->assertTrue($this->checkForConfiguration($stream, $target, $withLoop), sprintf('variable %s is %soptimized', $target, $withLoop ? 'not ' : '')); + } + } + + public function getTestsForForOptimizer() + { + return array( + array('{% for i in foo %}{% endfor %}', array('i' => false)), + + array('{% for i in foo %}{{ loop.index }}{% endfor %}', array('i' => true)), + + array('{% for i in foo %}{% for j in foo %}{% endfor %}{% endfor %}', array('i' => false, 'j' => false)), + + array('{% for i in foo %}{% include "foo" %}{% endfor %}', array('i' => true)), + + array('{% for i in foo %}{% include "foo" only %}{% endfor %}', array('i' => false)), + + array('{% for i in foo %}{% include "foo" with { "foo": "bar" } only %}{% endfor %}', array('i' => false)), + + array('{% for i in foo %}{% include "foo" with { "foo": loop.index } only %}{% endfor %}', array('i' => true)), + + array('{% for i in foo %}{% for j in foo %}{{ loop.index }}{% endfor %}{% endfor %}', array('i' => false, 'j' => true)), + + array('{% for i in foo %}{% for j in foo %}{{ loop.parent.loop.index }}{% endfor %}{% endfor %}', array('i' => true, 'j' => true)), + + array('{% for i in foo %}{% set l = loop %}{% for j in foo %}{{ l.index }}{% endfor %}{% endfor %}', array('i' => true, 'j' => false)), + + array('{% for i in foo %}{% for j in foo %}{{ foo.parent.loop.index }}{% endfor %}{% endfor %}', array('i' => false, 'j' => false)), + + array('{% for i in foo %}{% for j in foo %}{{ loop["parent"].loop.index }}{% endfor %}{% endfor %}', array('i' => true, 'j' => true)), + ); + } + + public function checkForConfiguration(Twig_NodeInterface $node = null, $target, $withLoop) + { + if (null === $node) { + return; + } + + foreach ($node as $n) { + if ($n instanceof Twig_Node_For) { + if ($target === $n->getNode('value_target')->getAttribute('name')) { + return $withLoop == $n->getAttribute('with_loop'); + } + } + + $ret = $this->checkForConfiguration($n, $target, $withLoop); + if (null !== $ret) { + return $ret; + } + } + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/ParserTest.php b/core/vendor/twig/twig/test/Twig/Tests/ParserTest.php new file mode 100644 index 000000000000..76f257a41c4f --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/ParserTest.php @@ -0,0 +1,160 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +class Twig_Tests_ParserTest extends PHPUnit_Framework_TestCase +{ + /** + * @expectedException Twig_Error_Syntax + */ + public function testSetMacroThrowsExceptionOnReservedMethods() + { + $parser = new Twig_Parser(new Twig_Environment()); + $parser->setMacro('display', $this->getMock('Twig_Node_Macro', array(), array(), '', null)); + } + + /** + * @expectedException Twig_Error_Syntax + * @expectedExceptionMessage Unknown tag name "foo". Did you mean "for" at line 0 + */ + public function testUnkownTag() + { + $stream = new Twig_TokenStream(array( + new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', 0), + new Twig_Token(Twig_Token::NAME_TYPE, 'foo', 0), + new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', 0), + new Twig_Token(Twig_Token::EOF_TYPE, '', 0), + )); + $parser = new Twig_Parser(new Twig_Environment()); + $parser->parse($stream); + } + + /** + * @dataProvider getFilterBodyNodesData + */ + public function testFilterBodyNodes($input, $expected) + { + $parser = $this->getParserForFilterBodyNodes(); + + $this->assertEquals($expected, $parser->filterBodyNodes($input)); + } + + public function getFilterBodyNodesData() + { + return array( + array( + new Twig_Node(array(new Twig_Node_Text(' ', 0))), + new Twig_Node(array()), + ), + array( + $input = new Twig_Node(array(new Twig_Node_Set(false, new Twig_Node(), new Twig_Node(), 0))), + $input, + ), + array( + $input = new Twig_Node(array(new Twig_Node_Set(true, new Twig_Node(), new Twig_Node(array(new Twig_Node(array(new Twig_Node_Text('foo', 0))))), 0))), + $input, + ), + ); + } + + /** + * @dataProvider getFilterBodyNodesDataThrowsException + * @expectedException Twig_Error_Syntax + */ + public function testFilterBodyNodesThrowsException($input) + { + $parser = $this->getParserForFilterBodyNodes(); + + $parser->filterBodyNodes($input); + } + + public function getFilterBodyNodesDataThrowsException() + { + return array( + array(new Twig_Node_Text('foo', 0)), + array(new Twig_Node(array(new Twig_Node(array(new Twig_Node_Text('foo', 0)))))), + ); + } + + /** + * @expectedException Twig_Error_Syntax + * @expectedExceptionMessage A template that extends another one cannot have a body but a byte order mark (BOM) has been detected; it must be removed at line 0. + */ + public function testFilterBodyNodesWithBOM() + { + $parser = $this->getParserForFilterBodyNodes(); + $parser->filterBodyNodes(new Twig_Node_Text(chr(0xEF).chr(0xBB).chr(0xBF), 0)); + } + + public function testParseIsReentrant() + { + $twig = new Twig_Environment(null, array( + 'autoescape' => false, + 'optimizations' => 0, + )); + $twig->addTokenParser(new TestTokenParser()); + + $parser = new Twig_Parser($twig); + + $parser->parse(new Twig_TokenStream(array( + new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', 0), + new Twig_Token(Twig_Token::NAME_TYPE, 'test', 0), + new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', 0), + new Twig_Token(Twig_Token::VAR_START_TYPE, '', 0), + new Twig_Token(Twig_Token::NAME_TYPE, 'foo', 0), + new Twig_Token(Twig_Token::VAR_END_TYPE, '', 0), + new Twig_Token(Twig_Token::EOF_TYPE, '', 0), + ))); + + $this->assertEquals(null, $parser->getParent()); + } + + protected function getParserForFilterBodyNodes() + { + $parser = new TestParser(new Twig_Environment()); + $parser->setParent(new Twig_Node()); + $parser->stream = $this->getMockBuilder('Twig_TokenStream')->disableOriginalConstructor()->getMock(); + + return $parser; + } +} + +class TestParser extends Twig_Parser +{ + public $stream; + + public function filterBodyNodes(Twig_NodeInterface $node) + { + return parent::filterBodyNodes($node); + } +} + +class TestTokenParser extends Twig_TokenParser +{ + public function parse(Twig_Token $token) + { + // simulate the parsing of another template right in the middle of the parsing of the current template + $this->parser->parse(new Twig_TokenStream(array( + new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', 0), + new Twig_Token(Twig_Token::NAME_TYPE, 'extends', 0), + new Twig_Token(Twig_Token::STRING_TYPE, 'base', 0), + new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', 0), + new Twig_Token(Twig_Token::EOF_TYPE, '', 0), + ))); + + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + + return new Twig_Node(array()); + } + + public function getTag() + { + return 'test'; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/TemplateTest.php b/core/vendor/twig/twig/test/Twig/Tests/TemplateTest.php new file mode 100644 index 000000000000..4213e2b654aa --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/TemplateTest.php @@ -0,0 +1,377 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase +{ + /** + * @expectedException Twig_Error_Runtime + * @expectedExceptionMessage Impossible to access a key ("a") on a "string" variable + */ + public function testAttributeOnAString() + { + $template = new Twig_TemplateTest( + new Twig_Environment(null, array('strict_variables' => true)), + false + ); + + $template->getAttribute('string', 'a', array(), Twig_TemplateInterface::ARRAY_CALL, false); + } + + /** + * @dataProvider getGetAttributeTests + */ + public function testGetAttribute($defined, $value, $object, $item, $arguments, $type, $useExt = false) + { + $template = new Twig_TemplateTest( + new Twig_Environment(), + $useExt + ); + + $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type)); + } + + /** + * @dataProvider getGetAttributeTests + */ + public function testGetAttributeStrict($defined, $value, $object, $item, $arguments, $type, $useExt = false, $exceptionMessage = null) + { + $template = new Twig_TemplateTest( + new Twig_Environment(null, array('strict_variables' => true)), + $useExt + ); + + if ($defined) { + $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type)); + } else { + try { + $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type)); + + throw new Exception('Expected Twig_Error_Runtime exception.'); + } catch (Twig_Error_Runtime $e) { + if (null !== $exceptionMessage) { + $this->assertSame($exceptionMessage, $e->getMessage()); + } + } + } + } + + /** + * @dataProvider getGetAttributeTests + */ + public function testGetAttributeDefined($defined, $value, $object, $item, $arguments, $type, $useExt = false) + { + $template = new Twig_TemplateTest( + new Twig_Environment(), + $useExt + ); + + $this->assertEquals($defined, $template->getAttribute($object, $item, $arguments, $type, true)); + } + + /** + * @dataProvider getGetAttributeTests + */ + public function testGetAttributeDefinedStrict($defined, $value, $object, $item, $arguments, $type, $useExt = false) + { + $template = new Twig_TemplateTest( + new Twig_Environment(null, array('strict_variables' => true)), + $useExt + ); + + $this->assertEquals($defined, $template->getAttribute($object, $item, $arguments, $type, true)); + } + + public function getGetAttributeTests() + { + $array = array( + 'defined' => 'defined', + 'zero' => 0, + 'null' => null, + '1' => 1, + ); + + $objectArray = new Twig_TemplateArrayAccessObject(); + $stdObject = (object) $array; + $magicPropertyObject = new Twig_TemplateMagicPropertyObject(); + $propertyObject = new Twig_TemplatePropertyObject(); + $propertyObject1 = new Twig_TemplatePropertyObjectAndIterator(); + $methodObject = new Twig_TemplateMethodObject(); + $magicMethodObject = new Twig_TemplateMagicMethodObject(); + + $anyType = Twig_TemplateInterface::ANY_CALL; + $methodType = Twig_TemplateInterface::METHOD_CALL; + $arrayType = Twig_TemplateInterface::ARRAY_CALL; + + $basicTests = array( + // array(defined, value, property to fetch) + array(true, 'defined', 'defined'), + array(false, null, 'undefined'), + array(false, null, 'protected'), + array(true, 0, 'zero'), + array(true, 1, 1), + array(true, 1, 1.0), + array(true, null, 'null'), + ); + $testObjects = array( + // array(object, type of fetch) + array($array, $arrayType), + array($objectArray, $arrayType), + array($stdObject, $anyType), + array($magicPropertyObject, $anyType), + array($methodObject, $methodType), + array($methodObject, $anyType), + array($propertyObject, $anyType), + array($propertyObject1, $anyType), + ); + + $tests = array(); + foreach ($testObjects as $testObject) { + foreach ($basicTests as $test) { + // properties cannot be numbers + if (($testObject[0] instanceof stdClass || $testObject[0] instanceof Twig_TemplatePropertyObject) && is_numeric($test[2])) { + continue; + } + + $tests[] = array($test[0], $test[1], $testObject[0], $test[2], array(), $testObject[1]); + } + } + + // additional method tests + $tests = array_merge($tests, array( + array(true, 'defined', $methodObject, 'defined', array(), $methodType), + array(true, 'defined', $methodObject, 'DEFINED', array(), $methodType), + array(true, 'defined', $methodObject, 'getDefined', array(), $methodType), + array(true, 'defined', $methodObject, 'GETDEFINED', array(), $methodType), + array(true, 'static', $methodObject, 'static', array(), $methodType), + array(true, 'static', $methodObject, 'getStatic', array(), $methodType), + + array(true, '__call_undefined', $magicMethodObject, 'undefined', array(), $methodType), + array(true, '__call_UNDEFINED', $magicMethodObject, 'UNDEFINED', array(), $methodType), + )); + + // add the same tests for the any type + foreach ($tests as $test) { + if ($anyType !== $test[5]) { + $test[5] = $anyType; + $tests[] = $test; + } + } + + $methodAndPropObject = new Twig_TemplateMethodAndPropObject; + + // additional method tests + $tests = array_merge($tests, array( + array(true, 'a', $methodAndPropObject, 'a', array(), $anyType), + array(true, 'a', $methodAndPropObject, 'a', array(), $methodType), + array(false, null, $methodAndPropObject, 'a', array(), $arrayType), + + array(true, 'b_prop', $methodAndPropObject, 'b', array(), $anyType), + array(true, 'b', $methodAndPropObject, 'B', array(), $anyType), + array(true, 'b', $methodAndPropObject, 'b', array(), $methodType), + array(true, 'b', $methodAndPropObject, 'B', array(), $methodType), + array(false, null, $methodAndPropObject, 'b', array(), $arrayType), + + array(false, null, $methodAndPropObject, 'c', array(), $anyType), + array(false, null, $methodAndPropObject, 'c', array(), $methodType), + array(false, null, $methodAndPropObject, 'c', array(), $arrayType), + + )); + + // tests when input is not an array or object + $tests = array_merge($tests, array( + array(false, null, 42, 'a', array(), $anyType, false, 'Item "a" for "42" does not exist'), + array(false, null, "string", 'a', array(), $anyType, false, 'Item "a" for "string" does not exist'), + array(false, null, array(), 'a', array(), $anyType, false, 'Item "a" for "Array" does not exist'), + )); + + // add twig_template_get_attributes tests + + if (function_exists('twig_template_get_attributes')) { + foreach(array_slice($tests, 0) as $test) { + $test = array_pad($test, 7, null); + $test[6] = true; + $tests[] = $test; + } + } + + return $tests; + } + + public function useExtGetAttribute() + { + return false; + } +} + +class Twig_TemplateTest extends Twig_Template +{ + protected $useExtGetAttribute = false; + + public function __construct(Twig_Environment $env, $useExtGetAttribute = false) + { + parent::__construct($env); + $this->useExtGetAttribute = $useExtGetAttribute; + Twig_Template::clearCache(); + } + + public function getTemplateName() + { + } + + public function getDebugInfo() + { + return array(); + } + + protected function doGetParent(array $context) + { + } + + protected function doDisplay(array $context, array $blocks = array()) + { + } + + public function getAttribute($object, $item, array $arguments = array(), $type = Twig_TemplateInterface::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false) + { + if ($this->useExtGetAttribute) { + return twig_template_get_attributes($this, $object, $item, $arguments, $type, $isDefinedTest, $ignoreStrictCheck); + } else { + return parent::getAttribute($object, $item, $arguments, $type, $isDefinedTest, $ignoreStrictCheck); + } + } +} + +class Twig_TemplateArrayAccessObject implements ArrayAccess +{ + protected $protected = 'protected'; + + public $attributes = array( + 'defined' => 'defined', + 'zero' => 0, + 'null' => null, + '1' => 1, + ); + + public function offsetExists($name) + { + return array_key_exists($name, $this->attributes); + } + + public function offsetGet($name) + { + return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : null; + } + + public function offsetSet($name, $value) + { + } + + public function offsetUnset($name) + { + } +} + +class Twig_TemplateMagicPropertyObject +{ + public $defined = 'defined'; + + public $attributes = array( + 'zero' => 0, + 'null' => null, + '1' => 1, + ); + + protected $protected = 'protected'; + + public function __isset($name) + { + return array_key_exists($name, $this->attributes); + } + + public function __get($name) + { + return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : null; + } +} + +class Twig_TemplatePropertyObject +{ + public $defined = 'defined'; + public $zero = 0; + public $null = null; + + protected $protected = 'protected'; +} + +class Twig_TemplatePropertyObjectAndIterator extends Twig_TemplatePropertyObject implements IteratorAggregate +{ + public function getIterator() + { + return new ArrayIterator(array('foo', 'bar')); + } +} + +class Twig_TemplateMethodObject +{ + public function getDefined() + { + return 'defined'; + } + + public function get1() + { + return 1; + } + + public function getZero() + { + return 0; + } + + public function getNull() + { + return null; + } + + protected function getProtected() + { + return 'protected'; + } + + static public function getStatic() + { + return 'static'; + } +} + +class Twig_TemplateMethodAndPropObject +{ + private $a = 'a_prop'; + public function getA() { + return 'a'; + } + + public $b = 'b_prop'; + public function getB() { + return 'b'; + } + + private $c = 'c_prop'; + private function getC() { + return 'c'; + } +} + +class Twig_TemplateMagicMethodObject +{ + public function __call($method, $arguments) { + return '__call_'.$method; + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php b/core/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php new file mode 100644 index 000000000000..794a037eb8af --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php @@ -0,0 +1,41 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +class Twig_Tests_TokenStreamTest extends PHPUnit_Framework_TestCase +{ + static protected $tokens; + + public function setUp() + { + self::$tokens = array( + new Twig_Token(Twig_Token::TEXT_TYPE, 1, 0), + new Twig_Token(Twig_Token::TEXT_TYPE, 2, 0), + new Twig_Token(Twig_Token::TEXT_TYPE, 3, 0), + new Twig_Token(Twig_Token::TEXT_TYPE, 4, 0), + new Twig_Token(Twig_Token::TEXT_TYPE, 5, 0), + new Twig_Token(Twig_Token::TEXT_TYPE, 6, 0), + new Twig_Token(Twig_Token::TEXT_TYPE, 7, 0), + new Twig_Token(Twig_Token::EOF_TYPE, 0, 0), + ); + } + + public function testNext() + { + $stream = new Twig_TokenStream(self::$tokens); + $repr = array(); + while (!$stream->isEOF()) { + $token = $stream->next(); + + $repr[] = $token->getValue(); + } + $this->assertEquals('1, 2, 3, 4, 5, 6, 7', implode(', ', $repr), '->next() advances the pointer and returns the current token'); + } +} diff --git a/core/vendor/twig/twig/test/Twig/Tests/integrationTest.php b/core/vendor/twig/twig/test/Twig/Tests/integrationTest.php new file mode 100644 index 000000000000..b905b56c5c57 --- /dev/null +++ b/core/vendor/twig/twig/test/Twig/Tests/integrationTest.php @@ -0,0 +1,322 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +// This function is defined to check that escaping strategies +// like html works even if a function with the same name is defined. +function html() +{ + return 'foo'; +} + +class Twig_Tests_IntegrationTest extends PHPUnit_Framework_TestCase +{ + public function getTests() + { + $fixturesDir = realpath(dirname(__FILE__).'/Fixtures/'); + $tests = array(); + + foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($fixturesDir), RecursiveIteratorIterator::LEAVES_ONLY) as $file) { + if (!preg_match('/\.test$/', $file)) { + continue; + } + + $test = file_get_contents($file->getRealpath()); + + if (preg_match('/ + --TEST--\s*(.*?)\s*(?:--CONDITION--\s*(.*))?\s*((?:--TEMPLATE(?:\(.*?\))?--(?:.*))+)\s*--EXCEPTION--\s*(.*)/sx', $test, $match)) { + $message = $match[1]; + $condition = $match[2]; + $templates = $this->parseTemplates($match[3]); + $exception = $match[4]; + $outputs = array(null, array(), null, ''); + } elseif (preg_match('/--TEST--\s*(.*?)\s*(?:--CONDITION--\s*(.*))?\s*((?:--TEMPLATE(?:\(.*?\))?--(?:.*?))+)--DATA--.*?--EXPECT--.*/s', $test, $match)) { + $message = $match[1]; + $condition = $match[2]; + $templates = $this->parseTemplates($match[3]); + $exception = false; + preg_match_all('/--DATA--(.*?)(?:--CONFIG--(.*?))?--EXPECT--(.*?)(?=\-\-DATA\-\-|$)/s', $test, $outputs, PREG_SET_ORDER); + } else { + throw new InvalidArgumentException(sprintf('Test "%s" is not valid.', str_replace($fixturesDir.'/', '', $file))); + } + + $tests[] = array(str_replace($fixturesDir.'/', '', $file), $message, $condition, $templates, $exception, $outputs); + } + + return $tests; + } + + /** + * @dataProvider getTests + */ + public function testIntegration($file, $message, $condition, $templates, $exception, $outputs) + { + if ($condition) { + eval('$ret = '.$condition.';'); + if (!$ret) { + $this->markTestSkipped($condition); + } + } + + $loader = new Twig_Loader_Array($templates); + + foreach ($outputs as $match) { + $config = array_merge(array( + 'cache' => false, + 'strict_variables' => true, + ), $match[2] ? eval($match[2].';') : array()); + $twig = new Twig_Environment($loader, $config); + $twig->addExtension(new TestExtension()); + $twig->addExtension(new Twig_Extension_Debug()); + $policy = new Twig_Sandbox_SecurityPolicy(array(), array(), array(), array(), array()); + $twig->addExtension(new Twig_Extension_Sandbox($policy, false)); + $twig->addGlobal('global', 'global'); + + try { + $template = $twig->loadTemplate('index.twig'); + } catch (Exception $e) { + if (false !== $exception) { + $this->assertEquals(trim($exception), trim(sprintf('%s: %s', get_class($e), $e->getMessage()))); + + return; + } + + if ($e instanceof Twig_Error_Syntax) { + $e->setTemplateFile($file); + + throw $e; + } + + throw new Twig_Error(sprintf('%s: %s', get_class($e), $e->getMessage()), -1, $file, $e); + } + + try { + $output = trim($template->render(eval($match[1].';')), "\n "); + } catch (Exception $e) { + if (false !== $exception) { + $this->assertEquals(trim($exception), trim(sprintf('%s: %s', get_class($e), $e->getMessage()))); + + return; + } + + if ($e instanceof Twig_Error_Syntax) { + $e->setTemplateFile($file); + } else { + $e = new Twig_Error(sprintf('%s: %s', get_class($e), $e->getMessage()), -1, $file, $e); + } + + $output = trim(sprintf('%s: %s', get_class($e), $e->getMessage())); + } + $expected = trim($match[3], "\n "); + + if ($expected != $output) { + echo 'Compiled template that failed:'; + + foreach (array_keys($templates) as $name) { + echo "Template: $name\n"; + $source = $loader->getSource($name); + echo $twig->compile($twig->parse($twig->tokenize($source, $name))); + } + } + $this->assertEquals($expected, $output, $message.' (in '.$file.')'); + } + } + + protected function parseTemplates($test) + { + $templates = array(); + preg_match_all('/--TEMPLATE(?:\((.*?)\))?--(.*?)(?=\-\-TEMPLATE|$)/s', $test, $matches, PREG_SET_ORDER); + foreach ($matches as $match) { + $templates[($match[1] ? $match[1] : 'index.twig')] = $match[2]; + } + + return $templates; + } +} + +function test_foo($value = 'foo') +{ + return $value; +} + +class Foo implements Iterator +{ + const BAR_NAME = 'bar'; + + public $position = 0; + public $array = array(1, 2); + + public function bar($param1 = null, $param2 = null) + { + return 'bar'.($param1 ? '_'.$param1 : '').($param2 ? '-'.$param2 : ''); + } + + public function getFoo() + { + return 'foo'; + } + + public function getSelf() + { + return $this; + } + + public function is() + { + return 'is'; + } + + public function in() + { + return 'in'; + } + + public function not() + { + return 'not'; + } + + public function strToLower($value) + { + return strtolower($value); + } + + public function rewind() + { + $this->position = 0; + } + + public function current() + { + return $this->array[$this->position]; + } + + public function key() + { + return 'a'; + } + + public function next() + { + ++$this->position; + } + + public function valid() + { + return isset($this->array[$this->position]); + } +} + +class TestTokenParser_☃ extends Twig_TokenParser +{ + public function parse(Twig_Token $token) + { + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + + return new Twig_Node_Print(new Twig_Node_Expression_Constant('☃', -1), -1); + } + + public function getTag() + { + return '☃'; + } +} + +class TestExtension extends Twig_Extension +{ + public function getTokenParsers() + { + return array( + new TestTokenParser_☃(), + ); + } + + public function getFilters() + { + return array( + '☃' => new Twig_Filter_Method($this, '☃Filter'), + 'escape_and_nl2br' => new Twig_Filter_Method($this, 'escape_and_nl2br', array('needs_environment' => true, 'is_safe' => array('html'))), + 'nl2br' => new Twig_Filter_Method($this, 'nl2br', array('pre_escape' => 'html', 'is_safe' => array('html'))), + 'escape_something' => new Twig_Filter_Method($this, 'escape_something', array('is_safe' => array('something'))), + 'preserves_safety' => new Twig_Filter_Method($this, 'preserves_safety', array('preserves_safety' => array('html'))), + '*_path' => new Twig_Filter_Method($this, 'dynamic_path'), + '*_foo_*_bar' => new Twig_Filter_Method($this, 'dynamic_foo'), + ); + } + + public function getFunctions() + { + return array( + '☃' => new Twig_Function_Method($this, '☃Function'), + 'safe_br' => new Twig_Function_Method($this, 'br', array('is_safe' => array('html'))), + 'unsafe_br' => new Twig_Function_Method($this, 'br'), + '*_path' => new Twig_Function_Method($this, 'dynamic_path'), + '*_foo_*_bar' => new Twig_Function_Method($this, 'dynamic_foo'), + ); + } + + public function ☃Filter($value) + { + return "☃{$value}☃"; + } + + public function ☃Function($value) + { + return "☃{$value}☃"; + } + + /** + * nl2br which also escapes, for testing escaper filters + */ + public function escape_and_nl2br($env, $value, $sep = '<br />') + { + return $this->nl2br(twig_escape_filter($env, $value, 'html'), $sep); + } + + /** + * nl2br only, for testing filters with pre_escape + */ + public function nl2br($value, $sep = '<br />') + { + // not secure if $value contains html tags (not only entities) + // don't use + return str_replace("\n", "$sep\n", $value); + } + + public function dynamic_path($element, $item) + { + return $element.'/'.$item; + } + + public function dynamic_foo($foo, $bar, $item) + { + return $foo.'/'.$bar.'/'.$item; + } + + public function escape_something($value) + { + return strtoupper($value); + } + + public function preserves_safety($value) + { + return strtoupper($value); + } + + public function br() + { + return '<br />'; + } + + public function getName() + { + return 'test'; + } +} diff --git a/core/vendor/twig/twig/test/bootstrap.php b/core/vendor/twig/twig/test/bootstrap.php new file mode 100644 index 000000000000..36eb46af67ef --- /dev/null +++ b/core/vendor/twig/twig/test/bootstrap.php @@ -0,0 +1,13 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once dirname(__FILE__).'/../lib/Twig/Autoloader.php'; +Twig_Autoloader::register(); -- GitLab