From 14a700d00aaacaa89f3769674ca6aabf413e4531 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 2 Apr 2013 10:48:54 +0200 Subject: [PATCH] updating vendors --- vendor/autoload.php | 2 +- vendor/composer/autoload_classmap.php | 12 +- vendor/composer/autoload_namespaces.php | 4 + vendor/composer/autoload_real.php | 6 +- vendor/composer/installed.json | 1073 +++++++++++------ .../doctrine-orm-service-provider/.gitignore | 2 + vendor/doctrine/common/.gitignore | 4 + vendor/doctrine/common/.gitmodules | 3 + vendor/doctrine/common/tests/.gitignore | 3 + vendor/doctrine/dbal/.gitignore | 6 + vendor/doctrine/dbal/.gitmodules | 9 + vendor/doctrine/dbal/tests/.gitignore | 3 + vendor/doctrine/migrations/.gitignore | 8 + vendor/doctrine/orm/.gitignore | 11 + vendor/doctrine/orm/.gitmodules | 15 + vendor/doctrine/orm/tests/.gitignore | 3 + vendor/ezyang/htmlpurifier/.gitattributes | 1 + vendor/ezyang/htmlpurifier/.gitignore | 24 + .../htmlpurifier/plugins/phorum/.gitignore | 2 + vendor/gedmo/doctrine-extensions/.gitignore | 8 + .../igorw/config-service-provider/.gitignore | 2 + vendor/knplabs/knp-menu/.gitignore | 4 + vendor/kriswallsmith/assetic/.gitignore | 2 + vendor/kriswallsmith/assetic/.travis.yml | 13 + vendor/kriswallsmith/assetic/CHANGELOG-1.0.md | 36 + vendor/kriswallsmith/assetic/LICENSE | 19 + vendor/kriswallsmith/assetic/README.md | 283 +++++ vendor/kriswallsmith/assetic/composer.json | 21 + vendor/kriswallsmith/assetic/docs/en/build.md | 32 + .../kriswallsmith/assetic/docs/en/concepts.md | 129 ++ .../kriswallsmith/assetic/docs/en/define.md | 145 +++ vendor/kriswallsmith/assetic/docs/en/index.md | 7 + .../assetic/docs/en/introduction.md | 21 + vendor/kriswallsmith/assetic/docs/ja/build.md | 30 + .../kriswallsmith/assetic/docs/ja/concepts.md | 121 ++ .../kriswallsmith/assetic/docs/ja/define.md | 140 +++ vendor/kriswallsmith/assetic/docs/ja/index.md | 7 + .../assetic/docs/ja/introduction.md | 18 + .../kriswallsmith/assetic/phpunit.travis.xml | 36 + vendor/kriswallsmith/assetic/phpunit.xml.dist | 36 + .../assetic/src/Assetic/Asset/AssetCache.php | 149 +++ .../src/Assetic/Asset/AssetCollection.php | 326 +++++ .../src/Assetic/Asset/AssetInterface.php | 135 +++ .../src/Assetic/Asset/AssetReference.php | 118 ++ .../assetic/src/Assetic/Asset/BaseAsset.php | 135 +++ .../assetic/src/Assetic/Asset/FileAsset.php | 64 + .../assetic/src/Assetic/Asset/GlobAsset.php | 101 ++ .../assetic/src/Assetic/Asset/HttpAsset.php | 76 ++ .../assetic/src/Assetic/Asset/StringAsset.php | 55 + .../assetic/src/Assetic/AssetManager.php | 79 ++ .../assetic/src/Assetic/AssetWriter.php | 57 + .../src/Assetic/Cache/CacheInterface.php | 53 + .../assetic/src/Assetic/Cache/ConfigCache.php | 123 ++ .../src/Assetic/Cache/ExpiringCache.php | 60 + .../src/Assetic/Cache/FilesystemCache.php | 65 + .../Extension/Twig/AsseticExtension.php | 70 ++ .../Extension/Twig/AsseticFilterFunction.php | 29 + .../Extension/Twig/AsseticFilterInvoker.php | 59 + .../Assetic/Extension/Twig/AsseticNode.php | 123 ++ .../Extension/Twig/AsseticTokenParser.php | 135 +++ .../Extension/Twig/TwigFormulaLoader.php | 96 ++ .../Assetic/Extension/Twig/TwigResource.php | 54 + .../src/Assetic/Factory/AssetFactory.php | 359 ++++++ .../src/Assetic/Factory/LazyAssetManager.php | 204 ++++ .../Factory/Loader/BasePhpFormulaLoader.php | 159 +++ .../Factory/Loader/CachedFormulaLoader.php | 68 ++ .../Factory/Loader/FormulaLoaderInterface.php | 34 + .../Loader/FunctionCallsFormulaLoader.php | 53 + .../Resource/CoalescingDirectoryResource.php | 112 ++ .../Factory/Resource/DirectoryResource.php | 133 ++ .../Assetic/Factory/Resource/FileResource.php | 47 + .../Resource/IteratorResourceInterface.php | 21 + .../Factory/Resource/ResourceInterface.php | 43 + .../Factory/Worker/EnsureFilterWorker.php | 60 + .../Factory/Worker/WorkerInterface.php | 29 + .../src/Assetic/Filter/BaseCssFilter.php | 71 ++ .../src/Assetic/Filter/CallablesFilter.php | 45 + .../src/Assetic/Filter/CoffeeScriptFilter.php | 60 + .../src/Assetic/Filter/CompassFilter.php | 334 +++++ .../src/Assetic/Filter/CssEmbedFilter.php | 138 +++ .../src/Assetic/Filter/CssImportFilter.php | 106 ++ .../src/Assetic/Filter/CssMinFilter.php | 73 ++ .../src/Assetic/Filter/CssRewriteFilter.php | 93 ++ .../src/Assetic/Filter/FilterCollection.php | 82 ++ .../src/Assetic/Filter/FilterInterface.php | 36 + .../GoogleClosure/BaseCompilerFilter.php | 84 ++ .../GoogleClosure/CompilerApiFilter.php | 82 ++ .../GoogleClosure/CompilerJarFilter.php | 88 ++ .../src/Assetic/Filter/HashableInterface.php | 27 + .../src/Assetic/Filter/JpegoptimFilter.php | 80 ++ .../src/Assetic/Filter/JpegtranFilter.php | 101 ++ .../assetic/src/Assetic/Filter/LessFilter.php | 112 ++ .../src/Assetic/Filter/LessphpFilter.php | 48 + .../src/Assetic/Filter/OptiPngFilter.php | 74 ++ .../src/Assetic/Filter/PackagerFilter.php | 64 + .../src/Assetic/Filter/PngoutFilter.php | 126 ++ .../src/Assetic/Filter/Sass/SassFilter.php | 167 +++ .../src/Assetic/Filter/Sass/ScssFilter.php | 27 + .../src/Assetic/Filter/SprocketsFilter.php | 147 +++ .../src/Assetic/Filter/StylusFilter.php | 115 ++ .../Filter/Yui/BaseCompressorFilter.php | 106 ++ .../Filter/Yui/CssCompressorFilter.php | 27 + .../Assetic/Filter/Yui/JsCompressorFilter.php | 60 + .../assetic/src/Assetic/FilterManager.php | 64 + .../assetic/src/Assetic/Util/Process.php | 379 ++++++ .../src/Assetic/Util/ProcessBuilder.php | 117 ++ .../src/Assetic/Util/TraversableString.php | 44 + .../kriswallsmith/assetic/src/functions.php | 121 ++ .../Assetic/Test/Asset/AssetCacheTest.php | 175 +++ .../Test/Asset/AssetCollectionTest.php | 260 ++++ .../Assetic/Test/Asset/AssetReferenceTest.php | 126 ++ .../Assetic/Test/Asset/FileAssetTest.php | 64 + .../Assetic/Test/Asset/GlobAssetTest.php | 61 + .../Assetic/Test/Asset/HttpAssetTest.php | 54 + .../Assetic/Test/Asset/StringAssetTest.php | 79 ++ .../tests/Assetic/Test/AssetManagerTest.php | 53 + .../tests/Assetic/Test/AssetWriterTest.php | 55 + .../Assetic/Test/Cache/ConfigCacheTest.php | 65 + .../Assetic/Test/Cache/ExpiringCacheTest.php | 111 ++ .../Test/Cache/FilesystemCacheTest.php | 51 + .../Extension/Twig/AsseticExtensionTest.php | 198 +++ .../Extension/Twig/TwigFormulaLoaderTest.php | 107 ++ .../Test/Extension/Twig/TwigResourceTest.php | 48 + .../Twig/templates/absolute_path.twig | 3 + .../Extension/Twig/templates/combine.twig | 3 + .../Test/Extension/Twig/templates/debug.twig | 3 + .../Extension/Twig/templates/filters.twig | 3 + .../Extension/Twig/templates/function.twig | 3 + .../Test/Extension/Twig/templates/glob.twig | 3 + .../Test/Extension/Twig/templates/image.twig | 3 + .../Extension/Twig/templates/mixture.twig | 3 + .../Twig/templates/optional_filter.twig | 3 + .../Twig/templates/output_pattern.twig | 3 + .../Extension/Twig/templates/output_url.twig | 3 + .../Extension/Twig/templates/reference.twig | 3 + .../Twig/templates/unclosed_tag.twig | 5 + .../Assetic/Test/Factory/AssetFactoryTest.php | 187 +++ .../Test/Factory/LazyAssetManagerTest.php | 96 ++ .../Loader/CachedFormulaLoaderTest.php | 138 +++ .../Loader/FunctionCallsFormulaLoaderTest.php | 69 ++ .../Test/Factory/Loader/templates/debug.php | 8 + .../CoalescingDirectoryResourceTest.php | 42 + .../Resource/DirectoryResourceTest.php | 132 ++ .../Factory/Resource/FileResourceTest.php | 42 + .../Factory/Resource/Fixtures/dir1/file1.txt | 0 .../Factory/Resource/Fixtures/dir1/file2.txt | 0 .../Factory/Resource/Fixtures/dir2/file1.txt | 0 .../Factory/Resource/Fixtures/dir2/file3.txt | 0 .../Factory/Worker/EnsureFilterWorkerTest.php | 47 + .../Test/Filter/BaseImageFilterTest.php | 24 + .../Test/Filter/CallablesFilterTest.php | 39 + .../Test/Filter/CoffeeScriptFilterTest.php | 48 + .../Assetic/Test/Filter/CompassFilterTest.php | 66 + .../Test/Filter/CssEmbedFilterTest.php | 54 + .../Test/Filter/CssImportFilterTest.php | 67 + .../Assetic/Test/Filter/CssMinFilterTest.php | 37 + .../Test/Filter/CssRewriteFilterTest.php | 124 ++ .../Test/Filter/FilterCollectionTest.php | 59 + .../GoogleClosure/CompilerApiFilterTest.php | 61 + .../GoogleClosure/CompilerJarFilterTest.php | 55 + .../Test/Filter/JpegoptimFilterTest.php | 45 + .../Test/Filter/JpegtranFilterTest.php | 45 + .../Assetic/Test/Filter/LessFilterTest.php | 63 + .../Assetic/Test/Filter/LessphpFilterTest.php | 31 + .../Assetic/Test/Filter/OptiPngFilterTest.php | 56 + .../Test/Filter/PackagerFilterTest.php | 69 ++ .../Assetic/Test/Filter/PngoutFilterTest.php | 57 + .../Test/Filter/Sass/SassFilterTest.php | 70 ++ .../Test/Filter/Sass/ScssFilterTest.php | 44 + .../Test/Filter/SprocketsFilterTest.php | 69 ++ .../Assetic/Test/Filter/StylusFilterTest.php | 53 + .../Filter/Yui/BaseCompressorFilterTest.php | 31 + .../Filter/Yui/CssCompressorFilterTest.php | 23 + .../Filter/Yui/JsCompressorFilterTest.php | 62 + .../Test/Filter/fixtures/compass/compass.sass | 4 + .../fixtures/compass/partials/_sass.sass | 4 + .../fixtures/compass/partials/_scss.scss | 6 + .../Filter/fixtures/compass/stylesheet.sass | 4 + .../Filter/fixtures/compass/stylesheet.scss | 6 + .../Test/Filter/fixtures/cssembed/test.css | 4 + .../Test/Filter/fixtures/cssimport/import.css | 2 + .../Test/Filter/fixtures/cssimport/main.css | 4 + .../Test/Filter/fixtures/cssimport/more.sass | 1 + .../fixtures/cssimport/more/evenmore/bg.gif | 0 .../cssimport/more/evenmore/deep1.css | 2 + .../cssimport/more/evenmore/deep2.css | 4 + .../fixtures/cssimport/noncssimport.css | 2 + .../Test/Filter/fixtures/cssmin/fonts.css | 3 + .../Test/Filter/fixtures/cssmin/main.css | 5 + .../Assetic/Test/Filter/fixtures/home.gif | Bin 0 -> 61 bytes .../Assetic/Test/Filter/fixtures/home.jpg | Bin 0 -> 431 bytes .../Assetic/Test/Filter/fixtures/home.png | Bin 0 -> 184 bytes .../Test/Filter/fixtures/less/_include.less | 1 + .../Test/Filter/fixtures/less/main.less | 3 + .../fixtures/packager/app/application.js | 11 + .../Filter/fixtures/packager/lib/package.yml | 4 + .../Test/Filter/fixtures/packager/lib/util.js | 11 + .../Test/Filter/fixtures/sass/_include.scss | 1 + .../Test/Filter/fixtures/sass/main.scss | 3 + .../Test/Filter/fixtures/sprockets/include.js | 1 + .../sprockets/lib1/assets/images/image.gif | Bin 0 -> 49 bytes .../Filter/fixtures/sprockets/lib1/header.js | 3 + .../Filter/fixtures/sprockets/lib2/footer.js | 1 + .../Test/Filter/fixtures/sprockets/main.js | 5 + .../tests/Assetic/Test/FilterManagerTest.php | 58 + .../Assetic/Test/Util/ProcessBuilderTest.php | 56 + .../Test/Util/TraversableStringTest.php | 35 + .../kriswallsmith/assetic/tests/bootstrap.php | 47 + vendor/leafo/lessphp | 1 + vendor/mheap/silex-assetic | 1 + vendor/monolog/monolog/CHANGELOG.mdown | 28 +- .../src/Monolog/Formatter/LineFormatter.php | 4 + .../src/Monolog/Handler/BufferHandler.php | 6 + .../Monolog/Handler/FingersCrossedHandler.php | 6 + .../src/Monolog/Handler/GroupHandler.php | 6 + .../src/Monolog/Handler/RavenHandler.php | 26 +- .../Monolog/Handler/RotatingFileHandler.php | 41 +- .../src/Monolog/Processor/WebProcessor.php | 12 +- .../Monolog/Formatter/LineFormatterTest.php | 17 + .../Monolog/Handler/BufferHandlerTest.php | 19 + .../Handler/FingersCrossedHandlerTest.php | 18 + .../tests/Monolog/Handler/Fixtures/.gitkeep | 0 .../Monolog/Handler/GroupHandlerTest.php | 18 + vendor/mpdf/mpdf/.gitignore | 3 + vendor/natxet/CssMin | 1 + vendor/pagerfanta/pagerfanta/.gitignore | 4 + vendor/pagerfanta/pagerfanta/.travis.yml | 5 +- vendor/pagerfanta/pagerfanta/README.md | 20 + vendor/pagerfanta/pagerfanta/composer.json | 2 +- vendor/pagerfanta/pagerfanta/phpunit.xml.dist | 2 +- .../Pagerfanta/Adapter/AdapterInterface.php | 6 - .../src/Pagerfanta/Adapter/ArrayAdapter.php | 6 - .../Pagerfanta/Adapter/CallbackAdapter.php | 26 +- .../Adapter/DoctrineCollectionAdapter.php | 6 - .../Adapter/DoctrineODMMongoDBAdapter.php | 12 +- .../Adapter/DoctrineORM/Paginator.php | 6 - .../Pagerfanta/Adapter/DoctrineORMAdapter.php | 13 +- .../src/Pagerfanta/Adapter/FixedAdapter.php | 52 + .../Pagerfanta/Adapter/MandangoAdapter.php | 6 - .../src/Pagerfanta/Adapter/MongoAdapter.php | 11 +- .../src/Pagerfanta/Adapter/NullAdapter.php | 30 +- .../src/Pagerfanta/Adapter/PropelAdapter.php | 10 +- .../Pagerfanta/Adapter/SolariumAdapter.php | 79 +- .../Exception/NotBooleanException.php | 19 + .../pagerfanta/src/Pagerfanta/Pagerfanta.php | 325 +++-- .../src/Pagerfanta/PagerfantaInterface.php | 132 +- .../src/Pagerfanta/View/DefaultView.php | 239 +++- .../src/Pagerfanta/View/OptionableView.php | 8 +- .../View/Template/DefaultTemplate.php | 89 ++ .../src/Pagerfanta/View/Template/Template.php | 43 + .../View/Template/TemplateInterface.php | 40 + .../Template/TwitterBootstrapTemplate.php | 139 +++ .../Pagerfanta/View/TwitterBootstrapView.php | 105 +- .../src/Pagerfanta/View/ViewFactory.php | 4 - .../Pagerfanta/View/ViewFactoryInterface.php | 12 - .../src/Pagerfanta/View/ViewInterface.php | 11 +- .../Tests/Adapter/ArrayAdapterTest.php | 15 +- .../Tests/Adapter/CallbackAdapterTest.php | 68 +- .../Adapter/DoctrineCollectionAdapterTest.php | 75 ++ .../Tests/Adapter/DoctrineCollectionTest.php | 64 - .../Adapter/DoctrineODMMongoDBAdapterTest.php | 65 +- .../Tests/Adapter/DoctrineORMAdapterTest.php | 28 +- .../Tests/Adapter/FixedAdapterTest.php | 32 + .../Tests/Adapter/MandangoAdapterTest.php | 72 +- .../Tests/Adapter/MongoAdapterTest.php | 58 +- .../Tests/Adapter/NullAdapterTest.php | 32 +- .../Tests/Adapter/PropelAdapterTest.php | 66 +- .../Tests/Adapter/Solarium2AdapterTest.php | 26 + .../Tests/Adapter/Solarium3AdapterTest.php | 26 + .../Tests/Adapter/SolariumAdapterTest.php | 143 +-- .../tests/Pagerfanta/Tests/PagerfantaTest.php | 637 +++++++--- .../Pagerfanta/Tests/View/DefaultViewTest.php | 285 ++++- .../Tests/View/OptionableViewTest.php | 62 +- .../Tests/View/TwitterBootstrapViewTest.php | 324 ++++- .../Pagerfanta/Tests/View/ViewTestCase.php | 72 ++ .../pagerfanta/pagerfanta/tests/bootstrap.php | 7 + vendor/pimple/pimple/.gitignore | 1 + vendor/psr/log/.gitignore | 1 + vendor/realityking/pchart | 1 + vendor/silex/silex/.gitignore | 5 + vendor/silex/silex/doc/cookbook/index.rst | 3 + .../silex/doc/cookbook/multiple_loggers.rst | 71 ++ vendor/silex/silex/doc/services.rst | 9 + vendor/silex/silex/doc/web_servers.rst | 3 +- vendor/silex/silex/src/Silex/Application.php | 11 +- .../silex/silex/src/Silex/RequestContext.php | 33 + vendor/silex/silex/src/Silex/Route.php | 16 + .../silex/tests/Silex/Tests/RouterTest.php | 12 + .../web-profiler/Silex/Provider/.gitignore | 3 + vendor/swiftmailer/swiftmailer/.gitignore | 6 + vendor/swiftmailer/swiftmailer/README.git | 85 ++ .../Symfony/Component/BrowserKit/.gitignore | 4 + .../Symfony/Component/Config/.gitignore | 4 + .../Symfony/Component/Console/.gitignore | 4 + .../Component/DependencyInjection/.gitignore | 4 + .../Symfony/Bridge/Doctrine/.gitignore | 4 + .../Symfony/Component/DomCrawler/.gitignore | 4 + .../Component/EventDispatcher/.gitignore | 4 + .../Symfony/Component/Finder/.gitignore | 4 + .../Finder/Adapter/AbstractAdapter.php | 225 ++++ .../Finder/Adapter/AbstractFindAdapter.php | 320 +++++ .../Finder/Adapter/AdapterInterface.php | 137 +++ .../Finder/Adapter/BsdFindAdapter.php | 101 ++ .../Finder/Adapter/GnuFindAdapter.php | 102 ++ .../Component/Finder/Adapter/PhpAdapter.php | 98 ++ .../Symfony/Component/Finder/CHANGELOG.md | 24 + .../Finder/Comparator/Comparator.php | 98 ++ .../Finder/Comparator/DateComparator.php | 54 + .../Finder/Comparator/NumberComparator.php | 82 ++ .../Exception/AdapterFailureException.php | 46 + .../Finder/Exception/ExceptionInterface.php | 14 + .../OperationNotPermitedException.php | 19 + .../ShellCommandFailureException.php | 45 + .../Finder/Expression/Expression.php | 146 +++ .../Component/Finder/Expression/Glob.php | 157 +++ .../Component/Finder/Expression/Regex.php | 317 +++++ .../Finder/Expression/ValueInterface.php | 60 + .../Symfony/Component/Finder/Finder.php | 811 +++++++++++++ .../finder/Symfony/Component/Finder/Glob.php | 103 ++ .../Finder/Iterator/CustomFilterIterator.php | 63 + .../Iterator/DateRangeFilterIterator.php | 60 + .../Iterator/DepthRangeFilterIterator.php | 47 + .../ExcludeDirectoryFilterIterator.php | 56 + .../Finder/Iterator/FilePathsIterator.php | 131 ++ .../Iterator/FileTypeFilterIterator.php | 55 + .../Iterator/FilecontentFilterIterator.php | 76 ++ .../Iterator/FilenameFilterIterator.php | 68 ++ .../Finder/Iterator/FilterIterator.php | 42 + .../Iterator/MultiplePcreFilterIterator.php | 68 ++ .../Finder/Iterator/PathFilterIterator.php | 75 ++ .../Iterator/RecursiveDirectoryIterator.php | 41 + .../Iterator/SizeRangeFilterIterator.php | 59 + .../Finder/Iterator/SortableIterator.php | 82 ++ .../finder/Symfony/Component/Finder/LICENSE | 19 + .../finder/Symfony/Component/Finder/README.md | 41 + .../Component/Finder/Shell/Command.php | 264 ++++ .../Symfony/Component/Finder/Shell/Shell.php | 95 ++ .../Symfony/Component/Finder/SplFileInfo.php | 77 ++ .../Tests/Comparator/ComparatorTest.php | 64 + .../Tests/Comparator/DateComparatorTest.php | 64 + .../Tests/Comparator/NumberComparatorTest.php | 109 ++ .../Tests/Expression/ExpressionTest.php | 68 ++ .../Finder/Tests/Expression/GlobTest.php | 47 + .../Finder/Tests/Expression/RegexTest.php | 143 +++ .../Finder/Tests/FakeAdapter/DummyAdapter.php | 57 + .../Tests/FakeAdapter/FailingAdapter.php | 45 + .../Finder/Tests/FakeAdapter/NamedAdapter.php | 57 + .../Tests/FakeAdapter/UnsupportedAdapter.php | 44 + .../Component/Finder/Tests/FinderTest.php | 775 ++++++++++++ .../Finder/Tests/Fixtures/A/B/C/abc.dat | 0 .../Finder/Tests/Fixtures/A/B/ab.dat | 0 .../Component/Finder/Tests/Fixtures/A/a.dat | 0 .../Tests/Fixtures/copy/A/B/C/abc.dat.copy | 0 .../Tests/Fixtures/copy/A/B/ab.dat.copy | 0 .../Finder/Tests/Fixtures/copy/A/a.dat.copy | 0 .../Component/Finder/Tests/Fixtures/dolor.txt | 2 + .../Component/Finder/Tests/Fixtures/ipsum.txt | 2 + .../Component/Finder/Tests/Fixtures/lorem.txt | 2 + .../Iterator/CustomFilterIteratorTest.php | 46 + .../Iterator/DateRangeFilterIteratorTest.php | 39 + .../Iterator/DepthRangeFilterIteratorTest.php | 48 + .../ExcludeDirectoryFilterIteratorTest.php | 62 + .../Tests/Iterator/FilePathsIteratorTest.php | 66 + .../Iterator/FileTypeFilterIteratorTest.php | 55 + .../FilecontentFilterIteratorTest.php | 89 ++ .../Iterator/FilenameFilterIteratorTest.php | 54 + .../Tests/Iterator/FilterIteratorTest.php | 50 + .../Finder/Tests/Iterator/Iterator.php | 56 + .../Tests/Iterator/IteratorTestCase.php | 36 + .../Tests/Iterator/MockFileListIterator.php | 21 + .../Finder/Tests/Iterator/MockSplFileInfo.php | 134 ++ .../MultiplePcreFilterIteratorTest.php | 67 + .../Tests/Iterator/PathFilterIteratorTest.php | 85 ++ .../Tests/Iterator/RealIteratorTestCase.php | 66 + .../Iterator/SizeRangeFilterIteratorTest.php | 60 + .../Tests/Iterator/SortableIteratorTest.php | 48 + .../Symfony/Component/Finder/composer.json | 31 + .../Symfony/Component/Finder/phpunit.xml.dist | 29 + .../form/Symfony/Component/Form/.gitignore | 4 + .../Extension/Validator/Util/ServerParams.php | 4 +- .../Validator/Util/ServerParamsTest.php | 4 + .../Component/HttpFoundation/.gitignore | 4 + .../Symfony/Component/HttpKernel/.gitignore | 5 + .../Symfony/Component/Locale/.gitignore | 9 + .../Component/OptionsResolver/.gitignore | 4 + .../Component/PropertyAccess/.gitattributes | 2 + .../Component/PropertyAccess/.gitignore | 4 + .../Symfony/Component/Routing/.gitignore | 4 + .../Symfony/Component/Security/.gitignore | 4 + .../Component/Stopwatch/.gitattributes | 2 + .../Symfony/Component/Stopwatch/.gitignore | 1 + .../Symfony/Component/Translation/.gitignore | 4 + .../Symfony/Bridge/Twig/.gitignore | 4 + .../Symfony/Component/Validator/.gitignore | 4 + .../Bundle/WebProfilerBundle/.gitignore | 4 + vendor/twig/twig/.gitignore | 2 + vendor/twig/twig/ext/twig/.gitignore | 30 + 397 files changed, 22772 insertions(+), 1479 deletions(-) create mode 100644 vendor/dflydev/doctrine-orm-service-provider/.gitignore create mode 100644 vendor/doctrine/common/.gitignore create mode 100644 vendor/doctrine/common/.gitmodules create mode 100644 vendor/doctrine/common/tests/.gitignore create mode 100644 vendor/doctrine/dbal/.gitignore create mode 100644 vendor/doctrine/dbal/.gitmodules create mode 100644 vendor/doctrine/dbal/tests/.gitignore create mode 100644 vendor/doctrine/migrations/.gitignore create mode 100644 vendor/doctrine/orm/.gitignore create mode 100644 vendor/doctrine/orm/.gitmodules create mode 100644 vendor/doctrine/orm/tests/.gitignore create mode 100644 vendor/ezyang/htmlpurifier/.gitattributes create mode 100644 vendor/ezyang/htmlpurifier/.gitignore create mode 100644 vendor/ezyang/htmlpurifier/plugins/phorum/.gitignore create mode 100644 vendor/gedmo/doctrine-extensions/.gitignore create mode 100644 vendor/igorw/config-service-provider/.gitignore create mode 100644 vendor/knplabs/knp-menu/.gitignore create mode 100644 vendor/kriswallsmith/assetic/.gitignore create mode 100644 vendor/kriswallsmith/assetic/.travis.yml create mode 100644 vendor/kriswallsmith/assetic/CHANGELOG-1.0.md create mode 100644 vendor/kriswallsmith/assetic/LICENSE create mode 100644 vendor/kriswallsmith/assetic/README.md create mode 100644 vendor/kriswallsmith/assetic/composer.json create mode 100644 vendor/kriswallsmith/assetic/docs/en/build.md create mode 100644 vendor/kriswallsmith/assetic/docs/en/concepts.md create mode 100644 vendor/kriswallsmith/assetic/docs/en/define.md create mode 100644 vendor/kriswallsmith/assetic/docs/en/index.md create mode 100644 vendor/kriswallsmith/assetic/docs/en/introduction.md create mode 100644 vendor/kriswallsmith/assetic/docs/ja/build.md create mode 100644 vendor/kriswallsmith/assetic/docs/ja/concepts.md create mode 100644 vendor/kriswallsmith/assetic/docs/ja/define.md create mode 100644 vendor/kriswallsmith/assetic/docs/ja/index.md create mode 100644 vendor/kriswallsmith/assetic/docs/ja/introduction.md create mode 100644 vendor/kriswallsmith/assetic/phpunit.travis.xml create mode 100644 vendor/kriswallsmith/assetic/phpunit.xml.dist create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCache.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollection.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetInterface.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetReference.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/BaseAsset.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/FileAsset.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/GlobAsset.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/HttpAsset.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/StringAsset.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/AssetManager.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Cache/CacheInterface.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Cache/ConfigCache.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Cache/ExpiringCache.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Cache/FilesystemCache.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticExtension.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterFunction.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterInvoker.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticNode.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticTokenParser.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigFormulaLoader.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigResource.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/AssetFactory.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/BasePhpFormulaLoader.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/CachedFormulaLoader.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FormulaLoaderInterface.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FunctionCallsFormulaLoader.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/CoalescingDirectoryResource.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/DirectoryResource.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/FileResource.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/IteratorResourceInterface.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/ResourceInterface.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/EnsureFilterWorker.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/WorkerInterface.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseCssFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/CallablesFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/CoffeeScriptFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/CompassFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/CssEmbedFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/CssImportFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/CssMinFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/CssRewriteFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterCollection.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterInterface.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/BaseCompilerFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerApiFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerJarFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/HashableInterface.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegoptimFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegtranFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/LessFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/LessphpFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/OptiPngFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/PackagerFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/PngoutFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/SassFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/ScssFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/SprocketsFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/StylusFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/BaseCompressorFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/CssCompressorFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/JsCompressorFilter.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/FilterManager.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Util/Process.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Util/ProcessBuilder.php create mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Util/TraversableString.php create mode 100644 vendor/kriswallsmith/assetic/src/functions.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetCacheTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetCollectionTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetReferenceTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/FileAssetTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/GlobAssetTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/HttpAssetTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/StringAssetTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/AssetManagerTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/AssetWriterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ConfigCacheTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ExpiringCacheTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/FilesystemCacheTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/AsseticExtensionTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/TwigFormulaLoaderTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/TwigResourceTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/absolute_path.twig create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/combine.twig create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/debug.twig create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/filters.twig create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/function.twig create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/glob.twig create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/image.twig create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/mixture.twig create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/optional_filter.twig create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/output_pattern.twig create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/output_url.twig create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/reference.twig create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/unclosed_tag.twig create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/AssetFactoryTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/LazyAssetManagerTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/CachedFormulaLoaderTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/FunctionCallsFormulaLoaderTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/templates/debug.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/CoalescingDirectoryResourceTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/DirectoryResourceTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/FileResourceTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir1/file1.txt create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir1/file2.txt create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir2/file1.txt create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir2/file3.txt create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Worker/EnsureFilterWorkerTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/BaseImageFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CallablesFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CoffeeScriptFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CompassFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssEmbedFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssImportFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssMinFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssRewriteFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/FilterCollectionTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GoogleClosure/CompilerApiFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GoogleClosure/CompilerJarFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JpegoptimFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JpegtranFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/LessFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/LessphpFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/OptiPngFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PackagerFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PngoutFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Sass/SassFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Sass/ScssFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/SprocketsFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/StylusFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/BaseCompressorFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/CssCompressorFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/JsCompressorFilterTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/compass.sass create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/partials/_sass.sass create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/partials/_scss.scss create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/stylesheet.sass create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/stylesheet.scss create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssembed/test.css create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/import.css create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/main.css create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more.sass create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/bg.gif create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/deep1.css create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/deep2.css create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/noncssimport.css create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssmin/fonts.css create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssmin/main.css create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/home.gif create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/home.jpg create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/home.png create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/less/_include.less create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/less/main.less create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/packager/app/application.js create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/packager/lib/package.yml create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/packager/lib/util.js create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sass/_include.scss create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sass/main.scss create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/include.js create mode 100755 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/lib1/assets/images/image.gif create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/lib1/header.js create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/lib2/footer.js create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/main.js create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/FilterManagerTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Util/ProcessBuilderTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Util/TraversableStringTest.php create mode 100644 vendor/kriswallsmith/assetic/tests/bootstrap.php create mode 160000 vendor/leafo/lessphp create mode 160000 vendor/mheap/silex-assetic create mode 100644 vendor/monolog/monolog/tests/Monolog/Handler/Fixtures/.gitkeep create mode 100644 vendor/mpdf/mpdf/.gitignore create mode 160000 vendor/natxet/CssMin create mode 100644 vendor/pagerfanta/pagerfanta/.gitignore create mode 100644 vendor/pagerfanta/pagerfanta/src/Pagerfanta/Adapter/FixedAdapter.php create mode 100644 vendor/pagerfanta/pagerfanta/src/Pagerfanta/Exception/NotBooleanException.php create mode 100644 vendor/pagerfanta/pagerfanta/src/Pagerfanta/View/Template/DefaultTemplate.php create mode 100644 vendor/pagerfanta/pagerfanta/src/Pagerfanta/View/Template/Template.php create mode 100644 vendor/pagerfanta/pagerfanta/src/Pagerfanta/View/Template/TemplateInterface.php create mode 100644 vendor/pagerfanta/pagerfanta/src/Pagerfanta/View/Template/TwitterBootstrapTemplate.php create mode 100644 vendor/pagerfanta/pagerfanta/tests/Pagerfanta/Tests/Adapter/DoctrineCollectionAdapterTest.php delete mode 100644 vendor/pagerfanta/pagerfanta/tests/Pagerfanta/Tests/Adapter/DoctrineCollectionTest.php create mode 100644 vendor/pagerfanta/pagerfanta/tests/Pagerfanta/Tests/Adapter/FixedAdapterTest.php create mode 100644 vendor/pagerfanta/pagerfanta/tests/Pagerfanta/Tests/Adapter/Solarium2AdapterTest.php create mode 100644 vendor/pagerfanta/pagerfanta/tests/Pagerfanta/Tests/Adapter/Solarium3AdapterTest.php create mode 100644 vendor/pagerfanta/pagerfanta/tests/Pagerfanta/Tests/View/ViewTestCase.php create mode 100644 vendor/pimple/pimple/.gitignore create mode 100644 vendor/psr/log/.gitignore create mode 160000 vendor/realityking/pchart create mode 100644 vendor/silex/silex/.gitignore create mode 100644 vendor/silex/silex/doc/cookbook/multiple_loggers.rst create mode 100644 vendor/silex/silex/src/Silex/RequestContext.php create mode 100644 vendor/silex/web-profiler/Silex/Provider/.gitignore create mode 100644 vendor/swiftmailer/swiftmailer/.gitignore create mode 100644 vendor/swiftmailer/swiftmailer/README.git create mode 100644 vendor/symfony/browser-kit/Symfony/Component/BrowserKit/.gitignore create mode 100644 vendor/symfony/config/Symfony/Component/Config/.gitignore create mode 100644 vendor/symfony/console/Symfony/Component/Console/.gitignore create mode 100644 vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/.gitignore create mode 100644 vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/.gitignore create mode 100644 vendor/symfony/dom-crawler/Symfony/Component/DomCrawler/.gitignore create mode 100644 vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/.gitignore create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/.gitignore create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Adapter/AbstractAdapter.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Adapter/AbstractFindAdapter.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Adapter/AdapterInterface.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Adapter/BsdFindAdapter.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Adapter/GnuFindAdapter.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Adapter/PhpAdapter.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/CHANGELOG.md create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Comparator/Comparator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Comparator/DateComparator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Comparator/NumberComparator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Exception/AdapterFailureException.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Exception/ExceptionInterface.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Exception/OperationNotPermitedException.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Exception/ShellCommandFailureException.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Expression/Expression.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Expression/Glob.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Expression/Regex.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Expression/ValueInterface.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Finder.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Glob.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Iterator/CustomFilterIterator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Iterator/DateRangeFilterIterator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Iterator/DepthRangeFilterIterator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Iterator/FilePathsIterator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Iterator/FileTypeFilterIterator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Iterator/FilecontentFilterIterator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Iterator/FilenameFilterIterator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Iterator/FilterIterator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Iterator/PathFilterIterator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Iterator/SizeRangeFilterIterator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Iterator/SortableIterator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/LICENSE create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/README.md create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Shell/Command.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Shell/Shell.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/SplFileInfo.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Comparator/ComparatorTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Comparator/DateComparatorTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Comparator/NumberComparatorTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Expression/ExpressionTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Expression/GlobTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Expression/RegexTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/FakeAdapter/DummyAdapter.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/FakeAdapter/FailingAdapter.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/FakeAdapter/NamedAdapter.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/FakeAdapter/UnsupportedAdapter.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/FinderTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Fixtures/A/B/C/abc.dat create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Fixtures/A/B/ab.dat create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Fixtures/A/a.dat create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Fixtures/copy/A/B/C/abc.dat.copy create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Fixtures/copy/A/B/ab.dat.copy create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Fixtures/copy/A/a.dat.copy create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Fixtures/dolor.txt create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Fixtures/ipsum.txt create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Fixtures/lorem.txt create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/CustomFilterIteratorTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/DateRangeFilterIteratorTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/DepthRangeFilterIteratorTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/ExcludeDirectoryFilterIteratorTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/FilePathsIteratorTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/FileTypeFilterIteratorTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/FilecontentFilterIteratorTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/FilenameFilterIteratorTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/FilterIteratorTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/Iterator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/IteratorTestCase.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/MockFileListIterator.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/MockSplFileInfo.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/MultiplePcreFilterIteratorTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/PathFilterIteratorTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/RealIteratorTestCase.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/SizeRangeFilterIteratorTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/SortableIteratorTest.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/composer.json create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/phpunit.xml.dist create mode 100644 vendor/symfony/form/Symfony/Component/Form/.gitignore create mode 100644 vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/.gitignore create mode 100644 vendor/symfony/http-kernel/Symfony/Component/HttpKernel/.gitignore create mode 100644 vendor/symfony/locale/Symfony/Component/Locale/.gitignore create mode 100644 vendor/symfony/options-resolver/Symfony/Component/OptionsResolver/.gitignore create mode 100644 vendor/symfony/property-access/Symfony/Component/PropertyAccess/.gitattributes create mode 100644 vendor/symfony/property-access/Symfony/Component/PropertyAccess/.gitignore create mode 100644 vendor/symfony/routing/Symfony/Component/Routing/.gitignore create mode 100644 vendor/symfony/security/Symfony/Component/Security/.gitignore create mode 100644 vendor/symfony/stopwatch/Symfony/Component/Stopwatch/.gitattributes create mode 100644 vendor/symfony/stopwatch/Symfony/Component/Stopwatch/.gitignore create mode 100644 vendor/symfony/translation/Symfony/Component/Translation/.gitignore create mode 100644 vendor/symfony/twig-bridge/Symfony/Bridge/Twig/.gitignore create mode 100644 vendor/symfony/validator/Symfony/Component/Validator/.gitignore create mode 100644 vendor/symfony/web-profiler-bundle/Symfony/Bundle/WebProfilerBundle/.gitignore create mode 100644 vendor/twig/twig/.gitignore create mode 100644 vendor/twig/twig/ext/twig/.gitignore diff --git a/vendor/autoload.php b/vendor/autoload.php index 57903ce6dd..74b093bd05 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInitd24496e0f90c4d116f1d9ee1aa6c4265::getLoader(); +return ComposerAutoloaderInit619569345dbdca8191d598b543f27c69::getLoader(); diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index c6a880304e..a64456d9d6 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -419,7 +419,6 @@ return array( 'MultipleAnswerCombination' => $baseDir . '/main/exercice/multiple_answer_combination.class.php', 'MultipleAnswerCombinationTrueFalse' => $baseDir . '/main/exercice/multiple_answer_combination_true_false.class.php', 'MultipleAnswerTrueFalse' => $baseDir . '/main/exercice/multiple_answer_true_false.class.php', - 'MyHorBar' => $baseDir . '/main/inc/lib/pchart/MyHorBar.class.php', 'Nanogong' => $baseDir . '/main/inc/lib/nanogong.lib.php', 'NotebookManager' => $baseDir . '/main/inc/lib/notebook.lib.php', 'Notification' => $baseDir . '/main/inc/lib/notification.lib.php', @@ -713,6 +712,11 @@ return array( 'learnpathItem' => $baseDir . '/main/newscorm/learnpathItem.class.php', 'learnpathList' => $baseDir . '/main/newscorm/learnpathList.class.php', 'learnpath_processor' => $baseDir . '/main/inc/lib/search/tool_processors/learnpath_processor.class.php', + 'lessc' => $baseDir . '/vendor/leafo/lessphp/lessc.inc.php', + 'lessc_formatter_classic' => $baseDir . '/vendor/leafo/lessphp/lessc.inc.php', + 'lessc_formatter_compressed' => $baseDir . '/vendor/leafo/lessphp/lessc.inc.php', + 'lessc_formatter_lessjs' => $baseDir . '/vendor/leafo/lessphp/lessc.inc.php', + 'lessc_parser' => $baseDir . '/vendor/leafo/lessphp/lessc.inc.php', 'link_processor' => $baseDir . '/main/inc/lib/search/tool_processors/link_processor.class.php', 'mPDF' => $baseDir . '/vendor/mpdf/mpdf/mpdf.php', 'manager' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.manager.php', @@ -728,9 +732,9 @@ return array( 'nusoap_wsdlcache' => $baseDir . '/main/inc/lib/nusoap/class.wsdlcache.php', 'nusoap_xmlschema' => $baseDir . '/main/inc/lib/nusoap/class.xmlschema.php', 'nusoapservermime' => $baseDir . '/main/inc/lib/nusoap/nusoapmime.php', - 'pCache' => $baseDir . '/main/inc/lib/pchart/pCache.class.php', - 'pChart' => $baseDir . '/main/inc/lib/pchart/pChart.class.php', - 'pData' => $baseDir . '/main/inc/lib/pchart/pData.class.php', + 'pCache' => $baseDir . '/vendor/realityking/pchart/src/pCache.php', + 'pChart' => $baseDir . '/vendor/realityking/pchart/src/pChart.php', + 'pData' => $baseDir . '/vendor/realityking/pchart/src/pData.php', 'pagination' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.pagination.php', 'php4DOMAttr' => $baseDir . '/main/auth/cas/lib/CAS/domxml-php4-to-php5.php', 'php4DOMDocument' => $baseDir . '/main/auth/cas/lib/CAS/domxml-php4-to-php5.php', diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index 4b89ba5589..faf3a29d5d 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -19,6 +19,7 @@ return array( 'Symfony\\Component\\HttpKernel\\' => $vendorDir . '/symfony/http-kernel/', 'Symfony\\Component\\HttpFoundation\\' => $vendorDir . '/symfony/http-foundation/', 'Symfony\\Component\\Form\\' => $vendorDir . '/symfony/form/', + 'Symfony\\Component\\Finder\\' => $vendorDir . '/symfony/finder/', 'Symfony\\Component\\EventDispatcher\\' => $vendorDir . '/symfony/event-dispatcher/', 'Symfony\\Component\\DomCrawler\\' => $vendorDir . '/symfony/dom-crawler/', 'Symfony\\Component\\DependencyInjection\\' => $vendorDir . '/symfony/dependency-injection/', @@ -29,6 +30,7 @@ return array( 'Symfony\\Bridge\\Twig\\' => $vendorDir . '/symfony/twig-bridge/', 'Symfony\\Bridge\\Doctrine\\' => $vendorDir . '/symfony/doctrine-bridge/', 'Silex\\Provider\\' => $vendorDir . '/silex/web-profiler/', + 'SilexAssetic' => $vendorDir . '/mheap/silex-assetic/src', 'Silex' => $vendorDir . '/silex/silex/src/', 'Psr\\Log\\' => $vendorDir . '/psr/log/', 'Pimple' => $vendorDir . '/pimple/pimple/lib/', @@ -46,6 +48,8 @@ return array( 'Dflydev\\Silex\\Provider\\DoctrineOrm' => $vendorDir . '/dflydev/doctrine-orm-service-provider/src', 'Dflydev\\Pimple\\Provider\\DoctrineOrm' => $vendorDir . '/dflydev/doctrine-orm-service-provider/src', 'Dflydev\\Cilex\\Provider\\DoctrineOrm' => $vendorDir . '/dflydev/doctrine-orm-service-provider/src', + 'CssMin' => $vendorDir . '/natxet/CssMin/src/', 'Chash' => $vendorDir . '/chamilo/chash/src/', 'ChamiloLMS' => $baseDir . '/src/', + 'Assetic' => $vendorDir . '/kriswallsmith/assetic/src/', ); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index ad587b7956..906ef41630 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php generated by Composer -class ComposerAutoloaderInitd24496e0f90c4d116f1d9ee1aa6c4265 +class ComposerAutoloaderInit619569345dbdca8191d598b543f27c69 { private static $loader; @@ -19,9 +19,9 @@ class ComposerAutoloaderInitd24496e0f90c4d116f1d9ee1aa6c4265 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitd24496e0f90c4d116f1d9ee1aa6c4265', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit619569345dbdca8191d598b543f27c69', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInitd24496e0f90c4d116f1d9ee1aa6c4265', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit619569345dbdca8191d598b543f27c69', 'loadClassLoader')); $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 9915340e72..7f382ca36a 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -805,12 +805,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/Form.git", - "reference": "1ec4311b512a051c18300e9e1ebc1442f62da5ac" + "reference": "8659a898edadadf170dc3697c70c1030f65e8d67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Form/zipball/1ec4311b512a051c18300e9e1ebc1442f62da5ac", - "reference": "1ec4311b512a051c18300e9e1ebc1442f62da5ac", + "url": "https://api.github.com/repos/symfony/Form/zipball/8659a898edadadf170dc3697c70c1030f65e8d67", + "reference": "8659a898edadadf170dc3697c70c1030f65e8d67", "shasum": "" }, "require": { @@ -828,7 +828,7 @@ "symfony/http-foundation": "2.2.*", "symfony/validator": "2.2.*" }, - "time": "2013-03-26 13:01:49", + "time": "2013-03-27 09:08:41", "type": "library", "extra": { "branch-alias": { @@ -1035,118 +1035,6 @@ "description": "Symfony DependencyInjection Component", "homepage": "http://symfony.com" }, - { - "name": "symfony/dom-crawler", - "version": "v2.2.0", - "version_normalized": "2.2.0.0", - "target-dir": "Symfony/Component/DomCrawler", - "source": { - "type": "git", - "url": "https://github.com/symfony/DomCrawler.git", - "reference": "v2.2.0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/v2.2.0", - "reference": "v2.2.0", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "symfony/css-selector": ">=2.0,<3.0" - }, - "suggest": { - "symfony/css-selector": "2.2.*" - }, - "time": "2013-03-01 06:43:14", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Symfony\\Component\\DomCrawler\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony DomCrawler Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/browser-kit", - "version": "dev-master", - "version_normalized": "9999999-dev", - "target-dir": "Symfony/Component/BrowserKit", - "source": { - "type": "git", - "url": "https://github.com/symfony/BrowserKit.git", - "reference": "b0aa5249d957930f93c0c2a3f1f10db0721cb6e9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/b0aa5249d957930f93c0c2a3f1f10db0721cb6e9", - "reference": "b0aa5249d957930f93c0c2a3f1f10db0721cb6e9", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "symfony/dom-crawler": ">=2.0,<3.0" - }, - "require-dev": { - "symfony/css-selector": ">=2.0,<3.0", - "symfony/process": ">=2.0,<3.0" - }, - "suggest": { - "symfony/process": "2.2.*" - }, - "time": "2013-03-20 14:03:03", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\BrowserKit\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony BrowserKit Component", - "homepage": "http://symfony.com" - }, { "name": "doctrine/dbal", "version": "2.3.3", @@ -1275,12 +1163,12 @@ "source": { "type": "git", "url": "https://github.com/whiteoctober/Pagerfanta.git", - "reference": "ae0ff215b3be2c3bd0b131a8b8daa9b15568c6db" + "reference": "43feb3d11af5ea16e5f1ef61fbe05df8337b6c46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/whiteoctober/Pagerfanta/zipball/ae0ff215b3be2c3bd0b131a8b8daa9b15568c6db", - "reference": "ae0ff215b3be2c3bd0b131a8b8daa9b15568c6db", + "url": "https://api.github.com/repos/whiteoctober/Pagerfanta/zipball/43feb3d11af5ea16e5f1ef61fbe05df8337b6c46", + "reference": "43feb3d11af5ea16e5f1ef61fbe05df8337b6c46", "shasum": "" }, "require": { @@ -1291,7 +1179,7 @@ "doctrine/orm": "2.*", "mandango/mandango": "*", "propel/propel1": ">=1.6,<2.0", - "solarium/solarium": "3.*" + "solarium/solarium": "dev-develop" }, "suggest": { "doctrine/mongodb-odm": "To use the DoctrineODMMongoDBAdapter.", @@ -1300,7 +1188,7 @@ "propel/propel1": "To use the PropelAdapter", "solarium/solarium": "To use the SolariumAdapter." }, - "time": "2013-03-12 22:52:44", + "time": "2013-04-02 00:47:33", "type": "library", "extra": { "branch-alias": { @@ -1397,35 +1285,30 @@ ] }, { - "name": "symfony/stopwatch", - "version": "v2.2.0", - "version_normalized": "2.2.0.0", - "target-dir": "Symfony/Component/Stopwatch", + "name": "symfony/yaml", + "version": "v2.1.9", + "version_normalized": "2.1.9.0", + "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", - "url": "https://github.com/symfony/Stopwatch.git", - "reference": "v2.2.0-RC3" + "url": "https://github.com/symfony/Yaml.git", + "reference": "v2.1.9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/v2.2.0-RC3", - "reference": "v2.2.0-RC3", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/v2.1.9", + "reference": "v2.1.9", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "time": "2013-01-04 16:58:00", + "time": "2013-03-23 01:54:33", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - } - }, "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Component\\Stopwatch\\": "" + "Symfony\\Component\\Yaml": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1442,58 +1325,674 @@ "homepage": "http://symfony.com/contributors" } ], - "description": "Symfony Stopwatch Component", + "description": "Symfony Yaml Component", "homepage": "http://symfony.com" }, { - "name": "symfony/twig-bridge", - "version": "2.2.x-dev", - "version_normalized": "2.2.9999999.9999999-dev", - "target-dir": "Symfony/Bridge/Twig", + "name": "chamilo/chash", + "version": "dev-master", + "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/symfony/TwigBridge.git", - "reference": "50bbc4a10d34a71325b58940c4887726b8a30841" + "url": "https://github.com/chamilo/chash.git", + "reference": "3d31e9577df292fb2ee010b6182ca7dd543b2c67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/TwigBridge/zipball/50bbc4a10d34a71325b58940c4887726b8a30841", - "reference": "50bbc4a10d34a71325b58940c4887726b8a30841", + "url": "https://api.github.com/repos/chamilo/chash/zipball/3d31e9577df292fb2ee010b6182ca7dd543b2c67", + "reference": "3d31e9577df292fb2ee010b6182ca7dd543b2c67", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "symfony/console": "2.3.*@dev", + "symfony/yaml": "2.1.*" + }, + "time": "2013-03-29 10:44:52", + "type": "library", + "installation-source": "source", + "autoload": { + "psr-0": { + "Chash": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/" + }, + { + "name": "mpdf/mpdf", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/finwe/mpdf.git", + "reference": "v5.6.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/finwe/mpdf/zipball/v5.6.1", + "reference": "v5.6.1", + "shasum": "" + }, + "require": { + "php": ">=4.3.10" + }, + "time": "2013-01-26 08:22:27", + "type": "library", + "installation-source": "source", + "autoload": { + "classmap": [ + "mpdf.php", + "classes" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-1.0+" + ], + "authors": [ + { + "name": "Ian Back" + } + ], + "description": "A PHP class to generate PDF files from HTML with Unicode/UTF-8 and CJK support", + "homepage": "http://www.mpdf1.com/mpdf/index.php", + "keywords": [ + "pdf", + "php", + "utf-8" + ] + }, + { + "name": "ezyang/htmlpurifier", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "v4.5.0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/v4.5.0", + "reference": "v4.5.0", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "time": "2013-02-18 00:04:08", + "type": "library", + "installation-source": "source", + "autoload": { + "psr-0": { + "HTMLPurifier": "library/" + }, + "files": [ + "library/HTMLPurifier.composer.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL" + ], + "authors": [ + { + "name": "Edward Z. Yang", + "email": "admin@htmlpurifier.org", + "homepage": "http://ezyang.com" + } + ], + "description": "Standards compliant HTML filter written in PHP", + "homepage": "http://htmlpurifier.org/", + "keywords": [ + "html" + ] + }, + { + "name": "symfony/finder", + "version": "v2.2.0", + "version_normalized": "2.2.0.0", + "target-dir": "Symfony/Component/Finder", + "source": { + "type": "git", + "url": "https://github.com/symfony/Finder.git", + "reference": "v2.2.0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Finder/zipball/v2.2.0", + "reference": "v2.2.0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2013-02-28 14:06:36", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\Finder\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "http://symfony.com" + }, + { + "name": "kriswallsmith/assetic", + "version": "v1.0.4", + "version_normalized": "1.0.4.0", + "source": { + "type": "git", + "url": "http://github.com/kriswallsmith/assetic.git", + "reference": "v1.0.4" + }, + "dist": { + "type": "zip", + "url": "https://github.com/kriswallsmith/assetic/zipball/v1.0.4", + "reference": "v1.0.4", + "shasum": "" + }, + "require": { + "php": ">=5.3.1" + }, + "time": "2012-08-28 05:18:28", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Assetic": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kris Wallsmith", + "email": "kris.wallsmith@gmail.com", + "homepage": "http://kriswallsmith.net/" + } + ], + "description": "Asset Management for PHP", + "homepage": "https://github.com/kriswallsmith/assetic", + "keywords": [ + "assets", + "compression", + "minification" + ] + }, + { + "name": "mheap/silex-assetic", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/mheap/Silex-Assetic.git", + "reference": "00cd1e43e7c778f8816d20893202addd13a40cc8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mheap/Silex-Assetic/zipball/00cd1e43e7c778f8816d20893202addd13a40cc8", + "reference": "00cd1e43e7c778f8816d20893202addd13a40cc8", + "shasum": "" + }, + "require": { + "kriswallsmith/assetic": ">=1.0", + "php": ">=5.3.0", + "symfony/finder": ">=2.1,<2.3" + }, + "require-dev": { + "silex/silex": "*", + "twig/twig": ">=1.2.0" + }, + "suggest": { + "twig/twig": ">=1.2.0" + }, + "time": "2013-03-25 09:35:46", + "type": "library", + "installation-source": "source", + "autoload": { + "psr-0": { + "SilexAssetic": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sven Eisenschmidt", + "email": "sven.eisenschmidt@gmail.com", + "homepage": "http://unsicherheitsagent.de/" + }, + { + "name": "Michael Heap", + "email": "m@michaelheap.com", + "homepage": "http://michaelheap.com/" + } + ], + "description": "Assetic extension for Silex", + "homepage": "https://github.com/mheap/Silex-Assetic", + "keywords": [ + "assetic", + "silex" + ] + }, + { + "name": "leafo/lessphp", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/leafo/lessphp.git", + "reference": "54bb80519c9a73eff250fa1671707b492a402280" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/leafo/lessphp/zipball/54bb80519c9a73eff250fa1671707b492a402280", + "reference": "54bb80519c9a73eff250fa1671707b492a402280", + "shasum": "" + }, + "time": "2013-03-08 21:29:33", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.3-dev" + } + }, + "installation-source": "source", + "autoload": { + "classmap": [ + "lessc.inc.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT", + "GPL-3.0" + ], + "authors": [ + { + "name": "Leaf Corcoran", + "email": "leafot@gmail.com", + "homepage": "http://leafo.net" + } + ], + "description": "lessphp is a compiler for LESS written in PHP.", + "homepage": "http://leafo.net/lessphp/" + }, + { + "name": "natxet/CssMin", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/natxet/CssMin.git", + "reference": "9801e2a0de7ae252ca4f2b85542d75a82047a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/natxet/CssMin/zipball/9801e2a0de7ae252ca4f2b85542d75a82047a8b4", + "reference": "9801e2a0de7ae252ca4f2b85542d75a82047a8b4", + "shasum": "" + }, + "require": { + "php": ">=5.0" + }, + "time": "2013-03-15 18:47:32", + "type": "library", + "installation-source": "source", + "autoload": { + "psr-0": { + "CssMin": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joe Scylla", + "email": "joe.scylla@gmail.com", + "homepage": "https://profiles.google.com/joe.scylla" + } + ], + "description": "Minifying CSS", + "homepage": "http://code.google.com/p/cssmin/", + "keywords": [ + "css", + "minify" + ] + }, + { + "name": "realityking/pchart", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/realityking/pChart.git", + "reference": "46fd01cad5a4d761b599df1ab09361fad55c83b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/realityking/pChart/zipball/46fd01cad5a4d761b599df1ab09361fad55c83b6", + "reference": "46fd01cad5a4d761b599df1ab09361fad55c83b6", + "shasum": "" + }, + "time": "2013-03-18 08:23:38", + "type": "library", + "installation-source": "source", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-1.0+" + ], + "authors": [ + { + "name": "Rouven Weßling", + "email": "me@rouvenwessling.de", + "homepage": "http://www.rouvenwessling.de" + } + ], + "description": "A fork of the popular pChart library." + }, + { + "name": "symfony/dom-crawler", + "version": "v2.2.0", + "version_normalized": "2.2.0.0", + "target-dir": "Symfony/Component/DomCrawler", + "source": { + "type": "git", + "url": "https://github.com/symfony/DomCrawler.git", + "reference": "v2.2.0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/v2.2.0", + "reference": "v2.2.0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/css-selector": ">=2.0,<3.0" + }, + "suggest": { + "symfony/css-selector": "2.2.*" + }, + "time": "2013-03-01 06:43:14", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\DomCrawler\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony DomCrawler Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/browser-kit", + "version": "dev-master", + "version_normalized": "9999999-dev", + "target-dir": "Symfony/Component/BrowserKit", + "source": { + "type": "git", + "url": "https://github.com/symfony/BrowserKit.git", + "reference": "b0aa5249d957930f93c0c2a3f1f10db0721cb6e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/b0aa5249d957930f93c0c2a3f1f10db0721cb6e9", + "reference": "b0aa5249d957930f93c0c2a3f1f10db0721cb6e9", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/dom-crawler": ">=2.0,<3.0" + }, + "require-dev": { + "symfony/css-selector": ">=2.0,<3.0", + "symfony/process": ">=2.0,<3.0" + }, + "suggest": { + "symfony/process": "2.2.*" + }, + "time": "2013-03-20 14:03:03", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "Symfony\\Component\\BrowserKit\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony BrowserKit Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/stopwatch", + "version": "v2.2.0", + "version_normalized": "2.2.0.0", + "target-dir": "Symfony/Component/Stopwatch", + "source": { + "type": "git", + "url": "https://github.com/symfony/Stopwatch.git", + "reference": "v2.2.0-RC3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/v2.2.0-RC3", + "reference": "v2.2.0-RC3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2013-01-04 16:58:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\Stopwatch\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/twig-bridge", + "version": "2.2.x-dev", + "version_normalized": "2.2.9999999.9999999-dev", + "target-dir": "Symfony/Bridge/Twig", + "source": { + "type": "git", + "url": "https://github.com/symfony/TwigBridge.git", + "reference": "50bbc4a10d34a71325b58940c4887726b8a30841" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/TwigBridge/zipball/50bbc4a10d34a71325b58940c4887726b8a30841", + "reference": "50bbc4a10d34a71325b58940c4887726b8a30841", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "twig/twig": ">=1.11.0,<2.0" + }, + "require-dev": { + "symfony/form": "2.2.*", + "symfony/http-kernel": ">=2.2,<2.3-dev", + "symfony/routing": ">=2.2,<2.3-dev", + "symfony/security": ">=2.0,<2.3-dev", + "symfony/templating": ">=2.1,<3.0", + "symfony/translation": ">=2.0,<2.3-dev", + "symfony/yaml": ">=2.0,<3.0" + }, + "suggest": { + "symfony/form": "2.2.*", + "symfony/http-kernel": "2.2.*", + "symfony/routing": "2.2.*", + "symfony/security": "2.2.*", + "symfony/templating": "2.2.*", + "symfony/translation": "2.2.*", + "symfony/yaml": "2.2.*" + }, + "time": "2013-03-15 10:14:31", + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "Symfony\\Bridge\\Twig\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Twig Bridge", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/routing", + "version": "v2.2.0", + "version_normalized": "2.2.0.0", + "target-dir": "Symfony/Component/Routing", + "source": { + "type": "git", + "url": "https://github.com/symfony/Routing.git", + "reference": "v2.2.0-RC3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Routing/zipball/v2.2.0-RC3", + "reference": "v2.2.0-RC3", "shasum": "" }, "require": { - "php": ">=5.3.3", - "twig/twig": ">=1.11.0,<2.0" + "php": ">=5.3.3" }, "require-dev": { - "symfony/form": "2.2.*", - "symfony/http-kernel": ">=2.2,<2.3-dev", - "symfony/routing": ">=2.2,<2.3-dev", - "symfony/security": ">=2.0,<2.3-dev", - "symfony/templating": ">=2.1,<3.0", - "symfony/translation": ">=2.0,<2.3-dev", + "doctrine/common": ">=2.2,<3.0", + "psr/log": ">=1.0,<2.0", + "symfony/config": ">=2.2,<2.3-dev", "symfony/yaml": ">=2.0,<3.0" }, "suggest": { - "symfony/form": "2.2.*", - "symfony/http-kernel": "2.2.*", - "symfony/routing": "2.2.*", - "symfony/security": "2.2.*", - "symfony/templating": "2.2.*", - "symfony/translation": "2.2.*", + "doctrine/common": "~2.2", + "symfony/config": "2.2.*", "symfony/yaml": "2.2.*" }, - "time": "2013-03-15 10:14:31", - "type": "symfony-bridge", + "time": "2013-02-11 11:24:47", + "type": "library", "extra": { "branch-alias": { "dev-master": "2.2-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Bridge\\Twig\\": "" + "Symfony\\Component\\Routing\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1510,7 +2009,7 @@ "homepage": "http://symfony.com/contributors" } ], - "description": "Symfony Twig Bridge", + "description": "Symfony Routing Component", "homepage": "http://symfony.com" }, { @@ -1625,12 +2124,12 @@ "source": { "type": "git", "url": "https://github.com/fabpot/Silex.git", - "reference": "a5cb55ced63ece76550de1599ddcc60719373594" + "reference": "803f809cdaa409e5769b24db952655d7e9187677" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fabpot/Silex/zipball/a5cb55ced63ece76550de1599ddcc60719373594", - "reference": "a5cb55ced63ece76550de1599ddcc60719373594", + "url": "https://api.github.com/repos/fabpot/Silex/zipball/803f809cdaa409e5769b24db952655d7e9187677", + "reference": "803f809cdaa409e5769b24db952655d7e9187677", "shasum": "" }, "require": { @@ -1667,7 +2166,7 @@ "symfony/dom-crawler": ">=2.1,<2.3-dev", "symfony/form": "To make use of the FormServiceProvider, >= 2.1.4 is required" }, - "time": "2013-03-27 09:31:32", + "time": "2013-04-01 08:47:32", "type": "library", "extra": { "branch-alias": { @@ -1748,63 +2247,19 @@ "description": "A WebProfiler for Silex", "homepage": "http://silex.sensiolabs.org/" }, - { - "name": "symfony/yaml", - "version": "v2.1.9", - "version_normalized": "2.1.9.0", - "target-dir": "Symfony/Component/Yaml", - "source": { - "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "v2.1.9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/v2.1.9", - "reference": "v2.1.9", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2013-03-23 01:54:33", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Symfony\\Component\\Yaml": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "http://symfony.com" - }, { "name": "monolog/monolog", - "version": "1.4.0", - "version_normalized": "1.4.0.0", + "version": "1.4.1", + "version_normalized": "1.4.1.0", "source": { "type": "git", - "url": "https://github.com/Seldaek/monolog", - "reference": "1.4.0" + "url": "https://github.com/Seldaek/monolog.git", + "reference": "1.4.1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1.4.0", - "reference": "1.4.0", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1.4.1", + "reference": "1.4.1", "shasum": "" }, "require": { @@ -1823,7 +2278,7 @@ "mlehner/gelf-php": "Allow sending log messages to a GrayLog2 server", "raven/raven": "Allow sending log messages to a Sentry server" }, - "time": "2013-02-13 18:06:51", + "time": "2013-04-01 10:04:58", "type": "library", "extra": { "branch-alias": { @@ -2076,66 +2531,6 @@ "uploadable" ] }, - { - "name": "symfony/routing", - "version": "v2.2.0", - "version_normalized": "2.2.0.0", - "target-dir": "Symfony/Component/Routing", - "source": { - "type": "git", - "url": "https://github.com/symfony/Routing.git", - "reference": "v2.2.0-RC3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Routing/zipball/v2.2.0-RC3", - "reference": "v2.2.0-RC3", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "doctrine/common": ">=2.2,<3.0", - "psr/log": ">=1.0,<2.0", - "symfony/config": ">=2.2,<2.3-dev", - "symfony/yaml": ">=2.0,<3.0" - }, - "suggest": { - "doctrine/common": "~2.2", - "symfony/config": "2.2.*", - "symfony/yaml": "2.2.*" - }, - "time": "2013-02-11 11:24:47", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\Routing\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony Routing Component", - "homepage": "http://symfony.com" - }, { "name": "igorw/config-service-provider", "version": "dev-master", @@ -2192,125 +2587,5 @@ "keywords": [ "silex" ] - }, - { - "name": "chamilo/chash", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/chamilo/chash.git", - "reference": "3d31e9577df292fb2ee010b6182ca7dd543b2c67" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/chamilo/chash/zipball/3d31e9577df292fb2ee010b6182ca7dd543b2c67", - "reference": "3d31e9577df292fb2ee010b6182ca7dd543b2c67", - "shasum": "" - }, - "require": { - "php": ">=5.3.2", - "symfony/console": "2.3.*@dev", - "symfony/yaml": "2.1.*" - }, - "time": "2013-03-29 10:44:52", - "type": "library", - "installation-source": "source", - "autoload": { - "psr-0": { - "Chash": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/" - }, - { - "name": "mpdf/mpdf", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/finwe/mpdf.git", - "reference": "v5.6.1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/finwe/mpdf/zipball/v5.6.1", - "reference": "v5.6.1", - "shasum": "" - }, - "require": { - "php": ">=4.3.10" - }, - "time": "2013-01-26 08:22:27", - "type": "library", - "installation-source": "source", - "autoload": { - "classmap": [ - "mpdf.php", - "classes" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-1.0+" - ], - "authors": [ - { - "name": "Ian Back" - } - ], - "description": "A PHP class to generate PDF files from HTML with Unicode/UTF-8 and CJK support", - "homepage": "http://www.mpdf1.com/mpdf/index.php", - "keywords": [ - "pdf", - "php", - "utf-8" - ] - }, - { - "name": "ezyang/htmlpurifier", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/ezyang/htmlpurifier.git", - "reference": "v4.5.0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/v4.5.0", - "reference": "v4.5.0", - "shasum": "" - }, - "require": { - "php": ">=5.2" - }, - "time": "2013-02-18 00:04:08", - "type": "library", - "installation-source": "source", - "autoload": { - "psr-0": { - "HTMLPurifier": "library/" - }, - "files": [ - "library/HTMLPurifier.composer.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL" - ], - "authors": [ - { - "name": "Edward Z. Yang", - "email": "admin@htmlpurifier.org", - "homepage": "http://ezyang.com" - } - ], - "description": "Standards compliant HTML filter written in PHP", - "homepage": "http://htmlpurifier.org/", - "keywords": [ - "html" - ] } ] diff --git a/vendor/dflydev/doctrine-orm-service-provider/.gitignore b/vendor/dflydev/doctrine-orm-service-provider/.gitignore new file mode 100644 index 0000000000..987e2a253c --- /dev/null +++ b/vendor/dflydev/doctrine-orm-service-provider/.gitignore @@ -0,0 +1,2 @@ +composer.lock +vendor diff --git a/vendor/doctrine/common/.gitignore b/vendor/doctrine/common/.gitignore new file mode 100644 index 0000000000..fb5e79d652 --- /dev/null +++ b/vendor/doctrine/common/.gitignore @@ -0,0 +1,4 @@ +build/ +logs/ +reports/ +dist/ diff --git a/vendor/doctrine/common/.gitmodules b/vendor/doctrine/common/.gitmodules new file mode 100644 index 0000000000..51f0843511 --- /dev/null +++ b/vendor/doctrine/common/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lib/vendor/doctrine-build-common"] + path = lib/vendor/doctrine-build-common + url = git://github.com/doctrine/doctrine-build-common.git diff --git a/vendor/doctrine/common/tests/.gitignore b/vendor/doctrine/common/tests/.gitignore new file mode 100644 index 0000000000..7210405266 --- /dev/null +++ b/vendor/doctrine/common/tests/.gitignore @@ -0,0 +1,3 @@ +Doctrine/Tests/Proxies/ +Doctrine/Tests/ORM/Proxy/generated/ +Doctrine/Tests/ORM/Tools/Export/export diff --git a/vendor/doctrine/dbal/.gitignore b/vendor/doctrine/dbal/.gitignore new file mode 100644 index 0000000000..a9b57aaada --- /dev/null +++ b/vendor/doctrine/dbal/.gitignore @@ -0,0 +1,6 @@ +build/ +logs/ +reports/ +dist/ +download/ +lib/Doctrine/Common/ diff --git a/vendor/doctrine/dbal/.gitmodules b/vendor/doctrine/dbal/.gitmodules new file mode 100644 index 0000000000..00dc3fa1c4 --- /dev/null +++ b/vendor/doctrine/dbal/.gitmodules @@ -0,0 +1,9 @@ +[submodule "lib/vendor/doctrine-common"] + path = lib/vendor/doctrine-common + url = git://github.com/doctrine/common.git +[submodule "lib/vendor/Symfony/Component/Console"] + path = lib/vendor/Symfony/Component/Console + url = git://github.com/symfony/Console.git +[submodule "lib/vendor/doctrine-build-common"] + path = lib/vendor/doctrine-build-common + url = git://github.com/doctrine/doctrine-build-common.git diff --git a/vendor/doctrine/dbal/tests/.gitignore b/vendor/doctrine/dbal/tests/.gitignore new file mode 100644 index 0000000000..7210405266 --- /dev/null +++ b/vendor/doctrine/dbal/tests/.gitignore @@ -0,0 +1,3 @@ +Doctrine/Tests/Proxies/ +Doctrine/Tests/ORM/Proxy/generated/ +Doctrine/Tests/ORM/Tools/Export/export diff --git a/vendor/doctrine/migrations/.gitignore b/vendor/doctrine/migrations/.gitignore new file mode 100644 index 0000000000..45f6c8fbd0 --- /dev/null +++ b/vendor/doctrine/migrations/.gitignore @@ -0,0 +1,8 @@ +build.properties +build/ +logs/ +reports/ +dist/ +tests/phpunit.xml +vendor/ +composer.lock diff --git a/vendor/doctrine/orm/.gitignore b/vendor/doctrine/orm/.gitignore new file mode 100644 index 0000000000..b49fac4bf9 --- /dev/null +++ b/vendor/doctrine/orm/.gitignore @@ -0,0 +1,11 @@ +build/ +logs/ +reports/ +dist/ +download/ +lib/api/ +lib/Doctrine/Common +lib/Doctrine/DBAL +/.settings/ +.buildpath +.project \ No newline at end of file diff --git a/vendor/doctrine/orm/.gitmodules b/vendor/doctrine/orm/.gitmodules new file mode 100644 index 0000000000..2d52e9acde --- /dev/null +++ b/vendor/doctrine/orm/.gitmodules @@ -0,0 +1,15 @@ +[submodule "lib/vendor/doctrine-common"] + path = lib/vendor/doctrine-common + url = git://github.com/doctrine/common.git +[submodule "lib/vendor/doctrine-dbal"] + path = lib/vendor/doctrine-dbal + url = git://github.com/doctrine/dbal.git +[submodule "lib/vendor/Symfony/Component/Console"] + path = lib/vendor/Symfony/Component/Console + url = git://github.com/symfony/Console.git +[submodule "lib/vendor/Symfony/Component/Yaml"] + path = lib/vendor/Symfony/Component/Yaml + url = git://github.com/symfony/Yaml.git +[submodule "lib/vendor/doctrine-build-common"] + path = lib/vendor/doctrine-build-common + url = git://github.com/doctrine/doctrine-build-common.git diff --git a/vendor/doctrine/orm/tests/.gitignore b/vendor/doctrine/orm/tests/.gitignore new file mode 100644 index 0000000000..7210405266 --- /dev/null +++ b/vendor/doctrine/orm/tests/.gitignore @@ -0,0 +1,3 @@ +Doctrine/Tests/Proxies/ +Doctrine/Tests/ORM/Proxy/generated/ +Doctrine/Tests/ORM/Tools/Export/export diff --git a/vendor/ezyang/htmlpurifier/.gitattributes b/vendor/ezyang/htmlpurifier/.gitattributes new file mode 100644 index 0000000000..51e6483770 --- /dev/null +++ b/vendor/ezyang/htmlpurifier/.gitattributes @@ -0,0 +1 @@ +configdoc/usage.xml -crlf diff --git a/vendor/ezyang/htmlpurifier/.gitignore b/vendor/ezyang/htmlpurifier/.gitignore new file mode 100644 index 0000000000..9fcd3c0eba --- /dev/null +++ b/vendor/ezyang/htmlpurifier/.gitignore @@ -0,0 +1,24 @@ +tags +conf/ +test-settings.php +config-schema.php +library/HTMLPurifier/DefinitionCache/Serializer/*/ +library/standalone/ +library/HTMLPurifier.standalone.php +library/HTMLPurifier*.tgz +library/package*.xml +smoketests/test-schema.html +configdoc/*.html +configdoc/configdoc.xml +docs/doxygen* +*.phpt.diff +*.phpt.exp +*.phpt.log +*.phpt.out +*.phpt.php +*.phpt.skip.php +*.htmlt.ini +*.patch +/*.php +vendor +composer.lock diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/.gitignore b/vendor/ezyang/htmlpurifier/plugins/phorum/.gitignore new file mode 100644 index 0000000000..8325e09020 --- /dev/null +++ b/vendor/ezyang/htmlpurifier/plugins/phorum/.gitignore @@ -0,0 +1,2 @@ +migrate.php +htmlpurifier/* diff --git a/vendor/gedmo/doctrine-extensions/.gitignore b/vendor/gedmo/doctrine-extensions/.gitignore new file mode 100644 index 0000000000..52755c7f26 --- /dev/null +++ b/vendor/gedmo/doctrine-extensions/.gitignore @@ -0,0 +1,8 @@ +tests/phpunit.xml +tests/temp/*.php +scripts/ +vendor/ +tags +.vimrc.local +/composer.lock +/composer.phar diff --git a/vendor/igorw/config-service-provider/.gitignore b/vendor/igorw/config-service-provider/.gitignore new file mode 100644 index 0000000000..987e2a253c --- /dev/null +++ b/vendor/igorw/config-service-provider/.gitignore @@ -0,0 +1,2 @@ +composer.lock +vendor diff --git a/vendor/knplabs/knp-menu/.gitignore b/vendor/knplabs/knp-menu/.gitignore new file mode 100644 index 0000000000..823721a04a --- /dev/null +++ b/vendor/knplabs/knp-menu/.gitignore @@ -0,0 +1,4 @@ +/phpunit.xml +/vendor/ +/composer.lock +/composer.phar diff --git a/vendor/kriswallsmith/assetic/.gitignore b/vendor/kriswallsmith/assetic/.gitignore new file mode 100644 index 0000000000..10875ac3ef --- /dev/null +++ b/vendor/kriswallsmith/assetic/.gitignore @@ -0,0 +1,2 @@ +phpunit.xml +vendor/ diff --git a/vendor/kriswallsmith/assetic/.travis.yml b/vendor/kriswallsmith/assetic/.travis.yml new file mode 100644 index 0000000000..dc8d22508f --- /dev/null +++ b/vendor/kriswallsmith/assetic/.travis.yml @@ -0,0 +1,13 @@ +language: php + +php: + - 5.3 + - 5.4 + +before_script: + - git clone https://github.com/kamicane/packager.git vendor/packager --quiet --depth 1 + - git clone https://github.com/leafo/lessphp.git vendor/lessphp --quiet --depth 1 + - git clone https://github.com/fabpot/Twig.git vendor/twig --quiet --depth 1 + - svn checkout http://cssmin.googlecode.com/svn/trunk/ vendor/cssmin --quiet + +script: phpunit --configuration phpunit.travis.xml \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/CHANGELOG-1.0.md b/vendor/kriswallsmith/assetic/CHANGELOG-1.0.md new file mode 100644 index 0000000000..f91a7e5206 --- /dev/null +++ b/vendor/kriswallsmith/assetic/CHANGELOG-1.0.md @@ -0,0 +1,36 @@ +1.0.4 (August 28, 2012) +----------------------- + + * Fixed the Twig tag to avoid a fatal error when left unclosed + * Added the HashableInterface for non-serialiable filters + * Fixed a bug for compass on windows + +1.0.3 (March 2, 2012) +--------------------- + + * Added "boring" option to Compass filter + * Fixed accumulation of load paths in Compass filter + * Fixed issues in CssImport and CssRewrite filters + +1.0.2 (August 26, 2011) +----------------------- + + * Twig 1.2 compatibility + * Fixed filtering of large LessCSS assets + * Fixed escaping of commands on Windows + * Misc fixes to Compass filter + * Removed default CssEmbed charset + +1.0.1 (July 15, 2011) +--------------------- + + * Fixed Twig error handling + * Removed use of STDIN + * Added inheritance of environment variables + * Fixed Compass on Windows + * Improved escaping of commands + +1.0.0 (July 10, 2011) +--------------------- + + * Initial release diff --git a/vendor/kriswallsmith/assetic/LICENSE b/vendor/kriswallsmith/assetic/LICENSE new file mode 100644 index 0000000000..1060e5b03a --- /dev/null +++ b/vendor/kriswallsmith/assetic/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2010-2012 OpenSky Project Inc + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/kriswallsmith/assetic/README.md b/vendor/kriswallsmith/assetic/README.md new file mode 100644 index 0000000000..6059834ba9 --- /dev/null +++ b/vendor/kriswallsmith/assetic/README.md @@ -0,0 +1,283 @@ +# Assetic ![project status](http://stillmaintained.com/kriswallsmith/assetic.png) # + +Assetic is an asset management framework for PHP. + +``` php +dump(); +``` + +Assets +------ + +An Assetic asset is something with filterable content that can be loaded and +dumped. An asset also includes metadata, some of which can be manipulated and +some of which is immutable. + +| **Property** | **Accessor** | **Mutator** | +|--------------|-----------------|---------------| +| content | getContent | setContent | +| mtime | getLastModified | n/a | +| source root | getSourceRoot | n/a | +| source path | getSourcePath | n/a | +| target path | getTargetPath | setTargetPath | + +Filters +------- + +Filters can be applied to manipulate assets. + +``` php +dump(); +``` + +The filters applied to the collection will cascade to each asset leaf if you +iterate over it. + +``` php +dump(); +} +``` + +The core provides the following filters in the `Assetic\Filter` namespace: + + * `CoffeeScriptFilter`: compiles CoffeeScript into Javascript + * `CssEmbedFilter`: embeds image data in your stylesheets + * `CssImportFilter`: inlines imported stylesheets + * `CssMinFilter`: minifies CSS + * `CssRewriteFilter`: fixes relative URLs in CSS assets when moving to a new URL + * `GoogleClosure\CompilerApiFilter`: compiles Javascript using the Google Closure Compiler API + * `GoogleClosure\CompilerJarFilter`: compiles Javascript using the Google Closure Compiler JAR + * `JpegoptimFilter`: optimize your JPEGs + * `JpegtranFilter`: optimize your JPEGs + * `LessFilter`: parses LESS into CSS (using less.js with node.js) + * `LessphpFilter`: parses LESS into CSS (using lessphp) + * `OptiPngFilter`: optimize your PNGs + * `PngoutFilter`: optimize your PNGs + * `CompassFilter`: Compass CSS authoring framework + * `Sass\SassFilter`: parses SASS into CSS + * `Sass\ScssFilter`: parses SCSS into CSS + * `SprocketsFilter`: Sprockets Javascript dependency management + * `StylusFilter`: parses STYL into CSS + * `Yui\CssCompressorFilter`: compresses CSS using the YUI compressor + * `Yui\JsCompressorFilter`: compresses Javascript using the YUI compressor + +Asset Manager +------------- + +An asset manager is provided for organizing assets. + +``` php +set('jquery', new FileAsset('/path/to/jquery.js')); +$am->set('base_css', new GlobAsset('/path/to/css/*')); +``` + +The asset manager can also be used to reference assets to avoid duplication. + +``` php +set('my_plugin', new AssetCollection(array( + new AssetReference($am, 'jquery'), + new FileAsset('/path/to/jquery.plugin.js'), +))); +``` + +Filter Manager +-------------- + +A filter manager is also provided for organizing filters. + +``` php +set('sass', new SassFilter('/path/to/parser/sass')); +$fm->set('yui_css', new Yui\CssCompressorFilter('/path/to/yuicompressor.jar')); +``` + +Asset Factory +------------- + +If you'd rather not create all these objects by hand, you can use the asset +factory, which will do most of the work for you. + +``` php +setAssetManager($am); +$factory->setFilterManager($fm); +$factory->setDebug(true); + +$css = $factory->createAsset(array( + '@reset', // load the asset manager's "reset" asset + 'css/src/*.scss', // load every scss files from "/path/to/asset/directory/css/src/" +), array( + 'scss', // filter through the filter manager's "scss" filter + '?yui_css', // don't use this filter in debug mode +)); + +echo $css->dump(); +``` + +Prefixing a filter name with a question mark, as `yui_css` is here, will cause +that filter to be omitted when the factory is in debug mode. + +Caching +------- + +A simple caching mechanism is provided to avoid unnecessary work. + +``` php +dump(); +$js->dump(); +$js->dump(); +``` + +Static Assets +------------- + +Alternatively you can just write filtered assets to your web directory and be +done with it. + +``` php +writeManagerAssets($am); +``` + +Twig +---- + +To use the Assetic [Twig][3] extension you must register it to your Twig +environment: + +``` php +addExtension(new AsseticExtension($factory, $debug)); +``` + +Once in place, the extension exposes a stylesheets and a javascripts tag with a syntax similar +to what the asset factory uses: + +``` html+jinja +{% stylesheets '/path/to/sass/main.sass' filter='sass,?yui_css' output='css/all.css' %} + +{% endstylesheets %} +``` + +This example will render one `link` element on the page that includes a URL +where the filtered asset can be found. + +When the extension is in debug mode, this same tag will render multiple `link` +elements, one for each asset referenced by the `css/src/*.sass` glob. The +specified filters will still be applied, unless they are marked as optional +using the `?` prefix. + +This behavior can also be triggered by setting a `debug` attribute on the tag: + +``` html+jinja +{% stylesheets 'css/*' debug=true %} ... {% stylesheets %} +``` + +These assets need to be written to the web directory so these URLs don't +return 404 errors. + +``` php +setLoader('twig', new TwigFormulaLoader($twig)); + +// loop through all your templates +foreach ($templates as $template) { + $resource = new TwigResource($twigLoader, $template); + $am->addResource($resource, 'twig'); +} + +$writer = new AssetWriter('/path/to/web'); +$writer->writeManagerAssets($am); +``` + +--- + +Assetic is based on the Python [webassets][1] library (available on +[GitHub][2]). + +[1]: http://elsdoerfer.name/docs/webassets +[2]: https://github.com/miracle2k/webassets +[3]: http://twig.sensiolabs.org diff --git a/vendor/kriswallsmith/assetic/composer.json b/vendor/kriswallsmith/assetic/composer.json new file mode 100644 index 0000000000..4e3db26b70 --- /dev/null +++ b/vendor/kriswallsmith/assetic/composer.json @@ -0,0 +1,21 @@ +{ + "name": "kriswallsmith/assetic", + "description": "Asset Management for PHP", + "keywords": ["assets", "compression", "minification"], + "homepage": "https://github.com/kriswallsmith/assetic", + "type": "library", + "license": "MIT", + "authors": [ + { + "name": "Kris Wallsmith", + "email": "kris.wallsmith@gmail.com", + "homepage": "http://kriswallsmith.net/" + } + ], + "require": { + "php": ">=5.3.1" + }, + "autoload": { + "psr-0": { "Assetic": "src/" } + } +} diff --git a/vendor/kriswallsmith/assetic/docs/en/build.md b/vendor/kriswallsmith/assetic/docs/en/build.md new file mode 100644 index 0000000000..d560172cb7 --- /dev/null +++ b/vendor/kriswallsmith/assetic/docs/en/build.md @@ -0,0 +1,32 @@ +Building and Dumping Assets +--------------------------- + +The is the simplest approach to using Assetic. It involves two steps: + + 1. Create a PHP script in your web directory that uses the Assetic OOP API to + create and output an asset. + 2. Reference that file from your template. + +For example, you could create a file in your web directory at +`assets/javascripts.php` with the following code: + + use Assetic\Asset\AssetCollection; + use Assetic\Asset\FileAsset; + use Assetic\Filter\Yui\JsCompressorFilter as YuiCompressorFilter; + + $js = new AssetCollection(array( + new FileAsset(__DIR__.'/jquery.js'), + new FileAsset(__DIR__.'/application.js'), + ), array( + new YuiCompressorFilter('/path/to/yuicompressor.jar'), + )); + + header('Content-Type: application/js'); + echo $js->dump(); + +In your HTML template you would include this generated Javascript using a +simple ` + +Next: [Basic Concepts](concepts.md) diff --git a/vendor/kriswallsmith/assetic/docs/en/concepts.md b/vendor/kriswallsmith/assetic/docs/en/concepts.md new file mode 100644 index 0000000000..7af7b1f2f6 --- /dev/null +++ b/vendor/kriswallsmith/assetic/docs/en/concepts.md @@ -0,0 +1,129 @@ +In order to use the Assetic OOP API you must first understand the two central +concepts of Assetic: assets and filters. + +### What is an Asset? + +As asset is an object that has content and metadata which can be loaded and +dumped. Your assets will probably fall into three categories: Javascripts, +stylesheets and images. Most assets will be loaded from files in your +filesystem, but they can also be loaded via HTTP, a database, from a string, +or virtually anything else. All that an asset has to do is fulfill Assetic's +basic asset interface. + +### What is a Filter? + +A filter is an object that acts upon an asset's content when that asset is +loaded and/or dumped. Similar to assets, a filter can do virtually anything, +as long as it implements Assetic's filter interface. + +Here is a list of some of the tools that can be applied to assets using a +filter: + + * CoffeeScript + * CssEmbed + * CssMin + * Google Closure Compiler + * jpegoptim + * jpegtran + * Less + * LessPHP + * optipng + * Packager + * pngout + * SASS + * Sprockets (version 1) + * Stylus + * YUI Compressor + +### Using Assets and Filters + +You need to start by creating an asset object. This will probably mean +instantiating a `FileAsset` instance, which takes a filesystem path as its +first argument: + + $asset = new Assetic\Asset\FileAsset('/path/to/main.css'); + +Once you have an asset you can begin adding filters to it by calling +`ensureFilter()`. For example, you can add a filter that applies the YUI +Compressor to the contents of the asset: + + $yui = new Assetic\Filter\Yui\CssCompressorFilter('/path/to/yui.jar'); + $asset->ensureFilter($yui); + +Once you've added as many filters as you'd like you can output the finished +asset to the browser: + + header('Content-Type: text/css'); + echo $asset->dump(); + +### Asset Collections + +It is a good idea to combine assets of the same type into a single file to +avoid unnecessary HTTP requests. You can do this in Assetic using the +`AssetCollection` class. This class is just like any other asset in Assetic's +eyes as it implements the asset interface, but under the hood it allows you to +combine multiple assets into one. + + use Assetic\Asset\AssetCollection; + + $asset = new AssetCollection(array( + new FileAsset('/path/to/js/jquery.js'), + new FileAsset('/path/to/js/jquery.plugin.js'), + new FileAsset('/path/to/js/application.js'), + )); + +### Nested Asset Collections + +The collection class implements the asset interface and all assets passed into +a collection must implement the same interface, which means you can easily +nest collections within one another: + + use Assetic\Asset\AssetCollection; + use Assetic\Asset\GlobAsset; + use Assetic\Asset\HttpAsset; + + $asset = new AssetCollection(array( + new HttpAsset('http://example.com/jquery.min.js'), + new GlobAsset('/path/to/js/*'), + )); + +The `HttpAsset` class is a special asset class that loads a file over HTTP; +`GlobAsset` is a special asset collection class that loads files based on a +filesystem glob -- both implement the asset interface. + +This concept of nesting asset collection become even more powerful when you +start applying different sets of filters to each collection. Imagine some of +your application's stylesheets are written in SASS, while some are written in +vanilla CSS. You can combine all of these into one seamless CSS asset: + + use Assetic\Asset\AssetCollection; + use Assetic\Asset\GlobAsset; + use Assetic\Filter\SassFilter; + use Assetic\Filter\Yui\CssCompressorFilter; + + $css = new AssetCollection(array( + new GlobAsset('/path/to/sass/*.sass', array(new SassFilter())), + new GlobAsset('/path/to/css/*.css'), + ), array( + new YuiCompressorFilter('/path/to/yuicompressor.jar'), + )); + +You'll notice I've also applied the YUI compressor filter to the combined +asset so all CSS will be minified. + +### Iterating over an Asset Collection + +Once you have an asset collection you can iterate over it like you would a +plain old PHP array: + + echo "Source paths:\n"; + foreach ($collection as $asset) { + echo ' - '.$asset->getSourcePath()."\n"; + } + +The asset collection iterates recursively, which means you will only see the +"leaf" assets during iteration. Iteration also includes a smart filter which +ensures you only see each asset once, even if the same asset has been included +multiple times. + +Next: [Defining Assets "On The Fly"](define.md) diff --git a/vendor/kriswallsmith/assetic/docs/en/define.md b/vendor/kriswallsmith/assetic/docs/en/define.md new file mode 100644 index 0000000000..3d8d3b13b6 --- /dev/null +++ b/vendor/kriswallsmith/assetic/docs/en/define.md @@ -0,0 +1,145 @@ +Defining Assets "On The Fly" +---------------------------- + +The second approach to using Assetic involves defining your application's +assets "on the fly" in your templates, instead of in an isolated PHP file. +Using this approach, your PHP template would look something like this: + + + +This call to `assetic_javascripts()` serves a dual purpose. It will be read by +the Assetic "formula loader" which will extract an asset "formula" that can be +used to build, dump and output the asset. It will also be executed when the +template is rendered, at which time the path to the output asset is output. + +Assetic includes the following templating helper functions: + + * `assetic_image()` + * `assetic_javascripts()` + * `assetic_stylesheets()` + +Defining assets on the fly is a much more sophisticated technique and +therefore relies on services to do the heavy lifting. The main one being the +asset factory. + +### Asset Factory + +The asset factory knows how to create asset objects using only arrays and +scalar values as input. This is the same string syntax used by the `assetic_*` +template helper functions. + + use Assetic\Factory\AssetFactory; + + $factory = new AssetFactory('/path/to/web'); + $js = $factory->createAsset(array( + 'js/jquery.js', + 'js/jquery.plugin.js', + 'js/application.js', + )); + +### Filter Manager + +You can also apply filters to asset created by the factory. To do this you +must setup a `FilterManager`, which organizes filters by a name. + + use Assetic\FilterManager; + use Assetic\Filter\GoogleClosure\ApiFilter as ClosureFilter; + + $fm = new FilterManager(); + $fm->set('closure', new ClosureFilter()); + $factory->setFilterManager($fm); + + $js = $factory->createAsset('js/*', 'closure'); + +This code creates an instance of the Google Closure Compiler filter and +assigns it the name `closure` using a filter manager. This filter manager is +then injected into the asset factory, making the filter available as `closure` +when creating assets. + +### Debug Mode + +The asset factory also introduces the concept of a debug mode. This mode +allows you to omit certain filters from assets the factory creates depending +on whether it is enabled or not. + +For example, the YUI Compressor is awesome, but it is only appropriate in a +production environment as it is very difficult to debug minified Javascript. + + use Asset\Factory\AssetFactory; + + $factory = new AssetFactory('/path/to/web', true); // debug mode is on + $factory->setFilterManager($fm); + $js = $factory->createAsset('js/*', '?closure'); + +By prefixing the `closure` filter's name with a question mark, we are telling +the factory this filter is optional and should only be applied with debug mode +is off. + +### Asset Manager and Asset References + +The asset factory provides another special string syntax that allows you to +reference assets you defined elsewhere. These are called "asset references" +and involve an asset manager which, similar to the filter manager, organizes +assets by name. + + use Assetic\AssetManager; + use Assetic\Asset\FileAsset; + use Assetic\Factory\AssetFactory; + + $am = new AssetManager(); + $am->set('jquery', new FileAsset('/path/to/jquery.js')); + + $factory = new AssetFactory('/path/to/web'); + $factory->setAssetManager($am); + + $js = $factory->createAsset(array( + '@jquery', + 'js/application.js', + )); + +### Extracting Assets from Templates + +Once you've defined a set of assets in your templates you must use the +"formula loader" service to extract these asset definitions. + + use Assetic\Factory\Loader\FunctionCallsFormulaLoader; + use Assetic\Factory\Resource\FileResource; + + $loader = new FunctionCallsFormulaLoader($factory); + $formulae = $loader->load(new FileResource('/path/to/template.php')); + +These asset formulae aren't much use by themselves. They each include just +enough information for the asset factory to create the intended asset object. +In order for these to be useful they must be wrapped in the special +`LazyAssetManager`. + +### The Lazy Asset Manager + +This service is a composition of the asset factory and one or more formula +loaders. It acts as the glue between these services behind the scenes, but can +be used just like a normal asset manager on the surface. + + use Assetic\Asset\FileAsset; + use Assetic\Factory\LazyAssetManager; + use Assetic\Factory\Loader\FunctionCallsFormulaLoader; + use Assetic\Factory\Resource\DirectoryResource; + + $am = new LazyAssetManager($factory); + $am->set('jquery', new FileAsset('/path/to/jquery.js')); + $am->setLoader('php', new FunctionCallsFormulaLoader($factory)); + $am->addResource(new DirectoryResource('/path/to/templates', '/\.php$/'), 'php'); + +### Asset Writer + +Finally, once you've create an asset manager that knows about every asset +you've defined in your templates, you must use an asset writer to actually +create the files your templates are going to be referencing. + + use Assetic\AssetWriter; + + $writer = new AssetWriter('/path/to/web'); + $writer->writeManagerAssets($am); + +After running this script, all of the assets in your asset manager will be +loaded into memory, filtered with their configured filters and dumped to your +web directory as static files, ready to be served. diff --git a/vendor/kriswallsmith/assetic/docs/en/index.md b/vendor/kriswallsmith/assetic/docs/en/index.md new file mode 100644 index 0000000000..46dc590f9e --- /dev/null +++ b/vendor/kriswallsmith/assetic/docs/en/index.md @@ -0,0 +1,7 @@ +Table Of Contents +----------------- + + 1. [Introduction](introduction.md) + 2. [Building and Dumping Assets](build.md) + 3. [Basic Concepts](concepts.md) + 4. [Defining Assets "On The Fly"](define.md) diff --git a/vendor/kriswallsmith/assetic/docs/en/introduction.md b/vendor/kriswallsmith/assetic/docs/en/introduction.md new file mode 100644 index 0000000000..352f496166 --- /dev/null +++ b/vendor/kriswallsmith/assetic/docs/en/introduction.md @@ -0,0 +1,21 @@ +What is Assetic? +---------------- + +Assetic is an asset management framework for PHP 5.3. Assetic enables you to +use a variety of third party tools that will help bring order to your +application's Javascripts, stylesheets and images. + +How Do I Use Assetic? +--------------------- + +There are two distinct approaches you can take when using Assetic: + + 1. Build, dump and output assets in PHP files that you reference directly + from your templates + 2. Defining assets in your templates ("on the fly") and use a loader to + extract, dump and output them + +The first approach is simpler, but the second, with all its moving parts, +offers more flexibility and opportunity for optimization. + +Next: [Building and Dumping Assets](build.md) diff --git a/vendor/kriswallsmith/assetic/docs/ja/build.md b/vendor/kriswallsmith/assetic/docs/ja/build.md new file mode 100644 index 0000000000..bee59ba659 --- /dev/null +++ b/vendor/kriswallsmith/assetic/docs/ja/build.md @@ -0,0 +1,30 @@ +アセットのビルドとダンプ +--------------------------- + +Asseticを使う一番単純な方法は、次の2ステップからなります。 + + 1. 公開領域内にPHPスクリプトを作成し、Assetic OOP APIを使用してアセットの作成・出力を行う + 2. テンプレートから上記のファイルを参照する + +例えば、公開領域内に`assets/javascripts.php`ファイルを作成し、 +下記のようなコードを記述します。 + + use Assetic\Asset\AssetCollection; + use Assetic\Asset\FileAsset; + use Assetic\Filter\Yui\JsCompressorFilter as YuiCompressorFilter; + + $js = new AssetCollection(array( + new FileAsset(__DIR__.'/jquery.js'), + new FileAsset(__DIR__.'/application.js'), + ), array( + new YuiCompressorFilter('/path/to/yuicompressor.jar'), + )); + + header('Content-Type: application/js'); + echo $js->dump(); + +HTMLテンプレート側では、単に` + +Next: [コンセプト](concepts.md) diff --git a/vendor/kriswallsmith/assetic/docs/ja/concepts.md b/vendor/kriswallsmith/assetic/docs/ja/concepts.md new file mode 100644 index 0000000000..3479b20eea --- /dev/null +++ b/vendor/kriswallsmith/assetic/docs/ja/concepts.md @@ -0,0 +1,121 @@ +Assetic OOP APIを使用するためには、まず、[アセット」と「フィルタ」の2つの重要なコンセプトを理解する必要があります。 + +### アセット + +アセットとは、読み込み、及びダンプが可能な、コンテンツとメタデータを内包しているオブジェクトの事を指します。 +大体の場合において3つのカテゴリー、すなわち、Javascriptとスタイルシート、画像のどれかに属することになるでしょう。 +読み込みの方法としては、ファイルシステムからがほとんどですが、 +HTTPやデータベース経由でも、文字列としてでも読み込みが可能で、事実上あらゆるものが読み込み可能です。 +Asseticのアセットインターフェースを満足させさえすれば良いのです。 + + +### フィルタ + +フィルタは、アセットが読み込まれる、かつ/もしくは、ダンプされる際に、 +アセットコンテンツに対して作用するオブジェクトです。 +アセットと同様に、Asseticのフィルタインターフェースを実装することで、 +どのような作用も可能になります。 + +フィルタを用いて、アセットに適用できるツール群の一覧です。 + + * CoffeeScript + * CssEmbed + * CssMin + * Google Closure Compiler + * jpegoptim + * jpegtran + * Less + * LessPHP + * optipng + * Packager + * pngout + * SASS + * Sprockets (version 1) + * Stylus + * YUI Compressor + + +### アセットとフィルタの使用 + +まずはアセットオブジェクトを作成することから始まります。 +多くの場合は`FileAsset`をインスタンス化し、ファイルシステムのパスを第一引数に渡します。 + + $asset = new Assetic\Asset\FileAsset('/path/to/main.css'); + +アセットオブジェクトを作成したら、`ensureFilter()`を呼び、フィルタを追加します。 +例えば、アセットコンテンツにYUI Compressorを適用してみましょう。 + + $yui = new Assetic\Filter\Yui\CssCompressorFilter('/path/to/yui.jar'); + $asset->ensureFilter($yui); + +任意のフィルタを追加したら、完成したアセットをブラウザに出力してみましょう。 + + header('Content-Type: text/css'); + echo $asset->dump(); + +### アセットコレクション + +1つのファイルに同じ種類のアセットをまとめて、不要なHTTPリクエストを抑えてみるのも良いでしょう。 +Asseticでは`AsseticColletion`クラスを使用することで可能となります。 +Assetic内部的には、このクラス自体は他のアセットと同様に、アセットインターフェースを実装したものですが、 +複数のアセットを1つにまとめることが可能になります。 + + use Assetic\Asset\AssetCollection; + + $asset = new AssetCollection(array( + new FileAsset('/path/to/js/jquery.js'), + new FileAsset('/path/to/js/jquery.plugin.js'), + new FileAsset('/path/to/js/application.js'), + )); + +### ネストしたアセットコレクション + +コレクションクラス自体がアセットインターフェースを実装し、コレクション内のアセットも同様に +アセットインターフェースを実装しているので、簡単にネストすることができます。 + + use Assetic\Asset\AssetCollection; + use Assetic\Asset\GlobAsset; + use Assetic\Asset\HttpAsset; + + $asset = new AssetCollection(array( + new HttpAsset('http://example.com/jquery.min.js'), + new GlobAsset('/path/to/js/*'), + )); + +`HttpAsset`は、HTTP経由でファイルを読み込むアセットクラス。 +`GlobAsset`は、ファイルシステムのglobを基にファイル群を読み込むアセットコレクションクラス。 +両者ともにアセットインターフェースを実装しています。 + +このネストしたアセットコレクションという概念は、コレクションそれぞれに異なる +フィルタ群を適用しようとしたときに、効果を発揮します。 +例えば、スタイルシートがSAASで記述されたものと、vanilla CSSを用いて記述されたものからなる +アプリケーションを考えた場合、次のようにして、全てを1つのシームレスなCSSアセットにまとめることができます。 + + use Assetic\Asset\AssetCollection; + use Assetic\Asset\GlobAsset; + use Assetic\Filter\SassFilter; + use Assetic\Filter\Yui\CssCompressorFilter; + + $css = new AssetCollection(array( + new GlobAsset('/path/to/sass/*.sass', array(new SassFilter())), + new GlobAsset('/path/to/css/*.css'), + ), array( + new YuiCompressorFilter('/path/to/yuicompressor.jar'), + )); + +上記の例では、1つにまとめられたCSSを、さらにYUI compressorフィルタを適用することで、全体を圧縮しています。 + +### アセットコレクションのイテレーション + +アセットコレクションは、旧来のPHP配列のように、イテレートできます。 + + echo "Source paths:\n"; + foreach ($collection as $asset) { + echo ' - '.$asset->getSourcePath()."\n"; + } + +アセットコレクションのイテレーションは再帰的で、「葉」にあたるアセットの取得を行います。 +また、気の利いたフィルタを内蔵しているので、同じアセットがコレクション内に複数存在する場合でも、 +一度だけのインクルードが保証されます。 + +Next: [アセットを「オンザフライ」で定義する](define.md) diff --git a/vendor/kriswallsmith/assetic/docs/ja/define.md b/vendor/kriswallsmith/assetic/docs/ja/define.md new file mode 100644 index 0000000000..3b0443610b --- /dev/null +++ b/vendor/kriswallsmith/assetic/docs/ja/define.md @@ -0,0 +1,140 @@ +アセットの「オンザフライ」な定義 +---------------------------------------- + +Asseticの使用方法二つ目は、独立したPHPファイルを使用する代わりに、 +テンプレートで「オンザフライ」にアセット定義をする方法です。 +このアプローチでは、PHPテンプレートは下記のようになります。 + + + +`assetic_javascripts()`の呼び出しは2つの目的を兼ねています。 +まず、「フォーミュラローダー」により走査され、アセットの構築、ダンプ、及び出力を行うための「フォーミュラ(処方箋)」が抽出されます。 +また、テンプレートのレンダー時にも実行され、アセットの出力パスが出力されます。 + +Asseticには下記のようなヘルパー関数があります。 + + * `assetic_image()` + * `assetic_javascripts()` + * `assetic_stylesheets()` + +アセットをオンザフライに定義するということは、より高度なテクニックであり、 +そのため、重い仕事をするサービスに依存することになります。 +そのうちの重要なものがアセットファクトリです。 + +### アセットファクトリ + +アセットファクトリは、アセットオブジェクトを、配列とスカラ値のみから、 +どのように作成するのか把握しています。 +`assetic_*`ヘルパー関数で使用する記法と同様のものとなります。 + + use Assetic\Factory\AssetFactory; + + $factory = new AssetFactory('/path/to/web'); + $js = $factory->createAsset(array( + 'js/jquery.js', + 'js/jquery.plugin.js', + 'js/application.js', + )); + +### フィルタマネージャー + +ファクトリによって作成されたアセットに対しても、フィルタを適用することができます。 +そのためには、`FilterManager`を設定して、名前を定義しフィルタを構成します。 + + use Assetic\FilterManager; + use Assetic\Filter\GoogleClosure\ApiFilter as ClosureFilter; + + $fm = new FilterManager(); + $fm->set('closure', new ClosureFilter()); + $factory->setFilterManager($fm); + + $js = $factory->createAsset('js/*', 'closure'); + +上記の例では、Google Closure Compilerフィルタをインスタンス化し、 +フィルタマネージャーを通じて`closure`という名前をつけています。 +このフィルタマネージャーをアセットファクトリに渡すことで、 +アセット作成時には、`closure`という名前でフィルタを使用できるようになります。 + +### デバッグモード + +アセットファクトリは、デバッグモードというコンセプトも取り入れており、 +デバッグモードの設定により、ファクトリが作成するアセットから、 +特定のフィルタを除外することができます。 + +たとえば、YUI Compressorは大変素晴らしいのですが、圧縮されたJavascriptを +デバッグするのは大変難しく、プロダクション環境でのみの使用が適切でしょう。 + + use Asset\Factory\AssetFactory; + + $factory = new AssetFactory('/path/to/web', true); // デバッグモードON + $factory->setFilterManager($fm); + $js = $factory->createAsset('js/*', '?closure'); + +フィルタ名`closure`の前にクエスチョンマークを記述すると、ファクトリに対して、 +このフィルタはオプションであり、 +デバッグモードがOFFの時にのみ適用するように通知することができます。 + +### アセットマネージャーとアセットリファレンス + +アセットファクトリにはもう一つ特別な記法があり、別の場所で定義した +アセットを参照することができるようになります。 +これを「アセットリファレンス」と呼び、アセットマネージャーを通じて、 +フィルタマネージャーと同様の、名前によるアセットの構成が可能です。 + + use Assetic\AssetManager; + use Assetic\Asset\FileAsset; + use Assetic\Factory\AssetFactory; + + $am = new AssetManager(); + $am->set('jquery', new FileAsset('/path/to/jquery.js')); + + $factory = new AssetFactory('/path/to/web'); + $factory->setAssetManager($am); + + $js = $factory->createAsset(array( + '@jquery', + 'js/application.js', + )); + +### テンプレートからのアセット抽出 + +テンプレート内でアセット群を定義したら、「フォーミュラローダー」サービスを使用して、 +アセットの定義を抽出します。 + + use Assetic\Factory\Loader\FunctionCallsFormulaLoader; + use Assetic\Factory\Resource\FileResource; + + $loader = new FunctionCallsFormulaLoader($factory); + $formulae = $loader->load(new FileResource('/path/to/template.php')); + +これらのフォーミュラ自体は、それ自体で使途はあまりなく、 +アセットファクトリが目的のアセットオブジェクトを作成するに足る情報しか持っていません。 +`LazyAssetManager`でラップすることで有益なものとなります。 + +### レイジーなアセットマネージャー + +このサービスは、アセットファクトリと、1つ以上のフォーミュラローダーから成っており、 +裏方のサービス間のグルとして動作しますが、表面上では、通常のアセットマネージャーと同じように使用することができます。 + + use Assetic\Asset\FileAsset; + use Assetic\Factory\LazyAssetManager; + use Assetic\Factory\Loader\FunctionCallsFormulaLoader; + use Assetic\Factory\Resource\DirectoryResource; + + $am = new LazyAssetManager($factory); + $am->set('jquery', new FileAsset('/path/to/jquery.js')); + $am->setLoader('php', new FunctionCallsFormulaLoader($factory)); + $am->addResource(new DirectoryResource('/path/to/templates', '/\.php$/'), 'php'); + +### アセットライター + +作成したアセットマネージャーが、テンプレート内で定義した全てのアセットを把握したら、 +アセットライターを使用して、テンプレートが参照することになる実際のファイルを作成します。 + + use Assetic\AssetWriter; + + $writer = new AssetWriter('/path/to/web'); + $writer->writeManagerAssets($am); + +上記のスクリプトを実行すると、アセットマネージャー内のすべてのアセットがメモリに読み込まれ、 +指定したフィルタが適用された後、公開領域に静的ファイルとしてダンプされ、準備完了となります。 diff --git a/vendor/kriswallsmith/assetic/docs/ja/index.md b/vendor/kriswallsmith/assetic/docs/ja/index.md new file mode 100644 index 0000000000..138280d2e6 --- /dev/null +++ b/vendor/kriswallsmith/assetic/docs/ja/index.md @@ -0,0 +1,7 @@ +目次 +----- + + 1. [イントロダクション](introduction.md) + 2. [アセットの構築とダンプ](build.md) + 3. [コンセプト](concepts.md) + 4. [アセットを「オンザフライ」で定義する](define.md) diff --git a/vendor/kriswallsmith/assetic/docs/ja/introduction.md b/vendor/kriswallsmith/assetic/docs/ja/introduction.md new file mode 100644 index 0000000000..0f45a8edc9 --- /dev/null +++ b/vendor/kriswallsmith/assetic/docs/ja/introduction.md @@ -0,0 +1,18 @@ +Asseticとは +----------------- + +Asseticは、PHP5.3用のアセット管理フレームワークです。 +Asseticを導入することで、Javascriptやスタイルシート、画像をコントロールする +様々なサードパーティー製のツールを使用できるようになります。 + +Asseticの使用方法 +--------------------- + +2つの異なるアプローチがあります。 + + 1. アセットのビルド、ダンプ、出力をPHPファイルで行い、テンプレートからそのファイルを直接参照する方法 + 2. テンプレート内でアセットを(「オンザフライ」に)定義し、抽出やダンプ、出力にローダーを使用する方法 + +前者はいくらかシンプルである一方、後者は動的で柔軟性に富み、最適化が可能となります。 + +Next: [アセットの構築とダンプ](build.md) diff --git a/vendor/kriswallsmith/assetic/phpunit.travis.xml b/vendor/kriswallsmith/assetic/phpunit.travis.xml new file mode 100644 index 0000000000..8bb44153c7 --- /dev/null +++ b/vendor/kriswallsmith/assetic/phpunit.travis.xml @@ -0,0 +1,36 @@ + + + + + + ./tests/Assetic/Test/ + + + + + + + + + + + + + + + + + + + + + + + + + + + ./src/Assetic/ + + + diff --git a/vendor/kriswallsmith/assetic/phpunit.xml.dist b/vendor/kriswallsmith/assetic/phpunit.xml.dist new file mode 100644 index 0000000000..d684a9f224 --- /dev/null +++ b/vendor/kriswallsmith/assetic/phpunit.xml.dist @@ -0,0 +1,36 @@ + + + + + + ./tests/Assetic/Test/ + + + + + + + + + + + + + + + + + + + + + + + + + + + ./src/Assetic/ + + + diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCache.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCache.php new file mode 100644 index 0000000000..7c1cfb24c2 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCache.php @@ -0,0 +1,149 @@ + + */ +class AssetCache implements AssetInterface +{ + private $asset; + private $cache; + + public function __construct(AssetInterface $asset, CacheInterface $cache) + { + $this->asset = $asset; + $this->cache = $cache; + } + + public function ensureFilter(FilterInterface $filter) + { + $this->asset->ensureFilter($filter); + } + + public function getFilters() + { + return $this->asset->getFilters(); + } + + public function clearFilters() + { + $this->asset->clearFilters(); + } + + public function load(FilterInterface $additionalFilter = null) + { + $cacheKey = self::getCacheKey($this->asset, $additionalFilter, 'load'); + if ($this->cache->has($cacheKey)) { + $this->asset->setContent($this->cache->get($cacheKey)); + + return; + } + + $this->asset->load($additionalFilter); + $this->cache->set($cacheKey, $this->asset->getContent()); + } + + public function dump(FilterInterface $additionalFilter = null) + { + $cacheKey = self::getCacheKey($this->asset, $additionalFilter, 'dump'); + if ($this->cache->has($cacheKey)) { + return $this->cache->get($cacheKey); + } + + $content = $this->asset->dump($additionalFilter); + $this->cache->set($cacheKey, $content); + + return $content; + } + + public function getContent() + { + return $this->asset->getContent(); + } + + public function setContent($content) + { + $this->asset->setContent($content); + } + + public function getSourceRoot() + { + return $this->asset->getSourceRoot(); + } + + public function getSourcePath() + { + return $this->asset->getSourcePath(); + } + + public function getTargetPath() + { + return $this->asset->getTargetPath(); + } + + public function setTargetPath($targetPath) + { + $this->asset->setTargetPath($targetPath); + } + + public function getLastModified() + { + return $this->asset->getLastModified(); + } + + /** + * Returns a cache key for the current asset. + * + * The key is composed of everything but an asset's content: + * + * * source root + * * source path + * * target url + * * last modified + * * filters + * + * @param AssetInterface $asset The asset + * @param FilterInterface $additionalFilter Any additional filter being applied + * @param string $salt Salt for the key + * + * @return string A key for identifying the current asset + */ + private static function getCacheKey(AssetInterface $asset, FilterInterface $additionalFilter = null, $salt = '') + { + if ($additionalFilter) { + $asset = clone $asset; + $asset->ensureFilter($additionalFilter); + } + + $cacheKey = $asset->getSourceRoot(); + $cacheKey .= $asset->getSourcePath(); + $cacheKey .= $asset->getTargetPath(); + $cacheKey .= $asset->getLastModified(); + + foreach ($asset->getFilters() as $filter) { + if ($filter instanceof HashableInterface) { + $cacheKey .= $filter->hash(); + } else { + $cacheKey .= serialize($filter); + } + } + + return md5($cacheKey.$salt); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollection.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollection.php new file mode 100644 index 0000000000..b70c6ad739 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollection.php @@ -0,0 +1,326 @@ + + */ +class AssetCollection implements AssetInterface, \IteratorAggregate +{ + private $assets; + private $filters; + private $sourceRoot; + private $targetPath; + private $content; + private $clones; + + /** + * Constructor. + * + * @param array $assets Assets for the current collection + * @param array $filters Filters for the current collection + * @param string $sourceRoot The root directory + */ + public function __construct($assets = array(), $filters = array(), $sourceRoot = null) + { + $this->assets = array(); + foreach ($assets as $asset) { + $this->add($asset); + } + + $this->filters = new FilterCollection($filters); + $this->sourceRoot = $sourceRoot; + $this->clones = new \SplObjectStorage(); + } + + /** + * Adds an asset to the current collection. + * + * @param AssetInterface $asset An asset + */ + public function add(AssetInterface $asset) + { + $this->assets[] = $asset; + } + + public function all() + { + return $this->assets; + } + + public function ensureFilter(FilterInterface $filter) + { + $this->filters->ensure($filter); + } + + public function getFilters() + { + return $this->filters->all(); + } + + public function clearFilters() + { + $this->filters->clear(); + } + + public function load(FilterInterface $additionalFilter = null) + { + // loop through leaves and load each asset + $parts = array(); + foreach ($this as $asset) { + $asset->load($additionalFilter); + $parts[] = $asset->getContent(); + } + + $this->content = implode("\n", $parts); + } + + public function dump(FilterInterface $additionalFilter = null) + { + // loop through leaves and dump each asset + $parts = array(); + foreach ($this as $asset) { + $parts[] = $asset->dump($additionalFilter); + } + + return implode("\n", $parts); + } + + public function getContent() + { + return $this->content; + } + + public function setContent($content) + { + $this->content = $content; + } + + public function getSourceRoot() + { + return $this->sourceRoot; + } + + public function getSourcePath() + { + } + + public function getTargetPath() + { + return $this->targetPath; + } + + public function setTargetPath($targetPath) + { + $this->targetPath = $targetPath; + } + + /** + * Returns the highest last-modified value of all assets in the current collection. + * + * @return integer|null A UNIX timestamp + */ + public function getLastModified() + { + if (!count($this->assets)) { + return; + } + + $mapper = function (AssetInterface $asset) { + return $asset->getLastModified(); + }; + + return max(array_map($mapper, $this->assets)); + } + + /** + * Returns an iterator for looping recursively over unique leaves. + */ + public function getIterator() + { + return new \RecursiveIteratorIterator(new AssetCollectionFilterIterator(new AssetCollectionIterator($this, $this->clones))); + } +} + +/** + * Asset collection filter iterator. + * + * The filter iterator is responsible for de-duplication of leaf assets based + * on both strict equality and source URL. + * + * @author Kris Wallsmith + * @access private + */ +class AssetCollectionFilterIterator extends \RecursiveFilterIterator +{ + private $visited; + private $sources; + + /** + * Constructor. + * + * @param AssetCollectionIterator $iterator The inner iterator + * @param array $visited An array of visited asset objects + * @param array $sources An array of visited source strings + */ + public function __construct(AssetCollectionIterator $iterator, array $visited = array(), array $sources = array()) + { + parent::__construct($iterator); + + $this->visited = $visited; + $this->sources = $sources; + } + + /** + * Determines whether the current asset is a duplicate. + * + * De-duplication is performed based on either strict equality or by + * matching sources. + * + * @return Boolean Returns true if we have not seen this asset yet + */ + public function accept() + { + $asset = $this->getInnerIterator()->current(true); + $duplicate = false; + + // check strict equality + if (in_array($asset, $this->visited, true)) { + $duplicate = true; + } else { + $this->visited[] = $asset; + } + + // check source + $sourceRoot = $asset->getSourceRoot(); + $sourcePath = $asset->getSourcePath(); + if ($sourceRoot && $sourcePath) { + $source = $sourceRoot.'/'.$sourcePath; + if (in_array($source, $this->sources)) { + $duplicate = true; + } else { + $this->sources[] = $source; + } + } + + return !$duplicate; + } + + /** + * Passes visited objects and source URLs to the child iterator. + */ + public function getChildren() + { + return new self($this->getInnerIterator()->getChildren(), $this->visited, $this->sources); + } +} + +/** + * Iterates over an asset collection. + * + * The iterator is responsible for cascading filters and target URL patterns + * from parent to child assets. + * + * @author Kris Wallsmith + * @access private + */ +class AssetCollectionIterator implements \RecursiveIterator +{ + private $assets; + private $filters; + private $output; + private $clones; + + public function __construct(AssetCollection $coll, \SplObjectStorage $clones) + { + $this->assets = $coll->all(); + $this->filters = $coll->getFilters(); + $this->output = $coll->getTargetPath(); + $this->clones = $clones; + + if (false === $pos = strpos($this->output, '.')) { + $this->output .= '_*'; + } else { + $this->output = substr($this->output, 0, $pos).'_*'.substr($this->output, $pos); + } + } + + /** + * Returns a copy of the current asset with filters and a target URL applied. + * + * @param Boolean $raw Returns the unmodified asset if true + */ + public function current($raw = false) + { + $asset = current($this->assets); + + if ($raw) { + return $asset; + } + + // clone once + if (!isset($this->clones[$asset])) { + $clone = $this->clones[$asset] = clone $asset; + + // generate a target path based on asset name + $name = sprintf('%s_%d', pathinfo($asset->getSourcePath(), PATHINFO_FILENAME) ?: 'part', $this->key() + 1); + $clone->setTargetPath(str_replace('*', $name, $this->output)); + } else { + $clone = $this->clones[$asset]; + } + + // cascade filters + foreach ($this->filters as $filter) { + $clone->ensureFilter($filter); + } + + return $clone; + } + + public function key() + { + return key($this->assets); + } + + public function next() + { + return next($this->assets); + } + + public function rewind() + { + return reset($this->assets); + } + + public function valid() + { + return false !== current($this->assets); + } + + public function hasChildren() + { + return current($this->assets) instanceof AssetCollection; + } + + /** + * @uses current() + */ + public function getChildren() + { + return new self($this->current(), $this->clones); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetInterface.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetInterface.php new file mode 100644 index 0000000000..abc7c79ccf --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetInterface.php @@ -0,0 +1,135 @@ + + */ +interface AssetInterface +{ + /** + * Ensures the current asset includes the supplied filter. + * + * @param FilterInterface $filter A filter + */ + public function ensureFilter(FilterInterface $filter); + + /** + * Returns an array of filters currently applied. + * + * @return array An array of filters + */ + public function getFilters(); + + /** + * Clears all filters from the current asset. + */ + public function clearFilters(); + + /** + * Loads the asset into memory and applies load filters. + * + * You may provide an additional filter to apply during load. + * + * @param FilterInterface $additionalFilter An additional filter + */ + public function load(FilterInterface $additionalFilter = null); + + /** + * Applies dump filters and returns the asset as a string. + * + * You may provide an additional filter to apply during dump. + * + * Dumping an asset should not change its state. + * + * If the current asset has not been loaded yet, it should be + * automatically loaded at this time. + * + * @param FilterInterface $additionalFilter An additional filter + * + * @return string The filtered content of the current asset + */ + public function dump(FilterInterface $additionalFilter = null); + + /** + * Returns the loaded content of the current asset. + * + * @return string The content + */ + public function getContent(); + + /** + * Sets the content of the current asset. + * + * Filters can use this method to change the content of the asset. + * + * @param string $content The asset content + */ + public function setContent($content); + + /** + * Returns an absolute path or URL to the source asset's root directory. + * + * This value should be an absolute path to a directory in the filesystem, + * an absolute URL with no path, or null. + * + * For example: + * + * * '/path/to/web' + * * 'http://example.com' + * * null + * + * @return string|null The asset's root + */ + public function getSourceRoot(); + + /** + * Returns the relative path for the source asset. + * + * This value can be combined with the asset's source root (if both are + * non-null) to get something compatible with file_get_contents(). + * + * For example: + * + * * 'js/main.js' + * * 'main.js' + * * null + * + * @return string|null The source asset path + */ + public function getSourcePath(); + + /** + * Returns the URL for the current asset. + * + * @return string|null A web URL where the asset will be dumped + */ + public function getTargetPath(); + + /** + * Sets the URL for the current asset. + * + * @param string $targetPath A web URL where the asset will be dumped + */ + public function setTargetPath($targetPath); + + /** + * Returns the time the current asset was last modified. + * + * @return integer|null A UNIX timestamp + */ + public function getLastModified(); +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetReference.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetReference.php new file mode 100644 index 0000000000..dc23aeafa0 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetReference.php @@ -0,0 +1,118 @@ + + */ +class AssetReference implements AssetInterface +{ + private $am; + private $name; + private $filters = array(); + + public function __construct(AssetManager $am, $name) + { + $this->am = $am; + $this->name = $name; + } + + public function ensureFilter(FilterInterface $filter) + { + $this->filters[] = $filter; + } + + public function getFilters() + { + $this->flushFilters(); + + return $this->callAsset(__FUNCTION__); + } + + public function clearFilters() + { + $this->filters = array(); + $this->callAsset(__FUNCTION__); + } + + public function load(FilterInterface $additionalFilter = null) + { + $this->flushFilters(); + + return $this->callAsset(__FUNCTION__, array($additionalFilter)); + } + + public function dump(FilterInterface $additionalFilter = null) + { + $this->flushFilters(); + + return $this->callAsset(__FUNCTION__, array($additionalFilter)); + } + + public function getContent() + { + return $this->callAsset(__FUNCTION__); + } + + public function setContent($content) + { + $this->callAsset(__FUNCTION__, array($content)); + } + + public function getSourceRoot() + { + return $this->callAsset(__FUNCTION__); + } + + public function getSourcePath() + { + return $this->callAsset(__FUNCTION__); + } + + public function getTargetPath() + { + return $this->callAsset(__FUNCTION__); + } + + public function setTargetPath($targetPath) + { + $this->callAsset(__FUNCTION__, array($targetPath)); + } + + public function getLastModified() + { + return $this->callAsset(__FUNCTION__); + } + + // private + + private function callAsset($method, $arguments = array()) + { + $asset = $this->am->get($this->name); + + return call_user_func_array(array($asset, $method), $arguments); + } + + private function flushFilters() + { + $asset = $this->am->get($this->name); + + while ($filter = array_shift($this->filters)) { + $asset->ensureFilter($filter); + } + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/BaseAsset.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/BaseAsset.php new file mode 100644 index 0000000000..a35331f070 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Asset/BaseAsset.php @@ -0,0 +1,135 @@ + + */ +abstract class BaseAsset implements AssetInterface +{ + private $filters; + private $sourceRoot; + private $sourcePath; + private $targetPath; + private $content; + private $loaded; + + /** + * Constructor. + * + * @param array $filters Filters for the asset + */ + public function __construct($filters = array(), $sourceRoot = null, $sourcePath = null) + { + $this->filters = new FilterCollection($filters); + $this->sourceRoot = $sourceRoot; + $this->sourcePath = $sourcePath; + $this->loaded = false; + } + + public function __clone() + { + $this->filters = clone $this->filters; + } + + public function ensureFilter(FilterInterface $filter) + { + $this->filters->ensure($filter); + } + + public function getFilters() + { + return $this->filters->all(); + } + + public function clearFilters() + { + $this->filters->clear(); + } + + /** + * Encapsulates asset loading logic. + * + * @param string $content The asset content + * @param FilterInterface $additionalFilter An additional filter + */ + protected function doLoad($content, FilterInterface $additionalFilter = null) + { + $filter = clone $this->filters; + if ($additionalFilter) { + $filter->ensure($additionalFilter); + } + + $asset = clone $this; + $asset->setContent($content); + + $filter->filterLoad($asset); + $this->content = $asset->getContent(); + + $this->loaded = true; + } + + public function dump(FilterInterface $additionalFilter = null) + { + if (!$this->loaded) { + $this->load(); + } + + $filter = clone $this->filters; + if ($additionalFilter) { + $filter->ensure($additionalFilter); + } + + $asset = clone $this; + $filter->filterDump($asset); + + return $asset->getContent(); + } + + public function getContent() + { + return $this->content; + } + + public function setContent($content) + { + $this->content = $content; + } + + public function getSourceRoot() + { + return $this->sourceRoot; + } + + public function getSourcePath() + { + return $this->sourcePath; + } + + public function getTargetPath() + { + return $this->targetPath; + } + + public function setTargetPath($targetPath) + { + $this->targetPath = $targetPath; + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/FileAsset.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/FileAsset.php new file mode 100644 index 0000000000..5f4e8747ce --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Asset/FileAsset.php @@ -0,0 +1,64 @@ + + */ +class FileAsset extends BaseAsset +{ + private $source; + + /** + * Constructor. + * + * @param string $source An absolute path + * @param array $filters An array of filters + * @param string $sourceRoot The source asset root directory + * @param string $sourcePath The source asset path + * + * @throws InvalidArgumentException If the supplied root doesn't match the source when guessing the path + */ + public function __construct($source, $filters = array(), $sourceRoot = null, $sourcePath = null) + { + if (null === $sourceRoot) { + $sourceRoot = dirname($source); + if (null === $sourcePath) { + $sourcePath = basename($source); + } + } elseif (null === $sourcePath) { + if (0 !== strpos($source, $sourceRoot)) { + throw new \InvalidArgumentException(sprintf('The source "%s" is not in the root directory "%s"', $source, $sourceRoot)); + } + + $sourcePath = substr($source, strlen($sourceRoot) + 1); + } + + $this->source = $source; + + parent::__construct($filters, $sourceRoot, $sourcePath); + } + + public function load(FilterInterface $additionalFilter = null) + { + $this->doLoad(file_get_contents($this->source), $additionalFilter); + } + + public function getLastModified() + { + return filemtime($this->source); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/GlobAsset.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/GlobAsset.php new file mode 100644 index 0000000000..aa736d2bca --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Asset/GlobAsset.php @@ -0,0 +1,101 @@ + + */ +class GlobAsset extends AssetCollection +{ + private $globs; + private $initialized; + + /** + * Constructor. + * + * @param string|array $globs A single glob path or array of paths + * @param array $filters An array of filters + * @param string $root The root directory + */ + public function __construct($globs, $filters = array(), $root = null) + { + $this->globs = (array) $globs; + $this->initialized = false; + + parent::__construct(array(), $filters, $root); + } + + public function all() + { + if (!$this->initialized) { + $this->initialize(); + } + + return parent::all(); + } + + public function load(FilterInterface $additionalFilter = null) + { + if (!$this->initialized) { + $this->initialize(); + } + + parent::load($additionalFilter); + } + + public function dump(FilterInterface $additionalFilter = null) + { + if (!$this->initialized) { + $this->initialize(); + } + + return parent::dump($additionalFilter); + } + + public function getLastModified() + { + if (!$this->initialized) { + $this->initialize(); + } + + return parent::getLastModified(); + } + + public function getIterator() + { + if (!$this->initialized) { + $this->initialize(); + } + + return parent::getIterator(); + } + + /** + * Initializes the collection based on the glob(s) passed in. + */ + private function initialize() + { + foreach ($this->globs as $glob) { + if (false !== $paths = glob($glob)) { + foreach ($paths as $path) { + $this->add(new FileAsset($path, array(), $this->getSourceRoot())); + } + } + } + + $this->initialized = true; + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/HttpAsset.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/HttpAsset.php new file mode 100644 index 0000000000..848fd9bfe7 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Asset/HttpAsset.php @@ -0,0 +1,76 @@ + + */ +class HttpAsset extends BaseAsset +{ + private $sourceUrl; + private $ignoreErrors; + + /** + * Constructor. + * + * @param string $sourceUrl The source URL + * @param array $filters An array of filters + * + * @throws InvalidArgumentException If the first argument is not an URL + */ + public function __construct($sourceUrl, $filters = array(), $ignoreErrors = false) + { + if (0 === strpos($sourceUrl, '//')) { + $sourceUrl = 'http:'.$sourceUrl; + } elseif (false === strpos($sourceUrl, '://')) { + throw new \InvalidArgumentException(sprintf('"%s" is not a valid URL.', $sourceUrl)); + } + + $this->sourceUrl = $sourceUrl; + $this->ignoreErrors = $ignoreErrors; + + list($scheme, $url) = explode('://', $sourceUrl, 2); + list($host, $path) = explode('/', $url, 2); + + parent::__construct($filters, $scheme.'://'.$host, $path); + } + + public function load(FilterInterface $additionalFilter = null) + { + if (false === $content = @file_get_contents($this->sourceUrl)) { + if ($this->ignoreErrors) { + return; + } else { + throw new \RuntimeException(sprintf('Unable to load asset from URL "%s"', $this->sourceUrl)); + } + } + + $this->doLoad($content, $additionalFilter); + } + + public function getLastModified() + { + if (false !== @file_get_contents($this->sourceUrl, false, stream_context_create(array('http' => array('method' => 'HEAD'))))) { + foreach ($http_response_header as $header) { + if (0 === stripos($header, 'Last-Modified: ')) { + list(, $mtime) = explode(':', $header, 2); + + return strtotime(trim($mtime)); + } + } + } + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/StringAsset.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/StringAsset.php new file mode 100644 index 0000000000..6d6dc5f79d --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Asset/StringAsset.php @@ -0,0 +1,55 @@ + + */ +class StringAsset extends BaseAsset +{ + private $content; + private $lastModified; + + /** + * Constructor. + * + * @param string $content The content of the asset + * @param array $filters Filters for the asset + * @param string $sourceRoot The source asset root directory + * @param string $sourcePath The source asset path + */ + public function __construct($content, $filters = array(), $sourceRoot = null, $sourcePath = null) + { + $this->content = $content; + + parent::__construct($filters, $sourceRoot, $sourcePath); + } + + public function load(FilterInterface $additionalFilter = null) + { + $this->doLoad($this->content, $additionalFilter); + } + + public function setLastModified($lastModified) + { + $this->lastModified = $lastModified; + } + + public function getLastModified() + { + return $this->lastModified; + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/AssetManager.php b/vendor/kriswallsmith/assetic/src/Assetic/AssetManager.php new file mode 100644 index 0000000000..230e4fc7e3 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/AssetManager.php @@ -0,0 +1,79 @@ + + */ +class AssetManager +{ + private $assets = array(); + + /** + * Gets an asset by name. + * + * @param string $name The asset name + * + * @return AssetInterface The asset + * + * @throws InvalidArgumentException If there is no asset by that name + */ + public function get($name) + { + if (!isset($this->assets[$name])) { + throw new \InvalidArgumentException(sprintf('There is no "%s" asset.', $name)); + } + + return $this->assets[$name]; + } + + /** + * Checks if the current asset manager has a certain asset. + * + * @param string $name an asset name + * + * @return Boolean True if the asset has been set, false if not + */ + public function has($name) + { + return isset($this->assets[$name]); + } + + /** + * Registers an asset to the current asset manager. + * + * @param string $name The asset name + * @param AssetInterface $asset The asset + */ + public function set($name, AssetInterface $asset) + { + if (!ctype_alnum(str_replace('_', '', $name))) { + throw new \InvalidArgumentException(sprintf('The name "%s" is invalid.', $name)); + } + + $this->assets[$name] = $asset; + } + + /** + * Returns an array of asset names. + * + * @return array An array of asset names + */ + public function getNames() + { + return array_keys($this->assets); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php b/vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php new file mode 100644 index 0000000000..3ee7f7c6ff --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php @@ -0,0 +1,57 @@ + + */ +class AssetWriter +{ + private $dir; + + /** + * Constructor. + * + * @param string $dir The base web directory + */ + public function __construct($dir) + { + $this->dir = $dir; + } + + public function writeManagerAssets(AssetManager $am) + { + foreach ($am->getNames() as $name) { + $this->writeAsset($am->get($name)); + } + } + + public function writeAsset(AssetInterface $asset) + { + static::write($this->dir . '/' . $asset->getTargetPath(), $asset->dump()); + } + + protected static function write($path, $contents) + { + if (!is_dir($dir = dirname($path)) && false === @mkdir($dir, 0777, true)) { + throw new \RuntimeException('Unable to create directory '.$dir); + } + + if (false === @file_put_contents($path, $contents)) { + throw new \RuntimeException('Unable to write file '.$path); + } + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Cache/CacheInterface.php b/vendor/kriswallsmith/assetic/src/Assetic/Cache/CacheInterface.php new file mode 100644 index 0000000000..30448e9ca5 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Cache/CacheInterface.php @@ -0,0 +1,53 @@ + + */ +interface CacheInterface +{ + /** + * Checks if the cache has a value for a key. + * + * @param string $key A unique key + * + * @return Boolean Whether the cache has a value for this key + */ + public function has($key); + + /** + * Returns the value for a key. + * + * @param string $key A unique key + * + * @return string|null The value in the cache + */ + public function get($key); + + /** + * Sets a value in the cache. + * + * @param string $key A unique key + * @param string $value The value to cache + */ + public function set($key, $value); + + /** + * Removes a value from the cache. + * + * @param string $key A unique key + */ + public function remove($key); +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Cache/ConfigCache.php b/vendor/kriswallsmith/assetic/src/Assetic/Cache/ConfigCache.php new file mode 100644 index 0000000000..de60c9ef70 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Cache/ConfigCache.php @@ -0,0 +1,123 @@ + + */ +class ConfigCache +{ + private $dir; + + /** + * Construct. + * + * @param string $dir The cache directory + */ + public function __construct($dir) + { + $this->dir = $dir; + } + + /** + * Checks of the cache has a file. + * + * @param string $resource A cache key + * + * @return Boolean True if a file exists + */ + public function has($resource) + { + return file_exists($this->getSourcePath($resource)); + } + + /** + * Writes a value to a file. + * + * @param string $resource A cache key + * @param mixed $value A value to cache + */ + public function set($resource, $value) + { + $path = $this->getSourcePath($resource); + + if (!is_dir($dir = dirname($path)) && false === @mkdir($dir, 0777, true)) { + // @codeCoverageIgnoreStart + throw new \RuntimeException('Unable to create directory '.$dir); + // @codeCoverageIgnoreEnd + } + + if (false === @file_put_contents($path, sprintf("getSourcePath($resource); + + if (!file_exists($path)) { + throw new \RuntimeException('There is no cached value for '.$resource); + } + + return include $path; + } + + /** + * Returns a timestamp for when the cache was created. + * + * @param string $resource A cache key + * + * @return integer A UNIX timestamp + */ + public function getTimestamp($resource) + { + $path = $this->getSourcePath($resource); + + if (!file_exists($path)) { + throw new \RuntimeException('There is no cached value for '.$resource); + } + + if (false === $mtime = @filemtime($path)) { + // @codeCoverageIgnoreStart + throw new \RuntimeException('Unable to determine file mtime for '.$path); + // @codeCoverageIgnoreEnd + } + + return $mtime; + } + + /** + * Returns the path where the file corresponding to the supplied cache key can be included from. + * + * @param string $resource A cache key + * + * @return string A file path + */ + private function getSourcePath($resource) + { + $key = md5($resource); + + return $this->dir.'/'.$key[0].'/'.$key.'.php'; + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Cache/ExpiringCache.php b/vendor/kriswallsmith/assetic/src/Assetic/Cache/ExpiringCache.php new file mode 100644 index 0000000000..9e95b6dce2 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Cache/ExpiringCache.php @@ -0,0 +1,60 @@ + + */ +class ExpiringCache implements CacheInterface +{ + private $cache; + private $lifetime; + + public function __construct(CacheInterface $cache, $lifetime) + { + $this->cache = $cache; + $this->lifetime = $lifetime; + } + + public function has($key) + { + if ($this->cache->has($key)) { + if (time() < $this->cache->get($key.'.expires')) { + return true; + } + + $this->cache->remove($key.'.expires'); + $this->cache->remove($key); + } + + return false; + } + + public function get($key) + { + return $this->cache->get($key); + } + + public function set($key, $value) + { + $this->cache->set($key.'.expires', time() + $this->lifetime); + $this->cache->set($key, $value); + } + + public function remove($key) + { + $this->cache->remove($key.'.expires'); + $this->cache->remove($key); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Cache/FilesystemCache.php b/vendor/kriswallsmith/assetic/src/Assetic/Cache/FilesystemCache.php new file mode 100644 index 0000000000..45cfbdb581 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Cache/FilesystemCache.php @@ -0,0 +1,65 @@ + + */ +class FilesystemCache implements CacheInterface +{ + private $dir; + + public function __construct($dir) + { + $this->dir = $dir; + } + + public function has($key) + { + return file_exists($this->dir.'/'.$key); + } + + public function get($key) + { + $path = $this->dir.'/'.$key; + + if (!file_exists($path)) { + throw new \RuntimeException('There is no cached value for '.$key); + } + + return file_get_contents($path); + } + + public function set($key, $value) + { + if (!is_dir($this->dir) && false === @mkdir($this->dir, 0777, true)) { + throw new \RuntimeException('Unable to create directory '.$this->dir); + } + + $path = $this->dir.'/'.$key; + + if (false === @file_put_contents($path, $value)) { + throw new \RuntimeException('Unable to write file '.$path); + } + } + + public function remove($key) + { + $path = $this->dir.'/'.$key; + + if (file_exists($path) && false === @unlink($path)) { + throw new \RuntimeException('Unable to remove file '.$path); + } + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticExtension.php b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticExtension.php new file mode 100644 index 0000000000..507ef51697 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticExtension.php @@ -0,0 +1,70 @@ +factory = $factory; + $this->functions = array(); + + foreach ($functions as $function => $options) { + if (is_integer($function) && is_string($options)) { + $this->functions[$options] = array('filter' => $options); + } else { + $this->functions[$function] = $options + array('filter' => $function); + } + } + } + + public function getTokenParsers() + { + return array( + new AsseticTokenParser($this->factory, 'javascripts', 'js/*.js'), + new AsseticTokenParser($this->factory, 'stylesheets', 'css/*.css'), + new AsseticTokenParser($this->factory, 'image', 'images/*', true), + ); + } + + public function getFunctions() + { + $functions = array(); + foreach ($this->functions as $function => $filter) { + $functions[$function] = new AsseticFilterFunction($function); + } + + return $functions; + } + + public function getGlobals() + { + return array( + 'assetic' => array('debug' => $this->factory->isDebug()), + ); + } + + public function getFilterInvoker($function) + { + return new AsseticFilterInvoker($this->factory, $this->functions[$function]); + } + + public function getName() + { + return 'assetic'; + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterFunction.php b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterFunction.php new file mode 100644 index 0000000000..c5c79a8dbe --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterFunction.php @@ -0,0 +1,29 @@ +filter = $filter; + + parent::__construct($options); + } + + public function compile() + { + return sprintf('$this->env->getExtension(\'assetic\')->getFilterInvoker(\'%s\')->invoke', $this->filter); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterInvoker.php b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterInvoker.php new file mode 100644 index 0000000000..185b67b80e --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterInvoker.php @@ -0,0 +1,59 @@ + + */ +class AsseticFilterInvoker +{ + private $factory; + private $filters; + private $options; + + public function __construct($factory, $filter) + { + $this->factory = $factory; + + if (is_array($filter) && isset($filter['filter'])) { + $this->filters = (array) $filter['filter']; + $this->options = isset($filter['options']) ? (array) $filter['options'] : array(); + } else { + $this->filters = (array) $filter; + $this->options = array(); + } + } + + public function getFactory() + { + return $this->factory; + } + + public function getFilters() + { + return $this->filters; + } + + public function getOptions() + { + return $this->options; + } + + public function invoke($input, array $options = array()) + { + $asset = $this->factory->createAsset($input, $this->filters, $options + $this->options); + + return $asset->getTargetPath(); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticNode.php b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticNode.php new file mode 100644 index 0000000000..3dfef186cf --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticNode.php @@ -0,0 +1,123 @@ + $body); + + $attributes = array_replace( + array('debug' => null, 'combine' => null, 'var_name' => 'asset_url'), + $attributes, + array('asset' => $asset, 'inputs' => $inputs, 'filters' => $filters, 'name' => $name) + ); + + parent::__construct($nodes, $attributes, $lineno, $tag); + } + + public function compile(\Twig_Compiler $compiler) + { + $compiler->addDebugInfo($this); + + $combine = $this->getAttribute('combine'); + $debug = $this->getAttribute('debug'); + + if (null === $combine && null !== $debug) { + $combine = !$debug; + } + + if (null === $combine) { + $compiler + ->write("if (isset(\$context['assetic']['debug']) && \$context['assetic']['debug']) {\n") + ->indent() + ; + + $this->compileDebug($compiler); + + $compiler + ->outdent() + ->write("} else {\n") + ->indent() + ; + + $this->compileAsset($compiler, $this->getAttribute('asset'), $this->getAttribute('name')); + + $compiler + ->outdent() + ->write("}\n") + ; + } elseif ($combine) { + $this->compileAsset($compiler, $this->getAttribute('asset'), $this->getAttribute('name')); + } else { + $this->compileDebug($compiler); + } + + $compiler + ->write('unset($context[') + ->repr($this->getAttribute('var_name')) + ->raw("]);\n") + ; + } + + protected function compileDebug(\Twig_Compiler $compiler) + { + $i = 0; + foreach ($this->getAttribute('asset') as $leaf) { + $leafName = $this->getAttribute('name').'_'.$i++; + $this->compileAsset($compiler, $leaf, $leafName); + } + } + + protected function compileAsset(\Twig_Compiler $compiler, AssetInterface $asset, $name) + { + $compiler + ->write("// asset \"$name\"\n") + ->write('$context[') + ->repr($this->getAttribute('var_name')) + ->raw('] = ') + ; + + $this->compileAssetUrl($compiler, $asset, $name); + + $compiler + ->raw(";\n") + ->subcompile($this->getNode('body')) + ; + } + + protected function compileAssetUrl(\Twig_Compiler $compiler, AssetInterface $asset, $name) + { + $compiler->repr($asset->getTargetPath()); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticTokenParser.php b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticTokenParser.php new file mode 100644 index 0000000000..93be9375ab --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticTokenParser.php @@ -0,0 +1,135 @@ +factory = $factory; + $this->tag = $tag; + $this->output = $output; + $this->single = $single; + $this->extensions = $extensions; + } + + public function parse(\Twig_Token $token) + { + $inputs = array(); + $filters = array(); + $name = null; + $attributes = array( + 'output' => $this->output, + 'var_name' => 'asset_url', + ); + + $stream = $this->parser->getStream(); + while (!$stream->test(\Twig_Token::BLOCK_END_TYPE)) { + if ($stream->test(\Twig_Token::STRING_TYPE)) { + // '@jquery', 'js/src/core/*', 'js/src/extra.js' + $inputs[] = $stream->next()->getValue(); + } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'filter')) { + // filter='yui_js' + $stream->next(); + $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); + $filters = array_merge($filters, array_filter(array_map('trim', explode(',', $stream->expect(\Twig_Token::STRING_TYPE)->getValue())))); + } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'output')) { + // output='js/packed/*.js' OR output='js/core.js' + $stream->next(); + $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); + $attributes['output'] = $stream->expect(\Twig_Token::STRING_TYPE)->getValue(); + } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'name')) { + // name='core_js' + $stream->next(); + $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); + $name = $stream->expect(\Twig_Token::STRING_TYPE)->getValue(); + } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'as')) { + // as='the_url' + $stream->next(); + $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); + $attributes['var_name'] = $stream->expect(\Twig_Token::STRING_TYPE)->getValue(); + } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'debug')) { + // debug=true + $stream->next(); + $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); + $attributes['debug'] = 'true' == $stream->expect(\Twig_Token::NAME_TYPE, array('true', 'false'))->getValue(); + } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'combine')) { + // combine=true + $stream->next(); + $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); + $attributes['combine'] = 'true' == $stream->expect(\Twig_Token::NAME_TYPE, array('true', 'false'))->getValue(); + } elseif ($stream->test(\Twig_Token::NAME_TYPE, $this->extensions)) { + // an arbitrary configured attribute + $key = $stream->next()->getValue(); + $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); + $attributes[$key] = $stream->expect(\Twig_Token::STRING_TYPE)->getValue(); + } else { + $token = $stream->getCurrent(); + throw new \Twig_Error_Syntax(sprintf('Unexpected token "%s" of value "%s"', \Twig_Token::typeToEnglish($token->getType(), $token->getLine()), $token->getValue()), $token->getLine()); + } + } + + $stream->expect(\Twig_Token::BLOCK_END_TYPE); + + $body = $this->parser->subparse(array($this, 'testEndTag'), true); + + $stream->expect(\Twig_Token::BLOCK_END_TYPE); + + if ($this->single && 1 < count($inputs)) { + $inputs = array_slice($inputs, -1); + } + + if (!$name) { + $name = $this->factory->generateAssetName($inputs, $filters, $attributes); + } + + $asset = $this->factory->createAsset($inputs, $filters, $attributes + array('name' => $name)); + + return $this->createNode($asset, $body, $inputs, $filters, $name, $attributes, $token->getLine(), $this->getTag()); + } + + public function getTag() + { + return $this->tag; + } + + public function testEndTag(\Twig_Token $token) + { + return $token->test(array('end'.$this->getTag())); + } + + protected function createNode(AssetInterface $asset, \Twig_NodeInterface $body, array $inputs, array $filters, $name, array $attributes = array(), $lineno = 0, $tag = null) + { + return new AsseticNode($asset, $body, $inputs, $filters, $name, $attributes, $lineno, $tag); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigFormulaLoader.php b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigFormulaLoader.php new file mode 100644 index 0000000000..f079ba3ed3 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigFormulaLoader.php @@ -0,0 +1,96 @@ + + */ +class TwigFormulaLoader implements FormulaLoaderInterface +{ + private $twig; + + public function __construct(\Twig_Environment $twig) + { + $this->twig = $twig; + } + + public function load(ResourceInterface $resource) + { + try { + $tokens = $this->twig->tokenize($resource->getContent(), (string) $resource); + $nodes = $this->twig->parse($tokens); + } catch (\Exception $e) { + return array(); + } + + return $this->loadNode($nodes); + } + + /** + * Loads assets from the supplied node. + * + * @return array An array of asset formulae indexed by name + */ + private function loadNode(\Twig_Node $node) + { + $formulae = array(); + + if ($node instanceof AsseticNode) { + $formulae[$node->getAttribute('name')] = array( + $node->getAttribute('inputs'), + $node->getAttribute('filters'), + array( + 'output' => $node->getAttribute('asset')->getTargetPath(), + 'name' => $node->getAttribute('name'), + 'debug' => $node->getAttribute('debug'), + 'combine' => $node->getAttribute('combine'), + ), + ); + } elseif ($node instanceof \Twig_Node_Expression_Function) { + $name = version_compare(\Twig_Environment::VERSION, '1.2.0-DEV', '<') + ? $node->getNode('name')->getAttribute('name') + : $node->getAttribute('name'); + + if ($this->twig->getFunction($name) instanceof AsseticFilterFunction) { + $arguments = array(); + foreach ($node->getNode('arguments') as $argument) { + $arguments[] = eval('return '.$this->twig->compile($argument).';'); + } + + $invoker = $this->twig->getExtension('assetic')->getFilterInvoker($name); + + $inputs = isset($arguments[0]) ? (array) $arguments[0] : array(); + $filters = $invoker->getFilters(); + $options = array_replace($invoker->getOptions(), isset($arguments[1]) ? $arguments[1] : array()); + + if (!isset($options['name'])) { + $options['name'] = $invoker->getFactory()->generateAssetName($inputs, $filters, $options); + } + + $formulae[$options['name']] = array($inputs, $filters, $options); + } + } + + foreach ($node as $child) { + if ($child instanceof \Twig_Node) { + $formulae += $this->loadNode($child); + } + } + + return $formulae; + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigResource.php b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigResource.php new file mode 100644 index 0000000000..58d4b45249 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigResource.php @@ -0,0 +1,54 @@ + + */ +class TwigResource implements ResourceInterface +{ + private $loader; + private $name; + + public function __construct(\Twig_LoaderInterface $loader, $name) + { + $this->loader = $loader; + $this->name = $name; + } + + public function getContent() + { + try { + return $this->loader->getSource($this->name); + } catch (\Twig_Error_Loader $e) { + return ''; + } + } + + public function isFresh($timestamp) + { + try { + return $this->loader->isFresh($this->name, $timestamp); + } catch (\Twig_Error_Loader $e) { + return false; + } + } + + public function __toString() + { + return $this->name; + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/AssetFactory.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/AssetFactory.php new file mode 100644 index 0000000000..abd8a9b7d1 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Factory/AssetFactory.php @@ -0,0 +1,359 @@ + + */ +class AssetFactory +{ + private $root; + private $debug; + private $output; + private $workers; + private $am; + private $fm; + + /** + * Constructor. + * + * @param string $root The default root directory + * @param string $output The default output string + * @param Boolean $debug Filters prefixed with a "?" will be omitted in debug mode + */ + public function __construct($root, $debug = false) + { + $this->root = rtrim($root, '/'); + $this->debug = $debug; + $this->output = 'assetic/*'; + $this->workers = array(); + } + + /** + * Sets debug mode for the current factory. + * + * @param Boolean $debug Debug mode + */ + public function setDebug($debug) + { + $this->debug = $debug; + } + + /** + * Checks if the factory is in debug mode. + * + * @return Boolean Debug mode + */ + public function isDebug() + { + return $this->debug; + } + + /** + * Sets the default output string. + * + * @param string $output The default output string + */ + public function setDefaultOutput($output) + { + $this->output = $output; + } + + /** + * Adds a factory worker. + * + * @param WorkerInterface $worker A worker + */ + public function addWorker(WorkerInterface $worker) + { + $this->workers[] = $worker; + } + + /** + * Returns the current asset manager. + * + * @return AssetManager|null The asset manager + */ + public function getAssetManager() + { + return $this->am; + } + + /** + * Sets the asset manager to use when creating asset references. + * + * @param AssetManager $am The asset manager + */ + public function setAssetManager(AssetManager $am) + { + $this->am = $am; + } + + /** + * Returns the current filter manager. + * + * @return FilterManager|null The filter manager + */ + public function getFilterManager() + { + return $this->fm; + } + + /** + * Sets the filter manager to use when adding filters. + * + * @param FilterManager $fm The filter manager + */ + public function setFilterManager(FilterManager $fm) + { + $this->fm = $fm; + } + + /** + * Creates a new asset. + * + * Prefixing a filter name with a question mark will cause it to be + * omitted when the factory is in debug mode. + * + * Available options: + * + * * output: An output string + * * name: An asset name for interpolation in output patterns + * * debug: Forces debug mode on or off for this asset + * * root: An array or string of more root directories + * + * @param array|string $inputs An array of input strings + * @param array|string $filters An array of filter names + * @param array $options An array of options + * + * @return AssetCollection An asset collection + */ + public function createAsset($inputs = array(), $filters = array(), array $options = array()) + { + if (!is_array($inputs)) { + $inputs = array($inputs); + } + + if (!is_array($filters)) { + $filters = array($filters); + } + + if (!isset($options['output'])) { + $options['output'] = $this->output; + } + + if (!isset($options['debug'])) { + $options['debug'] = $this->debug; + } + + if (!isset($options['root'])) { + $options['root'] = array($this->root); + } else { + if (!is_array($options['root'])) { + $options['root'] = array($options['root']); + } + + $options['root'][] = $this->root; + } + + if (!isset($options['name'])) { + $options['name'] = $this->generateAssetName($inputs, $filters, $options); + } + + $asset = $this->createAssetCollection(); + $extensions = array(); + + // inner assets + foreach ($inputs as $input) { + if (is_array($input)) { + // nested formula + $asset->add(call_user_func_array(array($this, 'createAsset'), $input)); + } else { + $asset->add($this->parseInput($input, $options)); + $extensions[pathinfo($input, PATHINFO_EXTENSION)] = true; + } + } + + // filters + foreach ($filters as $filter) { + if ('?' != $filter[0]) { + $asset->ensureFilter($this->getFilter($filter)); + } elseif (!$options['debug']) { + $asset->ensureFilter($this->getFilter(substr($filter, 1))); + } + } + + // append consensus extension if missing + if (1 == count($extensions) && !pathinfo($options['output'], PATHINFO_EXTENSION) && $extension = key($extensions)) { + $options['output'] .= '.'.$extension; + } + + // output --> target url + $asset->setTargetPath(str_replace('*', $options['name'], $options['output'])); + + // apply workers + $this->processAsset($asset); + + return $asset; + } + + public function generateAssetName($inputs, $filters, $options = array()) + { + foreach (array_diff(array_keys($options), array('output', 'debug', 'root')) as $key) { + unset($options[$key]); + } + + ksort($options); + + return substr(sha1(serialize($inputs).serialize($filters).serialize($options)), 0, 7); + } + + /** + * Parses an input string string into an asset. + * + * The input string can be one of the following: + * + * * A reference: If the string starts with an "at" sign it will be interpreted as a reference to an asset in the asset manager + * * An absolute URL: If the string contains "://" or starts with "//" it will be interpreted as an HTTP asset + * * A glob: If the string contains a "*" it will be interpreted as a glob + * * A path: Otherwise the string is interpreted as a filesystem path + * + * Both globs and paths will be absolutized using the current root directory. + * + * @param string $input An input string + * @param array $options An array of options + * + * @return AssetInterface An asset + */ + protected function parseInput($input, array $options = array()) + { + if ('@' == $input[0]) { + return $this->createAssetReference(substr($input, 1)); + } + + if (false !== strpos($input, '://') || 0 === strpos($input, '//')) { + return $this->createHttpAsset($input); + } + + if (self::isAbsolutePath($input)) { + if ($root = self::findRootDir($input, $options['root'])) { + $path = ltrim(substr($input, strlen($root)), '/'); + } else { + $path = null; + } + } else { + $root = $this->root; + $path = $input; + $input = $this->root.'/'.$path; + } + if (false !== strpos($input, '*')) { + return $this->createGlobAsset($input, $root); + } else { + return $this->createFileAsset($input, $root, $path); + } + } + + protected function createAssetCollection() + { + return new AssetCollection(); + } + + protected function createAssetReference($name) + { + if (!$this->am) { + throw new \LogicException('There is no asset manager.'); + } + + return new AssetReference($this->am, $name); + } + + protected function createHttpAsset($sourceUrl) + { + return new HttpAsset($sourceUrl); + } + + protected function createGlobAsset($glob, $root = null) + { + return new GlobAsset($glob, array(), $root); + } + + protected function createFileAsset($source, $root = null, $path = null) + { + return new FileAsset($source, array(), $root, $path); + } + + protected function getFilter($name) + { + if (!$this->fm) { + throw new \LogicException('There is no filter manager.'); + } + + return $this->fm->get($name); + } + + /** + * Filters an asset through the factory workers. + * + * Each leaf asset will be processed first if the asset is traversable, + * followed by the asset itself. + * + * @param AssetInterface $asset An asset + */ + private function processAsset(AssetInterface $asset) + { + if ($asset instanceof \Traversable) { + foreach ($asset as $leaf) { + foreach ($this->workers as $worker) { + $worker->process($leaf); + } + } + } + + foreach ($this->workers as $worker) { + $worker->process($asset); + } + } + + private static function isAbsolutePath($path) + { + return '/' == $path[0] || '\\' == $path[0] || (3 < strlen($path) && ctype_alpha($path[0]) && $path[1] == ':' && ('\\' == $path[2] || '/' == $path[2])); + } + + /** + * Loops through the root directories and returns the first match. + * + * @param string $path An absolute path + * @param array $roots An array of root directories + * + * @return string|null The matching root directory, if found + */ + private static function findRootDir($path, array $roots) + { + foreach ($roots as $root) { + if (0 === strpos($path, $root)) { + return $root; + } + } + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php new file mode 100644 index 0000000000..9a5fa132fd --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php @@ -0,0 +1,204 @@ + + */ +class LazyAssetManager extends AssetManager +{ + private $factory; + private $loaders; + private $resources; + private $formulae; + private $loaded; + private $loading; + + /** + * Constructor. + * + * @param AssetFactory $factory The asset factory + * @param array $loaders An array of loaders indexed by alias + */ + public function __construct(AssetFactory $factory, $loaders = array()) + { + $this->factory = $factory; + $this->loaders = array(); + $this->resources = array(); + $this->formulae = array(); + $this->loaded = false; + $this->loading = false; + + foreach ($loaders as $alias => $loader) { + $this->setLoader($alias, $loader); + } + } + + /** + * Adds a loader to the asset manager. + * + * @param string $alias An alias for the loader + * @param FormulaLoaderInterface $loader A loader + */ + public function setLoader($alias, FormulaLoaderInterface $loader) + { + $this->loaders[$alias] = $loader; + $this->loaded = false; + } + + /** + * Adds a resource to the asset manager. + * + * @param ResourceInterface $resource A resource + * @param string $loader The loader alias for this resource + */ + public function addResource(ResourceInterface $resource, $loader) + { + $this->resources[$loader][] = $resource; + $this->loaded = false; + } + + /** + * Returns an array of resources. + * + * @return array An array of resources + */ + public function getResources() + { + $resources = array(); + foreach ($this->resources as $r) { + $resources = array_merge($resources, $r); + } + + return $resources; + } + + /** + * Checks for an asset formula. + * + * @param string $name An asset name + * + * @return Boolean If there is a formula + */ + public function hasFormula($name) + { + if (!$this->loaded) { + $this->load(); + } + + return isset($this->formulae[$name]); + } + + /** + * Returns an asset's formula. + * + * @param string $name An asset name + * + * @return array The formula + * + * @throws InvalidArgumentException If there is no formula by that name + */ + public function getFormula($name) + { + if (!$this->loaded) { + $this->load(); + } + + if (!isset($this->formulae[$name])) { + throw new \InvalidArgumentException(sprintf('There is no "%s" formula.', $name)); + } + + return $this->formulae[$name]; + } + + /** + * Sets a formula on the asset manager. + * + * @param string $name An asset name + * @param array $formula A formula + */ + public function setFormula($name, array $formula) + { + $this->formulae[$name] = $formula; + } + + /** + * Loads formulae from resources. + * + * @throws LogicException If a resource has been added to an invalid loader + */ + public function load() + { + if ($this->loading) { + return; + } + + if ($diff = array_diff(array_keys($this->resources), array_keys($this->loaders))) { + throw new \LogicException('The following loader(s) are not registered: '.implode(', ', $diff)); + } + + $this->loading = true; + + foreach ($this->resources as $loader => $resources) { + foreach ($resources as $resource) { + $this->formulae = array_replace($this->formulae, $this->loaders[$loader]->load($resource)); + } + } + + $this->loaded = true; + $this->loading = false; + } + + public function get($name) + { + if (!$this->loaded) { + $this->load(); + } + + if (!parent::has($name) && isset($this->formulae[$name])) { + list($inputs, $filters, $options) = $this->formulae[$name]; + $options['name'] = $name; + parent::set($name, $this->factory->createAsset($inputs, $filters, $options)); + } + + return parent::get($name); + } + + public function has($name) + { + if (!$this->loaded) { + $this->load(); + } + + return isset($this->formulae[$name]) || parent::has($name); + } + + public function getNames() + { + if (!$this->loaded) { + $this->load(); + } + + return array_unique(array_merge(parent::getNames(), array_keys($this->formulae))); + } + + public function isDebug() + { + return $this->factory->isDebug(); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/BasePhpFormulaLoader.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/BasePhpFormulaLoader.php new file mode 100644 index 0000000000..d0ad598647 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/BasePhpFormulaLoader.php @@ -0,0 +1,159 @@ + + */ +abstract class BasePhpFormulaLoader implements FormulaLoaderInterface +{ + protected $factory; + protected $prototypes; + + public function __construct(AssetFactory $factory) + { + $this->factory = $factory; + $this->prototypes = array(); + + foreach ($this->registerPrototypes() as $prototype => $options) { + $this->addPrototype($prototype, $options); + } + } + + public function addPrototype($prototype, array $options = array()) + { + $tokens = token_get_all('prototypes[$prototype] = array($tokens, $options); + } + + public function load(ResourceInterface $resource) + { + if (!$nbProtos = count($this->prototypes)) { + throw new \LogicException('There are no prototypes registered.'); + } + + $buffers = array_fill(0, $nbProtos, ''); + $bufferLevels = array_fill(0, $nbProtos, 0); + $buffersInWildcard = array(); + + $tokens = token_get_all($resource->getContent()); + $calls = array(); + + while ($token = array_shift($tokens)) { + $current = self::tokenToString($token); + // loop through each prototype (by reference) + foreach (array_keys($this->prototypes) as $i) { + $prototype =& $this->prototypes[$i][0]; + $options = $this->prototypes[$i][1]; + $buffer =& $buffers[$i]; + $level =& $bufferLevels[$i]; + + if (isset($buffersInWildcard[$i])) { + switch ($current) { + case '(': ++$level; break; + case ')': --$level; break; + } + + $buffer .= $current; + + if (!$level) { + $calls[] = array($buffer.';', $options); + $buffer = ''; + unset($buffersInWildcard[$i]); + } + } elseif ($current == self::tokenToString(current($prototype))) { + $buffer .= $current; + if ('*' == self::tokenToString(next($prototype))) { + $buffersInWildcard[$i] = true; + ++$level; + } + } else { + reset($prototype); + unset($buffersInWildcard[$i]); + $buffer = ''; + } + } + } + + $formulae = array(); + foreach ($calls as $call) { + $formulae += call_user_func_array(array($this, 'processCall'), $call); + } + + return $formulae; + } + + private function processCall($call, array $protoOptions = array()) + { + $tmp = tempnam(sys_get_temp_dir(), 'assetic'); + file_put_contents($tmp, implode("\n", array( + 'registerSetupCode(), + $call, + 'echo serialize($_call);', + ))); + $args = unserialize(shell_exec('php '.escapeshellarg($tmp))); + unlink($tmp); + + $inputs = isset($args[0]) ? self::argumentToArray($args[0]) : array(); + $filters = isset($args[1]) ? self::argumentToArray($args[1]) : array(); + $options = isset($args[2]) ? $args[2] : array(); + + if (!isset($options['debug'])) { + $options['debug'] = $this->factory->isDebug(); + } + + if (!is_array($options)) { + throw new \RuntimeException('The third argument must be omitted, null or an array.'); + } + + // apply the prototype options + $options += $protoOptions; + + if (!isset($options['name'])) { + $options['name'] = $this->factory->generateAssetName($inputs, $filters, $options); + } + + return array($options['name'] => array($inputs, $filters, $options)); + } + + /** + * Returns an array of prototypical calls and options. + * + * @return array Prototypes and options + */ + abstract protected function registerPrototypes(); + + /** + * Returns setup code for the reflection scriptlet. + * + * @return string Some PHP setup code + */ + abstract protected function registerSetupCode(); + + protected static function tokenToString($token) + { + return is_array($token) ? $token[1] : $token; + } + + protected static function argumentToArray($argument) + { + return is_array($argument) ? $argument : array_filter(array_map('trim', explode(',', $argument))); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/CachedFormulaLoader.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/CachedFormulaLoader.php new file mode 100644 index 0000000000..174fdd29a7 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/CachedFormulaLoader.php @@ -0,0 +1,68 @@ + + */ +class CachedFormulaLoader implements FormulaLoaderInterface +{ + private $loader; + private $configCache; + private $debug; + + /** + * Constructor. + * + * When the loader is in debug mode it will ensure the cached formulae + * are fresh before returning them. + * + * @param FormulaLoaderInterface $loader A formula loader + * @param ConfigCache $configCache A config cache + * @param Boolean $debug The debug mode + */ + public function __construct(FormulaLoaderInterface $loader, ConfigCache $configCache, $debug = false) + { + $this->loader = $loader; + $this->configCache = $configCache; + $this->debug = $debug; + } + + public function load(ResourceInterface $resources) + { + if (!$resources instanceof IteratorResourceInterface) { + $resources = array($resources); + } + + $formulae = array(); + + foreach ($resources as $resource) { + $id = (string) $resource; + if (!$this->configCache->has($id) || ($this->debug && !$resource->isFresh($this->configCache->getTimestamp($id)))) { + $formulae += $this->loader->load($resource); + $this->configCache->set($id, $formulae); + } else { + $formulae += $this->configCache->get($id); + } + } + + return $formulae; + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FormulaLoaderInterface.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FormulaLoaderInterface.php new file mode 100644 index 0000000000..c77040344b --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FormulaLoaderInterface.php @@ -0,0 +1,34 @@ + + */ +interface FormulaLoaderInterface +{ + /** + * Loads formulae from a resource. + * + * Formulae should be loaded the same regardless of the current debug + * mode. Debug considerations should happen downstream. + * + * @param ResourceInterface $resource A resource + * + * @return array An array of formulae + */ + public function load(ResourceInterface $resource); +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FunctionCallsFormulaLoader.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FunctionCallsFormulaLoader.php new file mode 100644 index 0000000000..9147806f19 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FunctionCallsFormulaLoader.php @@ -0,0 +1,53 @@ + + */ +class FunctionCallsFormulaLoader extends BasePhpFormulaLoader +{ + protected function registerPrototypes() + { + return array( + 'assetic_javascripts(*)' => array('output' => 'js/*.js'), + 'assetic_stylesheets(*)' => array('output' => 'css/*.css'), + 'assetic_image(*)' => array('output' => 'images/*'), + ); + } + + protected function registerSetupCode() + { + return <<<'EOF' +function assetic_javascripts() +{ + global $_call; + $_call = func_get_args(); +} + +function assetic_stylesheets() +{ + global $_call; + $_call = func_get_args(); +} + +function assetic_image() +{ + global $_call; + $_call = func_get_args(); +} + +EOF; + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/CoalescingDirectoryResource.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/CoalescingDirectoryResource.php new file mode 100644 index 0000000000..07f880e7ad --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/CoalescingDirectoryResource.php @@ -0,0 +1,112 @@ + + */ +class CoalescingDirectoryResource implements IteratorResourceInterface +{ + private $directories; + + public function __construct($directories) + { + $this->directories = array(); + + foreach ($directories as $directory) { + $this->addDirectory($directory); + } + } + + public function addDirectory(IteratorResourceInterface $directory) + { + $this->directories[] = $directory; + } + + public function isFresh($timestamp) + { + foreach ($this->getFileResources() as $file) { + if (!$file->isFresh($timestamp)) { + return false; + } + } + + return true; + } + + public function getContent() + { + $parts = array(); + foreach ($this->getFileResources() as $file) { + $parts[] = $file->getContent(); + } + + return implode("\n", $parts); + } + + /** + * Returns a string to uniquely identify the current resource. + * + * @return string An identifying string + */ + public function __toString() + { + $parts = array(); + foreach ($this->directories as $directory) { + $parts[] = (string) $directory; + } + + return implode(',', $parts); + } + + public function getIterator() + { + return new \ArrayIterator($this->getFileResources()); + } + + /** + * Returns the relative version of a filename. + * + * @param ResourceInterface $file The file + * @param ResourceInterface $directory The directory + * + * @return string The name to compare with files from other directories + */ + protected function getRelativeName(ResourceInterface $file, ResourceInterface $directory) + { + return substr((string) $file, strlen((string) $directory)); + } + + /** + * Performs the coalesce. + * + * @return array An array of file resources + */ + private function getFileResources() + { + $paths = array(); + + foreach ($this->directories as $directory) { + foreach ($directory as $file) { + $relative = $this->getRelativeName($file, $directory); + + if (!isset($paths[$relative])) { + $paths[$relative] = $file; + } + } + } + + return array_values($paths); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/DirectoryResource.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/DirectoryResource.php new file mode 100644 index 0000000000..914d4a6d1e --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/DirectoryResource.php @@ -0,0 +1,133 @@ + + */ +class DirectoryResource implements IteratorResourceInterface +{ + private $path; + private $pattern; + + /** + * Constructor. + * + * @param string $path A directory path + * @param string $pattern A filename pattern + */ + public function __construct($path, $pattern = null) + { + if (DIRECTORY_SEPARATOR != substr($path, -1)) { + $path .= DIRECTORY_SEPARATOR; + } + + $this->path = $path; + $this->pattern = $pattern; + } + + public function isFresh($timestamp) + { + if (!is_dir($this->path) || filemtime($this->path) > $timestamp) { + return false; + } + + foreach ($this as $resource) { + if (!$resource->isFresh($timestamp)) { + return false; + } + } + + return true; + } + + /** + * Returns the combined content of all inner resources. + */ + public function getContent() + { + $content = array(); + foreach ($this as $resource) { + $content[] = $resource->getContent(); + } + + return implode("\n", $content); + } + + public function __toString() + { + return $this->path; + } + + public function getIterator() + { + return is_dir($this->path) + ? new DirectoryResourceIterator($this->getInnerIterator()) + : new \EmptyIterator(); + } + + protected function getInnerIterator() + { + return new DirectoryResourceFilterIterator(new \RecursiveDirectoryIterator($this->path, \RecursiveDirectoryIterator::FOLLOW_SYMLINKS), $this->pattern); + } +} + +/** + * An iterator that converts file objects into file resources. + * + * @author Kris Wallsmith + * @access private + */ +class DirectoryResourceIterator extends \RecursiveIteratorIterator +{ + public function current() + { + return new FileResource(parent::current()->getPathname()); + } +} + +/** + * Filters files by a basename pattern. + * + * @author Kris Wallsmith + * @access private + */ +class DirectoryResourceFilterIterator extends \RecursiveFilterIterator +{ + protected $pattern; + + public function __construct(\RecursiveDirectoryIterator $iterator, $pattern = null) + { + parent::__construct($iterator); + + $this->pattern = $pattern; + } + + public function accept() + { + $file = $this->current(); + $name = $file->getBasename(); + + if ($file->isDir()) { + return '.' != $name[0]; + } else { + return null === $this->pattern || 0 < preg_match($this->pattern, $name); + } + } + + public function getChildren() + { + return new self(new \RecursiveDirectoryIterator($this->current()->getPathname(), \RecursiveDirectoryIterator::FOLLOW_SYMLINKS), $this->pattern); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/FileResource.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/FileResource.php new file mode 100644 index 0000000000..1486f3e48d --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/FileResource.php @@ -0,0 +1,47 @@ + + */ +class FileResource implements ResourceInterface +{ + private $path; + + /** + * Constructor. + * + * @param string $path The path to a file + */ + public function __construct($path) + { + $this->path = $path; + } + + public function isFresh($timestamp) + { + return file_exists($this->path) && filemtime($this->path) <= $timestamp; + } + + public function getContent() + { + return file_exists($this->path) ? file_get_contents($this->path) : ''; + } + + public function __toString() + { + return $this->path; + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/IteratorResourceInterface.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/IteratorResourceInterface.php new file mode 100644 index 0000000000..02d797fd20 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/IteratorResourceInterface.php @@ -0,0 +1,21 @@ + + */ +interface IteratorResourceInterface extends ResourceInterface, \IteratorAggregate +{ +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/ResourceInterface.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/ResourceInterface.php new file mode 100644 index 0000000000..23b8a3bdaa --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/ResourceInterface.php @@ -0,0 +1,43 @@ + + */ +interface ResourceInterface +{ + /** + * Checks if a timestamp represents the latest resource. + * + * @param integer $timestamp A UNIX timestamp + * + * @return Boolean True if the timestamp is up to date + */ + public function isFresh($timestamp); + + /** + * Returns the content of the resource. + * + * @return string The content + */ + public function getContent(); + + /** + * Returns a unique string for the current resource. + * + * @return string A unique string to identity the current resource + */ + public function __toString(); +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/EnsureFilterWorker.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/EnsureFilterWorker.php new file mode 100644 index 0000000000..189cab8b7e --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/EnsureFilterWorker.php @@ -0,0 +1,60 @@ + + * @todo A better asset-matcher mechanism + */ +class EnsureFilterWorker implements WorkerInterface +{ + const CHECK_SOURCE = 1; + const CHECK_TARGET = 2; + + private $pattern; + private $filter; + private $flags; + + /** + * Constructor. + * + * @param string $pattern A regex for checking the asset's target URL + * @param FilterInterface $filter A filter to apply if the regex matches + * @param integer $flags Flags for what to check + */ + public function __construct($pattern, FilterInterface $filter, $flags = null) + { + if (null === $flags) { + $flags = self::CHECK_SOURCE | self::CHECK_TARGET; + } + + $this->pattern = $pattern; + $this->filter = $filter; + $this->flags = $flags; + } + + public function process(AssetInterface $asset) + { + if ( + (self::CHECK_SOURCE === (self::CHECK_SOURCE & $this->flags) && preg_match($this->pattern, $asset->getSourcePath())) + || + (self::CHECK_TARGET === (self::CHECK_TARGET & $this->flags) && preg_match($this->pattern, $asset->getTargetPath())) + ) { + $asset->ensureFilter($this->filter); + } + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/WorkerInterface.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/WorkerInterface.php new file mode 100644 index 0000000000..5cc2c9e639 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/WorkerInterface.php @@ -0,0 +1,29 @@ + + */ +interface WorkerInterface +{ + /** + * Processes an asset. + * + * @param AssetInterface $asset An asset + */ + public function process(AssetInterface $asset); +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseCssFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseCssFilter.php new file mode 100644 index 0000000000..0447fbcf42 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseCssFilter.php @@ -0,0 +1,71 @@ + + */ +abstract class BaseCssFilter implements FilterInterface +{ + /** + * Filters all references -- url() and "@import" -- through a callable. + * + * @param string $content The CSS + * @param mixed $callback A PHP callable + * + * @return string The filtered CSS + */ + protected function filterReferences($content, $callback, $limit = -1, & $count = 0) + { + $content = $this->filterUrls($content, $callback, $limit, $count); + $content = $this->filterImports($content, $callback, $limit, $count, false); + + return $content; + } + + /** + * Filters all CSS url()'s through a callable. + * + * @param string $content The CSS + * @param mixed $callback A PHP callable + * @param integer $limit Limit the number of replacements + * @param integer $count Will be populated with the count + * + * @return string The filtered CSS + */ + protected function filterUrls($content, $callback, $limit = -1, & $count = 0) + { + return preg_replace_callback('/url\((["\']?)(?.*?)(\\1)\)/', $callback, $content, $limit, $count); + } + + /** + * Filters all CSS imports through a callable. + * + * @param string $content The CSS + * @param mixed $callback A PHP callable + * @param integer $limit Limit the number of replacements + * @param integer $count Will be populated with the count + * @param Boolean $includeUrl Whether to include url() in the pattern + * + * @return string The filtered CSS + */ + protected function filterImports($content, $callback, $limit = -1, & $count = 0, $includeUrl = true) + { + $pattern = $includeUrl + ? '/@import (?:url\()?(\'|"|)(?[^\'"\)\n\r]*)\1\)?;?/' + : '/@import (?!url\()(\'|"|)(?[^\'"\)\n\r]*)\1;?/'; + + return preg_replace_callback($pattern, $callback, $content, $limit, $count); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CallablesFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CallablesFilter.php new file mode 100644 index 0000000000..323d11c927 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CallablesFilter.php @@ -0,0 +1,45 @@ + + */ +class CallablesFilter implements FilterInterface +{ + private $loader; + private $dumper; + + public function __construct($loader = null, $dumper = null) + { + $this->loader = $loader; + $this->dumper = $dumper; + } + + public function filterLoad(AssetInterface $asset) + { + if (null !== $callable = $this->loader) { + $callable($asset); + } + } + + public function filterDump(AssetInterface $asset) + { + if (null !== $callable = $this->dumper) { + $callable($asset); + } + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CoffeeScriptFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CoffeeScriptFilter.php new file mode 100644 index 0000000000..088a4f682b --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CoffeeScriptFilter.php @@ -0,0 +1,60 @@ + + */ +class CoffeeScriptFilter implements FilterInterface +{ + private $coffeePath; + private $nodePath; + + public function __construct($coffeePath = '/usr/bin/coffee', $nodePath = '/usr/bin/node') + { + $this->coffeePath = $coffeePath; + $this->nodePath = $nodePath; + } + + public function filterLoad(AssetInterface $asset) + { + $input = tempnam(sys_get_temp_dir(), 'assetic_coffeescript'); + file_put_contents($input, $asset->getContent()); + + $pb = new ProcessBuilder(array( + $this->nodePath, + $this->coffeePath, + '-cp', + $input, + )); + + $proc = $pb->getProcess(); + $code = $proc->run(); + unlink($input); + + if (0 < $code) { + throw new \RuntimeException($proc->getErrorOutput()); + } + + $asset->setContent($proc->getOutput()); + } + + public function filterDump(AssetInterface $asset) + { + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CompassFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CompassFilter.php new file mode 100644 index 0000000000..aea7203bde --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CompassFilter.php @@ -0,0 +1,334 @@ + + */ +class CompassFilter implements FilterInterface +{ + private $compassPath; + private $scss; + + // sass options + private $unixNewlines; + private $debugInfo; + private $cacheLocation; + private $noCache; + + // compass options + private $force; + private $style; + private $quiet; + private $boring; + private $noLineComments; + private $imagesDir; + private $javascriptsDir; + + // compass configuration file options + private $plugins = array(); + private $loadPaths = array(); + private $httpPath; + private $httpImagesPath; + private $httpJavascriptsPath; + + public function __construct($compassPath = '/usr/bin/compass') + { + $this->compassPath = $compassPath; + $this->cacheLocation = sys_get_temp_dir(); + + if ('cli' !== php_sapi_name()) { + $this->boring = true; + } + } + + public function setScss($scss) + { + $this->scss = $scss; + } + + // sass options setters + public function setUnixNewlines($unixNewlines) + { + $this->unixNewlines = $unixNewlines; + } + + public function setDebugInfo($debugInfo) + { + $this->debugInfo = $debugInfo; + } + + public function setCacheLocation($cacheLocation) + { + $this->cacheLocation = $cacheLocation; + } + + public function setNoCache($noCache) + { + $this->noCache = $noCache; + } + + // compass options setters + public function setForce($force) + { + $this->force = $force; + } + + public function setStyle($style) + { + $this->style = $style; + } + + public function setQuiet($quiet) + { + $this->quiet = $quiet; + } + + public function setBoring($boring) + { + $this->boring = $boring; + } + + public function setNoLineComments($noLineComments) + { + $this->noLineComments = $noLineComments; + } + + public function setImagesDir($imagesDir) + { + $this->imagesDir = $imagesDir; + } + + public function setJavascriptsDir($javascriptsDir) + { + $this->javascriptsDir = $javascriptsDir; + } + + // compass configuration file options setters + public function setPlugins(array $plugins) + { + $this->plugins = $plugins; + } + + public function addPlugin($plugin) + { + $this->plugins[] = $plugin; + } + + public function addLoadPath($loadPath) + { + $this->loadPaths[] = $loadPath; + } + + public function setHttpPath($httpPath) + { + $this->httpPath = $httpPath; + } + + public function setHttpImagesPath($httpImagesPath) + { + $this->httpImagesPath = $httpImagesPath; + } + + public function setHttpJavascriptsPath($httpJavascriptsPath) + { + $this->httpJavascriptsPath = $httpJavascriptsPath; + } + + public function filterLoad(AssetInterface $asset) + { + $root = $asset->getSourceRoot(); + $path = $asset->getSourcePath(); + + $loadPaths = $this->loadPaths; + if ($root && $path) { + $loadPaths[] = dirname($root.'/'.$path); + } + + // compass does not seems to handle symlink, so we use realpath() + $tempDir = realpath(sys_get_temp_dir()); + + $pb = new ProcessBuilder(array( + $this->compassPath, + 'compile', + $tempDir, + )); + $pb->inheritEnvironmentVariables(); + + if ($this->force) { + $pb->add('--force'); + } + + if ($this->style) { + $pb->add('--output-style')->add($this->style); + } + + if ($this->quiet) { + $pb->add('--quiet'); + } + + if ($this->boring) { + $pb->add('--boring'); + } + + if ($this->noLineComments) { + $pb->add('--no-line-comments'); + } + + // these two options are not passed into the config file + // because like this, compass adapts this to be xxx_dir or xxx_path + // whether it's an absolute path or not + if ($this->imagesDir) { + $pb->add('--images-dir')->add($this->imagesDir); + } + + if ($this->javascriptsDir) { + $pb->add('--javascripts-dir')->add($this->javascriptsDir); + } + + // options in config file + $optionsConfig = array(); + + if (!empty($loadPaths)) { + $optionsConfig['additional_import_paths'] = $loadPaths; + } + + if ($this->unixNewlines) { + $optionsConfig['sass_options']['unix_newlines'] = true; + } + + if ($this->debugInfo) { + $optionsConfig['sass_options']['debug_info'] = true; + } + + if ($this->cacheLocation) { + $optionsConfig['sass_options']['cache_location'] = $this->cacheLocation; + } + + if ($this->noCache) { + $optionsConfig['sass_options']['no_cache'] = true; + } + + if ($this->httpPath) { + $optionsConfig['http_path'] = $this->httpPath; + } + + if ($this->httpImagesPath) { + $optionsConfig['http_images_path'] = $this->httpImagesPath; + } + + if ($this->httpJavascriptsPath) { + $optionsConfig['http_javascripts_path'] = $this->httpJavascriptsPath; + } + + // options in configuration file + if (count($optionsConfig)) { + $config = array(); + foreach ($this->plugins as $plugin) { + $config[] = sprintf("require '%s'", addcslashes($plugin, '\\')); + } + foreach ($optionsConfig as $name => $value) { + if (!is_array($value)) { + $config[] = sprintf('%s = "%s"', $name, addcslashes($value, '\\')); + } elseif (!empty($value)) { + $config[] = sprintf('%s = %s', $name, $this->formatArrayToRuby($value)); + } + } + + $configFile = tempnam($tempDir, 'assetic_compass'); + file_put_contents($configFile, implode("\n", $config)."\n"); + $pb->add('--config')->add($configFile); + } + + $pb->add('--sass-dir')->add('')->add('--css-dir')->add(''); + + // compass choose the type (sass or scss from the filename) + if (null !== $this->scss) { + $type = $this->scss ? 'scss' : 'sass'; + } elseif ($path) { + // FIXME: what if the extension is something else? + $type = pathinfo($path, PATHINFO_EXTENSION); + } else { + $type = 'scss'; + } + + $tempName = tempnam($tempDir, 'assetic_compass'); + unlink($tempName); // FIXME: don't use tempnam() here + + // input + $input = $tempName.'.'.$type; + + // work-around for https://github.com/chriseppstein/compass/issues/748 + if (defined('PHP_WINDOWS_VERSION_MAJOR')) { + $input = str_replace('\\', '/', $input); + } + + $pb->add($input); + file_put_contents($input, $asset->getContent()); + + // output + $output = $tempName.'.css'; + + // it's not really usefull but... https://github.com/chriseppstein/compass/issues/376 + $pb->setEnv('HOME', sys_get_temp_dir()); + + $proc = $pb->getProcess(); + $code = $proc->run(); + + if (0 < $code) { + unlink($input); + if (isset($configFile)) { + unlink($configFile); + } + + throw new \RuntimeException($proc->getErrorOutput().'...'.$proc->getOutput()); + } + + $asset->setContent(file_get_contents($output)); + + unlink($input); + unlink($output); + if (isset($configFile)) { + unlink($configFile); + } + } + + public function filterDump(AssetInterface $asset) + { + } + + private function formatArrayToRuby($array) + { + $output = array(); + + // does we have an associative array ? + if (count(array_filter(array_keys($array), "is_numeric")) != count($array)) { + foreach ($array as $name => $value) { + $output[] = sprintf(' :%s => "%s"', $name, addcslashes($value, '\\')); + } + $output = "{\n".implode(",\n", $output)."\n}"; + } else { + foreach ($array as $name => $value) { + $output[] = sprintf(' "%s"', addcslashes($value, '\\')); + } + $output = "[\n".implode(",\n", $output)."\n]"; + } + + return $output; + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssEmbedFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssEmbedFilter.php new file mode 100644 index 0000000000..df42eed43d --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssEmbedFilter.php @@ -0,0 +1,138 @@ + + */ +class CssEmbedFilter implements FilterInterface +{ + private $jarPath; + private $javaPath; + private $charset; + private $mhtml; // Enable MHTML mode. + private $mhtmlRoot; // Use as the MHTML root for the file. + private $root; // Prepends to all relative URLs. + private $skipMissing; // Don't throw an error for missing image files. + private $maxUriLength; // Maximum length for a data URI. Defaults to 32768. + private $maxImageSize; // Maximum image size (in bytes) to convert. + + public function __construct($jarPath, $javaPath = '/usr/bin/java') + { + $this->jarPath = $jarPath; + $this->javaPath = $javaPath; + } + + public function setCharset($charset) + { + $this->charset = $charset; + } + + public function setMhtml($mhtml) + { + $this->mhtml = $mhtml; + } + + public function setMhtmlRoot($mhtmlRoot) + { + $this->mhtmlRoot = $mhtmlRoot; + } + + public function setRoot($root) + { + $this->root = $root; + } + + public function setSkipMissing($skipMissing) + { + $this->skipMissing = $skipMissing; + } + + public function setMaxUriLength($maxUriLength) + { + $this->maxUriLength = $maxUriLength; + } + + public function setMaxImageSize($maxImageSize) + { + $this->maxImageSize = $maxImageSize; + } + + public function filterLoad(AssetInterface $asset) + { + } + + public function filterDump(AssetInterface $asset) + { + $pb = new ProcessBuilder(array( + $this->javaPath, + '-jar', + $this->jarPath, + )); + + if (null !== $this->charset) { + $pb->add('--charset')->add($this->charset); + } + + if ($this->mhtml) { + $pb->add('--mhtml'); + } + + if (null !== $this->mhtmlRoot) { + $pb->add('--mhtmlroot')->add($this->mhtmlRoot); + } + + // automatically define root if not already defined + if (null === $this->root) { + $root = $asset->getSourceRoot(); + $path = $asset->getSourcePath(); + + if ($root && $path) { + $pb->add('--root')->add(dirname($root.'/'.$path)); + } + } else { + $pb->add('--root')->add($this->root); + } + + if ($this->skipMissing) { + $pb->add('--skip-missing'); + } + + if (null !== $this->maxUriLength) { + $pb->add('--max-uri-length')->add($this->maxUriLength); + } + + if (null !== $this->maxImageSize) { + $pb->add('--max-image-size')->add($this->maxImageSize); + } + + // input + $pb->add($input = tempnam(sys_get_temp_dir(), 'assetic_cssembed')); + file_put_contents($input, $asset->getContent()); + + $proc = $pb->getProcess(); + $code = $proc->run(); + unlink($input); + + if (0 < $code) { + throw new \RuntimeException($proc->getErrorOutput()); + } + + $asset->setContent($proc->getOutput()); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssImportFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssImportFilter.php new file mode 100644 index 0000000000..7e5c737a7f --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssImportFilter.php @@ -0,0 +1,106 @@ + + */ +class CssImportFilter extends BaseCssFilter +{ + private $importFilter; + + /** + * Constructor. + * + * @param FilterInterface $importFilter Filter for each imported asset + */ + public function __construct(FilterInterface $importFilter = null) + { + $this->importFilter = $importFilter ?: new CssRewriteFilter(); + } + + public function filterLoad(AssetInterface $asset) + { + $importFilter = $this->importFilter; + $sourceRoot = $asset->getSourceRoot(); + $sourcePath = $asset->getSourcePath(); + + $callback = function($matches) use ($importFilter, $sourceRoot, $sourcePath) { + if (!$matches['url'] || null === $sourceRoot) { + return $matches[0]; + } + + $importRoot = $sourceRoot; + + if (false !== strpos($matches['url'], '://')) { + // absolute + list($importScheme, $tmp) = explode('://', $matches['url'], 2); + list($importHost, $importPath) = explode('/', $tmp, 2); + $importRoot = $importScheme.'://'.$importHost; + } elseif (0 === strpos($matches['url'], '//')) { + // protocol-relative + list($importHost, $importPath) = explode('/', substr($matches['url'], 2), 2); + $importHost = '//'.$importHost; + } elseif ('/' == $matches['url'][0]) { + // root-relative + $importPath = substr($matches['url'], 1); + } elseif (null !== $sourcePath) { + // document-relative + $importPath = $matches['url']; + if ('.' != $sourceDir = dirname($sourcePath)) { + $importPath = $sourceDir.'/'.$importPath; + } + } else { + return $matches[0]; + } + + // ignore other imports + if ('css' != pathinfo($importPath, PATHINFO_EXTENSION)) { + return $matches[0]; + } + + $importSource = $importRoot.'/'.$importPath; + if (false !== strpos($importSource, '://') || 0 === strpos($importSource, '//')) { + $import = new HttpAsset($importSource, array($importFilter), true); + } elseif (!file_exists($importSource)) { + // ignore not found imports + return $matches[0]; + } else { + $import = new FileAsset($importSource, array($importFilter), $importRoot, $importPath); + } + + $import->setTargetPath($sourcePath); + + return $import->dump(); + }; + + $content = $asset->getContent(); + $lastHash = md5($content); + + do { + $content = $this->filterImports($content, $callback); + $hash = md5($content); + } while ($lastHash != $hash && $lastHash = $hash); + + $asset->setContent($content); + } + + public function filterDump(AssetInterface $asset) + { + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssMinFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssMinFilter.php new file mode 100644 index 0000000000..f9921509d4 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssMinFilter.php @@ -0,0 +1,73 @@ + + */ +class CssMinFilter implements FilterInterface +{ + private $filters; + private $plugins; + + public function __construct() + { + $this->filters = array(); + $this->plugins = array(); + } + + public function setFilters(array $filters) + { + $this->filters = $filters; + } + + public function setFilter($name, $value) + { + $this->filters[$name] = $value; + } + + public function setPlugins(array $plugins) + { + $this->plugins = $plugins; + } + + public function setPlugin($name, $value) + { + $this->plugins[$name] = $value; + } + + public function filterLoad(AssetInterface $asset) + { + } + + public function filterDump(AssetInterface $asset) + { + $filters = $this->filters; + $plugins = $this->plugins; + + if (isset($filters['ImportImports']) && true === $filters['ImportImports']) { + $root = $asset->getSourceRoot(); + $path = $asset->getSourcePath(); + if ($root && $path) { + $filters['ImportImports'] = array('BasePath' => dirname($root.'/'.$path)); + } else { + unset($filters['ImportImports']); + } + } + + $asset->setContent(\CssMin::minify($asset->getContent(), $filters, $plugins)); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssRewriteFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssRewriteFilter.php new file mode 100644 index 0000000000..f95b967a5f --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssRewriteFilter.php @@ -0,0 +1,93 @@ + + */ +class CssRewriteFilter extends BaseCssFilter +{ + public function filterLoad(AssetInterface $asset) + { + } + + public function filterDump(AssetInterface $asset) + { + $sourceBase = $asset->getSourceRoot(); + $sourcePath = $asset->getSourcePath(); + $targetPath = $asset->getTargetPath(); + + if (null === $sourcePath || null === $targetPath || $sourcePath == $targetPath) { + return; + } + + // learn how to get from the target back to the source + if (false !== strpos($sourceBase, '://')) { + list($scheme, $url) = explode('://', $sourceBase.'/'.$sourcePath, 2); + list($host, $path) = explode('/', $url, 2); + + $host = $scheme.'://'.$host.'/'; + $path = false === strpos($path, '/') ? '' : dirname($path); + $path .= '/'; + } else { + // assume source and target are on the same host + $host = ''; + + // pop entries off the target until it fits in the source + if ('.' == dirname($sourcePath)) { + $path = str_repeat('../', substr_count($targetPath, '/')); + } elseif ('.' == $targetDir = dirname($targetPath)) { + $path = dirname($sourcePath).'/'; + } else { + $path = ''; + while (0 !== strpos($sourcePath, $targetDir)) { + if (false !== $pos = strrpos($targetDir, '/')) { + $targetDir = substr($targetDir, 0, $pos); + $path .= '../'; + } else { + $targetDir = ''; + $path .= '../'; + break; + } + } + $path .= ltrim(substr(dirname($sourcePath).'/', strlen($targetDir)), '/'); + } + } + + $content = $this->filterReferences($asset->getContent(), function($matches) use ($host, $path) { + if (false !== strpos($matches['url'], '://') || 0 === strpos($matches['url'], '//') || 0 === strpos($matches['url'], 'data:')) { + // absolute or protocol-relative or data uri + return $matches[0]; + } + + if ('/' == $matches['url'][0]) { + // root relative + return str_replace($matches['url'], $host.$matches['url'], $matches[0]); + } + + // document relative + $url = $matches['url']; + while (0 === strpos($url, '../') && 2 <= substr_count($path, '/')) { + $path = substr($path, 0, strrpos(rtrim($path, '/'), '/') + 1); + $url = substr($url, 3); + } + + return str_replace($matches['url'], $host.$path.$url, $matches[0]); + }); + + $asset->setContent($content); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterCollection.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterCollection.php new file mode 100644 index 0000000000..1ee743dcde --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterCollection.php @@ -0,0 +1,82 @@ + + */ +class FilterCollection implements FilterInterface, \IteratorAggregate, \Countable +{ + private $filters = array(); + + public function __construct($filters = array()) + { + foreach ($filters as $filter) { + $this->ensure($filter); + } + } + + /** + * Checks that the current collection contains the supplied filter. + * + * If the supplied filter is another filter collection, each of its + * filters will be checked. + */ + public function ensure(FilterInterface $filter) + { + if ($filter instanceof \Traversable) { + foreach ($filter as $f) { + $this->ensure($f); + } + } elseif (!in_array($filter, $this->filters, true)) { + $this->filters[] = $filter; + } + } + + public function all() + { + return $this->filters; + } + + public function clear() + { + $this->filters = array(); + } + + public function filterLoad(AssetInterface $asset) + { + foreach ($this->filters as $filter) { + $filter->filterLoad($asset); + } + } + + public function filterDump(AssetInterface $asset) + { + foreach ($this->filters as $filter) { + $filter->filterDump($asset); + } + } + + public function getIterator() + { + return new \ArrayIterator($this->filters); + } + + public function count() + { + return count($this->filters); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterInterface.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterInterface.php new file mode 100644 index 0000000000..7bd1a7e3a1 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterInterface.php @@ -0,0 +1,36 @@ + + */ +interface FilterInterface +{ + /** + * Filters an asset after it has been loaded. + * + * @param AssetInterface $asset An asset + */ + public function filterLoad(AssetInterface $asset); + + /** + * Filters an asset just before it's dumped. + * + * @param AssetInterface $asset An asset + */ + public function filterDump(AssetInterface $asset); +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/BaseCompilerFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/BaseCompilerFilter.php new file mode 100644 index 0000000000..e571158941 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/BaseCompilerFilter.php @@ -0,0 +1,84 @@ + + */ +abstract class BaseCompilerFilter implements FilterInterface +{ + // compilation levels + const COMPILE_WHITESPACE_ONLY = 'WHITESPACE_ONLY'; + const COMPILE_SIMPLE_OPTIMIZATIONS = 'SIMPLE_OPTIMIZATIONS'; + const COMPILE_ADVANCED_OPTIMIZATIONS = 'ADVANCED_OPTIMIZATIONS'; + + // formatting modes + const FORMAT_PRETTY_PRINT = 'pretty_print'; + const FORMAT_PRINT_INPUT_DELIMITER = 'print_input_delimiter'; + + // warning levels + const LEVEL_QUIET = 'QUIET'; + const LEVEL_DEFAULT = 'DEFAULT'; + const LEVEL_VERBOSE = 'VERBOSE'; + + protected $compilationLevel; + protected $jsExterns; + protected $externsUrl; + protected $excludeDefaultExterns; + protected $formatting; + protected $useClosureLibrary; + protected $warningLevel; + + public function setCompilationLevel($compilationLevel) + { + $this->compilationLevel = $compilationLevel; + } + + public function setJsExterns($jsExterns) + { + $this->jsExterns = $jsExterns; + } + + public function setExternsUrl($externsUrl) + { + $this->externsUrl = $externsUrl; + } + + public function setExcludeDefaultExterns($excludeDefaultExterns) + { + $this->excludeDefaultExterns = $excludeDefaultExterns; + } + + public function setFormatting($formatting) + { + $this->formatting = $formatting; + } + + public function setUseClosureLibrary($useClosureLibrary) + { + $this->useClosureLibrary = $useClosureLibrary; + } + + public function setWarningLevel($warningLevel) + { + $this->warningLevel = $warningLevel; + } + + public function filterLoad(AssetInterface $asset) + { + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerApiFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerApiFilter.php new file mode 100644 index 0000000000..5ed5ff0504 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerApiFilter.php @@ -0,0 +1,82 @@ + + */ +class CompilerApiFilter extends BaseCompilerFilter +{ + public function filterDump(AssetInterface $asset) + { + $query = array( + 'js_code' => $asset->getContent(), + 'output_format' => 'json', + 'output_info' => 'compiled_code', + ); + + if (null !== $this->compilationLevel) { + $query['compilation_level'] = $this->compilationLevel; + } + + if (null !== $this->jsExterns) { + $query['js_externs'] = $this->jsExterns; + } + + if (null !== $this->externsUrl) { + $query['externs_url'] = $this->externsUrl; + } + + if (null !== $this->excludeDefaultExterns) { + $query['exclude_default_externs'] = $this->excludeDefaultExterns ? 'true' : 'false'; + } + + if (null !== $this->formatting) { + $query['formatting'] = $this->formatting; + } + + if (null !== $this->useClosureLibrary) { + $query['use_closure_library'] = $this->useClosureLibrary ? 'true' : 'false'; + } + + if (null !== $this->warningLevel) { + $query['warning_level'] = $this->warningLevel; + } + + $context = stream_context_create(array('http' => array( + 'method' => 'POST', + 'header' => 'Content-Type: application/x-www-form-urlencoded', + 'content' => http_build_query($query), + ))); + + $response = file_get_contents('http://closure-compiler.appspot.com/compile', false, $context); + $data = json_decode($response); + + if (isset($data->serverErrors) && 0 < count($data->serverErrors)) { + // @codeCoverageIgnoreStart + throw new \RuntimeException(sprintf('The Google Closure Compiler API threw some server errors: '.print_r($data->serverErrors, true))); + // @codeCoverageIgnoreEnd + } + + if (isset($data->errors) && 0 < count($data->errors)) { + // @codeCoverageIgnoreStart + throw new \RuntimeException(sprintf('The Google Closure Compiler API threw some errors: '.print_r($data->errors, true))); + // @codeCoverageIgnoreEnd + } + + $asset->setContent($data->compiledCode); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerJarFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerJarFilter.php new file mode 100644 index 0000000000..ad998948a0 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerJarFilter.php @@ -0,0 +1,88 @@ + + */ +class CompilerJarFilter extends BaseCompilerFilter +{ + private $jarPath; + private $javaPath; + + public function __construct($jarPath, $javaPath = '/usr/bin/java') + { + $this->jarPath = $jarPath; + $this->javaPath = $javaPath; + } + + public function filterDump(AssetInterface $asset) + { + $cleanup = array(); + + $pb = new ProcessBuilder(array( + $this->javaPath, + '-jar', + $this->jarPath, + )); + + if (null !== $this->compilationLevel) { + $pb->add('--compilation_level')->add($this->compilationLevel); + } + + if (null !== $this->jsExterns) { + $cleanup[] = $externs = tempnam(sys_get_temp_dir(), 'assetic_google_closure_compiler'); + file_put_contents($externs, $this->jsExterns); + $pb->add('--externs')->add($externs); + } + + if (null !== $this->externsUrl) { + $cleanup[] = $externs = tempnam(sys_get_temp_dir(), 'assetic_google_closure_compiler'); + file_put_contents($externs, file_get_contents($this->externsUrl)); + $pb->add('--externs')->add($externs); + } + + if (null !== $this->excludeDefaultExterns) { + $pb->add('--use_only_custom_externs'); + } + + if (null !== $this->formatting) { + $pb->add('--formatting')->add($this->formatting); + } + + if (null !== $this->useClosureLibrary) { + $pb->add('--manage_closure_dependencies'); + } + + if (null !== $this->warningLevel) { + $pb->add('--warning_level')->add($this->warningLevel); + } + + $pb->add('--js')->add($cleanup[] = $input = tempnam(sys_get_temp_dir(), 'assetic_google_closure_compiler')); + file_put_contents($input, $asset->getContent()); + + $proc = $pb->getProcess(); + $code = $proc->run(); + array_map('unlink', $cleanup); + + if (0 < $code) { + throw new \RuntimeException($proc->getErrorOutput()); + } + + $asset->setContent($proc->getOutput()); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/HashableInterface.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/HashableInterface.php new file mode 100644 index 0000000000..da68a0bad2 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/HashableInterface.php @@ -0,0 +1,27 @@ + + */ +interface HashableInterface +{ + /** + * Generates a hash for the object + * + * @return string Object hash + */ + public function hash(); +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegoptimFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegoptimFilter.php new file mode 100644 index 0000000000..bcedb4a4ac --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegoptimFilter.php @@ -0,0 +1,80 @@ + + */ +class JpegoptimFilter implements FilterInterface +{ + private $jpegoptimBin; + private $stripAll; + private $max; + + /** + * Constructor. + * + * @param string $jpegoptimBin Path to the jpegoptim binary + */ + public function __construct($jpegoptimBin = '/usr/bin/jpegoptim') + { + $this->jpegoptimBin = $jpegoptimBin; + } + + public function setStripAll($stripAll) + { + $this->stripAll = $stripAll; + } + + public function setMax($max) + { + $this->max = $max; + } + + public function filterLoad(AssetInterface $asset) + { + } + + public function filterDump(AssetInterface $asset) + { + $pb = new ProcessBuilder(array($this->jpegoptimBin)); + + if ($this->stripAll) { + $pb->add('--strip-all'); + } + + if ($this->max) { + $pb->add('--max='.$this->max); + } + + $pb->add($input = tempnam(sys_get_temp_dir(), 'assetic_jpegoptim')); + file_put_contents($input, $asset->getContent()); + + $proc = $pb->getProcess(); + $proc->run(); + + if (false !== strpos($proc->getOutput(), 'ERROR')) { + unlink($input); + throw new \RuntimeException($proc->getOutput()); + } + + $asset->setContent(file_get_contents($input)); + + unlink($input); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegtranFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegtranFilter.php new file mode 100644 index 0000000000..4cc5d3bbc0 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegtranFilter.php @@ -0,0 +1,101 @@ + + */ +class JpegtranFilter implements FilterInterface +{ + const COPY_NONE = 'none'; + const COPY_COMMENTS = 'comments'; + const COPY_ALL = 'all'; + + private $jpegtranBin; + private $optimize; + private $copy; + private $progressive; + private $restart; + + /** + * Constructor. + * + * @param string $jpegtranBin Path to the jpegtran binary + */ + public function __construct($jpegtranBin = '/usr/bin/jpegtran') + { + $this->jpegtranBin = $jpegtranBin; + } + + public function setOptimize($optimize) + { + $this->optimize = $optimize; + } + + public function setCopy($copy) + { + $this->copy = $copy; + } + + public function setProgressive($progressive) + { + $this->progressive = $progressive; + } + + public function setRestart($restart) + { + $this->restart = $restart; + } + + public function filterLoad(AssetInterface $asset) + { + } + + public function filterDump(AssetInterface $asset) + { + $pb = new ProcessBuilder(array($this->jpegtranBin)); + + if ($this->optimize) { + $pb->add('-optimize'); + } + + if ($this->copy) { + $pb->add('-copy')->add($this->copy); + } + + if ($this->progressive) { + $pb->add('-progressive'); + } + + if (null !== $this->restart) { + $pb->add('-restart')->add($this->restart); + } + + $pb->add($input = tempnam(sys_get_temp_dir(), 'assetic_jpegtran')); + file_put_contents($input, $asset->getContent()); + + $proc = $pb->getProcess(); + $code = $proc->run(); + unlink($input); + + if (0 < $code) { + throw new \RuntimeException($proc->getErrorOutput()); + } + + $asset->setContent($proc->getOutput()); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessFilter.php new file mode 100644 index 0000000000..d60af7b2a6 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessFilter.php @@ -0,0 +1,112 @@ + + */ +class LessFilter implements FilterInterface +{ + private $nodeBin; + private $nodePaths; + private $compress; + + /** + * Constructor. + * + * @param string $nodeBin The path to the node binary + * @param array $nodePaths An array of node paths + */ + public function __construct($nodeBin = '/usr/bin/node', array $nodePaths = array()) + { + $this->nodeBin = $nodeBin; + $this->nodePaths = $nodePaths; + } + + public function setCompress($compress) + { + $this->compress = $compress; + } + + public function filterLoad(AssetInterface $asset) + { + static $format = <<<'EOF' +var less = require('less'); +var sys = require(process.binding('natives').util ? 'util' : 'sys'); + +new(less.Parser)(%s).parse(%s, function(e, tree) { + if (e) { + less.writeError(e); + process.exit(2); + } + + try { + sys.print(tree.toCSS(%s)); + } catch (e) { + less.writeError(e); + process.exit(3); + } +}); + +EOF; + + $root = $asset->getSourceRoot(); + $path = $asset->getSourcePath(); + + // parser options + $parserOptions = array(); + if ($root && $path) { + $parserOptions['paths'] = array(dirname($root.'/'.$path)); + $parserOptions['filename'] = basename($path); + } + + // tree options + $treeOptions = array(); + if (null !== $this->compress) { + $treeOptions['compress'] = $this->compress; + } + + $pb = new ProcessBuilder(); + $pb->inheritEnvironmentVariables(); + + // node.js configuration + if (0 < count($this->nodePaths)) { + $pb->setEnv('NODE_PATH', implode(':', $this->nodePaths)); + } + + $pb->add($this->nodeBin)->add($input = tempnam(sys_get_temp_dir(), 'assetic_less')); + file_put_contents($input, sprintf($format, + json_encode($parserOptions), + json_encode($asset->getContent()), + json_encode($treeOptions) + )); + + $proc = $pb->getProcess(); + $code = $proc->run(); + unlink($input); + + if (0 < $code) { + throw new \RuntimeException($proc->getErrorOutput()); + } + + $asset->setContent($proc->getOutput()); + } + + public function filterDump(AssetInterface $asset) + { + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessphpFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessphpFilter.php new file mode 100644 index 0000000000..c9f5a43820 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessphpFilter.php @@ -0,0 +1,48 @@ + + * @author Kris Wallsmith + */ +class LessphpFilter implements FilterInterface +{ + public function filterLoad(AssetInterface $asset) + { + $root = $asset->getSourceRoot(); + $path = $asset->getSourcePath(); + + $lc = new \lessc(); + if ($root && $path) { + $lc->importDir = dirname($root.'/'.$path); + } + + $asset->setContent($lc->parse($asset->getContent())); + } + + public function filterDump(AssetInterface $asset) + { + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/OptiPngFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/OptiPngFilter.php new file mode 100644 index 0000000000..0413574984 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/OptiPngFilter.php @@ -0,0 +1,74 @@ + + */ +class OptiPngFilter implements FilterInterface +{ + private $optipngBin; + private $level; + + /** + * Constructor. + * + * @param string $optipngBin Path to the optipng binary + */ + public function __construct($optipngBin = '/usr/bin/optipng') + { + $this->optipngBin = $optipngBin; + } + + public function setLevel($level) + { + $this->level = $level; + } + + public function filterLoad(AssetInterface $asset) + { + } + + public function filterDump(AssetInterface $asset) + { + $pb = new ProcessBuilder(array($this->optipngBin)); + + if (null !== $this->level) { + $pb->add('-o')->add($this->level); + } + + $pb->add('-out')->add($output = tempnam(sys_get_temp_dir(), 'assetic_optipng')); + unlink($output); + + $pb->add($input = tempnam(sys_get_temp_dir(), 'assetic_optipng')); + file_put_contents($input, $asset->getContent()); + + $proc = $pb->getProcess(); + $code = $proc->run(); + + if (0 < $code) { + unlink($input); + throw new \RuntimeException($proc->getErrorOutput()); + } + + $asset->setContent(file_get_contents($output)); + + unlink($input); + unlink($output); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackagerFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackagerFilter.php new file mode 100644 index 0000000000..c3a331b131 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackagerFilter.php @@ -0,0 +1,64 @@ + + */ +class PackagerFilter implements FilterInterface +{ + private $packages; + + public function __construct(array $packages = array()) + { + $this->packages = $packages; + } + + public function addPackage($package) + { + $this->packages[] = $package; + } + + public function filterLoad(AssetInterface $asset) + { + static $manifest = <<getContent()); + + $packager = new \Packager(array_merge(array($package), $this->packages)); + $content = $packager->build(array(), array(), array('Application'.$hash)); + + unlink($package.'/package.yml'); + unlink($package.'/source.js'); + rmdir($package); + + $asset->setContent($content); + } + + public function filterDump(AssetInterface $asset) + { + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/PngoutFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/PngoutFilter.php new file mode 100644 index 0000000000..cef0953d5c --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/PngoutFilter.php @@ -0,0 +1,126 @@ + + */ +class PngoutFilter implements FilterInterface +{ + // -c# + const COLOR_GREY = '0'; + const COLOR_RGB = '2'; + const COLOR_PAL = '3'; + const COLOR_GRAY_ALPHA = '4'; + const COLOR_RGB_ALPHA = '6'; + + // -f# + const FILTER_NONE = '0'; + const FILTER_X = '1'; + const FILTER_Y = '2'; + const FILTER_X_Y = '3'; + const FILTER_PAETH = '4'; + const FILTER_MIXED = '5'; + + // -s# + const STRATEGY_XTREME = '0'; + const STRATEGY_INTENSE = '1'; + const STRATEGY_LONGEST_MATCH = '2'; + const STRATEGY_HUFFMAN_ONLY = '3'; + const STRATEGY_UNCOMPRESSED = '4'; + + private $pngoutBin; + private $color; + private $filter; + private $strategy; + private $blockSplitThreshold; + + /** + * Constructor. + * + * @param string $pngoutBin Path to the pngout binary + */ + public function __construct($pngoutBin = '/usr/bin/pngout') + { + $this->pngoutBin = $pngoutBin; + } + + public function setColor($color) + { + $this->color = $color; + } + + public function setFilter($filter) + { + $this->filter = $filter; + } + + public function setStrategy($strategy) + { + $this->strategy = $strategy; + } + + public function setBlockSplitThreshold($blockSplitThreshold) + { + $this->blockSplitThreshold = $blockSplitThreshold; + } + + public function filterLoad(AssetInterface $asset) + { + } + + public function filterDump(AssetInterface $asset) + { + $pb = new ProcessBuilder(array($this->pngoutBin)); + + if (null !== $this->color) { + $pb->add('-c'.$this->color); + } + + if (null !== $this->filter) { + $pb->add('-f'.$this->filter); + } + + if (null !== $this->strategy) { + $pb->add('-s'.$this->strategy); + } + + if (null !== $this->blockSplitThreshold) { + $pb->add('-b'.$this->blockSplitThreshold); + } + + $pb->add($input = tempnam(sys_get_temp_dir(), 'assetic_pngout')); + file_put_contents($input, $asset->getContent()); + + $output = tempnam(sys_get_temp_dir(), 'assetic_pngout'); + unlink($output); + $pb->add($output .= '.png'); + + $proc = $pb->getProcess(); + $code = $proc->run(); + + if (0 < $code) { + unlink($input); + throw new \RuntimeException($proc->getErrorOutput()); + } + + $asset->setContent(file_get_contents($output)); + + unlink($input); + unlink($output); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/SassFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/SassFilter.php new file mode 100644 index 0000000000..09ca9d93a4 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/SassFilter.php @@ -0,0 +1,167 @@ + + */ +class SassFilter implements FilterInterface +{ + const STYLE_NESTED = 'nested'; + const STYLE_EXPANDED = 'expanded'; + const STYLE_COMPACT = 'compact'; + const STYLE_COMPRESSED = 'compressed'; + + private $sassPath; + private $unixNewlines; + private $scss; + private $style; + private $quiet; + private $debugInfo; + private $lineNumbers; + private $loadPaths = array(); + private $cacheLocation; + private $noCache; + private $compass; + + public function __construct($sassPath = '/usr/bin/sass') + { + $this->sassPath = $sassPath; + $this->cacheLocation = realpath(sys_get_temp_dir()); + } + + public function setUnixNewlines($unixNewlines) + { + $this->unixNewlines = $unixNewlines; + } + + public function setScss($scss) + { + $this->scss = $scss; + } + + public function setStyle($style) + { + $this->style = $style; + } + + public function setQuiet($quiet) + { + $this->quiet = $quiet; + } + + public function setDebugInfo($debugInfo) + { + $this->debugInfo = $debugInfo; + } + + public function setLineNumbers($lineNumbers) + { + $this->lineNumbers = $lineNumbers; + } + + public function addLoadPath($loadPath) + { + $this->loadPaths[] = $loadPath; + } + + public function setCacheLocation($cacheLocation) + { + $this->cacheLocation = $cacheLocation; + } + + public function setNoCache($noCache) + { + $this->noCache = $noCache; + } + + public function setCompass($compass) + { + $this->compass = $compass; + } + + public function filterLoad(AssetInterface $asset) + { + $pb = new ProcessBuilder(array($this->sassPath)); + + $root = $asset->getSourceRoot(); + $path = $asset->getSourcePath(); + + if ($root && $path) { + $pb->add('--load-path')->add(dirname($root.'/'.$path)); + } + + if ($this->unixNewlines) { + $pb->add('--unix-newlines'); + } + + if (true === $this->scss || (null === $this->scss && 'scss' == pathinfo($path, PATHINFO_EXTENSION))) { + $pb->add('--scss'); + } + + if ($this->style) { + $pb->add('--style')->add($this->style); + } + + if ($this->quiet) { + $pb->add('--quiet'); + } + + if ($this->debugInfo) { + $pb->add('--debug-info'); + } + + if ($this->lineNumbers) { + $pb->add('--line-numbers'); + } + + foreach ($this->loadPaths as $loadPath) { + $pb->add('--load-path')->add($loadPath); + } + + if ($this->cacheLocation) { + $pb->add('--cache-location')->add($this->cacheLocation); + } + + if ($this->noCache) { + $pb->add('--no-cache'); + } + + if ($this->compass) { + $pb->add('--compass'); + } + + // input + $pb->add($input = tempnam(sys_get_temp_dir(), 'assetic_sass')); + file_put_contents($input, $asset->getContent()); + + $proc = $pb->getProcess(); + $code = $proc->run(); + unlink($input); + + if (0 < $code) { + throw new \RuntimeException($proc->getErrorOutput()); + } + + $asset->setContent($proc->getOutput()); + } + + public function filterDump(AssetInterface $asset) + { + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/ScssFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/ScssFilter.php new file mode 100644 index 0000000000..ab240557e3 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/ScssFilter.php @@ -0,0 +1,27 @@ + + */ +class ScssFilter extends SassFilter +{ + public function __construct($sassPath = '/usr/bin/sass') + { + parent::__construct($sassPath); + + $this->setScss(true); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/SprocketsFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/SprocketsFilter.php new file mode 100644 index 0000000000..6d4d50bbc0 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/SprocketsFilter.php @@ -0,0 +1,147 @@ + + */ +class SprocketsFilter implements FilterInterface +{ + private $sprocketsLib; + private $rubyBin; + private $includeDirs; + private $assetRoot; + + /** + * Constructor. + * + * @param string $sprocketsLib Path to the Sprockets lib/ directory + * @param string $rubyBin Path to the ruby binary + */ + public function __construct($sprocketsLib = null, $rubyBin = '/usr/bin/ruby') + { + $this->sprocketsLib = $sprocketsLib; + $this->rubyBin = $rubyBin; + $this->includeDirs = array(); + } + + public function addIncludeDir($directory) + { + $this->includeDirs[] = $directory; + } + + public function setAssetRoot($assetRoot) + { + $this->assetRoot = $assetRoot; + } + + /** + * Hack around a bit, get the job done. + */ + public function filterLoad(AssetInterface $asset) + { + static $format = <<<'EOF' +#!/usr/bin/env ruby + +require %s +%s +options = { :load_path => [], + :source_files => [%s], + :expand_paths => false } + +%ssecretary = Sprockets::Secretary.new(options) +secretary.install_assets if options[:asset_root] +print secretary.concatenation + +EOF; + + $more = ''; + + foreach ($this->includeDirs as $directory) { + $more .= 'options[:load_path] << '.var_export($directory, true)."\n"; + } + + if (null !== $this->assetRoot) { + $more .= 'options[:asset_root] = '.var_export($this->assetRoot, true)."\n"; + } + + if ($more) { + $more .= "\n"; + } + + $tmpAsset = tempnam(sys_get_temp_dir(), 'assetic_sprockets'); + file_put_contents($tmpAsset, $asset->getContent()); + + $input = tempnam(sys_get_temp_dir(), 'assetic_sprockets'); + file_put_contents($input, sprintf($format, + $this->sprocketsLib + ? sprintf('File.join(%s, \'sprockets\')', var_export($this->sprocketsLib, true)) + : '\'sprockets\'', + $this->getHack($asset), + var_export($tmpAsset, true), + $more + )); + + $pb = new ProcessBuilder(array( + $this->rubyBin, + $input, + )); + + $proc = $pb->getProcess(); + $code = $proc->run(); + unlink($tmpAsset); + unlink($input); + + if (0 < $code) { + throw new \RuntimeException($proc->getErrorOutput()); + } + + $asset->setContent($proc->getOutput()); + } + + public function filterDump(AssetInterface $asset) + { + } + + private function getHack(AssetInterface $asset) + { + static $format = <<<'EOF' + +module Sprockets + class Preprocessor + protected + def pathname_for_relative_require_from(source_line) + Sprockets::Pathname.new(@environment, File.join(%s, location_from(source_line))) + end + end +end + +EOF; + + $root = $asset->getSourceRoot(); + $path = $asset->getSourcePath(); + + if ($root && $path) { + return sprintf($format, var_export(dirname($root.'/'.$path), true)); + } + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/StylusFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/StylusFilter.php new file mode 100644 index 0000000000..ed34cf6c82 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/StylusFilter.php @@ -0,0 +1,115 @@ + + */ +class StylusFilter implements FilterInterface +{ + private $nodeBin; + private $nodePaths; + private $compress; + + /** + * Constructs filter. + * + * @param string $nodeBin The path to the node binary + * @param array $nodePaths An array of node paths + */ + public function __construct($nodeBin = '/usr/bin/node', array $nodePaths = array()) + { + $this->nodeBin = $nodeBin; + $this->nodePaths = $nodePaths; + } + + /** + * Enable output compression. + * + * @param boolean $compress + */ + public function setCompress($compress) + { + $this->compress = $compress; + } + + /** + * {@inheritdoc} + */ + public function filterLoad(AssetInterface $asset) + { + static $format = <<<'EOF' +var stylus = require('stylus'); +var sys = require(process.binding('natives').util ? 'util' : 'sys'); + +stylus(%s, %s).render(function(e, css){ + if (e) { + throw e; + } + + sys.print(css); + process.exit(0); +}); + +EOF; + + $root = $asset->getSourceRoot(); + $path = $asset->getSourcePath(); + + // parser options + $parserOptions = array(); + if ($root && $path) { + $parserOptions['paths'] = array(dirname($root.'/'.$path)); + $parserOptions['filename'] = basename($path); + } + + if (null !== $this->compress) { + $parserOptions['compress'] = $this->compress; + } + + $pb = new ProcessBuilder(); + $pb->inheritEnvironmentVariables(); + + // node.js configuration + if (0 < count($this->nodePaths)) { + $pb->setEnv('NODE_PATH', implode(':', $this->nodePaths)); + } + + $pb->add($this->nodeBin)->add($input = tempnam(sys_get_temp_dir(), 'assetic_stylus')); + file_put_contents($input, sprintf($format, + json_encode($asset->getContent()), + json_encode($parserOptions) + )); + + $proc = $pb->getProcess(); + $code = $proc->run(); + unlink($input); + + if (0 < $code) { + throw new \RuntimeException($proc->getErrorOutput()); + } + + $asset->setContent($proc->getOutput()); + } + + /** + * {@inheritdoc} + */ + public function filterDump(AssetInterface $asset) + { + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/BaseCompressorFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/BaseCompressorFilter.php new file mode 100644 index 0000000000..5e031c25f5 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/BaseCompressorFilter.php @@ -0,0 +1,106 @@ + + */ +abstract class BaseCompressorFilter implements FilterInterface +{ + private $jarPath; + private $javaPath; + private $charset; + private $lineBreak; + + public function __construct($jarPath, $javaPath = '/usr/bin/java') + { + $this->jarPath = $jarPath; + $this->javaPath = $javaPath; + } + + public function setCharset($charset) + { + $this->charset = $charset; + } + + public function setLineBreak($lineBreak) + { + $this->lineBreak = $lineBreak; + } + + public function filterLoad(AssetInterface $asset) + { + } + + /** + * Compresses a string. + * + * @param string $content The content to compress + * @param string $type The type of content, either "js" or "css" + * @param array $options An indexed array of additional options + * + * @return string The compressed content + */ + protected function compress($content, $type, $options = array()) + { + $pb = new ProcessBuilder(array( + $this->javaPath, + '-jar', + $this->jarPath, + )); + + foreach ($options as $option) { + $pb->add($option); + } + + if (null !== $this->charset) { + $pb->add('--charset')->add($this->charset); + } + + if (null !== $this->lineBreak) { + $pb->add('--line-break')->add($this->lineBreak); + } + + // input and output files + $tempDir = realpath(sys_get_temp_dir()); + $hash = substr(sha1(time().rand(11111, 99999)), 0, 7); + $input = $tempDir.DIRECTORY_SEPARATOR.$hash.'.'.$type; + $output = $tempDir.DIRECTORY_SEPARATOR.$hash.'-min.'.$type; + file_put_contents($input, $content); + $pb->add('-o')->add($output)->add($input); + + $proc = $pb->getProcess(); + $code = $proc->run(); + unlink($input); + + if (0 < $code) { + if (file_exists($output)) { + unlink($output); + } + + throw new \RuntimeException($proc->getErrorOutput()); + } elseif (!file_exists($output)) { + throw new \RuntimeException('Error creating output file.'); + } + + $retval = file_get_contents($output); + unlink($output); + + return $retval; + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/CssCompressorFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/CssCompressorFilter.php new file mode 100644 index 0000000000..a184fc0b4d --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/CssCompressorFilter.php @@ -0,0 +1,27 @@ + + */ +class CssCompressorFilter extends BaseCompressorFilter +{ + public function filterDump(AssetInterface $asset) + { + $asset->setContent($this->compress($asset->getContent(), 'css')); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/JsCompressorFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/JsCompressorFilter.php new file mode 100644 index 0000000000..4fcfbb7225 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/JsCompressorFilter.php @@ -0,0 +1,60 @@ + + */ +class JsCompressorFilter extends BaseCompressorFilter +{ + private $nomunge; + private $preserveSemi; + private $disableOptimizations; + + public function setNomunge($nomunge = true) + { + $this->nomunge = $nomunge; + } + + public function setPreserveSemi($preserveSemi) + { + $this->preserveSemi = $preserveSemi; + } + + public function setDisableOptimizations($disableOptimizations) + { + $this->disableOptimizations = $disableOptimizations; + } + + public function filterDump(AssetInterface $asset) + { + $options = array(); + + if ($this->nomunge) { + $options[] = '--nomunge'; + } + + if ($this->preserveSemi) { + $options[] = '--preserve-semi'; + } + + if ($this->disableOptimizations) { + $options[] = '--disable-optimizations'; + } + + $asset->setContent($this->compress($asset->getContent(), 'js', $options)); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/FilterManager.php b/vendor/kriswallsmith/assetic/src/Assetic/FilterManager.php new file mode 100644 index 0000000000..ddf6cac521 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/FilterManager.php @@ -0,0 +1,64 @@ + + */ +class FilterManager +{ + private $filters = array(); + + public function set($alias, FilterInterface $filter) + { + $this->checkName($alias); + + $this->filters[$alias] = $filter; + } + + public function get($alias) + { + if (!isset($this->filters[$alias])) { + throw new \InvalidArgumentException(sprintf('There is no "%s" filter.', $alias)); + } + + return $this->filters[$alias]; + } + + public function has($alias) + { + return isset($this->filters[$alias]); + } + + public function getNames() + { + return array_keys($this->filters); + } + + /** + * Checks that a name is valid. + * + * @param string $name An asset name candidate + * + * @throws InvalidArgumentException If the asset name is invalid + */ + protected function checkName($name) + { + if (!ctype_alnum(str_replace('_', '', $name))) { + throw new \InvalidArgumentException(sprintf('The name "%s" is invalid.', $name)); + } + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Util/Process.php b/vendor/kriswallsmith/assetic/src/Assetic/Util/Process.php new file mode 100644 index 0000000000..07b8cdb74f --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Util/Process.php @@ -0,0 +1,379 @@ + + * + * @api + */ +class Process +{ + private $commandline; + private $cwd; + private $env; + private $stdin; + private $timeout; + private $options; + private $exitcode; + private $status; + private $stdout; + private $stderr; + + /** + * Constructor. + * + * @param string $commandline The command line to run + * @param string $cwd The working directory + * @param array $env The environment variables + * @param string $stdin The STDIN content + * @param integer $timeout The timeout in seconds + * @param array $options An array of options for proc_open + * + * @throws \RuntimeException When proc_open is not installed + * + * @api + */ + public function __construct($commandline, $cwd = null, array $env = null, $stdin = null, $timeout = 60, array $options = array()) + { + if (!function_exists('proc_open')) { + throw new \RuntimeException('The Process class relies on proc_open, which is not available on your PHP installation.'); + } + + $this->commandline = $commandline; + $this->cwd = null === $cwd ? getcwd() : $cwd; + if (null !== $env) { + $this->env = array(); + foreach ($env as $key => $value) { + $this->env[(binary) $key] = (binary) $value; + } + } else { + $this->env = null; + } + $this->stdin = $stdin; + $this->timeout = $timeout; + $this->options = array_merge(array('suppress_errors' => true, 'binary_pipes' => true, 'bypass_shell' => false), $options); + } + + /** + * Runs the process. + * + * The callback receives the type of output (out or err) and + * some bytes from the output in real-time. It allows to have feedback + * from the independent process during execution. + * + * The STDOUT and STDERR are also available after the process is finished + * via the getOutput() and getErrorOutput() methods. + * + * @param Closure|string|array $callback A PHP callback to run whenever there is some + * output available on STDOUT or STDERR + * + * @return integer The exit status code + * + * @throws \RuntimeException When process can't be launch or is stopped + * + * @api + */ + public function run($callback = null) + { + $this->stdout = ''; + $this->stderr = ''; + $that = $this; + $callback = function ($type, $data) use ($that, $callback) { + if ('out' == $type) { + $that->addOutput($data); + } else { + $that->addErrorOutput($data); + } + + if (null !== $callback) { + call_user_func($callback, $type, $data); + } + }; + + $descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w')); + + $process = proc_open($this->commandline, $descriptors, $pipes, $this->cwd, $this->env, $this->options); + + if (!is_resource($process)) { + throw new \RuntimeException('Unable to launch a new process.'); + } + + foreach ($pipes as $pipe) { + stream_set_blocking($pipe, false); + } + + if (null === $this->stdin) { + fclose($pipes[0]); + $writePipes = null; + } else { + $writePipes = array($pipes[0]); + $stdinLen = strlen($this->stdin); + $stdinOffset = 0; + } + unset($pipes[0]); + + while ($pipes || $writePipes) { + $r = $pipes; + $w = $writePipes; + $e = null; + + $n = @stream_select($r, $w, $e, $this->timeout); + + if (false === $n) { + break; + } elseif ($n === 0) { + proc_terminate($process); + + throw new \RuntimeException('The process timed out.'); + } + + if ($w) { + $written = fwrite($writePipes[0], (binary) substr($this->stdin, $stdinOffset), 8192); + if (false !== $written) { + $stdinOffset += $written; + } + if ($stdinOffset >= $stdinLen) { + fclose($writePipes[0]); + $writePipes = null; + } + } + + foreach ($r as $pipe) { + $type = array_search($pipe, $pipes); + $data = fread($pipe, 8192); + if (strlen($data) > 0) { + call_user_func($callback, $type == 1 ? 'out' : 'err', $data); + } + if (false === $data || feof($pipe)) { + fclose($pipe); + unset($pipes[$type]); + } + } + } + + $this->status = proc_get_status($process); + + $time = 0; + while (1 == $this->status['running'] && $time < 1000000) { + $time += 1000; + usleep(1000); + $this->status = proc_get_status($process); + } + + $exitcode = proc_close($process); + + if ($this->status['signaled']) { + throw new \RuntimeException(sprintf('The process stopped because of a "%s" signal.', $this->status['stopsig'])); + } + + return $this->exitcode = $this->status['running'] ? $exitcode : $this->status['exitcode']; + } + + /** + * Returns the output of the process (STDOUT). + * + * This only returns the output if you have not supplied a callback + * to the run() method. + * + * @return string The process output + * + * @api + */ + public function getOutput() + { + return $this->stdout; + } + + /** + * Returns the error output of the process (STDERR). + * + * This only returns the error output if you have not supplied a callback + * to the run() method. + * + * @return string The process error output + * + * @api + */ + public function getErrorOutput() + { + return $this->stderr; + } + + /** + * Returns the exit code returned by the process. + * + * @return integer The exit status code + * + * @api + */ + public function getExitCode() + { + return $this->exitcode; + } + + /** + * Checks if the process ended successfully. + * + * @return Boolean true if the process ended successfully, false otherwise + * + * @api + */ + public function isSuccessful() + { + return 0 == $this->exitcode; + } + + /** + * Returns true if the child process has been terminated by an uncaught signal. + * + * It always returns false on Windows. + * + * @return Boolean + * + * @api + */ + public function hasBeenSignaled() + { + return $this->status['signaled']; + } + + /** + * Returns the number of the signal that caused the child process to terminate its execution. + * + * It is only meaningful if hasBeenSignaled() returns true. + * + * @return integer + * + * @api + */ + public function getTermSignal() + { + return $this->status['termsig']; + } + + /** + * Returns true if the child process has been stopped by a signal. + * + * It always returns false on Windows. + * + * @return Boolean + * + * @api + */ + public function hasBeenStopped() + { + return $this->status['stopped']; + } + + /** + * Returns the number of the signal that caused the child process to stop its execution + * + * It is only meaningful if hasBeenStopped() returns true. + * + * @return integer + * + * @api + */ + public function getStopSignal() + { + return $this->status['stopsig']; + } + + public function addOutput($line) + { + $this->stdout .= $line; + } + + public function addErrorOutput($line) + { + $this->stderr .= $line; + } + + public function getCommandLine() + { + return $this->commandline; + } + + public function setCommandLine($commandline) + { + $this->commandline = $commandline; + } + + public function getTimeout() + { + return $this->timeout; + } + + public function setTimeout($timeout) + { + $this->timeout = $timeout; + } + + public function getWorkingDirectory() + { + return $this->cwd; + } + + public function setWorkingDirectory($cwd) + { + $this->cwd = $cwd; + } + + public function getEnv() + { + return $this->env; + } + + public function setEnv(array $env) + { + $this->env = $env; + } + + public function getStdin() + { + return $this->stdin; + } + + public function setStdin($stdin) + { + $this->stdin = $stdin; + } + + public function getOptions() + { + return $this->options; + } + + public function setOptions(array $options) + { + $this->options = $options; + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Util/ProcessBuilder.php b/vendor/kriswallsmith/assetic/src/Assetic/Util/ProcessBuilder.php new file mode 100644 index 0000000000..8eaaca8108 --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Util/ProcessBuilder.php @@ -0,0 +1,117 @@ + + */ +class ProcessBuilder +{ + private $arguments; + private $cwd; + private $env; + private $stdin; + private $timeout = 60; + private $options = array(); + private $inheritEnv = false; + + public function __construct(array $arguments = array()) + { + $this->arguments = $arguments; + } + + /** + * Adds an unescaped argument to the command string. + * + * @param string $argument A command argument + */ + public function add($argument) + { + $this->arguments[] = $argument; + + return $this; + } + + public function setWorkingDirectory($cwd) + { + $this->cwd = $cwd; + + return $this; + } + + public function inheritEnvironmentVariables($inheritEnv = true) + { + $this->inheritEnv = $inheritEnv; + + return $this; + } + + public function setEnv($name, $value) + { + if (null === $this->env) { + $this->env = array(); + } + + $this->env[$name] = $value; + + return $this; + } + + public function setInput($stdin) + { + $this->stdin = $stdin; + + return $this; + } + + public function setTimeout($timeout) + { + $this->timeout = $timeout; + + return $this; + } + + public function setOption($name, $value) + { + $this->options[$name] = $value; + + return $this; + } + + public function getProcess() + { + if (!count($this->arguments)) { + throw new \LogicException('You must add() command arguments before calling getProcess().'); + } + + $options = $this->options; + + if (defined('PHP_WINDOWS_VERSION_MAJOR')) { + $options += array('bypass_shell' => true); + + $args = $this->arguments; + $cmd = array_shift($args); + + $script = '"'.$cmd.'"'; + if ($args) { + $script .= ' '.implode(' ', array_map('escapeshellarg', $args)); + } + } else { + $script = implode(' ', array_map('escapeshellarg', $this->arguments)); + } + $env = $this->inheritEnv && $_ENV ? ($this->env ?: array()) + $_ENV : $this->env; + + return new Process($script, $this->cwd, $env, $this->stdin, $this->timeout, $options); + } +} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Util/TraversableString.php b/vendor/kriswallsmith/assetic/src/Assetic/Util/TraversableString.php new file mode 100644 index 0000000000..9f1a633eaf --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/Assetic/Util/TraversableString.php @@ -0,0 +1,44 @@ + + */ +class TraversableString implements \IteratorAggregate, \Countable +{ + private $one; + private $many; + + public function __construct($one, array $many) + { + $this->one = $one; + $this->many = $many; + } + + public function getIterator() + { + return new \ArrayIterator($this->many); + } + + public function count() + { + return count($this->many); + } + + public function __toString() + { + return (string) $this->one; + } +} diff --git a/vendor/kriswallsmith/assetic/src/functions.php b/vendor/kriswallsmith/assetic/src/functions.php new file mode 100644 index 0000000000..264589e1ab --- /dev/null +++ b/vendor/kriswallsmith/assetic/src/functions.php @@ -0,0 +1,121 @@ +factory = $factory; +} + +/** + * Returns an array of javascript URLs. + * + * @param array|string $inputs Input strings + * @param array|string $filters Filter names + * @param array $options An array of options + * + * @return array An array of javascript URLs + */ +function assetic_javascripts($inputs = array(), $filters = array(), array $options = array()) +{ + if (!isset($options['output'])) { + $options['output'] = 'js/*.js'; + } + + return _assetic_urls($inputs, $filters, $options); +} + +/** + * Returns an array of stylesheet URLs. + * + * @param array|string $inputs Input strings + * @param array|string $filters Filter names + * @param array $options An array of options + * + * @return array An array of stylesheet URLs + */ +function assetic_stylesheets($inputs = array(), $filters = array(), array $options = array()) +{ + if (!isset($options['output'])) { + $options['output'] = 'css/*.css'; + } + + return _assetic_urls($inputs, $filters, $options); +} + +/** + * Returns an image URL. + * + * @param string $input An input + * @param array|string $filters Filter names + * @param array $options An array of options + * + * @return string An image URL + */ +function assetic_image($input, $filters = array(), array $options = array()) +{ + if (!isset($options['output'])) { + $options['output'] = 'images/*'; + } + + $urls = _assetic_urls($input, $filters, $options); + + return current($urls); +} + +/** + * Returns an array of asset urls. + * + * @param array|string $inputs Input strings + * @param array|string $filters Filter names + * @param array $options An array of options + * + * @return array An array of URLs + */ +function _assetic_urls($inputs = array(), $filters = array(), array $options = array()) +{ + global $_assetic; + + if (!is_array($inputs)) { + $inputs = array_filter(array_map('trim', explode(',', $inputs))); + } + + if (!is_array($filters)) { + $filters = array_filter(array_map('trim', explode(',', $filters))); + } + + $coll = $_assetic->factory->createAsset($inputs, $filters, $options); + + $debug = isset($options['debug']) ? $options['debug'] : $_assetic->factory->isDebug(); + $combine = isset($options['combine']) ? $options['combine'] : !$debug; + + $one = $coll->getTargetPath(); + if ($combine) { + $many = array(); + foreach ($coll as $leaf) { + $many[] = $leaf->getTargetPath(); + } + } else { + $many = array($one); + } + + return new TraversableString($one, $many); +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetCacheTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetCacheTest.php new file mode 100644 index 0000000000..9484f2a6b8 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetCacheTest.php @@ -0,0 +1,175 @@ +inner = $this->getMock('Assetic\\Asset\\AssetInterface'); + $this->cache = $this->getMock('Assetic\\Cache\\CacheInterface'); + + $this->asset = new AssetCache($this->inner, $this->cache); + } + + public function testLoadFromCache() + { + $content = 'asdf'; + $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); + + $this->inner->expects($this->once()) + ->method('getFilters') + ->will($this->returnValue(array($filter))); + $this->cache->expects($this->once()) + ->method('has') + ->with($this->isType('string')) + ->will($this->returnValue(true)); + $this->cache->expects($this->once()) + ->method('get') + ->with($this->isType('string')) + ->will($this->returnValue($content)); + $this->inner->expects($this->once()) + ->method('setContent') + ->with($content); + + $this->asset->load($filter); + } + + public function testLoadToCache() + { + $content = 'asdf'; + + $this->inner->expects($this->once()) + ->method('getFilters') + ->will($this->returnValue(array())); + $this->cache->expects($this->once()) + ->method('has') + ->with($this->isType('string')) + ->will($this->returnValue(false)); + $this->inner->expects($this->once())->method('load'); + $this->inner->expects($this->once()) + ->method('getContent') + ->will($this->returnValue($content)); + $this->cache->expects($this->once()) + ->method('set') + ->with($this->isType('string'), $content); + + $this->asset->load(); + } + + public function testDumpFromCache() + { + $content = 'asdf'; + + $this->inner->expects($this->once()) + ->method('getFilters') + ->will($this->returnValue(array())); + $this->cache->expects($this->once()) + ->method('has') + ->with($this->isType('string')) + ->will($this->returnValue(true)); + $this->cache->expects($this->once()) + ->method('get') + ->with($this->isType('string')) + ->will($this->returnValue($content)); + + $this->assertEquals($content, $this->asset->dump(), '->dump() returns the cached value'); + } + + public function testDumpToCache() + { + $content = 'asdf'; + + $this->inner->expects($this->once()) + ->method('getFilters') + ->will($this->returnValue(array())); + $this->cache->expects($this->once()) + ->method('has') + ->with($this->isType('string')) + ->will($this->returnValue(false)); + $this->inner->expects($this->once()) + ->method('dump') + ->will($this->returnValue($content)); + $this->cache->expects($this->once()) + ->method('set') + ->with($this->isType('string'), $content); + + $this->assertEquals($content, $this->asset->dump(), '->dump() returns the dumped value'); + } + + public function testEnsureFilter() + { + $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); + $this->inner->expects($this->once())->method('ensureFilter'); + $this->asset->ensureFilter($filter); + } + + public function testGetFilters() + { + $this->inner->expects($this->once()) + ->method('getFilters') + ->will($this->returnValue(array())); + + $this->assertInternalType('array', $this->asset->getFilters(), '->getFilters() returns the inner asset filters'); + } + + public function testGetContent() + { + $this->inner->expects($this->once()) + ->method('getContent') + ->will($this->returnValue('asdf')); + + $this->assertEquals('asdf', $this->asset->getContent(), '->getContent() returns the inner asset content'); + } + + public function testSetContent() + { + $this->inner->expects($this->once()) + ->method('setContent') + ->with('asdf'); + + $this->asset->setContent('asdf'); + } + + public function testGetSourceRoot() + { + $this->inner->expects($this->once()) + ->method('getSourceRoot') + ->will($this->returnValue('asdf')); + + $this->assertEquals('asdf', $this->asset->getSourceRoot(), '->getSourceRoot() returns the inner asset source root'); + } + + public function testGetSourcePath() + { + $this->inner->expects($this->once()) + ->method('getSourcePath') + ->will($this->returnValue('asdf')); + + $this->assertEquals('asdf', $this->asset->getSourcePath(), '->getSourcePath() returns the inner asset source path'); + } + + public function testGetLastModified() + { + $this->inner->expects($this->once()) + ->method('getLastModified') + ->will($this->returnValue(123)); + + $this->assertEquals(123, $this->asset->getLastModified(), '->getLastModified() returns the inner asset last modified'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetCollectionTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetCollectionTest.php new file mode 100644 index 0000000000..f461cac803 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetCollectionTest.php @@ -0,0 +1,260 @@ +assertInstanceOf('Assetic\\Asset\\AssetInterface', $coll, 'AssetCollection implements AssetInterface'); + } + + public function testLoadFilter() + { + $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); + $filter->expects($this->once())->method('filterLoad'); + + $coll = new AssetCollection(array(new StringAsset('')), array($filter)); + $coll->load(); + } + + public function testDumpFilter() + { + $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); + $filter->expects($this->once())->method('filterDump'); + + $coll = new AssetCollection(array(new StringAsset('')), array($filter)); + $coll->dump(); + } + + public function testNestedCollectionLoad() + { + $content = 'foobar'; + + $count = 0; + $matches = array(); + $filter = new CallablesFilter(function($asset) use ($content, &$matches, &$count) { + ++$count; + if ($content == $asset->getContent()) { + $matches[] = $asset; + } + }); + + $innerColl = new AssetCollection(array(new StringAsset($content))); + $outerColl = new AssetCollection(array($innerColl), array($filter)); + $outerColl->load(); + + $this->assertEquals(1, count($matches), '->load() applies filters to leaves'); + $this->assertEquals(1, $count, '->load() applies filters to leaves only'); + } + + public function testMixedIteration() + { + $asset = new StringAsset('asset'); + $nestedAsset = new StringAsset('nested'); + $innerColl = new AssetCollection(array($nestedAsset)); + + $contents = array(); + $filter = new CallablesFilter(function($asset) use (&$contents) { + $contents[] = $asset->getContent(); + }); + + $coll = new AssetCollection(array($asset, $innerColl), array($filter)); + $coll->load(); + + $this->assertEquals(array('asset', 'nested'), $contents, '->load() iterates over multiple levels'); + } + + public function testLoadDedupBySourceUrl() + { + $asset1 = new StringAsset('asset', array(), '/some/dir', 'foo.bar'); + $asset2 = new StringAsset('asset', array(), '/some/dir', 'foo.bar'); + + $coll = new AssetCollection(array($asset1, $asset2)); + $coll->load(); + + $this->assertEquals('asset', $coll->getContent(), '->load() detects duplicate assets based on source URL'); + } + + public function testLoadDedupByStrictEquality() + { + $asset = new StringAsset('foo'); + + $coll = new AssetCollection(array($asset, $asset)); + $coll->load(); + + $this->assertEquals('foo', $coll->getContent(), '->load() detects duplicate assets based on strict equality'); + } + + public function testDumpDedupBySourceUrl() + { + $asset1 = new StringAsset('asset', array(), '/some/dir', 'foo.bar'); + $asset2 = new StringAsset('asset', array(), '/some/dir', 'foo.bar'); + + $coll = new AssetCollection(array($asset1, $asset2)); + $coll->load(); + + $this->assertEquals('asset', $coll->dump(), '->dump() detects duplicate assets based on source URL'); + } + + public function testDumpDedupByStrictEquality() + { + $asset = new StringAsset('foo'); + + $coll = new AssetCollection(array($asset, $asset)); + $coll->load(); + + $this->assertEquals('foo', $coll->dump(), '->dump() detects duplicate assets based on strict equality'); + } + + public function testIterationFilters() + { + $count = 0; + $filter = new CallablesFilter(function() use (&$count) { ++$count; }); + + $coll = new AssetCollection(); + $coll->add(new StringAsset('')); + $coll->ensureFilter($filter); + + foreach ($coll as $asset) { + $asset->dump(); + } + + $this->assertEquals(1, $count, 'collection filters are called when child assets are iterated over'); + } + + public function testSetContent() + { + $coll = new AssetCollection(); + $coll->setContent('asdf'); + + $this->assertEquals('asdf', $coll->getContent(), '->setContent() sets the content'); + } + + /** + * @dataProvider getTimestampsAndExpected + */ + public function testGetLastModified($timestamps, $expected) + { + $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); + + for ($i = 0; $i < count($timestamps); $i++) { + $asset->expects($this->at($i)) + ->method('getLastModified') + ->will($this->returnValue($timestamps[$i])); + } + + $coll = new AssetCollection(array_fill(0, count($timestamps), $asset)); + + $this->assertEquals($expected, $coll->getLastModified(), '->getLastModifed() returns the highest last modified'); + } + + public function getTimestampsAndExpected() + { + return array( + array(array(1, 2, 3), 3), + array(array(5, 4, 3), 5), + array(array(3, 8, 5), 8), + array(array(3, 8, null), 8), + ); + } + + public function testRecursiveIteration() + { + $asset1 = $this->getMock('Assetic\\Asset\\AssetInterface'); + $asset2 = $this->getMock('Assetic\\Asset\\AssetInterface'); + $asset3 = $this->getMock('Assetic\\Asset\\AssetInterface'); + $asset4 = $this->getMock('Assetic\\Asset\\AssetInterface'); + + $coll3 = new AssetCollection(array($asset1, $asset2)); + $coll2 = new AssetCollection(array($asset3, $coll3)); + $coll1 = new AssetCollection(array($asset4, $coll2)); + + $i = 0; + foreach ($coll1 as $a) { + $i++; + } + + $this->assertEquals(4, $i, 'iteration with a recursive iterator is recursive'); + } + + public function testRecursiveDeduplication() + { + $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); + + $coll3 = new AssetCollection(array($asset, $asset)); + $coll2 = new AssetCollection(array($asset, $coll3)); + $coll1 = new AssetCollection(array($asset, $coll2)); + + $i = 0; + foreach ($coll1 as $a) { + $i++; + } + + $this->assertEquals(1, $i, 'deduplication is performed recursively'); + } + + public function testIteration() + { + $asset1 = new StringAsset('asset1', array(), '/some/dir', 'foo.css'); + $asset2 = new StringAsset('asset2', array(), '/some/dir', 'foo.css'); + $asset3 = new StringAsset('asset3', array(), '/some/dir', 'bar.css'); + + $coll = new AssetCollection(array($asset1, $asset2, $asset3)); + + $count = 0; + foreach ($coll as $a) { + ++$count; + } + + $this->assertEquals(2, $count, 'iterator filters duplicates based on url'); + } + + public function testBasenameCollision() + { + $asset1 = new StringAsset('asset1', array(), '/some/dir', 'foo/foo.css'); + $asset2 = new StringAsset('asset2', array(), '/some/dir', 'bar/foo.css'); + + $coll = new AssetCollection(array($asset1, $asset2)); + + $urls = array(); + foreach ($coll as $leaf) { + $urls[] = $leaf->getTargetPath(); + } + + $this->assertEquals(2, count(array_unique($urls)), 'iterator prevents basename collisions'); + } + + public function testEmptyMtime() + { + $coll = new AssetCollection(); + $this->assertNull($coll->getLastModified(), '->getLastModified() returns null on empty collection'); + } + + public function testLeafManipulation() + { + $coll = new AssetCollection(array(new StringAsset('asdf'))); + + foreach ($coll as $leaf) { + $leaf->setTargetPath('asdf'); + } + + foreach ($coll as $leaf) { + $this->assertEquals('asdf', $leaf->getTargetPath(), 'leaf changes persist between iterations'); + } + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetReferenceTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetReferenceTest.php new file mode 100644 index 0000000000..3a62b77e7a --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetReferenceTest.php @@ -0,0 +1,126 @@ +am = $this->getMock('Assetic\\AssetManager'); + $this->ref = new AssetReference($this->am, 'foo'); + } + + /** + * @dataProvider getMethodAndRetVal + */ + public function testMethods($method, $returnValue) + { + $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); + + $this->am->expects($this->once()) + ->method('get') + ->with('foo') + ->will($this->returnValue($asset)); + $asset->expects($this->once()) + ->method($method) + ->will($this->returnValue($returnValue)); + + $this->assertEquals($returnValue, $this->ref->$method(), '->'.$method.'() returns the asset value'); + } + + public function getMethodAndRetVal() + { + return array( + array('getContent', 'asdf'), + array('getSourceRoot', 'asdf'), + array('getSourcePath', 'asdf'), + array('getTargetPath', 'asdf'), + array('getLastModified', 123), + ); + } + + public function testLazyFilters() + { + $this->am->expects($this->never())->method('get'); + $this->ref->ensureFilter($this->getMock('Assetic\\Filter\\FilterInterface')); + } + + public function testFilterFlush() + { + $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); + + $this->am->expects($this->exactly(2)) + ->method('get') + ->with('foo') + ->will($this->returnValue($asset)); + $asset->expects($this->once())->method('ensureFilter'); + $asset->expects($this->once()) + ->method('getFilters') + ->will($this->returnValue(array())); + + $this->ref->ensureFilter($this->getMock('Assetic\\Filter\\FilterInterface')); + + $this->assertInternalType('array', $this->ref->getFilters(), '->getFilters() flushes and returns filters'); + } + + public function testSetContent() + { + $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); + + $this->am->expects($this->once()) + ->method('get') + ->with('foo') + ->will($this->returnValue($asset)); + $asset->expects($this->once()) + ->method('setContent') + ->with('asdf'); + + $this->ref->setContent('asdf'); + } + + public function testLoad() + { + $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); + $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); + + $this->am->expects($this->exactly(2)) + ->method('get') + ->with('foo') + ->will($this->returnValue($asset)); + $asset->expects($this->once()) + ->method('load') + ->with($filter); + + $this->ref->load($filter); + } + + public function testDump() + { + $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); + $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); + + $this->am->expects($this->exactly(2)) + ->method('get') + ->with('foo') + ->will($this->returnValue($asset)); + $asset->expects($this->once()) + ->method('dump') + ->with($filter); + + $this->ref->dump($filter); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/FileAssetTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/FileAssetTest.php new file mode 100644 index 0000000000..a76bb126e2 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/FileAssetTest.php @@ -0,0 +1,64 @@ +assertInstanceOf('Assetic\\Asset\\AssetInterface', $asset, 'Asset implements AssetInterface'); + } + + public function testLazyLoading() + { + $asset = new FileAsset(__FILE__); + $this->assertEmpty($asset->getContent(), 'The asset content is empty before load'); + + $asset->load(); + $this->assertNotEmpty($asset->getContent(), 'The asset content is not empty after load'); + } + + public function testGetLastModifiedType() + { + $asset = new FileAsset(__FILE__); + $this->assertInternalType('integer', $asset->getLastModified(), '->getLastModified() returns an integer'); + } + + public function testGetLastModifiedValue() + { + $asset = new FileAsset(__FILE__); + $this->assertLessThan(time(), $asset->getLastModified(), '->getLastModified() returns the mtime'); + } + + public function testDefaultBaseAndPath() + { + $asset = new FileAsset(__FILE__); + $this->assertEquals(__DIR__, $asset->getSourceRoot(), '->__construct() defaults base to the asset directory'); + $this->assertEquals(basename(__FILE__), $asset->getSourcePath(), '->__construct() defaults path to the asset basename'); + } + + public function testPathGuessing() + { + $asset = new FileAsset(__FILE__, array(), __DIR__); + $this->assertEquals(basename(__FILE__), $asset->getSourcePath(), '->__construct() guesses the asset path'); + } + + public function testInvalidBase() + { + $this->setExpectedException('InvalidArgumentException'); + + $asset = new FileAsset(__FILE__, array(), __DIR__.'/foo'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/GlobAssetTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/GlobAssetTest.php new file mode 100644 index 0000000000..e0d7199c4c --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/GlobAssetTest.php @@ -0,0 +1,61 @@ +assertInstanceOf('Assetic\\Asset\\AssetInterface', $asset, 'Asset implements AssetInterface'); + } + + public function testIteration() + { + $assets = new GlobAsset(__DIR__.'/*.php'); + $this->assertGreaterThan(0, iterator_count($assets), 'GlobAsset initializes for iteration'); + } + + public function testRecursiveIteration() + { + $assets = new GlobAsset(__DIR__.'/*.php'); + $this->assertGreaterThan(0, iterator_count($assets), 'GlobAsset initializes for recursive iteration'); + } + + public function testGetLastModifiedType() + { + $assets = new GlobAsset(__DIR__.'/*.php'); + $this->assertInternalType('integer', $assets->getLastModified(), '->getLastModified() returns an integer'); + } + + public function testGetLastModifiedValue() + { + $assets = new GlobAsset(__DIR__.'/*.php'); + $this->assertLessThan(time(), $assets->getLastModified(), '->getLastModified() returns a file mtime'); + } + + public function testLoad() + { + $assets = new GlobAsset(__DIR__.'/*.php'); + $assets->load(); + + $this->assertNotEmpty($assets->getContent(), '->load() loads contents'); + } + + public function testDump() + { + $assets = new GlobAsset(__DIR__.'/*.php'); + $this->assertNotEmpty($assets->dump(), '->dump() dumps contents'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/HttpAssetTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/HttpAssetTest.php new file mode 100644 index 0000000000..f090bd3234 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/HttpAssetTest.php @@ -0,0 +1,54 @@ +assertInternalType('integer', $asset->getLastModified(), '->getLastModified() returns an integer'); + } + + public function testProtocolRelativeUrl() + { + $asset = new HttpAsset(substr(self::JQUERY, 6)); + $asset->load(); + $this->assertNotEmpty($asset->getContent()); + } + + public function testMalformedUrl() + { + $this->setExpectedException('InvalidArgumentException'); + + new HttpAsset(__FILE__); + } + + public function testInvalidUrl() + { + $this->setExpectedException('RuntimeException'); + + $asset = new HttpAsset('http://invalid.com/foobar'); + $asset->load(); + } + + public function testSourceMetadata() + { + $asset = new HttpAsset(self::JQUERY); + $this->assertEquals('https://ajax.googleapis.com', $asset->getSourceRoot(), '->__construct() set the source root'); + $this->assertEquals('ajax/libs/jquery/1.6.1/jquery.min.js', $asset->getSourcePath(), '->__construct() set the source path'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/StringAssetTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/StringAssetTest.php new file mode 100644 index 0000000000..7994a3896a --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/StringAssetTest.php @@ -0,0 +1,79 @@ +assertInstanceOf('Assetic\\Asset\\AssetInterface', $asset, 'Asset implements AssetInterface'); + } + + public function testLoadAppliesFilters() + { + $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); + $filter->expects($this->once())->method('filterLoad'); + + $asset = new StringAsset('foo', array($filter)); + $asset->load(); + } + + public function testAutomaticLoad() + { + $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); + $filter->expects($this->once())->method('filterLoad'); + + $asset = new StringAsset('foo', array($filter)); + $asset->dump(); + } + + public function testGetFilters() + { + $asset = new StringAsset(''); + $this->assertInternalType('array', $asset->getFilters(), '->getFilters() returns an array'); + } + + public function testLoadAppliesAdditionalFilter() + { + $asset = new StringAsset(''); + $asset->load(); + + $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); + $filter->expects($this->once()) + ->method('filterLoad') + ->with($asset); + + $asset->load($filter); + } + + public function testDumpAppliesAdditionalFilter() + { + $asset = new StringAsset(''); + + $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); + $filter->expects($this->once()) + ->method('filterDump') + ->with($asset); + + $asset->dump($filter); + } + + public function testLastModified() + { + $asset = new StringAsset(''); + $asset->setLastModified(123); + $this->assertEquals(123, $asset->getLastModified(), '->getLastModified() return the set last modified value'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/AssetManagerTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/AssetManagerTest.php new file mode 100644 index 0000000000..d4598554ec --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/AssetManagerTest.php @@ -0,0 +1,53 @@ +am = new AssetManager(); + } + + public function testGetAsset() + { + $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); + $this->am->set('foo', $asset); + $this->assertSame($asset, $this->am->get('foo'), '->get() returns an asset'); + } + + public function testGetInvalidAsset() + { + $this->setExpectedException('InvalidArgumentException'); + $this->am->get('foo'); + } + + public function testHas() + { + $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); + $this->am->set('foo', $asset); + + $this->assertTrue($this->am->has('foo'), '->has() returns true if the asset is set'); + $this->assertFalse($this->am->has('bar'), '->has() returns false if the asset is not set'); + } + + public function testInvalidName() + { + $this->setExpectedException('InvalidArgumentException'); + + $this->am->set('@foo', $this->getMock('Assetic\\Asset\\AssetInterface')); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/AssetWriterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/AssetWriterTest.php new file mode 100644 index 0000000000..19341170a0 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/AssetWriterTest.php @@ -0,0 +1,55 @@ +dir = sys_get_temp_dir().'/assetic_tests_'.rand(11111, 99999); + mkdir($this->dir); + $this->writer = new AssetWriter($this->dir); + } + + protected function tearDown() + { + array_map('unlink', glob($this->dir.'/*')); + rmdir($this->dir); + } + + public function testWriteManagerAssets() + { + $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); + $am = $this->getMock('Assetic\\AssetManager'); + + $am->expects($this->once()) + ->method('getNames') + ->will($this->returnValue(array('foo'))); + $am->expects($this->once()) + ->method('get') + ->with('foo') + ->will($this->returnValue($asset)); + $asset->expects($this->once()) + ->method('getTargetPath') + ->will($this->returnValue('target_url')); + $asset->expects($this->once()) + ->method('dump') + ->will($this->returnValue('content')); + + $this->writer->writeManagerAssets($am); + + $this->assertFileExists($this->dir.'/target_url'); + $this->assertEquals('content', file_get_contents($this->dir.'/target_url')); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ConfigCacheTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ConfigCacheTest.php new file mode 100644 index 0000000000..78ab541238 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ConfigCacheTest.php @@ -0,0 +1,65 @@ +dir = sys_get_temp_dir().'/assetic/tests/config_cache'; + $this->cache = new ConfigCache($this->dir); + } + + protected function tearDown() + { + foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->dir, \FilesystemIterator::SKIP_DOTS)) as $file) { + unlink($file->getPathname()); + } + } + + public function testCache() + { + $this->cache->set('foo', array(1, 2, 3)); + $this->assertEquals(array(1, 2, 3), $this->cache->get('foo'), '->get() returns the ->set() value'); + } + + public function testTimestamp() + { + $this->cache->set('bar', array(4, 5, 6)); + $this->assertInternalType('integer', $time = $this->cache->getTimestamp('bar'), '->getTimestamp() returns an integer'); + $this->assertNotEmpty($time, '->getTimestamp() returns a non-empty number'); + } + + public function testInvalidValue() + { + $this->setExpectedException('RuntimeException'); + $this->cache->get('_invalid'); + } + + public function testInvalidTimestamp() + { + $this->setExpectedException('RuntimeException'); + $this->cache->getTimestamp('_invalid'); + } + + public function testHas() + { + $this->cache->set('foo', 'bar'); + $this->assertTrue($this->cache->has('foo')); + $this->assertFalse($this->cache->has('_invalid')); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ExpiringCacheTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ExpiringCacheTest.php new file mode 100644 index 0000000000..b67cab3e48 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ExpiringCacheTest.php @@ -0,0 +1,111 @@ +inner = $this->getMock('Assetic\\Cache\\CacheInterface'); + $this->lifetime = 3600; + $this->cache = new ExpiringCache($this->inner, $this->lifetime); + } + + public function testHasExpired() + { + $key = 'asdf'; + $expiresKey = 'asdf.expires'; + $thePast = 0; + + $this->inner->expects($this->once()) + ->method('has') + ->with($key) + ->will($this->returnValue(true)); + $this->inner->expects($this->once()) + ->method('get') + ->with($expiresKey) + ->will($this->returnValue($thePast)); + $this->inner->expects($this->at(2)) + ->method('remove') + ->with($expiresKey); + $this->inner->expects($this->at(3)) + ->method('remove') + ->with($key); + + $this->assertFalse($this->cache->has($key), '->has() returns false if an expired value exists'); + } + + public function testHasNotExpired() + { + $key = 'asdf'; + $expiresKey = 'asdf.expires'; + $theFuture = time() * 2; + + $this->inner->expects($this->once()) + ->method('has') + ->with($key) + ->will($this->returnValue(true)); + $this->inner->expects($this->once()) + ->method('get') + ->with($expiresKey) + ->will($this->returnValue($theFuture)); + + $this->assertTrue($this->cache->has($key), '->has() returns true if a value the not expired'); + } + + public function testSetLifetime() + { + $key = 'asdf'; + $expiresKey = 'asdf.expires'; + $value = 'qwerty'; + + $this->inner->expects($this->at(0)) + ->method('set') + ->with($expiresKey, $this->greaterThanOrEqual(time() + $this->lifetime)); + $this->inner->expects($this->at(1)) + ->method('set') + ->with($key, $value); + + $this->cache->set($key, $value); + } + + public function testRemove() + { + $key = 'asdf'; + $expiresKey = 'asdf.expires'; + + $this->inner->expects($this->at(0)) + ->method('remove') + ->with($expiresKey); + $this->inner->expects($this->at(1)) + ->method('remove') + ->with($key); + + $this->cache->remove($key); + } + + public function testGet() + { + $this->inner->expects($this->once()) + ->method('get') + ->with('foo') + ->will($this->returnValue('bar')); + + $this->assertEquals('bar', $this->cache->get('foo'), '->get() returns the cached value'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/FilesystemCacheTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/FilesystemCacheTest.php new file mode 100644 index 0000000000..6bddf9d8fa --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/FilesystemCacheTest.php @@ -0,0 +1,51 @@ +assertFalse($cache->has('foo')); + + $cache->set('foo', 'bar'); + $this->assertEquals('bar', $cache->get('foo')); + + $this->assertTrue($cache->has('foo')); + + $cache->remove('foo'); + $this->assertFalse($cache->has('foo')); + } + + public function testSetCreatesDir() + { + $dir = sys_get_temp_dir().'/assetic/fscachetest'; + + $tearDown = function() use ($dir) { + array_map('unlink', glob($dir.'/*')); + @rmdir($dir); + }; + + $tearDown(); + + $cache = new FilesystemCache($dir); + $cache->set('foo', 'bar'); + + $this->assertFileExists($dir.'/foo'); + + $tearDown(); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/AsseticExtensionTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/AsseticExtensionTest.php new file mode 100644 index 0000000000..c8941b93f4 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/AsseticExtensionTest.php @@ -0,0 +1,198 @@ +markTestSkipped('Twig is not installed.'); + } + + $this->am = $this->getMock('Assetic\\AssetManager'); + $this->fm = $this->getMock('Assetic\\FilterManager'); + + $this->factory = new AssetFactory(__DIR__.'/templates'); + $this->factory->setAssetManager($this->am); + $this->factory->setFilterManager($this->fm); + + $this->twig = new \Twig_Environment(); + $this->twig->setLoader(new \Twig_Loader_Filesystem(__DIR__.'/templates')); + $this->twig->addExtension(new AsseticExtension($this->factory)); + } + + public function testReference() + { + $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); + $this->am->expects($this->any()) + ->method('get') + ->with('foo') + ->will($this->returnValue($asset)); + + $xml = $this->renderXml('reference.twig'); + $this->assertEquals(1, count($xml->asset)); + $this->assertStringStartsWith('css/', (string) $xml->asset['url']); + } + + public function testGlob() + { + $xml = $this->renderXml('glob.twig'); + $this->assertEquals(1, count($xml->asset)); + $this->assertStringStartsWith('css/', (string) $xml->asset['url']); + } + + public function testAbsolutePath() + { + $xml = $this->renderXml('absolute_path.twig'); + $this->assertEquals(1, count($xml->asset)); + $this->assertStringStartsWith('css/', (string) $xml->asset['url']); + } + + public function testFilters() + { + $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); + + $this->fm->expects($this->at(0)) + ->method('get') + ->with('foo') + ->will($this->returnValue($filter)); + $this->fm->expects($this->at(1)) + ->method('get') + ->with('bar') + ->will($this->returnValue($filter)); + + $xml = $this->renderXml('filters.twig'); + $this->assertEquals(1, count($xml->asset)); + $this->assertStringStartsWith('css/', (string) $xml->asset['url']); + } + + public function testOptionalFilter() + { + $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); + + $this->fm->expects($this->once()) + ->method('get') + ->with('foo') + ->will($this->returnValue($filter)); + + $xml = $this->renderXml('optional_filter.twig'); + $this->assertEquals(1, count($xml->asset)); + $this->assertStringStartsWith('css/', (string) $xml->asset['url']); + } + + public function testOutputPattern() + { + $xml = $this->renderXml('output_pattern.twig'); + $this->assertEquals(1, count($xml->asset)); + $this->assertStringStartsWith('css/packed/', (string) $xml->asset['url']); + $this->assertStringEndsWith('.css', (string) $xml->asset['url']); + } + + public function testOutput() + { + $xml = $this->renderXml('output_url.twig'); + $this->assertEquals(1, count($xml->asset)); + $this->assertEquals('explicit_url.css', (string) $xml->asset['url']); + } + + public function testMixture() + { + $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); + $this->am->expects($this->any()) + ->method('get') + ->with('foo') + ->will($this->returnValue($asset)); + + $xml = $this->renderXml('mixture.twig'); + $this->assertEquals(1, count($xml->asset)); + $this->assertEquals('packed/mixture', (string) $xml->asset['url']); + } + + public function testDebug() + { + $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); + + $this->fm->expects($this->once()) + ->method('get') + ->with('bar') + ->will($this->returnValue($filter)); + + $xml = $this->renderXml('debug.twig'); + $this->assertEquals(2, count($xml->asset)); + $this->assertStringStartsWith('css/packed_', (string) $xml->asset[0]['url']); + $this->assertStringEndsWith('.css', (string) $xml->asset[0]['url']); + } + + public function testCombine() + { + $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); + + $this->fm->expects($this->once()) + ->method('get') + ->with('bar') + ->will($this->returnValue($filter)); + + $xml = $this->renderXml('combine.twig'); + $this->assertEquals(1, count($xml->asset)); + $this->assertEquals('css/packed.css', (string) $xml->asset[0]['url']); + } + + public function testImage() + { + $xml = $this->renderXml('image.twig'); + $this->assertEquals(1, count($xml->image)); + $this->assertStringEndsWith('.png', (string) $xml->image[0]['url']); + } + + public function testFilterFunction() + { + $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); + + $this->fm->expects($this->once()) + ->method('get') + ->with('some_filter') + ->will($this->returnValue($filter)); + + $this->twig->addExtension(new AsseticExtension($this->factory, array( + 'some_func' => array( + 'filter' => 'some_filter', + 'options' => array('output' => 'css/*.css'), + ), + ))); + + $xml = $this->renderXml('function.twig'); + $this->assertEquals(1, count($xml->asset)); + $this->assertStringEndsWith('.css', (string) $xml->asset[0]['url']); + } + + /** + * @expectedException Twig_Error + */ + public function testUnclosedTag() + { + $this->renderXml('unclosed_tag.twig'); + } + + private function renderXml($name, $context = array()) + { + return new \SimpleXMLElement($this->twig->loadTemplate($name)->render($context)); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/TwigFormulaLoaderTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/TwigFormulaLoaderTest.php new file mode 100644 index 0000000000..d21f03075b --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/TwigFormulaLoaderTest.php @@ -0,0 +1,107 @@ +markTestSkipped('Twig is not installed.'); + } + + $this->am = $this->getMock('Assetic\\AssetManager'); + $this->fm = $this->getMock('Assetic\\FilterManager'); + + $factory = new AssetFactory(__DIR__.'/templates'); + $factory->setAssetManager($this->am); + $factory->setFilterManager($this->fm); + + $twig = new \Twig_Environment(); + $twig->addExtension(new AsseticExtension($factory, array( + 'some_func' => array( + 'filter' => 'some_filter', + 'options' => array('output' => 'css/*.css'), + ), + ))); + + $this->loader = new TwigFormulaLoader($twig); + } + + public function testMixture() + { + $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); + + $expected = array( + 'mixture' => array( + array('foo', 'foo/*', '@foo'), + array(), + array( + 'output' => 'packed/mixture', + 'name' => 'mixture', + 'debug' => false, + 'combine' => null, + ), + ), + ); + + $resource = $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'); + $resource->expects($this->once()) + ->method('getContent') + ->will($this->returnValue(file_get_contents(__DIR__.'/templates/mixture.twig'))); + $this->am->expects($this->any()) + ->method('get') + ->with('foo') + ->will($this->returnValue($asset)); + + $formulae = $this->loader->load($resource); + $this->assertEquals($expected, $formulae); + } + + public function testFunction() + { + $expected = array( + 'my_asset' => array( + array('path/to/asset'), + array('some_filter'), + array('output' => 'css/*.css', 'name' => 'my_asset'), + ), + ); + + $resource = $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'); + $resource->expects($this->once()) + ->method('getContent') + ->will($this->returnValue(file_get_contents(__DIR__.'/templates/function.twig'))); + + $formulae = $this->loader->load($resource); + $this->assertEquals($expected, $formulae); + } + + public function testUnclosedTag() + { + $resource = $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'); + $resource->expects($this->once()) + ->method('getContent') + ->will($this->returnValue(file_get_contents(__DIR__.'/templates/unclosed_tag.twig'))); + + $formulae = $this->loader->load($resource); + $this->assertEquals(array(), $formulae); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/TwigResourceTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/TwigResourceTest.php new file mode 100644 index 0000000000..771da9f218 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/TwigResourceTest.php @@ -0,0 +1,48 @@ +markTestSkipped('Twig is not installed.'); + } + } + + public function testInvalidTemplateNameGetContent() + { + $loader = $this->getMock('Twig_LoaderInterface'); + $loader->expects($this->once()) + ->method('getSource') + ->with('asdf') + ->will($this->throwException(new \Twig_Error_Loader(''))); + + $resource = new TwigResource($loader, 'asdf'); + $this->assertEquals('', $resource->getContent()); + } + + public function testInvalidTemplateNameIsFresh() + { + $loader = $this->getMock('Twig_LoaderInterface'); + $loader->expects($this->once()) + ->method('isFresh') + ->with('asdf', 1234) + ->will($this->throwException(new \Twig_Error_Loader(''))); + + $resource = new TwigResource($loader, 'asdf'); + $this->assertFalse($resource->isFresh(1234)); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/absolute_path.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/absolute_path.twig new file mode 100644 index 0000000000..05dc382db7 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/absolute_path.twig @@ -0,0 +1,3 @@ + +{% stylesheets '/path/to/something.css' as='foo' %}{% endstylesheets %} + diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/combine.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/combine.twig new file mode 100644 index 0000000000..e1ab5f9e4b --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/combine.twig @@ -0,0 +1,3 @@ + +{% stylesheets 'foo.css' 'bar.css' filter='?foo,bar' output='css/packed.css' debug=true combine=true %}{% endstylesheets %} + diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/debug.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/debug.twig new file mode 100644 index 0000000000..550292ef13 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/debug.twig @@ -0,0 +1,3 @@ + +{% stylesheets 'foo.css' 'bar.css' filter='?foo,bar' output='css/packed.css' debug=true %}{% endstylesheets %} + diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/filters.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/filters.twig new file mode 100644 index 0000000000..d2113847d1 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/filters.twig @@ -0,0 +1,3 @@ + +{% stylesheets 'foo' filter='foo, bar' %}{% endstylesheets %} + diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/function.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/function.twig new file mode 100644 index 0000000000..028419746e --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/function.twig @@ -0,0 +1,3 @@ + + + diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/glob.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/glob.twig new file mode 100644 index 0000000000..4624933a61 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/glob.twig @@ -0,0 +1,3 @@ + +{% stylesheets 'css/src/*' %}{% endstylesheets %} + diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/image.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/image.twig new file mode 100644 index 0000000000..902ecf0c4e --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/image.twig @@ -0,0 +1,3 @@ + +{% image 'images/foo.png' %}{% endimage %} + diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/mixture.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/mixture.twig new file mode 100644 index 0000000000..482e6ece7d --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/mixture.twig @@ -0,0 +1,3 @@ + +{% stylesheets 'foo' 'foo/*' '@foo' output='packed/*' name='mixture' %}{% endstylesheets %} + diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/optional_filter.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/optional_filter.twig new file mode 100644 index 0000000000..4a4dbb6de3 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/optional_filter.twig @@ -0,0 +1,3 @@ + +{% stylesheets 'foo' filter='?foo' %}{% endstylesheets %} + diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/output_pattern.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/output_pattern.twig new file mode 100644 index 0000000000..cf85897641 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/output_pattern.twig @@ -0,0 +1,3 @@ + +{% stylesheets 'foo' output='css/packed/*.css' %}{% endstylesheets %} + diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/output_url.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/output_url.twig new file mode 100644 index 0000000000..51a2a2d65b --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/output_url.twig @@ -0,0 +1,3 @@ + +{% stylesheets 'foo' output='explicit_url.css' %}{% endstylesheets %} + diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/reference.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/reference.twig new file mode 100644 index 0000000000..371c4b7e90 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/reference.twig @@ -0,0 +1,3 @@ + +{% stylesheets '@foo' %}{% endstylesheets %} + diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/unclosed_tag.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/unclosed_tag.twig new file mode 100644 index 0000000000..6c1d30b9df --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/unclosed_tag.twig @@ -0,0 +1,5 @@ + +{% block assets %} +{% stylesheets 'foo.css' 'bar.css' filter='?foo,bar' output='css/packed.css' debug=true %} +{% endblock %} + diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/AssetFactoryTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/AssetFactoryTest.php new file mode 100644 index 0000000000..215e282f69 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/AssetFactoryTest.php @@ -0,0 +1,187 @@ +am = $this->getMock('Assetic\\AssetManager'); + $this->fm = $this->getMock('Assetic\\FilterManager'); + + $this->factory = new AssetFactory(__DIR__); + $this->factory->setAssetManager($this->am); + $this->factory->setFilterManager($this->fm); + } + + public function testNoAssetManagerReference() + { + $this->setExpectedException('LogicException', 'There is no asset manager.'); + + $factory = new AssetFactory('.'); + $factory->createAsset(array('@foo')); + } + + public function testNoAssetManagerNotReference() + { + $factory = new AssetFactory('.'); + $this->assertInstanceOf('Assetic\\Asset\\AssetInterface', $factory->createAsset(array('foo'))); + } + + public function testNoFilterManager() + { + $this->setExpectedException('LogicException', 'There is no filter manager.'); + + $factory = new AssetFactory('.'); + $factory->createAsset(array('foo'), array('foo')); + } + + public function testCreateAssetReference() + { + $referenced = $this->getMock('Assetic\\Asset\\AssetInterface'); + + $this->am->expects($this->any()) + ->method('get') + ->with('jquery') + ->will($this->returnValue($referenced)); + + $assets = $this->factory->createAsset(array('@jquery')); + $arr = iterator_to_array($assets); + $this->assertInstanceOf('Assetic\\Asset\\AssetReference', $arr[0], '->createAsset() creates a reference'); + } + + /** + * @dataProvider getHttpUrls + */ + public function testCreateHttpAsset($sourceUrl) + { + $assets = $this->factory->createAsset(array($sourceUrl)); + $arr = iterator_to_array($assets); + $this->assertInstanceOf('Assetic\\Asset\\HttpAsset', $arr[0], '->createAsset() creates an HTTP asset'); + } + + public function getHttpUrls() + { + return array( + array('http://example.com/foo.css'), + array('https://example.com/foo.css'), + array('//example.com/foo.css'), + ); + } + + public function testCreateFileAsset() + { + $assets = $this->factory->createAsset(array(basename(__FILE__))); + $arr = iterator_to_array($assets); + $this->assertInstanceOf('Assetic\\Asset\\FileAsset', $arr[0], '->createAsset() creates a file asset'); + } + + public function testCreateGlobAsset() + { + $assets = $this->factory->createAsset(array('*')); + $arr = iterator_to_array($assets); + $this->assertInstanceOf('Assetic\\Asset\\FileAsset', $arr[0], '->createAsset() uses a glob to create a file assets'); + } + + public function testCreateAssetCollection() + { + $asset = $this->factory->createAsset(array('*', basename(__FILE__))); + $this->assertInstanceOf('Assetic\\Asset\\AssetCollection', $asset, '->createAsset() creates an asset collection'); + } + + public function testFilter() + { + $this->fm->expects($this->once()) + ->method('get') + ->with('foo') + ->will($this->returnValue($this->getMock('Assetic\\Filter\\FilterInterface'))); + + $asset = $this->factory->createAsset(array(), array('foo')); + $this->assertEquals(1, count($asset->getFilters()), '->createAsset() adds filters'); + } + + public function testInvalidFilter() + { + $this->setExpectedException('InvalidArgumentException'); + + $this->fm->expects($this->once()) + ->method('get') + ->with('foo') + ->will($this->throwException(new \InvalidArgumentException())); + + $asset = $this->factory->createAsset(array(), array('foo')); + } + + public function testOptionalInvalidFilter() + { + $this->factory->setDebug(true); + + $asset = $this->factory->createAsset(array(), array('?foo')); + + $this->assertEquals(0, count($asset->getFilters()), '->createAsset() does not add an optional invalid filter'); + } + + public function testIncludingOptionalFilter() + { + $this->fm->expects($this->once()) + ->method('get') + ->with('foo') + ->will($this->returnValue($this->getMock('Assetic\\Filter\\FilterInterface'))); + + $this->factory->createAsset(array('foo.css'), array('?foo')); + } + + public function testWorkers() + { + $worker = $this->getMock('Assetic\\Factory\\Worker\\WorkerInterface'); + + // called once on the collection and once on each leaf + $worker->expects($this->exactly(3)) + ->method('process') + ->with($this->isInstanceOf('Assetic\\Asset\\AssetInterface')); + + $this->factory->addWorker($worker); + $this->factory->createAsset(array('foo.js', 'bar.js')); + } + + public function testNestedFormula() + { + $this->fm->expects($this->once()) + ->method('get') + ->with('foo') + ->will($this->returnValue($this->getMock('Assetic\\Filter\\FilterInterface'))); + + $inputs = array( + 'css/main.css', + array( + // nested formula + array('css/more.sass'), + array('foo'), + ), + ); + + $asset = $this->factory->createAsset($inputs, array(), array('output' => 'css/*.css')); + + $i = 0; + foreach ($asset as $leaf) { + $i++; + } + + $this->assertEquals(2, $i); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/LazyAssetManagerTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/LazyAssetManagerTest.php new file mode 100644 index 0000000000..46cdf94c2d --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/LazyAssetManagerTest.php @@ -0,0 +1,96 @@ +factory = $this->getMockBuilder('Assetic\\Factory\\AssetFactory') + ->disableOriginalConstructor() + ->getMock(); + + $this->am = new LazyAssetManager($this->factory); + } + + public function testGetFromLoader() + { + $resource = $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'); + $loader = $this->getMock('Assetic\\Factory\\Loader\\FormulaLoaderInterface'); + $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); + + $formula = array( + array('js/core.js', 'js/more.js'), + array('?yui_js'), + array('output' => 'js/all.js') + ); + + $loader->expects($this->once()) + ->method('load') + ->with($resource) + ->will($this->returnValue(array('foo' => $formula))); + $this->factory->expects($this->once()) + ->method('createAsset') + ->with($formula[0], $formula[1], $formula[2] + array('name' => 'foo')) + ->will($this->returnValue($asset)); + + $this->am->setLoader('foo', $loader); + $this->am->addResource($resource, 'foo'); + + $this->assertSame($asset, $this->am->get('foo'), '->get() returns an asset from the loader'); + + // test the "once" expectations + $this->am->get('foo'); + } + + public function testGetResources() + { + $resources = array( + $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'), + $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'), + ); + + $this->am->addResource($resources[0], 'foo'); + $this->am->addResource($resources[1], 'bar'); + + $ret = $this->am->getResources(); + + foreach ($resources as $resource) { + $this->assertTrue(in_array($resource, $ret, true)); + } + } + + public function testGetResourcesEmpty() + { + $this->am->getResources(); + } + + public function testSetFormula() + { + $this->am->setFormula('foo', array()); + $this->am->load(); + $this->assertTrue($this->am->hasFormula('foo'), '->load() does not remove manually added formulae'); + } + + public function testIsDebug() + { + $this->factory->expects($this->once()) + ->method('isDebug') + ->will($this->returnValue(false)); + + $this->assertSame(false, $this->am->isDebug(), '->isDebug() proxies the factory'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/CachedFormulaLoaderTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/CachedFormulaLoaderTest.php new file mode 100644 index 0000000000..5253003b05 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/CachedFormulaLoaderTest.php @@ -0,0 +1,138 @@ +loader = $this->getMock('Assetic\\Factory\\Loader\\FormulaLoaderInterface'); + $this->configCache = $this->getMockBuilder('Assetic\\Cache\\ConfigCache') + ->disableOriginalConstructor() + ->getMock(); + $this->resource = $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'); + } + + public function testNotDebug() + { + $expected = array( + 'foo' => array(array(), array(), array()), + 'bar' => array(array(), array(), array()), + ); + + $this->configCache->expects($this->once()) + ->method('has') + ->with($this->isType('string')) + ->will($this->returnValue(false)); + $this->loader->expects($this->once()) + ->method('load') + ->with($this->resource) + ->will($this->returnValue($expected)); + $this->configCache->expects($this->once()) + ->method('set') + ->with($this->isType('string'), $expected); + + $loader = new CachedFormulaLoader($this->loader, $this->configCache); + $this->assertEquals($expected, $loader->load($this->resource), '->load() returns formulae'); + } + + public function testNotDebugCached() + { + $expected = array( + 'foo' => array(array(), array(), array()), + 'bar' => array(array(), array(), array()), + ); + + $this->configCache->expects($this->once()) + ->method('has') + ->with($this->isType('string')) + ->will($this->returnValue(true)); + $this->resource->expects($this->never()) + ->method('isFresh'); + $this->configCache->expects($this->once()) + ->method('get') + ->with($this->isType('string')) + ->will($this->returnValue($expected)); + + $loader = new CachedFormulaLoader($this->loader, $this->configCache); + $this->assertEquals($expected, $loader->load($this->resource), '->load() returns formulae'); + } + + public function testDebugCached() + { + $timestamp = 123; + $expected = array( + 'foo' => array(array(), array(), array()), + 'bar' => array(array(), array(), array()), + ); + + $this->configCache->expects($this->once()) + ->method('has') + ->with($this->isType('string')) + ->will($this->returnValue(true)); + $this->configCache->expects($this->once()) + ->method('getTimestamp') + ->with($this->isType('string')) + ->will($this->returnValue($timestamp)); + $this->resource->expects($this->once()) + ->method('isFresh') + ->with($timestamp) + ->will($this->returnValue(true)); + $this->loader->expects($this->never()) + ->method('load'); + $this->configCache->expects($this->once()) + ->method('get') + ->with($this->isType('string')) + ->will($this->returnValue($expected)); + + $loader = new CachedFormulaLoader($this->loader, $this->configCache, true); + $this->assertEquals($expected, $loader->load($this->resource), '->load() returns formulae'); + } + + public function testDebugCachedStale() + { + $timestamp = 123; + $expected = array( + 'foo' => array(array(), array(), array()), + 'bar' => array(array(), array(), array()), + ); + + $this->configCache->expects($this->once()) + ->method('has') + ->with($this->isType('string')) + ->will($this->returnValue(true)); + $this->configCache->expects($this->once()) + ->method('getTimestamp') + ->with($this->isType('string')) + ->will($this->returnValue($timestamp)); + $this->resource->expects($this->once()) + ->method('isFresh') + ->with($timestamp) + ->will($this->returnValue(false)); + $this->loader->expects($this->once()) + ->method('load') + ->with($this->resource) + ->will($this->returnValue($expected)); + $this->configCache->expects($this->once()) + ->method('set') + ->with($this->isType('string'), $expected); + + $loader = new CachedFormulaLoader($this->loader, $this->configCache, true); + $this->assertEquals($expected, $loader->load($this->resource), '->load() returns formulae'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/FunctionCallsFormulaLoaderTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/FunctionCallsFormulaLoaderTest.php new file mode 100644 index 0000000000..6b631bf505 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/FunctionCallsFormulaLoaderTest.php @@ -0,0 +1,69 @@ +getMock('Assetic\\Factory\\Resource\\ResourceInterface'); + $factory = $this->getMockBuilder('Assetic\\Factory\\AssetFactory') + ->disableOriginalConstructor() + ->getMock(); + + $resource->expects($this->once()) + ->method('getContent') + ->will($this->returnValue('')); + $factory->expects($this->once()) + ->method('generateAssetName') + ->will($this->returnValue($name)); + + $loader = new FunctionCallsFormulaLoader($factory); + $formulae = $loader->load($resource); + + $this->assertEquals($expected, $formulae); + } + + public function getJavascriptInputs() + { + return array( + array('assetic_javascripts', '"js/core.js"', 'asdf', array('asdf' => array(array('js/core.js'), array(), array('debug' => false, 'output' => 'js/*.js', 'name' => 'asdf', )))), + array('assetic_javascripts', "'js/core.js'", 'asdf', array('asdf' => array(array('js/core.js'), array(), array('debug' => false, 'output' => 'js/*.js', 'name' => 'asdf', )))), + array('assetic_javascripts', "array('js/core.js')", 'asdf', array('asdf' => array(array('js/core.js'), array(), array('debug' => false, 'output' => 'js/*.js', 'name' => 'asdf', )))), + array('assetic_javascripts', 'array("js/core.js")', 'asdf', array('asdf' => array(array('js/core.js'), array(), array('debug' => false, 'output' => 'js/*.js', 'name' => 'asdf', )))), + array('assetic_image', '"images/logo.gif"', 'asdf', array('asdf' => array(array('images/logo.gif'), array(), array('debug' => false, 'output' => 'images/*', 'name' => 'asdf')))), + ); + } + + public function testComplexFormula() + { + $factory = new AssetFactory(__DIR__.'/templates', true); + $loader = new FunctionCallsFormulaLoader($factory); + $resource = new FileResource(__DIR__.'/templates/debug.php'); + $formulae = $loader->load($resource); + + $this->assertEquals(array( + 'test123' => array( + array('foo.css', 'bar.css'), + array('?foo', 'bar'), + array('name' => 'test123', 'output' => 'css/packed.css', 'debug' => true), + ), + ), $formulae); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/templates/debug.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/templates/debug.php new file mode 100644 index 0000000000..750c25d8da --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/templates/debug.php @@ -0,0 +1,8 @@ + + 'test123', 'output' => 'css/packed.css', 'debug' => true)) as $url): ?> + + + diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/CoalescingDirectoryResourceTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/CoalescingDirectoryResourceTest.php new file mode 100644 index 0000000000..d5a333d314 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/CoalescingDirectoryResourceTest.php @@ -0,0 +1,42 @@ +assertEquals(array( + __DIR__.'/Fixtures/dir1/file1.txt', + __DIR__.'/Fixtures/dir1/file2.txt', + __DIR__.'/Fixtures/dir2/file3.txt', + ), $paths, 'files from multiple directories are merged'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/DirectoryResourceTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/DirectoryResourceTest.php new file mode 100644 index 0000000000..ccb073d385 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/DirectoryResourceTest.php @@ -0,0 +1,132 @@ +assertTrue($resource->isFresh(time() + 5)); + $this->assertFalse($resource->isFresh(0)); + } + + /** + * @dataProvider getPatterns + */ + public function testGetContent($pattern) + { + $resource = new DirectoryResource(__DIR__, $pattern); + $content = $resource->getContent(); + + $this->assertInternalType('string', $content); + } + + public function getPatterns() + { + return array( + array(null), + array('/\.php$/'), + array('/\.foo$/'), + ); + } + + /** + * @dataProvider getPatternsAndEmpty + */ + public function testIteration($pattern, $empty) + { + $resource = new DirectoryResource(__DIR__, $pattern); + + $count = 0; + foreach ($resource as $r) { + ++$count; + $this->assertInstanceOf('Assetic\\Factory\\Resource\\ResourceInterface', $r); + } + + if ($empty) { + $this->assertEmpty($count); + } else { + $this->assertNotEmpty($count); + } + } + + public function getPatternsAndEmpty() + { + return array( + array(null, false), + array('/\.php$/', false), + array('/\.foo$/', true), + ); + } + + public function testRecursiveIteration() + { + $resource = new DirectoryResource(realpath(__DIR__.'/..'), '/^'.preg_quote(basename(__FILE__)).'$/'); + + $count = 0; + foreach ($resource as $r) { + ++$count; + } + + $this->assertEquals(1, $count); + } + + /** + * @dataProvider getPaths + */ + public function testTrailingSlash($path) + { + $resource = new DirectoryResource($path); + $this->assertStringEndsWith(DIRECTORY_SEPARATOR, (string) $resource, 'path ends with a slash'); + } + + public function getPaths() + { + return array( + array(__DIR__), + array(__DIR__.DIRECTORY_SEPARATOR), + ); + } + + public function testInvalidDirectory() + { + $resource = new DirectoryResource(__DIR__.'foo'); + $this->assertEquals(0, iterator_count($resource), 'works for non-existent directory'); + } + + public function testFollowSymlinks() + { + // Create the symlink if it doesn't already exist yet (if someone broke the entire testsuite perhaps) + if (!is_dir(__DIR__.'/Fixtures/dir3')) { + symlink(__DIR__.'/Fixtures/dir2', __DIR__.'/Fixtures/dir3'); + } + + $resource = new DirectoryResource(__DIR__.'/Fixtures'); + + $count = 0; + foreach ($resource as $r) { + ++$count; + } + + $this->assertEquals(6, $count); + } + + public function tearDown() + { + if (is_dir(__DIR__.'/Fixtures/dir3')) { + unlink(__DIR__.'/Fixtures/dir3'); + } + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/FileResourceTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/FileResourceTest.php new file mode 100644 index 0000000000..4864c8016e --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/FileResourceTest.php @@ -0,0 +1,42 @@ +assertTrue($resource->isFresh(time() + 5)); + $this->assertFalse($resource->isFresh(0)); + } + + public function testGetContent() + { + $resource = new FileResource(__FILE__); + $this->assertEquals(file_get_contents(__FILE__), $resource->getContent()); + } + + public function testIsFreshOnInvalidPath() + { + $resource = new FileResource(__FILE__.'foo'); + $this->assertFalse($resource->isFresh(time()), '->isFresh() returns false if the file does not exist'); + } + + public function testGetContentOnInvalidPath() + { + $resource = new FileResource(__FILE__.'foo'); + $this->assertSame('', $resource->getContent(), '->getContent() returns an empty string when path is invalid'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir1/file1.txt b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir1/file1.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir1/file2.txt b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir1/file2.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir2/file1.txt b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir2/file1.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir2/file3.txt b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir2/file3.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Worker/EnsureFilterWorkerTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Worker/EnsureFilterWorkerTest.php new file mode 100644 index 0000000000..bdcffe549b --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Worker/EnsureFilterWorkerTest.php @@ -0,0 +1,47 @@ +getMock('Assetic\\Filter\\FilterInterface'); + $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); + + $asset->expects($this->once()) + ->method('getTargetPath') + ->will($this->returnValue('css/main.css')); + $asset->expects($this->once()) + ->method('ensureFilter') + ->with($filter); + + $worker = new EnsureFilterWorker('/\.css$/', $filter); + $worker->process($asset); + } + + public function testNonMatch() + { + $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); + $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); + + $asset->expects($this->once()) + ->method('getTargetPath') + ->will($this->returnValue('js/all.js')); + $asset->expects($this->never())->method('ensureFilter'); + + $worker = new EnsureFilterWorker('/\.css$/', $filter); + $worker->process($asset); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/BaseImageFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/BaseImageFilterTest.php new file mode 100644 index 0000000000..78332599d2 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/BaseImageFilterTest.php @@ -0,0 +1,24 @@ +file($data) : $finfo->buffer($data); + + self::assertEquals($expected, $actual, $message); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CallablesFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CallablesFilterTest.php new file mode 100644 index 0000000000..9dd9952409 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CallablesFilterTest.php @@ -0,0 +1,39 @@ +assertInstanceOf('Assetic\\Filter\\FilterInterface', $filter, 'CallablesFilter implements FilterInterface'); + } + + public function testLoader() + { + $nb = 0; + $filter = new CallablesFilter(function($asset) use (&$nb) { $nb++; }); + $filter->filterLoad($this->getMock('Assetic\\Asset\\AssetInterface')); + $this->assertEquals(1, $nb, '->filterLoad() calls the loader callable'); + } + + public function testDumper() + { + $nb = 0; + $filter = new CallablesFilter(null, function($asset) use (&$nb) { $nb++; }); + $filter->filterDump($this->getMock('Assetic\\Asset\\AssetInterface')); + $this->assertEquals(1, $nb, '->filterDump() calls the loader callable'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CoffeeScriptFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CoffeeScriptFilterTest.php new file mode 100644 index 0000000000..5e2e61970e --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CoffeeScriptFilterTest.php @@ -0,0 +1,48 @@ +markTestSkipped('There is no COFFEE_BIN or NODE_BIN environment variable.'); + } + + $expected = << x * x'); + $asset->load(); + + $filter = new CoffeeScriptFilter($_SERVER['COFFEE_BIN'], $_SERVER['NODE_BIN']); + $filter->filterLoad($asset); + + $this->assertEquals($expected, $asset->getContent()); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CompassFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CompassFilterTest.php new file mode 100644 index 0000000000..4231e8a725 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CompassFilterTest.php @@ -0,0 +1,66 @@ + + * @group integration + */ +class CompassFilterTest extends \PHPUnit_Framework_TestCase +{ + protected function setUp() + { + if (!isset($_SERVER['COMPASS_BIN'])) { + $this->markTestSkipped('There is no COMPASS_BIN environment variable.'); + } + } + + public function testFilterLoadWithScss() + { + $asset = new FileAsset(__DIR__.'/fixtures/compass/stylesheet.scss'); + $asset->load(); + + $filter = new CompassFilter($_SERVER['COMPASS_BIN']); + $filter->filterLoad($asset); + + $this->assertContains('.test-class', $asset->getContent()); + $this->assertContains('font-size: 2em;', $asset->getContent()); + } + + public function testFilterLoadWithSass() + { + $asset = new FileAsset(__DIR__.'/fixtures/compass/stylesheet.sass'); + $asset->load(); + + $filter = new CompassFilter($_SERVER['COMPASS_BIN']); + $filter->filterLoad($asset); + + $this->assertContains('.test-class', $asset->getContent()); + $this->assertContains('font-size: 2em;', $asset->getContent()); + } + + public function testCompassMixin() + { + $asset = new FileAsset(__DIR__.'/fixtures/compass/compass.sass'); + $asset->load(); + + $filter = new CompassFilter($_SERVER['COMPASS_BIN']); + $filter->filterLoad($asset); + + $this->assertContains('text-decoration', $asset->getContent()); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssEmbedFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssEmbedFilterTest.php new file mode 100644 index 0000000000..579abf2734 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssEmbedFilterTest.php @@ -0,0 +1,54 @@ +markTestSkipped('There is no CSSEMBED_JAR environment variable.'); + } + } + + public function testCssEmbedDataUri() + { + $data = base64_encode(file_get_contents(__DIR__.'/fixtures/home.png')); + + $asset = new FileAsset(__DIR__ . '/fixtures/cssembed/test.css'); + $asset->load(); + + $filter = new CssEmbedFilter($_SERVER['CSSEMBED_JAR']); + $filter->filterDump($asset); + + $this->assertContains('url(data:image/png;base64,'.$data, $asset->getContent()); + } + + public function testCssEmbedMhtml() + { + $asset = new FileAsset(__DIR__ . '/fixtures/cssembed/test.css'); + $asset->load(); + + $filter = new CssEmbedFilter($_SERVER['CSSEMBED_JAR']); + $filter->setMhtml(true); + $filter->setMhtmlRoot('/test'); + $filter->filterDump($asset); + + $this->assertContains('url(mhtml:/test/!', $asset->getContent()); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssImportFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssImportFilterTest.php new file mode 100644 index 0000000000..ecde8e15da --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssImportFilterTest.php @@ -0,0 +1,67 @@ +setTargetPath('foo/bar.css'); + $asset->ensureFilter($filter1); + $asset->ensureFilter($filter2); + + $expected = <<assertEquals($expected, $asset->dump(), '->filterLoad() inlines CSS imports'); + } + + /** + * The order of these two filters is only interchangeable because one acts on + * load and the other on dump. We need a more scalable solution. + */ + public function getFilters() + { + return array( + array(new CssImportFilter(), new CssRewriteFilter()), + array(new CssRewriteFilter(), new CssImportFilter()), + ); + } + + public function testNonCssImport() + { + $asset = new FileAsset(__DIR__.'/fixtures/cssimport/noncssimport.css', array(), __DIR__.'/fixtures/cssimport', 'noncssimport.css'); + $asset->load(); + + $filter = new CssImportFilter(); + $filter->filterLoad($asset); + + $this->assertEquals(file_get_contents(__DIR__.'/fixtures/cssimport/noncssimport.css'), $asset->getContent(), '->filterLoad() skips non css'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssMinFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssMinFilterTest.php new file mode 100644 index 0000000000..4ecb20181b --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssMinFilterTest.php @@ -0,0 +1,37 @@ +markTestSkipped('CssMin is not installed.'); + } + } + + public function testRelativeSourceUrlImportImports() + { + $asset = new FileAsset(__DIR__.'/fixtures/cssmin/main.css'); + $asset->load(); + + $filter = new CssMinFilter(__DIR__.'/fixtures/cssmin'); + $filter->setFilter('ImportImports', true); + $filter->filterDump($asset); + + $this->assertEquals('body{color:white}body{background:black}', $asset->getContent()); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssRewriteFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssRewriteFilterTest.php new file mode 100644 index 0000000000..4c497bfb5d --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssRewriteFilterTest.php @@ -0,0 +1,124 @@ +setTargetPath($targetPath); + $asset->load(); + + $filter = new CssRewriteFilter(); + $filter->filterLoad($asset); + $filter->filterDump($asset); + + $this->assertEquals(sprintf($format, $expectedUrl), $asset->getContent(), '->filterDump() rewrites relative urls'); + } + + public function provideUrls() + { + return array( + // url variants + array('body { background: url(%s); }', 'css/body.css', 'css/build/main.css', '../images/bg.gif', '../../images/bg.gif'), + array('body { background: url("%s"); }', 'css/body.css', 'css/build/main.css', '../images/bg.gif', '../../images/bg.gif'), + array('body { background: url(\'%s\'); }', 'css/body.css', 'css/build/main.css', '../images/bg.gif', '../../images/bg.gif'), + + //url with data: + array('body { background: url(\'%s\'); }', 'css/body.css', 'css/build/main.css', 'data:image/png;base64,abcdef=', 'data:image/png;base64,abcdef='), + array('body { background: url(\'%s\'); }', 'css/body.css', 'css/build/main.css', '../images/bg-data:.gif', '../../images/bg-data:.gif'), + + // @import variants + array('@import "%s";', 'css/imports.css', 'css/build/main.css', 'import.css', '../import.css'), + array('@import url(%s);', 'css/imports.css', 'css/build/main.css', 'import.css', '../import.css'), + array('@import url("%s");', 'css/imports.css', 'css/build/main.css', 'import.css', '../import.css'), + array('@import url(\'%s\');', 'css/imports.css', 'css/build/main.css', 'import.css', '../import.css'), + + // path diffs + array('body { background: url(%s); }', 'css/body/bg.css', 'css/build/main.css', '../../images/bg.gif', '../../images/bg.gif'), + array('body { background: url(%s); }', 'css/body.css', 'main.css', '../images/bg.gif', 'css/../images/bg.gif'), // fixme + array('body { background: url(%s); }', 'body.css', 'css/main.css', 'images/bg.gif', '../images/bg.gif'), + array('body { background: url(%s); }', 'source/css/body.css', 'output/build/main.css', '../images/bg.gif', '../../source/images/bg.gif'), + array('body { background: url(%s); }', 'css/body.css', 'css/build/main.css', '//example.com/images/bg.gif', '//example.com/images/bg.gif'), + + // url diffs + array('body { background: url(%s); }', 'css/body.css', 'css/build/main.css', 'http://foo.com/bar.gif', 'http://foo.com/bar.gif'), + array('body { background: url(%s); }', 'css/body.css', 'css/build/main.css', '/images/foo.gif', '/images/foo.gif'), + array('body { background: url(%s); }', 'css/body.css', 'css/build/main.css', 'http://foo.com/images/foo.gif', 'http://foo.com/images/foo.gif'), + ); + } + + /** + * @dataProvider provideMultipleUrls + */ + public function testMultipleUrls($format, $sourcePath, $targetPath, $inputUrl1, $inputUrl2, $expectedUrl1, $expectedUrl2) + { + $asset = new StringAsset(sprintf($format, $inputUrl1, $inputUrl2), array(), null, $sourcePath); + $asset->setTargetPath($targetPath); + $asset->load(); + + $filter = new CssRewriteFilter(); + $filter->filterLoad($asset); + $filter->filterDump($asset); + + $this->assertEquals(sprintf($format, $expectedUrl1, $expectedUrl2), $asset->getContent(), '->filterDump() rewrites relative urls'); + } + + public function provideMultipleUrls() + { + return array( + // multiple url + array('body { background: url(%s); background: url(%s); }', 'css/body.css', 'css/build/main.css', '../images/bg.gif', '../images/bg2.gif', '../../images/bg.gif', '../../images/bg2.gif'), + array("body { background: url(%s);\nbackground: url(%s); }", 'css/body.css', 'css/build/main.css', '../images/bg.gif', '../images/bg2.gif', '../../images/bg.gif', '../../images/bg2.gif'), + + // multiple import + array('@import "%s"; @import "%s";', 'css/imports.css', 'css/build/main.css', 'import.css', 'import2.css', '../import.css', '../import2.css'), + array("@import \"%s\";\n@import \"%s\";", 'css/imports.css', 'css/build/main.css', 'import.css', 'import2.css', '../import.css', '../import2.css'), + + // mixed urls and imports + array('@import "%s"; body { background: url(%s); }', 'css/body.css', 'css/build/main.css', 'import.css', '../images/bg2.gif', '../import.css', '../../images/bg2.gif'), + array("@import \"%s\";\nbody { background: url(%s); }", 'css/body.css', 'css/build/main.css', 'import.css', '../images/bg2.gif', '../import.css', '../../images/bg2.gif'), + ); + } + + public function testNoTargetPath() + { + $content = 'body { background: url(foo.gif); }'; + + $asset = new StringAsset($content); + $asset->load(); + + $filter = new CssRewriteFilter(); + $filter->filterDump($asset); + + $this->assertEquals($content, $asset->getContent(), '->filterDump() urls are not changed without urls'); + } + + public function testExternalSource() + { + $asset = new StringAsset('body { background: url(../images/bg.gif); }', array(), 'http://www.example.com', 'css/main.css'); + $asset->setTargetPath('css/packed/main.css'); + $asset->load(); + + $filter = new CssRewriteFilter(); + $filter->filterDump($asset); + + $this->assertContains('http://www.example.com/css/../images/bg.gif', $asset->getContent(), '->filterDump() rewrites references in external stylesheets'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/FilterCollectionTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/FilterCollectionTest.php new file mode 100644 index 0000000000..277c773bd5 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/FilterCollectionTest.php @@ -0,0 +1,59 @@ +assertInstanceOf('Assetic\\Filter\\FilterInterface', $filter, 'FilterCollection implements FilterInterface'); + } + + public function testEnsure() + { + $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); + $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); + + $filter->expects($this->once())->method('filterLoad'); + + $coll = new FilterCollection(); + $coll->ensure($filter); + $coll->ensure($filter); + $coll->filterLoad($asset); + } + + public function testAll() + { + $filter = new FilterCollection(array( + $this->getMock('Assetic\\Filter\\FilterInterface'), + $this->getMock('Assetic\\Filter\\FilterInterface'), + )); + + $this->assertInternalType('array', $filter->all(), '->all() returns an array'); + } + + public function testEmptyAll() + { + $filter = new FilterCollection(); + $this->assertInternalType('array', $filter->all(), '->all() returns an array'); + } + + public function testCountable() + { + $filters = new FilterCollection(array($this->getMock('Assetic\\Filter\\FilterInterface'))); + + $this->assertEquals(1, count($filters), 'Countable returns the count'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GoogleClosure/CompilerApiFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GoogleClosure/CompilerApiFilterTest.php new file mode 100644 index 0000000000..31bdad00aa --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GoogleClosure/CompilerApiFilterTest.php @@ -0,0 +1,61 @@ +load(); + + $filter = new CompilerApiFilter(); + $filter->setCompilationLevel(CompilerApiFilter::COMPILE_SIMPLE_OPTIMIZATIONS); + $filter->setJsExterns(''); + $filter->setExternsUrl(''); + $filter->setExcludeDefaultExterns(true); + $filter->setFormatting(CompilerApiFilter::FORMAT_PRETTY_PRINT); + $filter->setUseClosureLibrary(false); + $filter->setWarningLevel(CompilerApiFilter::LEVEL_VERBOSE); + + $filter->filterLoad($asset); + $filter->filterDump($asset); + + $this->assertEquals($expected, $asset->getContent()); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GoogleClosure/CompilerJarFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GoogleClosure/CompilerJarFilterTest.php new file mode 100644 index 0000000000..e2d9717e83 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GoogleClosure/CompilerJarFilterTest.php @@ -0,0 +1,55 @@ +markTestSkipped('There is no CLOSURE_JAR environment variable.'); + } + + $input = <<load(); + + $filter = new CompilerJarFilter($_SERVER['CLOSURE_JAR']); + $filter->filterLoad($asset); + $filter->filterDump($asset); + + $this->assertEquals($expected, $asset->getContent()); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JpegoptimFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JpegoptimFilterTest.php new file mode 100644 index 0000000000..d0a67612b9 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JpegoptimFilterTest.php @@ -0,0 +1,45 @@ +markTestSkipped('No jpegoptim configuration.'); + } + + $this->filter = new JpegoptimFilter($_SERVER['JPEGOPTIM_BIN']); + } + + public function testFilter() + { + $asset = new FileAsset(__DIR__.'/fixtures/home.jpg'); + $asset->load(); + + $before = $asset->getContent(); + $this->filter->filterDump($asset); + + $this->assertNotEmpty($asset->getContent(), '->filterLoad() sets content'); + $this->assertNotEquals($before, $asset->getContent(), '->filterDump() changes the content'); + $this->assertMimeType('image/jpeg', $asset->getContent(), '->filterDump() creates JPEG data'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JpegtranFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JpegtranFilterTest.php new file mode 100644 index 0000000000..10245f686a --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JpegtranFilterTest.php @@ -0,0 +1,45 @@ +markTestSkipped('No jpegtran configuration.'); + } + + $this->filter = new JpegtranFilter($_SERVER['JPEGTRAN_BIN']); + } + + public function testFilter() + { + $asset = new FileAsset(__DIR__.'/fixtures/home.jpg'); + $asset->load(); + + $before = $asset->getContent(); + $this->filter->filterDump($asset); + + $this->assertNotEmpty($asset->getContent(), '->filterLoad() sets content'); + $this->assertNotEquals($before, $asset->getContent(), '->filterDump() changes the content'); + $this->assertMimeType('image/jpeg', $asset->getContent(), '->filterDump() creates JPEG data'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/LessFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/LessFilterTest.php new file mode 100644 index 0000000000..41719902a3 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/LessFilterTest.php @@ -0,0 +1,63 @@ +markTestSkipped('No node.js configuration.'); + } + + $this->filter = new LessFilter($_SERVER['NODE_BIN'], array($_SERVER['NODE_PATH'])); + } + + public function testFilterLoad() + { + $asset = new StringAsset('.foo{.bar{width:1+1;}}'); + $asset->load(); + + $this->filter->filterLoad($asset); + + $this->assertEquals(".foo .bar {\n width: 2;\n}\n", $asset->getContent(), '->filterLoad() parses the content'); + } + + public function testImport() + { + $expected = <<load(); + + $this->filter->filterLoad($asset); + + $this->assertEquals($expected, $asset->getContent(), '->filterLoad() sets an include path based on source url'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/LessphpFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/LessphpFilterTest.php new file mode 100644 index 0000000000..e55ae6643f --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/LessphpFilterTest.php @@ -0,0 +1,31 @@ +markTestSkipped('No lessphp configuration.'); + } + + $this->filter = new LessphpFilter(); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/OptiPngFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/OptiPngFilterTest.php new file mode 100644 index 0000000000..c2f72c7d6c --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/OptiPngFilterTest.php @@ -0,0 +1,56 @@ +markTestSkipped('No OptiPNG configuration.'); + } + + $this->filter = new OptiPngFilter($_SERVER['OPTIPNG_BIN']); + } + + /** + * @dataProvider getImages + */ + public function testFilter($image) + { + $asset = new FileAsset($image); + $asset->load(); + + $before = $asset->getContent(); + $this->filter->filterDump($asset); + + $this->assertNotEmpty($asset->getContent(), '->filterDump() sets content'); + $this->assertNotEquals($before, $asset->getContent(), '->filterDump() changes the content'); + $this->assertMimeType('image/png', $asset->getContent(), '->filterDump() creates PNG data'); + } + + public function getImages() + { + return array( + array(__DIR__.'/fixtures/home.gif'), + array(__DIR__.'/fixtures/home.png'), + ); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PackagerFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PackagerFilterTest.php new file mode 100644 index 0000000000..7dcdaa07d0 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PackagerFilterTest.php @@ -0,0 +1,69 @@ +markTestSkipped('Packager is not available.'); + } + } + + public function testPackager() + { + $expected = <<load(); + + $filter = new PackagerFilter(); + $filter->addPackage(__DIR__.'/fixtures/packager/lib'); + $filter->filterLoad($asset); + + $this->assertEquals($expected, $asset->getContent(), '->filterLoad() runs packager'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PngoutFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PngoutFilterTest.php new file mode 100644 index 0000000000..23c07129c0 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PngoutFilterTest.php @@ -0,0 +1,57 @@ +markTestSkipped('No pngout configuration.'); + } + + $this->filter = new PngoutFilter($_SERVER['PNGOUT_BIN']); + } + + /** + * @dataProvider getImages + */ + public function testFilter($image) + { + $asset = new FileAsset($image); + $asset->load(); + + $before = $asset->getContent(); + $this->filter->filterDump($asset); + + $this->assertNotEmpty($asset->getContent(), '->filterLoad() sets content'); + $this->assertNotEquals($before, $asset->getContent(), '->filterLoad() changes the content'); + $this->assertMimeType('image/png', $asset->getContent(), '->filterLoad() creates PNG data'); + } + + public function getImages() + { + return array( + array(__DIR__.'/fixtures/home.gif'), + array(__DIR__.'/fixtures/home.jpg'), + array(__DIR__.'/fixtures/home.png'), + ); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Sass/SassFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Sass/SassFilterTest.php new file mode 100644 index 0000000000..874e5911ca --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Sass/SassFilterTest.php @@ -0,0 +1,70 @@ +markTestSkipped('There is no SASS_BIN environment variable.'); + } + + $this->filter = new SassFilter($_SERVER['SASS_BIN']); + } + + public function testSass() + { + $input = <<load(); + + $this->filter->setStyle(SassFilter::STYLE_COMPACT); + $this->filter->filterLoad($asset); + + $this->assertEquals("body { color: red; }\n", $asset->getContent(), '->filterLoad() parses the sass'); + } + + public function testScssGuess() + { + $input = <<<'EOF' +$red: #F00; + +.foo { + color: $red; +} + +EOF; + + $expected = '.foo { color: red; }'; + + $asset = new StringAsset($input, array(), null, 'foo.scss'); + $asset->load(); + + $this->filter->setStyle(SassFilter::STYLE_COMPACT); + $this->filter->filterLoad($asset); + + $this->assertEquals(".foo { color: red; }\n", $asset->getContent(), '->filterLoad() detects SCSS based on source path extension'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Sass/ScssFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Sass/ScssFilterTest.php new file mode 100644 index 0000000000..a08fe0e6ba --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Sass/ScssFilterTest.php @@ -0,0 +1,44 @@ +markTestSkipped('There is no SASS_BIN environment variable.'); + } + + $asset = new FileAsset(__DIR__.'/../fixtures/sass/main.scss'); + $asset->load(); + + $filter = new ScssFilter($_SERVER['SASS_BIN']); + $filter->setStyle(ScssFilter::STYLE_COMPACT); + $filter->filterLoad($asset); + + $expected = <<assertEquals($expected, $asset->getContent(), '->filterLoad() loads imports'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/SprocketsFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/SprocketsFilterTest.php new file mode 100644 index 0000000000..8694dc5e56 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/SprocketsFilterTest.php @@ -0,0 +1,69 @@ +markTestSkipped('There is no sprockets configuration.'); + } + + $this->assetRoot = sys_get_temp_dir().'/assetic_sprockets'; + if (is_dir($this->assetRoot)) { + $this->cleanup(); + } else { + mkdir($this->assetRoot); + } + } + + protected function tearDown() + { + $this->cleanup(); + } + + private function cleanup() + { + $it = new \RecursiveDirectoryIterator($this->assetRoot); + foreach (new \RecursiveIteratorIterator($it) as $path => $file) { + if (is_file($path)) { + unlink($path); + } + } + } + + public function testFilterLoad() + { + $asset = new FileAsset(__DIR__.'/fixtures/sprockets/main.js'); + $asset->load(); + + $filter = new SprocketsFilter($_SERVER['SPROCKETS_LIB'], $_SERVER['RUBY_BIN']); + $filter->addIncludeDir(__DIR__.'/fixtures/sprockets/lib1'); + $filter->addIncludeDir(__DIR__.'/fixtures/sprockets/lib2'); + $filter->setAssetRoot($this->assetRoot); + $filter->filterLoad($asset); + + $this->assertContains('/* header.js */', $asset->getContent()); + $this->assertContains('/* include.js */', $asset->getContent()); + $this->assertContains('/* footer.js */', $asset->getContent()); + $this->assertFileExists($this->assetRoot.'/images/image.gif'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/StylusFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/StylusFilterTest.php new file mode 100644 index 0000000000..03fc729449 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/StylusFilterTest.php @@ -0,0 +1,53 @@ +markTestSkipped('No node.js configuration.'); + } + + $this->filter = new StylusFilter($_SERVER['NODE_BIN'], array($_SERVER['NODE_PATH'])); + } + + public function testFilterLoad() + { + $asset = new StringAsset("body\n font 12px Helvetica, Arial, sans-serif\n color black"); + $asset->load(); + + $this->filter->filterLoad($asset); + + $this->assertEquals("body {\n font: 12px Helvetica, Arial, sans-serif;\n color: #000;\n}\n", $asset->getContent(), '->filterLoad() parses the content'); + } + + public function testFilterLoadWithCompression() + { + $asset = new StringAsset("body\n font 12px Helvetica, Arial, sans-serif\n color black;"); + $asset->load(); + + $this->filter->setCompress(true); + $this->filter->filterLoad($asset); + + $this->assertEquals("body{font:12px Helvetica,Arial,sans-serif;color:#000}\n", $asset->getContent(), '->filterLoad() parses the content and compress it'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/BaseCompressorFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/BaseCompressorFilterTest.php new file mode 100644 index 0000000000..39491b10b4 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/BaseCompressorFilterTest.php @@ -0,0 +1,31 @@ +assertInstanceOf('Assetic\\Filter\\FilterInterface', $filter, 'BaseCompressorFilter implements FilterInterface'); + } +} + +class YuiCompressorFilterForTest extends BaseCompressorFilter +{ + public function filterDump(AssetInterface $asset) + { + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/CssCompressorFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/CssCompressorFilterTest.php new file mode 100644 index 0000000000..61f9fd8480 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/CssCompressorFilterTest.php @@ -0,0 +1,23 @@ +assertInstanceOf('Assetic\\Filter\\FilterInterface', $filter, 'CssCompressorFilter implements FilterInterface'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/JsCompressorFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/JsCompressorFilterTest.php new file mode 100644 index 0000000000..c3918371e8 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/JsCompressorFilterTest.php @@ -0,0 +1,62 @@ +assertInstanceOf('Assetic\\Filter\\FilterInterface', $filter, 'JsCompressorFilter implements FilterInterface'); + } + + /** + * @group integration + */ + public function testFilterDump() + { + if (!isset($_SERVER['YUI_COMPRESSOR_JAR'])) { + $this->markTestSkipped('There is no YUI_COMPRESSOR_JAR environment variable.'); + } + + $source = <<load(); + + $filter = new JsCompressorFilter($_SERVER['YUI_COMPRESSOR_JAR']); + $filter->filterDump($asset); + + $this->assertEquals($expected, $asset->getContent(), '->filterDump()'); + } +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/compass.sass b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/compass.sass new file mode 100644 index 0000000000..dfc99fbdcd --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/compass.sass @@ -0,0 +1,4 @@ +@import "compass/typography/links/hover-link" + +a + @include hover-link diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/partials/_sass.sass b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/partials/_sass.sass new file mode 100644 index 0000000000..8593aabdcc --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/partials/_sass.sass @@ -0,0 +1,4 @@ +@import "compass/utilities" + +@mixin mixin-test($fontSize: 1em) + font-size: $fontSize \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/partials/_scss.scss b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/partials/_scss.scss new file mode 100644 index 0000000000..896ba5b691 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/partials/_scss.scss @@ -0,0 +1,6 @@ +@import "compass/utilities"; + +@mixin mixin-test($fontSize: 1em) +{ + font-size: $fontSize; +} \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/stylesheet.sass b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/stylesheet.sass new file mode 100644 index 0000000000..569d84eb2d --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/stylesheet.sass @@ -0,0 +1,4 @@ +@import "partials/sass" + +.test-class + @include mixin-test(2em) \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/stylesheet.scss b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/stylesheet.scss new file mode 100644 index 0000000000..461884c965 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/stylesheet.scss @@ -0,0 +1,6 @@ +@import "partials/scss"; + +.test-class +{ + @include mixin-test(2em); +} \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssembed/test.css b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssembed/test.css new file mode 100644 index 0000000000..370982ceaa --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssembed/test.css @@ -0,0 +1,4 @@ +.test +{ + background: url(../home.png); +} \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/import.css b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/import.css new file mode 100644 index 0000000000..e2c77fee35 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/import.css @@ -0,0 +1,2 @@ +/* import.css */ +body { color: red; } \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/main.css b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/main.css new file mode 100644 index 0000000000..1a90d49ab2 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/main.css @@ -0,0 +1,4 @@ +/* main.css */ +@import "import.css"; +@import url('more/evenmore/deep1.css'); +body { color: black; } \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more.sass b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more.sass new file mode 100644 index 0000000000..1463b1683f --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more.sass @@ -0,0 +1 @@ +/* more.sass */ \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/bg.gif b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/bg.gif new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/deep1.css b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/deep1.css new file mode 100644 index 0000000000..433b34153d --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/deep1.css @@ -0,0 +1,2 @@ +/* more/evenmore/deep1.css */ +@import url(deep2.css); \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/deep2.css b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/deep2.css new file mode 100644 index 0000000000..645a40eb0f --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/deep2.css @@ -0,0 +1,4 @@ +/* more/evenmore/deep2.css */ +body { + background: url(bg.gif); +} \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/noncssimport.css b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/noncssimport.css new file mode 100644 index 0000000000..2cea30f013 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/noncssimport.css @@ -0,0 +1,2 @@ +/* noncssimport.css */ +@import "more.sass"; \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssmin/fonts.css b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssmin/fonts.css new file mode 100644 index 0000000000..2d135f6008 --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssmin/fonts.css @@ -0,0 +1,3 @@ +body { + color: white; +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssmin/main.css b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssmin/main.css new file mode 100644 index 0000000000..8fbabc82dd --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssmin/main.css @@ -0,0 +1,5 @@ +@import url("fonts.css"); + +body { + background: black; +} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/home.gif b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/home.gif new file mode 100644 index 0000000000000000000000000000000000000000..edda5603d352c0483c577cf208db53cb7ef13471 GIT binary patch literal 61 zcmZ?wbhEHbC5UDGKfoZ!!NA49#mp$kz$D1XEXer(2tzUh z12fQ#NPvZdlaUdL4`vDgJ)(FaTYrk~7(Q*CwD^^RPU!s(ss;rnA{dE zWm7n%vc#{t^UjVq7gtTUzPeu5Bi)x&rzUu6dWpB+d|UL+X^LIIZ{AzM`{!+8Zr}AY cVT#W6n0+f4v7|ftIx;YR|DNig)WpGT%PfAtr%uP&B4N6T+sVqF1Y6Dc{<>}%WQgJKk&;S4S%ti^{?(UXy z`G5C~Oqb5N7GFUtX;;NvEW0Fx^;}V5n3!A`8LR<&whSHs literal 0 HcmV?d00001 diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/lib1/header.js b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/lib1/header.js new file mode 100644 index 0000000000..c60f8d540a --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/lib1/header.js @@ -0,0 +1,3 @@ +/* header.js */ + +//= provide "assets" diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/lib2/footer.js b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/lib2/footer.js new file mode 100644 index 0000000000..5ce2b9c48a --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/lib2/footer.js @@ -0,0 +1 @@ +/* footer.js */ diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/main.js b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/main.js new file mode 100644 index 0000000000..6ea483ac4f --- /dev/null +++ b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/main.js @@ -0,0 +1,5 @@ +//= require
+ +//= require "include" + +//= require