diff --git a/.bowerrc b/.bowerrc new file mode 100644 index 0000000..fce70af --- /dev/null +++ b/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "vendor/bower" +} diff --git a/.gitignore b/.gitignore index 93c6fc6..9701bd7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ /build *~ .*~ +.idea/ diff --git a/.idea/resume.iml b/.idea/resume.iml index 3302c79..3bb906b 100644 --- a/.idea/resume.iml +++ b/.idea/resume.iml @@ -42,12 +42,12 @@ - + - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index bf892d6..e0d660d 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,16 +2,88 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -24,7 +96,6 @@ - @@ -33,55 +104,76 @@ - - + + - - + + - + - - + + - - - + + + + + - - + + - - - + + + + + - - + + - - - + + + + + - - + + - - - + + + + + + + + + + + + + + + + + + @@ -94,14 +186,25 @@ @@ -113,10 +216,10 @@ - @@ -143,6 +246,7 @@ + @@ -171,7 +275,7 @@ @@ -193,6 +297,28 @@ - + + + - - + project + + + + + @@ -319,32 +473,38 @@ - - + - - - - + + + + + - + + + + + - - + + @@ -369,6 +529,14 @@ + + + + @@ -377,60 +545,181 @@ - + - - - - - - - - - - - - - - - - - - - + + + + + - + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..670d092 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,46 @@ +module.exports = function (grunt) { + + grunt.initConfig({ + bower: { + dist: { + dest: 'web/js/vendor', + options: { + checkExistence: false, + debugging: true, + paths: { + bowerDirectory: 'vendor/bower', + bowerrc: '.bowerrc', + bowerJson: 'bower.json' + } + } + } + }, + less: { + build: { + options: { + plugins: [new (require('less-plugin-autoprefix'))({browsers: ["last 3 versions"]}),], + paths: [ + 'vendor/bower/uikit/less', + 'src/Sikofitt/less' + ], + strictImports: true, + compress: true + }, + files: { + 'web/css/resume.min.css': 'src/Sikofitt/less/resume.less' + } + } + } + }); + + + + + grunt.loadNpmTasks('grunt-contrib-less'); + grunt.loadNpmTasks('main-bower-files'); + grunt.loadNpmTasks('grunt-phpunit'); + + grunt.registerTask('dist', ['bower', 'less']); + grunt.registerTask('default', 'dist'); + +}; \ No newline at end of file diff --git a/app/App.php b/app/App.php new file mode 100644 index 0000000..556d4db --- /dev/null +++ b/app/App.php @@ -0,0 +1,73 @@ +getFileName()); + } + + /** + * Returns the root directory of the application. + * + * @return string + * The root directory of the application. + */ + public function getRootDirectory() { + return dirname($this->getAppDirectory()); + } + + /** + * @return string + */ + public function getConfDirectory() { + return $this->getAppDirectory() . '/config'; + } + + /** + * @return string + */ + public function getDataDirectory() { + return $this->getRootDirectory() . '/data'; + } + + /** + * @return string + */ + public function getResumeJson() { + return $this->getDataDirectory() . '/resume.json'; + } + + /** + * @return string + */ + public function getResumeSchema() { + return $this->getDataDirectory() . '/resume.schema.json'; + } + + /** + * @return \Noodlehaus\Config + */ + public function conf2() { + return Noodlehaus\Config::load($this->getConfDirectory()); + } +} + diff --git a/config/config.yml b/app/config/config.yml similarity index 100% rename from config/config.yml rename to app/config/config.yml diff --git a/app/config/default/config.php b/app/config/default/config.php new file mode 100644 index 0000000..1e0fc24 --- /dev/null +++ b/app/config/default/config.php @@ -0,0 +1,5 @@ + 'neat', +]; \ No newline at end of file diff --git a/views/base.html.twig b/app/views/base.html.twig similarity index 100% rename from views/base.html.twig rename to app/views/base.html.twig diff --git a/app/views/hidden.html.twig b/app/views/hidden.html.twig new file mode 100644 index 0000000..e69de29 diff --git a/app/views/recaptcha.html.twig b/app/views/recaptcha.html.twig new file mode 100644 index 0000000..e69de29 diff --git a/app/views/resume.html.twig b/app/views/resume.html.twig new file mode 100644 index 0000000..e69de29 diff --git a/bin/build b/bin/build deleted file mode 100755 index e727003..0000000 --- a/bin/build +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -PHP=`which php` -GIT=`which git` -DIR=`$PHP -r "echo dirname(dirname(realpath('$0')));"` - -if [ ! -d "$DIR/build" ]; then - mkdir -p $DIR/build -fi - -cd $DIR/build - -if [ ! -f "composer.phar" ]; then - curl -s http://getcomposer.org/installer 2>/dev/null | $PHP >/dev/null 2>/dev/null -else - $PHP composer.phar self-update >/dev/null 2>/dev/null -fi - -for TYPE in slim fat -do - if [ -d "$DIR/build/skeleton" ]; then - rm -rf $DIR/build/skeleton - fi - mkdir -p $DIR/build/skeleton - - cd "$DIR/build/skeleton" - - mkdir -p web/ - COMPOSER=$TYPE"_composer.json" - cp $DIR/bin/skeleton/$COMPOSER composer.json - cp $DIR/bin/skeleton/index.php web/index.php - - $PHP ../composer.phar install -q - - if [ -d "$DIR/build/tmp/silex" ]; then - rm -rf $DIR/build/tmp/silex - fi - mkdir -p $DIR/build/tmp/silex - - cd "$DIR/build/tmp/silex" - cp -r ../../skeleton/* . - - find . -name .DS_Store | xargs rm -rf - - find . -name .git | xargs rm -rf - - find . -name phpunit.xml.* | xargs rm -rf - - find . -type d -name Tests | xargs rm -rf - - find . -type d -name test* | xargs rm -rf - - find . -type d -name doc | xargs rm -rf - - find . -type d -name ext | xargs rm -rf - - - export COPY_EXTENDED_ATTRIBUTES_DISABLE=true - export COPYFILE_DISABLE=true - - cd "$DIR/build/tmp" - - if [ "slim" = "$TYPE" ]; then - NAME="silex" - else - NAME="silex_fat" - fi - - rm -f "$DIR/build/$NAME.*" - tar zcpf "$DIR/build/$NAME.tgz" silex - zip -rq "$DIR/build/$NAME.zip" silex - rm -rf "$DIR/build/tmp" - rm -rf "$DIR/build/skeleton" -done diff --git a/bin/console b/bin/console old mode 100644 new mode 100755 index 263d0b5..728a6b7 --- a/bin/console +++ b/bin/console @@ -1,10 +1,13 @@ #!/usr/bin/env php getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev'); @@ -26,5 +30,5 @@ if ($debug) { //$kernel = new AppKernel($env, $debug); $application = new Application(); -$application->add(new \Symfony\Bundle\FrameworkBundle\Command\ServerRunCommand()); +$application->add(new SchemaValidationCommand()); $application->run($input); diff --git a/bin/skeleton/fat_composer.json b/bin/skeleton/fat_composer.json deleted file mode 100644 index 4495d4f..0000000 --- a/bin/skeleton/fat_composer.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "require": { - "silex/silex": "~1.1", - "symfony/browser-kit": "~2.3", - "symfony/console": "~2.3", - "symfony/config": "~2.3", - "symfony/css-selector": "~2.3", - "symfony/dom-crawler": "~2.3", - "symfony/filesystem": "~2.3", - "symfony/finder": "~2.3", - "symfony/form": "~2.3", - "symfony/locale": "~2.3", - "symfony/process": "~2.3", - "symfony/security": "~2.3", - "symfony/serializer": "~2.3", - "symfony/translation": "~2.3", - "symfony/validator": "~2.3", - "symfony/monolog-bridge": "~2.3", - "symfony/twig-bridge": "~2.3", - "doctrine/dbal": ">=2.2.0,<2.4.0-dev", - "swiftmailer/swiftmailer": "5.*" - } -} diff --git a/bin/skeleton/index.php b/bin/skeleton/index.php deleted file mode 100644 index 683c610..0000000 --- a/bin/skeleton/index.php +++ /dev/null @@ -1,11 +0,0 @@ -get('/hello', function () { - return 'Hello!'; -}); - -$app->run(); diff --git a/bin/skeleton/slim_composer.json b/bin/skeleton/slim_composer.json deleted file mode 100644 index df5ed00..0000000 --- a/bin/skeleton/slim_composer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "require": { - "silex/silex": "~1.1" - } -} diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..0ef215f --- /dev/null +++ b/bower.json @@ -0,0 +1,52 @@ +{ + "name": "resume", + "authors": [ + "sikofitt " + ], + "description": "PHP implementation of resume.json", + "main": "", + "license": "GPL-3.0", + "homepage": "code.reric.me", + "private": true, + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "vendor/bower", + "test", + "tests" + ], + "dependencies": { + "uikit": "^2.26.3", + "html5shiv": "^3.7.3", + "respond": "^1.4.2" + }, + "overrides": { + "uikit": { + "main": [ + "**/uikit.min.js", + "**/tooltip.min.js", + "**/lightbox.min.js", + "**/smooth-scroll.min.js", + "**/scrollspy.min.js", + "**/parallax.min.js", + "**/offcanvas.min.js" + ] + }, + "jquery": { + "main": [ + "**/jquery.min.js" + ] + }, + "respond": { + "main": [ + "**/respond.min.js" + ] + }, + "html5shiv": { + "main": [ + "**/html5shiv.min.js" + ] + } + } +} diff --git a/composer.json b/composer.json index 16a9806..feb2f85 100644 --- a/composer.json +++ b/composer.json @@ -1,81 +1,56 @@ { - "name": "silex/silex", - "description": "The PHP micro-framework based on the Symfony Components", - "keywords": ["microframework"], - "homepage": "http://silex.sensiolabs.org", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - } - ], - "require": { - "php": ">=5.5.9", - "pimple/pimple": "~3.0", - "symfony/event-dispatcher": "~2.8|^3.0", - "symfony/http-foundation": "~2.8|^3.0", - "symfony/http-kernel": "~2.8|^3.0", - "symfony/routing": "~2.8|^3.0", - "knplabs/knp-snappy": "^0.4.3", - "h4cc/wkhtmltopdf-amd64": "0.12.x", - "h4cc/wkhtmltoimage-amd64": "0.12.x", - "webmozart/json": "^1.2", - "symfony/yaml": "^3.1", - "monolog/monolog": "^1.20", - "symfony/monolog-bridge": "^3.1", - "google/recaptcha": "^1.1", - "hassankhan/config": "^0.10.0", - "groovey/config": "dev-master" - }, - "require-dev": { - "symfony/asset": "~2.8|^3.0", - "symfony/expression-language": "~2.8|^3.0", - "symfony/security": "~2.8|^3.0", - "symfony/form": "~2.8|^3.0", - "symfony/browser-kit": "~2.8|^3.0", - "symfony/css-selector": "~2.8|^3.0", - "symfony/debug": "~2.8|^3.0", - "symfony/dom-crawler": "~2.8|^3.0", - "symfony/finder": "~2.8|^3.0", - "symfony/intl": "~2.8|^3.0", - "symfony/doctrine-bridge": "~2.8|^3.0", - "symfony/options-resolver": "~2.8|^3.0", - "symfony/phpunit-bridge": "~2.8|^3.0", - "symfony/process": "~2.8|^3.0", - "symfony/serializer": "~2.8|^3.0", - "symfony/translation": "~2.8|^3.0", - "symfony/twig-bridge": "~2.8|^3.0", - "symfony/validator": "~2.8|^3.0", - "symfony/var-dumper": "^3.1", - "twig/twig": "~1.8|~2.0", - "doctrine/dbal": "~2.2", - "swiftmailer/swiftmailer": "~5", - "symfony/console": "^3.1", - "texthtml/whoops-silex": "^1.0", - "symfony/framework-bundle": "^3.1" - }, - "replace": { - "silex/api": "v2.0.2", - "silex/providers": "v2.0.2" - }, - "autoload": { - "psr-4": { - "Silex\\": "src/Silex", - "Sikofitt\\": "src/Sikofitt" - } - }, - "autoload-dev" : { - "psr-4": { "Silex\\Tests\\" : "tests/Silex/Tests" } - }, - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "minimum-stability": "dev" + "name": "sikofitt/resumejson", + "description": "PHP implementation of resume.json", + "keywords": [ + "resume.json", + "resume", + "resume.json", + "php", + "silex" + ], + "homepage": "http://resume.reric.me/about/resume", + "license": "GPL-3.0", + "authors": [ + { + "name": "R. Eric Wheeler", + "email": "sikofitt@gmail.com", + "homepage": "https://code.reric.me" + } + ], + "require": { + "php": ">=5.6.0", + "silex/silex": "~2.0", + "symfony/form": "~2.8|^3.0", + "symfony/validator": "~2.8|^3.0", + "symfony/intl": "~2.8|^3.0", + "symfony/asset": "~2.8|^3.0", + "symfony/translation": "~2.8|^3.0", + "symfony/yaml": "^3.1", + "twig/twig": "~1.8|~2.0", + "symfony/twig-bridge": "~2.8|^3.0", + "swiftmailer/swiftmailer": "~5", + "symfony/swiftmailer-bridge": "~2.1", + "knplabs/knp-snappy": "^0.4.3", + "h4cc/wkhtmltopdf-amd64": "0.12.x", + "h4cc/wkhtmltoimage-amd64": "0.12.x", + "webmozart/json": "^1.2", + "monolog/monolog": "^1.20", + "symfony/monolog-bridge": "^3.1", + "google/recaptcha": "^1.1", + "hassankhan/config": "^0.10.0" + }, + "require-dev": { + "symfony/debug": "~2.8|^3.0", + "symfony/phpunit-bridge": "~2.8|^3.0", + "symfony/process": "~2.8|^3.0", + "symfony/serializer": "~2.8|^3.0", + "symfony/var-dumper": "^3.1", + "symfony/console": "^3.1", + "texthtml/whoops-silex": "^1.0" + }, + "autoload": { + "psr-4": { + "Sikofitt\\": "src/Sikofitt" + } + } } diff --git a/composer.lock b/composer.lock index 77b0152..888396e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,88 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "6b9330a38c1159ea3114ad19b4e04a4f", - "content-hash": "713ed9d1dc5f1a5a9a6ff1d4b7804942", + "hash": "bff507b41d23db26ac64f22c144abe58", + "content-hash": "fca3e43ff787d71afd6f495624a8bf9c", "packages": [ - { - "name": "doctrine/inflector", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "803a2ed9fea02f9ca47cd45395089fe78769a392" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/803a2ed9fea02f9ca47cd45395089fe78769a392", - "reference": "803a2ed9fea02f9ca47cd45395089fe78769a392", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "4.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\Inflector\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "inflection", - "pluralize", - "singularize", - "string" - ], - "time": "2016-05-12 17:23:41" - }, { "name": "google/recaptcha", - "version": "dev-master", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/google/recaptcha.git", - "reference": "f3390c376129f84d22734df1f94cc7db25006bbc" + "reference": "2b7e00566afca82a38a1d3adb8e42c118006296e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/google/recaptcha/zipball/f3390c376129f84d22734df1f94cc7db25006bbc", - "reference": "f3390c376129f84d22734df1f94cc7db25006bbc", + "url": "https://api.github.com/repos/google/recaptcha/zipball/2b7e00566afca82a38a1d3adb8e42c118006296e", + "reference": "2b7e00566afca82a38a1d3adb8e42c118006296e", "shasum": "" }, "require": { @@ -117,52 +50,7 @@ "recaptcha", "spam" ], - "time": "2015-12-28 18:03:30" - }, - { - "name": "groovey/config", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/groovey/Config.git", - "reference": "c30bca2bbe1f9f4e7f789bb69e14265da89dd359" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/groovey/Config/zipball/c30bca2bbe1f9f4e7f789bb69e14265da89dd359", - "reference": "c30bca2bbe1f9f4e7f789bb69e14265da89dd359", - "shasum": "" - }, - "require": { - "illuminate/config": "~5.2", - "illuminate/filesystem": "~5.2", - "silex/silex": "~2.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Groovey\\Config\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Harold Kim Cantil", - "email": "pokoot@gmail.com" - } - ], - "description": "A Silex 2 service provider that uses the Laravel's config component.", - "keywords": [ - "config", - "laravel", - "laravel config", - "silex", - "silex 2" - ], - "time": "2016-06-30 14:29:37" + "time": "2015-09-02 17:23:59" }, { "name": "h4cc/wkhtmltoimage-amd64", @@ -301,201 +189,6 @@ ], "time": "2016-02-11 16:21:17" }, - { - "name": "illuminate/config", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/illuminate/config.git", - "reference": "37f3abf242a031220d3e5d5b7a089c42a1f56ec7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/config/zipball/37f3abf242a031220d3e5d5b7a089c42a1f56ec7", - "reference": "37f3abf242a031220d3e5d5b7a089c42a1f56ec7", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.4.*", - "illuminate/filesystem": "5.4.*", - "illuminate/support": "5.4.*", - "php": ">=5.6.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.4-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Config\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" - } - ], - "description": "The Illuminate Config package.", - "homepage": "http://laravel.com", - "time": "2016-06-01 13:50:01" - }, - { - "name": "illuminate/contracts", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/illuminate/contracts.git", - "reference": "54ea029a3c512efc56a93c25e2b0b17102276af8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/54ea029a3c512efc56a93c25e2b0b17102276af8", - "reference": "54ea029a3c512efc56a93c25e2b0b17102276af8", - "shasum": "" - }, - "require": { - "php": ">=5.6.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.4-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Contracts\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" - } - ], - "description": "The Illuminate Contracts package.", - "homepage": "http://laravel.com", - "time": "2016-06-30 14:17:23" - }, - { - "name": "illuminate/filesystem", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/illuminate/filesystem.git", - "reference": "8436d3b652e5a18b5bae7edbc2cea8baf739a5ab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/filesystem/zipball/8436d3b652e5a18b5bae7edbc2cea8baf739a5ab", - "reference": "8436d3b652e5a18b5bae7edbc2cea8baf739a5ab", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.4.*", - "illuminate/support": "5.4.*", - "php": ">=5.6.4", - "symfony/finder": "3.2.*" - }, - "suggest": { - "league/flysystem": "Required to use the Flysystem local and FTP drivers (~1.0).", - "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).", - "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.4-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Filesystem\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" - } - ], - "description": "The Illuminate Filesystem package.", - "homepage": "http://laravel.com", - "time": "2016-07-02 19:27:18" - }, - { - "name": "illuminate/support", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/illuminate/support.git", - "reference": "b02d2cd18c6657a5fe9b02a3babc7de43d2f6df9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/b02d2cd18c6657a5fe9b02a3babc7de43d2f6df9", - "reference": "b02d2cd18c6657a5fe9b02a3babc7de43d2f6df9", - "shasum": "" - }, - "require": { - "doctrine/inflector": "~1.0", - "ext-mbstring": "*", - "illuminate/contracts": "5.4.*", - "paragonie/random_compat": "~1.4|~2.0", - "php": ">=5.6.4" - }, - "replace": { - "tightenco/collect": "self.version" - }, - "suggest": { - "illuminate/filesystem": "Required to use the composer class (5.2.*).", - "jeremeamia/superclosure": "Required to be able to serialize closures (~2.2).", - "symfony/process": "Required to use the composer class (3.2.*).", - "symfony/var-dumper": "Required to use the dd function (3.2.*)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.4-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - }, - "files": [ - "helpers.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" - } - ], - "description": "The Illuminate Support package.", - "homepage": "http://laravel.com", - "time": "2016-07-02 19:27:18" - }, { "name": "justinrainbow/json-schema", "version": "1.6.1", @@ -629,7 +322,7 @@ }, { "name": "monolog/monolog", - "version": "1.x-dev", + "version": "1.20.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", @@ -755,16 +448,16 @@ }, { "name": "pimple/pimple", - "version": "dev-master", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/silexphp/Pimple.git", - "reference": "64e0f8320639b434baa073a40dd1e037e3286555" + "reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silexphp/Pimple/zipball/64e0f8320639b434baa073a40dd1e037e3286555", - "reference": "64e0f8320639b434baa073a40dd1e037e3286555", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/a30f7d6e57565a2e1a316e1baf2a483f788b258a", + "reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a", "shasum": "" }, "require": { @@ -797,34 +490,26 @@ "container", "dependency injection" ], - "time": "2015-09-11 15:11:22" + "time": "2015-09-11 15:10:35" }, { "name": "psr/log", - "version": "dev-master", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d8e60a5619fff77f9669da8997697443ef1a1d7e" + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d8e60a5619fff77f9669da8997697443ef1a1d7e", - "reference": "d8e60a5619fff77f9669da8997697443ef1a1d7e", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", "shasum": "" }, - "require": { - "php": ">=5.3.0" - }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "psr-0": { + "Psr\\Log\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -838,13 +523,12 @@ } ], "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", "keywords": [ "log", "psr", "psr-3" ], - "time": "2016-01-06 21:40:42" + "time": "2012-12-21 11:40:51" }, { "name": "seld/jsonlint", @@ -893,17 +577,210 @@ "time": "2015-11-21 02:21:41" }, { - "name": "symfony/debug", - "version": "dev-master", + "name": "silex/silex", + "version": "v2.0.2", "source": { "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "7bd1a604be83c0490b223df54581eaa01d97b9a3" + "url": "https://github.com/silexphp/Silex.git", + "reference": "7420ac96195ea7eb6f1e11dc273be49359dd50ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/7bd1a604be83c0490b223df54581eaa01d97b9a3", - "reference": "7bd1a604be83c0490b223df54581eaa01d97b9a3", + "url": "https://api.github.com/repos/silexphp/Silex/zipball/7420ac96195ea7eb6f1e11dc273be49359dd50ad", + "reference": "7420ac96195ea7eb6f1e11dc273be49359dd50ad", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "pimple/pimple": "~3.0", + "symfony/event-dispatcher": "~2.8|^3.0", + "symfony/http-foundation": "~2.8|^3.0", + "symfony/http-kernel": "~2.8|^3.0", + "symfony/routing": "~2.8|^3.0" + }, + "replace": { + "silex/api": "self.version", + "silex/providers": "self.version" + }, + "require-dev": { + "doctrine/dbal": "~2.2", + "monolog/monolog": "^1.4.1", + "swiftmailer/swiftmailer": "~5", + "symfony/asset": "~2.8|^3.0", + "symfony/browser-kit": "~2.8|^3.0", + "symfony/config": "~2.8|^3.0", + "symfony/css-selector": "~2.8|^3.0", + "symfony/debug": "~2.8|^3.0", + "symfony/doctrine-bridge": "~2.8|^3.0", + "symfony/dom-crawler": "~2.8|^3.0", + "symfony/expression-language": "~2.8|^3.0", + "symfony/finder": "~2.8|^3.0", + "symfony/form": "~2.8|^3.0", + "symfony/intl": "~2.8|^3.0", + "symfony/monolog-bridge": "~2.8|^3.0", + "symfony/options-resolver": "~2.8|^3.0", + "symfony/phpunit-bridge": "~2.8|^3.0", + "symfony/process": "~2.8|^3.0", + "symfony/security": "~2.8|^3.0", + "symfony/serializer": "~2.8|^3.0", + "symfony/translation": "~2.8|^3.0", + "symfony/twig-bridge": "~2.8|^3.0", + "symfony/validator": "~2.8|^3.0", + "symfony/var-dumper": "~2.8|^3.0", + "twig/twig": "~1.8|~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Silex\\": "src/Silex" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "The PHP micro-framework based on the Symfony Components", + "homepage": "http://silex.sensiolabs.org", + "keywords": [ + "microframework" + ], + "time": "2016-06-14 09:27:51" + }, + { + "name": "swiftmailer/swiftmailer", + "version": "v5.4.2", + "source": { + "type": "git", + "url": "https://github.com/swiftmailer/swiftmailer.git", + "reference": "d8db871a54619458a805229a057ea2af33c753e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/d8db871a54619458a805229a057ea2af33c753e8", + "reference": "d8db871a54619458a805229a057ea2af33c753e8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "mockery/mockery": "~0.9.1,<0.9.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.4-dev" + } + }, + "autoload": { + "files": [ + "lib/swift_required.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Corbyn" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Swiftmailer, free feature-rich PHP mailer", + "homepage": "http://swiftmailer.org", + "keywords": [ + "email", + "mail", + "mailer" + ], + "time": "2016-05-01 08:45:47" + }, + { + "name": "symfony/asset", + "version": "v3.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/asset.git", + "reference": "1354ba65bb5054e6311f0338e26f4907c220d1dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/asset/zipball/1354ba65bb5054e6311f0338e26f4907c220d1dc", + "reference": "1354ba65bb5054e6311f0338e26f4907c220d1dc", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "require-dev": { + "symfony/http-foundation": "~2.8|~3.0" + }, + "suggest": { + "symfony/http-foundation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Asset\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Asset Component", + "homepage": "https://symfony.com", + "time": "2016-05-13 18:06:41" + }, + { + "name": "symfony/debug", + "version": "v3.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "06e2d52e307ef880ac739f44ee6c2418ca9e3283" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/06e2d52e307ef880ac739f44ee6c2418ca9e3283", + "reference": "06e2d52e307ef880ac739f44ee6c2418ca9e3283", "shasum": "" }, "require": { @@ -920,7 +797,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -947,20 +824,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2016-06-29 05:43:10" + "time": "2016-06-29 05:41:56" }, { "name": "symfony/event-dispatcher", - "version": "dev-master", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "6d07e9b202576411d80e70ddc0fd8d6b4c975b78" + "reference": "7f9839ede2070f53e7e2f0849b9bd14748c434c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/6d07e9b202576411d80e70ddc0fd8d6b4c975b78", - "reference": "6d07e9b202576411d80e70ddc0fd8d6b4c975b78", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7f9839ede2070f53e7e2f0849b9bd14748c434c5", + "reference": "7f9839ede2070f53e7e2f0849b9bd14748c434c5", "shasum": "" }, "require": { @@ -980,7 +857,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -1007,34 +884,59 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-06-29 05:43:10" + "time": "2016-06-29 05:41:56" }, { - "name": "symfony/finder", - "version": "dev-master", + "name": "symfony/form", + "version": "v3.1.2", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "11fd749a2331de120c7fd9fa174020b43c187f36" + "url": "https://github.com/symfony/form.git", + "reference": "2ca5a2743b9cef9f5cfd604bb46396d7f794a72e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/11fd749a2331de120c7fd9fa174020b43c187f36", - "reference": "11fd749a2331de120c7fd9fa174020b43c187f36", + "url": "https://api.github.com/repos/symfony/form/zipball/2ca5a2743b9cef9f5cfd604bb46396d7f794a72e", + "reference": "2ca5a2743b9cef9f5cfd604bb46396d7f794a72e", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": ">=5.5.9", + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/intl": "~2.8|~3.0", + "symfony/options-resolver": "~2.8|~3.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/property-access": "~2.8|~3.0" + }, + "conflict": { + "symfony/doctrine-bridge": "<2.7", + "symfony/framework-bundle": "<2.7", + "symfony/twig-bridge": "<2.7" + }, + "require-dev": { + "doctrine/collections": "~1.0", + "symfony/dependency-injection": "~2.8|~3.0", + "symfony/http-foundation": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0", + "symfony/security-csrf": "~2.8|~3.0", + "symfony/translation": "~2.8|~3.0", + "symfony/validator": "~2.8|~3.0" + }, + "suggest": { + "symfony/framework-bundle": "For templating with PHP.", + "symfony/security-csrf": "For protecting forms against CSRF attacks.", + "symfony/twig-bridge": "For templating with Twig.", + "symfony/validator": "For form validation." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.1-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Finder\\": "" + "Symfony\\Component\\Form\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -1054,22 +956,22 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Finder Component", + "description": "Symfony Form Component", "homepage": "https://symfony.com", - "time": "2016-06-29 05:43:10" + "time": "2016-06-29 13:38:22" }, { "name": "symfony/http-foundation", - "version": "dev-master", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "b0da5d1686cc0dec1de68d49caabdb28a0ba553a" + "reference": "6b5a3764c5b0ce1f0ec3b8be5bba969122a78cfc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/b0da5d1686cc0dec1de68d49caabdb28a0ba553a", - "reference": "b0da5d1686cc0dec1de68d49caabdb28a0ba553a", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/6b5a3764c5b0ce1f0ec3b8be5bba969122a78cfc", + "reference": "6b5a3764c5b0ce1f0ec3b8be5bba969122a78cfc", "shasum": "" }, "require": { @@ -1082,7 +984,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -1109,20 +1011,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2016-07-01 16:08:10" + "time": "2016-06-29 07:02:31" }, { "name": "symfony/http-kernel", - "version": "dev-master", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "908cf0da21173eff2b9bd0e02dd9524056d30772" + "reference": "3a1ce1829128988826739bd9dd820f3238b92d65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/908cf0da21173eff2b9bd0e02dd9524056d30772", - "reference": "908cf0da21173eff2b9bd0e02dd9524056d30772", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/3a1ce1829128988826739bd9dd820f3238b92d65", + "reference": "3a1ce1829128988826739bd9dd820f3238b92d65", "shasum": "" }, "require": { @@ -1164,7 +1066,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -1191,20 +1093,152 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2016-07-01 16:08:10" + "time": "2016-06-30 17:16:01" }, { - "name": "symfony/monolog-bridge", - "version": "dev-master", + "name": "symfony/inflector", + "version": "v3.1.2", "source": { "type": "git", - "url": "https://github.com/symfony/monolog-bridge.git", - "reference": "2c533fb1ba9eecab9a8ede9e51cf0cea50816645" + "url": "https://github.com/symfony/inflector.git", + "reference": "1ea83acdd81053bdf35ccf3ee91f01b243664b61" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/2c533fb1ba9eecab9a8ede9e51cf0cea50816645", - "reference": "2c533fb1ba9eecab9a8ede9e51cf0cea50816645", + "url": "https://api.github.com/repos/symfony/inflector/zipball/1ea83acdd81053bdf35ccf3ee91f01b243664b61", + "reference": "1ea83acdd81053bdf35ccf3ee91f01b243664b61", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Inflector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Inflector Component", + "homepage": "https://symfony.com", + "keywords": [ + "inflection", + "pluralize", + "singularize", + "string", + "symfony", + "words" + ], + "time": "2016-06-08 11:24:07" + }, + { + "name": "symfony/intl", + "version": "v3.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/intl.git", + "reference": "2c5e101f3fcaeae81b68b439db684a8269b16617" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/intl/zipball/2c5e101f3fcaeae81b68b439db684a8269b16617", + "reference": "2c5e101f3fcaeae81b68b439db684a8269b16617", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/polyfill-intl-icu": "~1.0" + }, + "require-dev": { + "symfony/filesystem": "~2.8|~3.0" + }, + "suggest": { + "ext-intl": "to use the component with locales other than \"en\"" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Intl\\": "" + }, + "classmap": [ + "Resources/stubs" + ], + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + }, + { + "name": "Eriksen Costa", + "email": "eriksen.costa@infranology.com.br" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A PHP replacement layer for the C intl extension that includes additional data from the ICU library.", + "homepage": "https://symfony.com", + "keywords": [ + "i18n", + "icu", + "internationalization", + "intl", + "l10n", + "localization" + ], + "time": "2016-06-29 05:41:56" + }, + { + "name": "symfony/monolog-bridge", + "version": "v3.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/monolog-bridge.git", + "reference": "e4c31de00c7bf692868ac05169a61ed5b625e7ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/e4c31de00c7bf692868ac05169a61ed5b625e7ff", + "reference": "e4c31de00c7bf692868ac05169a61ed5b625e7ff", "shasum": "" }, "require": { @@ -1224,7 +1258,7 @@ "type": "symfony-bridge", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -1251,20 +1285,132 @@ ], "description": "Symfony Monolog Bridge", "homepage": "https://symfony.com", - "time": "2016-06-29 05:43:10" + "time": "2016-06-29 05:41:56" }, { - "name": "symfony/polyfill-mbstring", - "version": "dev-master", + "name": "symfony/options-resolver", + "version": "v3.1.2", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8a6bdec191138e01c92ae026e5aacb7b3e66267d" + "url": "https://github.com/symfony/options-resolver.git", + "reference": "30605874d99af0cde6c41fd39e18546330c38100" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8a6bdec191138e01c92ae026e5aacb7b3e66267d", - "reference": "8a6bdec191138e01c92ae026e5aacb7b3e66267d", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/30605874d99af0cde6c41fd39e18546330c38100", + "reference": "30605874d99af0cde6c41fd39e18546330c38100", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony OptionsResolver Component", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "time": "2016-05-12 15:59:27" + }, + { + "name": "symfony/polyfill-intl-icu", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-icu.git", + "reference": "0f8dc2c45f69f8672379e9210bca4a115cd5146f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/0f8dc2c45f69f8672379e9210bca4a115cd5146f", + "reference": "0f8dc2c45f69f8672379e9210bca4a115cd5146f", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/intl": "~2.3|~3.0" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's ICU-related data and classes", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "icu", + "intl", + "polyfill", + "portable", + "shim" + ], + "time": "2016-05-18 14:26:46" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "dff51f72b0706335131b00a7f49606168c582594" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", + "reference": "dff51f72b0706335131b00a7f49606168c582594", "shasum": "" }, "require": { @@ -1310,20 +1456,79 @@ "portable", "shim" ], - "time": "2016-06-29 14:58:48" + "time": "2016-05-18 14:26:46" }, { - "name": "symfony/process", - "version": "dev-master", + "name": "symfony/polyfill-php70", + "version": "v1.2.0", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "cdb8db3590748b544e673f8879269afa3c65460a" + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "a42f4b6b05ed458910f8af4c4e1121b0101b2d85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/cdb8db3590748b544e673f8879269afa3c65460a", - "reference": "cdb8db3590748b544e673f8879269afa3c65460a", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/a42f4b6b05ed458910f8af4c4e1121b0101b2d85", + "reference": "a42f4b6b05ed458910f8af4c4e1121b0101b2d85", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "~1.0|~2.0", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php70\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2016-05-18 14:26:46" + }, + { + "name": "symfony/process", + "version": "v3.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "5c11a1a4d4016662eeaf0f8757958c7de069f9a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/5c11a1a4d4016662eeaf0f8757958c7de069f9a0", + "reference": "5c11a1a4d4016662eeaf0f8757958c7de069f9a0", "shasum": "" }, "require": { @@ -1332,7 +1537,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -1359,20 +1564,82 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2016-06-29 05:43:10" + "time": "2016-06-29 05:42:25" }, { - "name": "symfony/routing", - "version": "dev-master", + "name": "symfony/property-access", + "version": "v3.1.2", "source": { "type": "git", - "url": "https://github.com/symfony/routing.git", - "reference": "3943c0b193c8f8fc599acc16664cea81fe606029" + "url": "https://github.com/symfony/property-access.git", + "reference": "b982bfb21901b130e4f814d2835ee9759fa60f40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/3943c0b193c8f8fc599acc16664cea81fe606029", - "reference": "3943c0b193c8f8fc599acc16664cea81fe606029", + "url": "https://api.github.com/repos/symfony/property-access/zipball/b982bfb21901b130e4f814d2835ee9759fa60f40", + "reference": "b982bfb21901b130e4f814d2835ee9759fa60f40", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/inflector": "~3.1", + "symfony/polyfill-php70": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\PropertyAccess\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony PropertyAccess Component", + "homepage": "https://symfony.com", + "keywords": [ + "access", + "array", + "extraction", + "index", + "injection", + "object", + "property", + "property path", + "reflection" + ], + "time": "2016-06-29 05:41:56" + }, + { + "name": "symfony/routing", + "version": "v3.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/routing.git", + "reference": "22c7adc204057a0ff0b12eea2889782a5deb70a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/routing/zipball/22c7adc204057a0ff0b12eea2889782a5deb70a3", + "reference": "22c7adc204057a0ff0b12eea2889782a5deb70a3", "shasum": "" }, "require": { @@ -1401,7 +1668,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -1434,35 +1701,301 @@ "uri", "url" ], - "time": "2016-07-01 08:30:59" + "time": "2016-06-29 05:41:56" }, { - "name": "symfony/yaml", - "version": "dev-master", + "name": "symfony/swiftmailer-bridge", + "version": "v2.8.8", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "b69648974b39cc6f76aea9d3aee8212cd0c0d75d" + "url": "https://github.com/symfony/swiftmailer-bridge.git", + "reference": "06fbe292e0301255838202318ab5f4498e4fe709" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/b69648974b39cc6f76aea9d3aee8212cd0c0d75d", - "reference": "b69648974b39cc6f76aea9d3aee8212cd0c0d75d", + "url": "https://api.github.com/repos/symfony/swiftmailer-bridge/zipball/06fbe292e0301255838202318ab5f4498e4fe709", + "reference": "06fbe292e0301255838202318ab5f4498e4fe709", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "swiftmailer/swiftmailer": ">=4.2.0,<6.0-dev" + }, + "suggest": { + "symfony/http-kernel": "" + }, + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bridge\\Swiftmailer\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Swiftmailer Bridge", + "homepage": "https://symfony.com", + "time": "2016-03-07 14:04:32" + }, + { + "name": "symfony/translation", + "version": "v3.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "d63a94528530c3ea5ff46924c8001cec4a398609" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/d63a94528530c3ea5ff46924c8001cec4a398609", + "reference": "d63a94528530c3ea5ff46924c8001cec4a398609", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<2.8" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0", + "symfony/intl": "~2.8|~3.0", + "symfony/yaml": "~2.8|~3.0" + }, + "suggest": { + "psr/log": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Translation Component", + "homepage": "https://symfony.com", + "time": "2016-06-29 05:41:56" + }, + { + "name": "symfony/twig-bridge", + "version": "v3.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/twig-bridge.git", + "reference": "d7044fc3ec23f9a7b626c4798fc013b234756696" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/d7044fc3ec23f9a7b626c4798fc013b234756696", + "reference": "d7044fc3ec23f9a7b626c4798fc013b234756696", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "twig/twig": "~1.23|~2.0" + }, + "require-dev": { + "symfony/asset": "~2.8|~3.0", + "symfony/console": "~2.8|~3.0", + "symfony/expression-language": "~2.8|~3.0", + "symfony/finder": "~2.8|~3.0", + "symfony/form": "~3.0.4", + "symfony/http-kernel": "~2.8|~3.0", + "symfony/polyfill-intl-icu": "~1.0", + "symfony/routing": "~2.8|~3.0", + "symfony/security": "~2.8|~3.0", + "symfony/security-acl": "~2.8|~3.0", + "symfony/stopwatch": "~2.8|~3.0", + "symfony/templating": "~2.8|~3.0", + "symfony/translation": "~2.8|~3.0", + "symfony/var-dumper": "~2.8|~3.0", + "symfony/yaml": "~2.8|~3.0" + }, + "suggest": { + "symfony/asset": "For using the AssetExtension", + "symfony/expression-language": "For using the ExpressionExtension", + "symfony/finder": "", + "symfony/form": "For using the FormExtension", + "symfony/http-kernel": "For using the HttpKernelExtension", + "symfony/routing": "For using the RoutingExtension", + "symfony/security": "For using the SecurityExtension", + "symfony/stopwatch": "For using the StopwatchExtension", + "symfony/templating": "For using the TwigEngine", + "symfony/translation": "For using the TranslationExtension", + "symfony/var-dumper": "For using the DumpExtension", + "symfony/yaml": "For using the YamlExtension" + }, + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bridge\\Twig\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Twig Bridge", + "homepage": "https://symfony.com", + "time": "2016-06-29 05:41:56" + }, + { + "name": "symfony/validator", + "version": "v3.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/validator.git", + "reference": "6f518619e56b2437dbec0e959847706961172493" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/validator/zipball/6f518619e56b2437dbec0e959847706961172493", + "reference": "6f518619e56b2437dbec0e959847706961172493", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation": "~2.8|~3.0" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "egulias/email-validator": "~1.2,>=1.2.1", + "symfony/cache": "~3.1", + "symfony/config": "~2.8|~3.0", + "symfony/expression-language": "~2.8|~3.0", + "symfony/http-foundation": "~2.8|~3.0", + "symfony/intl": "~2.8|~3.0", + "symfony/yaml": "~2.8|~3.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "egulias/email-validator": "Strict (RFC compliant) email validation", + "psr/cache-implementation": "For using the metadata cache.", + "symfony/config": "", + "symfony/expression-language": "For using the Expression validator", + "symfony/http-foundation": "", + "symfony/intl": "", + "symfony/property-access": "For using the Expression validator", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Validator\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Validator Component", + "homepage": "https://symfony.com", + "time": "2016-06-29 05:41:56" + }, + { + "name": "symfony/yaml", + "version": "v3.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/2884c26ce4c1d61aebf423a8b912950fe7c764de", + "reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de", "shasum": "" }, "require": { "php": ">=5.5.9" }, - "require-dev": { - "symfony/console": "~2.8|~3.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -1489,33 +2022,93 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-07-01 16:08:10" + "time": "2016-06-29 05:41:56" }, { - "name": "webmozart/assert", - "version": "dev-master", + "name": "twig/twig", + "version": "v1.24.1", "source": { "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "3a8e045064f294992a13966b6c892fb9d64853a3" + "url": "https://github.com/twigphp/Twig.git", + "reference": "3566d311a92aae4deec6e48682dc5a4528c4a512" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/3a8e045064f294992a13966b6c892fb9d64853a3", - "reference": "3a8e045064f294992a13966b6c892fb9d64853a3", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/3566d311a92aae4deec6e48682dc5a4528c4a512", + "reference": "3566d311a92aae4deec6e48682dc5a4528c4a512", "shasum": "" }, "require": { - "php": "^5.3.3|^7.0" + "php": ">=5.2.7" }, "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" + "symfony/debug": "~2.7", + "symfony/phpunit-bridge": "~2.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.24-dev" + } + }, + "autoload": { + "psr-0": { + "Twig_": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + }, + { + "name": "Twig Team", + "homepage": "http://twig.sensiolabs.org/contributors", + "role": "Contributors" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "http://twig.sensiolabs.org", + "keywords": [ + "templating" + ], + "time": "2016-05-30 09:11:59" + }, + { + "name": "webmozart/assert", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", + "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" } }, "autoload": { @@ -1539,27 +2132,26 @@ "check", "validate" ], - "time": "2016-03-04 13:27:44" + "time": "2015-08-24 13:29:44" }, { "name": "webmozart/json", - "version": "dev-master", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/webmozart/json.git", - "reference": "be0e18a01f2ef720008a91d047f16de1dc30030c" + "reference": "a1fb3da904b8364e3db47eed68f76bfb6cd0031a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/json/zipball/be0e18a01f2ef720008a91d047f16de1dc30030c", - "reference": "be0e18a01f2ef720008a91d047f16de1dc30030c", + "url": "https://api.github.com/repos/webmozart/json/zipball/a1fb3da904b8364e3db47eed68f76bfb6cd0031a", + "reference": "a1fb3da904b8364e3db47eed68f76bfb6cd0031a", "shasum": "" }, "require": { "justinrainbow/json-schema": "^1.6", "php": "^5.3.3|^7.0", "seld/jsonlint": "^1.0", - "webmozart/assert": "^1.0", "webmozart/path-util": "^2.3" }, "require-dev": { @@ -1570,7 +2162,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.2-dev" } }, "autoload": { @@ -1589,24 +2181,24 @@ } ], "description": "A robust JSON decoder/encoder with support for schema validation.", - "time": "2016-02-01 10:05:50" + "time": "2016-01-14 12:11:46" }, { "name": "webmozart/path-util", - "version": "dev-master", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/webmozart/path-util.git", - "reference": "e08599402b51d89a5bccc9f423ec9fbc8cd1776d" + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/path-util/zipball/e08599402b51d89a5bccc9f423ec9fbc8cd1776d", - "reference": "e08599402b51d89a5bccc9f423ec9fbc8cd1776d", + "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", "shasum": "" }, "require": { - "php": "^5.3.3|^7.0", + "php": ">=5.3.3", "webmozart/assert": "~1.0" }, "require-dev": { @@ -1635,411 +2227,10 @@ } ], "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", - "time": "2016-01-12 15:57:47" + "time": "2015-12-17 08:42:14" } ], "packages-dev": [ - { - "name": "doctrine/annotations", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "2e1b1f7597e2f647e99e96e747fcae9718ac817b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/2e1b1f7597e2f647e99e96e747fcae9718ac817b", - "reference": "2e1b1f7597e2f647e99e96e747fcae9718ac817b", - "shasum": "" - }, - "require": { - "doctrine/lexer": "1.*", - "php": ">=5.3.2" - }, - "require-dev": { - "doctrine/cache": "1.*", - "phpunit/phpunit": "4.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\Annotations\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "time": "2016-03-24 07:09:52" - }, - { - "name": "doctrine/cache", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/doctrine/cache.git", - "reference": "51010cb7802c1fc30471eee3d8aa4ea4302d1398" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/51010cb7802c1fc30471eee3d8aa4ea4302d1398", - "reference": "51010cb7802c1fc30471eee3d8aa4ea4302d1398", - "shasum": "" - }, - "require": { - "php": "~5.5|~7.0" - }, - "conflict": { - "doctrine/common": ">2.2,<2.4" - }, - "require-dev": { - "phpunit/phpunit": "~4.8|~5.0", - "predis/predis": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Caching library offering an object-oriented API for many cache backends", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "cache", - "caching" - ], - "time": "2016-06-29 15:54:19" - }, - { - "name": "doctrine/collections", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/doctrine/collections.git", - "reference": "315485ae4bc22affb75be25709740949460b851a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/315485ae4bc22affb75be25709740949460b851a", - "reference": "315485ae4bc22affb75be25709740949460b851a", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\Collections\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Collections Abstraction library", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "array", - "collections", - "iterator" - ], - "time": "2016-06-16 12:51:43" - }, - { - "name": "doctrine/common", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/doctrine/common.git", - "reference": "c16f1f8063fed82aa4e495fed19f84cca3263254" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/c16f1f8063fed82aa4e495fed19f84cca3263254", - "reference": "c16f1f8063fed82aa4e495fed19f84cca3263254", - "shasum": "" - }, - "require": { - "doctrine/annotations": "1.*", - "doctrine/cache": "1.*", - "doctrine/collections": "1.*", - "doctrine/inflector": "1.*", - "doctrine/lexer": "1.*", - "php": "~5.6|~7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.4.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\": "lib/Doctrine/Common" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Common Library for Doctrine projects", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "annotations", - "collections", - "eventmanager", - "persistence", - "spl" - ], - "time": "2016-06-19 16:38:36" - }, - { - "name": "doctrine/dbal", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/doctrine/dbal.git", - "reference": "0348953fdffb2a9d709ef98168873b7f24fe7050" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/0348953fdffb2a9d709ef98168873b7f24fe7050", - "reference": "0348953fdffb2a9d709ef98168873b7f24fe7050", - "shasum": "" - }, - "require": { - "doctrine/common": "~2.4", - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.4.6", - "symfony/console": "2.*" - }, - "suggest": { - "symfony/console": "For helpful console commands such as SQL execution and import of files." - }, - "bin": [ - "bin/doctrine-dbal" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\DBAL\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - } - ], - "description": "Database Abstraction Layer", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "database", - "dbal", - "persistence", - "queryobject" - ], - "time": "2016-06-30 07:45:43" - }, - { - "name": "doctrine/lexer", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\Lexer\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "lexer", - "parser" - ], - "time": "2014-09-09 13:34:57" - }, { "name": "filp/whoops", "version": "2.1.2", @@ -2100,404 +2291,18 @@ ], "time": "2016-04-07 06:16:25" }, - { - "name": "psr/cache", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "9e66031f41fbbdda45ee11e93c45d480ccba3eb3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/9e66031f41fbbdda45ee11e93c45d480ccba3eb3", - "reference": "9e66031f41fbbdda45ee11e93c45d480ccba3eb3", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "time": "2015-12-11 02:52:07" - }, - { - "name": "swiftmailer/swiftmailer", - "version": "5.x-dev", - "source": { - "type": "git", - "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "7c0abd960cc60ff9870863886e6ce626c2e93bad" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/7c0abd960cc60ff9870863886e6ce626c2e93bad", - "reference": "7c0abd960cc60ff9870863886e6ce626c2e93bad", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "mockery/mockery": "~0.9.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.4-dev" - } - }, - "autoload": { - "files": [ - "lib/swift_required.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Chris Corbyn" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Swiftmailer, free feature-rich PHP mailer", - "homepage": "http://swiftmailer.org", - "keywords": [ - "email", - "mail", - "mailer" - ], - "time": "2016-06-30 14:03:38" - }, - { - "name": "symfony/asset", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/asset.git", - "reference": "3be3ab14de3811b562e9ad840af0851fa2b7fb74" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/asset/zipball/3be3ab14de3811b562e9ad840af0851fa2b7fb74", - "reference": "3be3ab14de3811b562e9ad840af0851fa2b7fb74", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "symfony/http-foundation": "~2.8|~3.0" - }, - "suggest": { - "symfony/http-foundation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Asset\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Asset Component", - "homepage": "https://symfony.com", - "time": "2016-07-01 16:08:10" - }, - { - "name": "symfony/browser-kit", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/browser-kit.git", - "reference": "7b89fea59c109e574b7102a0e3d4d74b1286e0d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/7b89fea59c109e574b7102a0e3d4d74b1286e0d4", - "reference": "7b89fea59c109e574b7102a0e3d4d74b1286e0d4", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/dom-crawler": "~2.8|~3.0" - }, - "require-dev": { - "symfony/css-selector": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" - }, - "suggest": { - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\BrowserKit\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony BrowserKit Component", - "homepage": "https://symfony.com", - "time": "2016-06-29 05:43:10" - }, - { - "name": "symfony/cache", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/cache.git", - "reference": "30ac2b8853f8ab733d939ccf101fbe3175ea1c3f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/30ac2b8853f8ab733d939ccf101fbe3175ea1c3f", - "reference": "30ac2b8853f8ab733d939ccf101fbe3175ea1c3f", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "psr/cache": "~1.0", - "psr/log": "~1.0" - }, - "provide": { - "psr/cache-implementation": "1.0" - }, - "require-dev": { - "cache/integration-tests": "dev-master", - "doctrine/cache": "~1.6", - "predis/predis": "~1.0" - }, - "suggest": { - "symfony/polyfill-apcu": "For using ApcuAdapter on HHVM" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Cache\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony implementation of PSR-6", - "homepage": "https://symfony.com", - "keywords": [ - "caching", - "psr6" - ], - "time": "2016-07-01 16:09:33" - }, - { - "name": "symfony/class-loader", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/class-loader.git", - "reference": "a155e9640c16d7d7282e5be8676546abe2747983" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/a155e9640c16d7d7282e5be8676546abe2747983", - "reference": "a155e9640c16d7d7282e5be8676546abe2747983", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "symfony/finder": "~2.8|~3.0", - "symfony/polyfill-apcu": "~1.1" - }, - "suggest": { - "symfony/polyfill-apcu": "For using ApcClassLoader on HHVM" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\ClassLoader\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony ClassLoader Component", - "homepage": "https://symfony.com", - "time": "2016-06-29 05:43:10" - }, - { - "name": "symfony/config", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "5d688ee77abc1a9a13135d8d62be515ac402d34a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/5d688ee77abc1a9a13135d8d62be515ac402d34a", - "reference": "5d688ee77abc1a9a13135d8d62be515ac402d34a", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/filesystem": "~2.8|~3.0" - }, - "suggest": { - "symfony/yaml": "To use the yaml reference dumper" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Config\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Config Component", - "homepage": "https://symfony.com", - "time": "2016-06-29 05:43:10" - }, { "name": "symfony/console", - "version": "dev-master", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "e62a1ec70f679510ecde30466885ffb89d4c7cb8" + "reference": "747154aa69b0f83cd02fc9aa554836dee417631a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/e62a1ec70f679510ecde30466885ffb89d4c7cb8", - "reference": "e62a1ec70f679510ecde30466885ffb89d4c7cb8", + "url": "https://api.github.com/repos/symfony/console/zipball/747154aa69b0f83cd02fc9aa554836dee417631a", + "reference": "747154aa69b0f83cd02fc9aa554836dee417631a", "shasum": "" }, "require": { @@ -2507,19 +2312,17 @@ "require-dev": { "psr/log": "~1.0", "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/filesystem": "~2.8|~3.0", "symfony/process": "~2.8|~3.0" }, "suggest": { "psr/log": "For using the console logger", "symfony/event-dispatcher": "", - "symfony/filesystem": "", "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -2546,723 +2349,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-07-01 16:19:27" - }, - { - "name": "symfony/css-selector", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "7a3ee9a4689295146659044f7c47c4734e0c552a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/7a3ee9a4689295146659044f7c47c4734e0c552a", - "reference": "7a3ee9a4689295146659044f7c47c4734e0c552a", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com", - "time": "2016-06-29 05:43:10" - }, - { - "name": "symfony/dependency-injection", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "54c33a9e194086202a09907c1a7eaf687fa0faa3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/54c33a9e194086202a09907c1a7eaf687fa0faa3", - "reference": "54c33a9e194086202a09907c1a7eaf687fa0faa3", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "conflict": { - "symfony/yaml": "<3.2" - }, - "require-dev": { - "symfony/config": "~2.8|~3.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/yaml": "~3.2" - }, - "suggest": { - "symfony/config": "", - "symfony/expression-language": "For using expressions in service container configuration", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony DependencyInjection Component", - "homepage": "https://symfony.com", - "time": "2016-07-01 16:08:10" - }, - { - "name": "symfony/doctrine-bridge", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/doctrine-bridge.git", - "reference": "6662fb2d0164e3fe567f4c69b087b769b81bc398" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/6662fb2d0164e3fe567f4c69b087b769b81bc398", - "reference": "6662fb2d0164e3fe567f4c69b087b769b81bc398", - "shasum": "" - }, - "require": { - "doctrine/common": "~2.4", - "php": ">=5.5.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "doctrine/data-fixtures": "1.0.*", - "doctrine/dbal": "~2.4", - "doctrine/orm": "~2.4,>=2.4.5", - "symfony/dependency-injection": "~2.8|~3.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/form": "~3.0,>=3.0.5", - "symfony/http-kernel": "~2.8|~3.0", - "symfony/property-access": "~2.8|~3.0", - "symfony/property-info": "~2.8|3.0", - "symfony/proxy-manager-bridge": "~2.8|~3.0", - "symfony/security": "~2.8|~3.0", - "symfony/stopwatch": "~2.8|~3.0", - "symfony/translation": "~2.8|~3.0", - "symfony/validator": "~2.8|~3.0" - }, - "suggest": { - "doctrine/data-fixtures": "", - "doctrine/dbal": "", - "doctrine/orm": "", - "symfony/form": "", - "symfony/property-info": "", - "symfony/validator": "" - }, - "type": "symfony-bridge", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Bridge\\Doctrine\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Doctrine Bridge", - "homepage": "https://symfony.com", - "time": "2016-07-01 16:08:10" - }, - { - "name": "symfony/dom-crawler", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/dom-crawler.git", - "reference": "34acda6a4ba1478753b8c73c96ef3a0e7e46e382" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/34acda6a4ba1478753b8c73c96ef3a0e7e46e382", - "reference": "34acda6a4ba1478753b8c73c96ef3a0e7e46e382", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "symfony/css-selector": "~2.8|~3.0" - }, - "suggest": { - "symfony/css-selector": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\DomCrawler\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony DomCrawler Component", - "homepage": "https://symfony.com", - "time": "2016-06-29 05:43:10" - }, - { - "name": "symfony/expression-language", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/expression-language.git", - "reference": "7e9231b097c6e70eda8e8f109f65e22847daccb7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/expression-language/zipball/7e9231b097c6e70eda8e8f109f65e22847daccb7", - "reference": "7e9231b097c6e70eda8e8f109f65e22847daccb7", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\ExpressionLanguage\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony ExpressionLanguage Component", - "homepage": "https://symfony.com", - "time": "2016-06-21 06:43:40" - }, - { - "name": "symfony/filesystem", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "45e9008bc169ab89cc031bf723219092838b0b3d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/45e9008bc169ab89cc031bf723219092838b0b3d", - "reference": "45e9008bc169ab89cc031bf723219092838b0b3d", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Filesystem Component", - "homepage": "https://symfony.com", - "time": "2016-06-29 05:43:10" - }, - { - "name": "symfony/form", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/form.git", - "reference": "f68c7a12d4f6d55982260ca5a42f5a091a4dfe94" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/form/zipball/f68c7a12d4f6d55982260ca5a42f5a091a4dfe94", - "reference": "f68c7a12d4f6d55982260ca5a42f5a091a4dfe94", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/intl": "~2.8|~3.0", - "symfony/options-resolver": "~2.8|~3.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/property-access": "~2.8|~3.0" - }, - "conflict": { - "symfony/doctrine-bridge": "<2.7", - "symfony/framework-bundle": "<2.7", - "symfony/twig-bridge": "<2.7" - }, - "require-dev": { - "doctrine/collections": "~1.0", - "symfony/dependency-injection": "~2.8|~3.0", - "symfony/http-foundation": "~2.8|~3.0", - "symfony/http-kernel": "~2.8|~3.0", - "symfony/security-csrf": "~2.8|~3.0", - "symfony/translation": "~2.8|~3.0", - "symfony/validator": "~2.8|~3.0" - }, - "suggest": { - "symfony/framework-bundle": "For templating with PHP.", - "symfony/security-csrf": "For protecting forms against CSRF attacks.", - "symfony/twig-bridge": "For templating with Twig.", - "symfony/validator": "For form validation." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Form\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Form Component", - "homepage": "https://symfony.com", - "time": "2016-07-01 16:08:10" - }, - { - "name": "symfony/framework-bundle", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/framework-bundle.git", - "reference": "22205e5ae668553c7c7e5acff392255377736fa6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/22205e5ae668553c7c7e5acff392255377736fa6", - "reference": "22205e5ae668553c7c7e5acff392255377736fa6", - "shasum": "" - }, - "require": { - "doctrine/annotations": "~1.0", - "doctrine/cache": "~1.0", - "php": ">=5.5.9", - "symfony/asset": "~2.8|~3.0", - "symfony/cache": "~3.1", - "symfony/class-loader": "~2.8|~3.0", - "symfony/config": "~2.8|~3.0", - "symfony/dependency-injection": "~3.2", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/filesystem": "~2.8|~3.0", - "symfony/finder": "~2.8|~3.0", - "symfony/http-foundation": "~3.1", - "symfony/http-kernel": "~3.1.2|~3.2", - "symfony/polyfill-mbstring": "~1.0", - "symfony/routing": "~3.0", - "symfony/security-core": "~2.8|~3.0", - "symfony/security-csrf": "~2.8|~3.0", - "symfony/stopwatch": "~2.8|~3.0", - "symfony/templating": "~2.8|~3.0", - "symfony/translation": "~2.8|~3.0" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "<3.0" - }, - "require-dev": { - "phpdocumentor/reflection-docblock": "^3.0", - "symfony/browser-kit": "~2.8|~3.0", - "symfony/console": "~2.8.8|~3.0.8|~3.1.2|~3.2", - "symfony/css-selector": "~2.8|~3.0", - "symfony/dom-crawler": "~2.8|~3.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/form": "~2.8|~3.0", - "symfony/polyfill-intl-icu": "~1.0", - "symfony/process": "~2.8|~3.0", - "symfony/property-info": "~2.8|~3.0", - "symfony/security": "~2.8|~3.0", - "symfony/serializer": "~2.8|^3.0", - "symfony/validator": "~3.1", - "symfony/yaml": "~3.2", - "twig/twig": "~1.23|~2.0" - }, - "suggest": { - "ext-apcu": "For best performance of the system caches", - "symfony/console": "For using the console commands", - "symfony/form": "For using forms", - "symfony/process": "For using the server:run, server:start, server:stop, and server:status commands", - "symfony/property-info": "For using the property_info service", - "symfony/serializer": "For using the serializer service", - "symfony/validator": "For using validation", - "symfony/yaml": "For using the debug:config and lint:yaml commands" - }, - "type": "symfony-bundle", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Bundle\\FrameworkBundle\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony FrameworkBundle", - "homepage": "https://symfony.com", - "time": "2016-07-01 16:08:10" - }, - { - "name": "symfony/inflector", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/inflector.git", - "reference": "50453f605f0f7f397aad4a4566d2b1d1fab9c3e2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/inflector/zipball/50453f605f0f7f397aad4a4566d2b1d1fab9c3e2", - "reference": "50453f605f0f7f397aad4a4566d2b1d1fab9c3e2", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Inflector\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Inflector Component", - "homepage": "https://symfony.com", - "keywords": [ - "inflection", - "pluralize", - "singularize", - "string", - "symfony", - "words" - ], - "time": "2016-06-14 11:18:32" - }, - { - "name": "symfony/intl", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/intl.git", - "reference": "51958aa34294154a4d7b0ab1302d0ac37218c400" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/intl/zipball/51958aa34294154a4d7b0ab1302d0ac37218c400", - "reference": "51958aa34294154a4d7b0ab1302d0ac37218c400", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/polyfill-intl-icu": "~1.0" - }, - "require-dev": { - "symfony/filesystem": "~2.8|~3.0" - }, - "suggest": { - "ext-intl": "to use the component with locales other than \"en\"" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Intl\\": "" - }, - "classmap": [ - "Resources/stubs" - ], - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - }, - { - "name": "Eriksen Costa", - "email": "eriksen.costa@infranology.com.br" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A PHP replacement layer for the C intl extension that includes additional data from the ICU library.", - "homepage": "https://symfony.com", - "keywords": [ - "i18n", - "icu", - "internationalization", - "intl", - "l10n", - "localization" - ], - "time": "2016-06-29 05:43:10" - }, - { - "name": "symfony/options-resolver", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "45940bcad6388b3b6058107eca67ced738d205bb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/45940bcad6388b3b6058107eca67ced738d205bb", - "reference": "45940bcad6388b3b6058107eca67ced738d205bb", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony OptionsResolver Component", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "time": "2016-05-13 18:13:23" + "time": "2016-06-29 07:02:31" }, { "name": "symfony/phpunit-bridge", - "version": "dev-master", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "ba5807105e4f00553da6522aa5978c5628e85015" + "reference": "eeb3bf9a195df7552fdda46f4724a9442d157413" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/ba5807105e4f00553da6522aa5978c5628e85015", - "reference": "ba5807105e4f00553da6522aa5978c5628e85015", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/eeb3bf9a195df7552fdda46f4724a9442d157413", + "reference": "eeb3bf9a195df7552fdda46f4724a9442d157413", "shasum": "" }, "require": { @@ -3274,7 +2374,7 @@ "type": "symfony-bridge", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -3304,391 +2404,20 @@ ], "description": "Symfony PHPUnit Bridge", "homepage": "https://symfony.com", - "time": "2016-06-29 05:43:10" - }, - { - "name": "symfony/polyfill-intl-icu", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-icu.git", - "reference": "0f8dc2c45f69f8672379e9210bca4a115cd5146f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/0f8dc2c45f69f8672379e9210bca4a115cd5146f", - "reference": "0f8dc2c45f69f8672379e9210bca4a115cd5146f", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "symfony/intl": "~2.3|~3.0" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's ICU-related data and classes", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "icu", - "intl", - "polyfill", - "portable", - "shim" - ], - "time": "2016-05-18 14:26:46" - }, - { - "name": "symfony/polyfill-php56", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php56.git", - "reference": "3edf57a8fbf9a927533344cef65ad7e1cf31030a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/3edf57a8fbf9a927533344cef65ad7e1cf31030a", - "reference": "3edf57a8fbf9a927533344cef65ad7e1cf31030a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "symfony/polyfill-util": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php56\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2016-05-18 14:26:46" - }, - { - "name": "symfony/polyfill-php70", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "a42f4b6b05ed458910f8af4c4e1121b0101b2d85" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/a42f4b6b05ed458910f8af4c4e1121b0101b2d85", - "reference": "a42f4b6b05ed458910f8af4c4e1121b0101b2d85", - "shasum": "" - }, - "require": { - "paragonie/random_compat": "~1.0|~2.0", - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php70\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2016-05-18 14:26:46" - }, - { - "name": "symfony/polyfill-util", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-util.git", - "reference": "ef830ce3d218e622b221d6bfad42c751d974bf99" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/ef830ce3d218e622b221d6bfad42c751d974bf99", - "reference": "ef830ce3d218e622b221d6bfad42c751d974bf99", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Util\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony utilities for portability of PHP codes", - "homepage": "https://symfony.com", - "keywords": [ - "compat", - "compatibility", - "polyfill", - "shim" - ], - "time": "2016-05-18 14:26:46" - }, - { - "name": "symfony/property-access", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/property-access.git", - "reference": "a24c4e786fd0a3a030614a317fa318cdc483f497" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/property-access/zipball/a24c4e786fd0a3a030614a317fa318cdc483f497", - "reference": "a24c4e786fd0a3a030614a317fa318cdc483f497", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/inflector": "~3.1", - "symfony/polyfill-php70": "~1.0" - }, - "require-dev": { - "symfony/cache": "~3.1" - }, - "suggest": { - "psr/cache-implementation": "To cache access methods." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\PropertyAccess\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony PropertyAccess Component", - "homepage": "https://symfony.com", - "keywords": [ - "access", - "array", - "extraction", - "index", - "injection", - "object", - "property", - "property path", - "reflection" - ], - "time": "2016-06-29 05:43:10" - }, - { - "name": "symfony/security", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/security.git", - "reference": "f7d4e3bf10b580b5766b94a97be8409d7dbcd842" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/security/zipball/f7d4e3bf10b580b5766b94a97be8409d7dbcd842", - "reference": "f7d4e3bf10b580b5766b94a97be8409d7dbcd842", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/http-foundation": "~2.8|~3.0", - "symfony/http-kernel": "~2.8|~3.0", - "symfony/polyfill-php56": "~1.0", - "symfony/polyfill-php70": "~1.0", - "symfony/polyfill-util": "~1.0", - "symfony/property-access": "~2.8|~3.0" - }, - "replace": { - "symfony/security-core": "self.version", - "symfony/security-csrf": "self.version", - "symfony/security-guard": "self.version", - "symfony/security-http": "self.version" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/finder": "~2.8|~3.0", - "symfony/ldap": "~3.1", - "symfony/polyfill-intl-icu": "~1.0", - "symfony/routing": "~2.8|~3.0", - "symfony/validator": "~2.8|~3.0" - }, - "suggest": { - "symfony/expression-language": "For using the expression voter", - "symfony/form": "", - "symfony/ldap": "For using the LDAP user and authentication providers", - "symfony/routing": "For using the HttpUtils class to create sub-requests, redirect the user, and match URLs", - "symfony/validator": "For using the user password constraint" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Security\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Security Component", - "homepage": "https://symfony.com", - "time": "2016-07-01 16:08:10" + "time": "2016-06-29 05:42:25" }, { "name": "symfony/serializer", - "version": "dev-master", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "1d9ef0fca333b46fd4622b5542bb2ec016f0de82" + "reference": "e8621c273575617e132d582983d5d14ce0c2b76c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/1d9ef0fca333b46fd4622b5542bb2ec016f0de82", - "reference": "1d9ef0fca333b46fd4622b5542bb2ec016f0de82", + "url": "https://api.github.com/repos/symfony/serializer/zipball/e8621c273575617e132d582983d5d14ce0c2b76c", + "reference": "e8621c273575617e132d582983d5d14ce0c2b76c", "shasum": "" }, "require": { @@ -3720,7 +2449,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -3747,343 +2476,20 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", - "time": "2016-06-29 05:52:42" - }, - { - "name": "symfony/stopwatch", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "5b139e1c4290e6c7640ba80d9c9b5e49ef22b841" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5b139e1c4290e6c7640ba80d9c9b5e49ef22b841", - "reference": "5b139e1c4290e6c7640ba80d9c9b5e49ef22b841", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Stopwatch Component", - "homepage": "https://symfony.com", - "time": "2016-06-29 05:43:10" - }, - { - "name": "symfony/templating", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/templating.git", - "reference": "fd340a1ea52f08f12642c3df5155b6dcfd069ad1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/templating/zipball/fd340a1ea52f08f12642c3df5155b6dcfd069ad1", - "reference": "fd340a1ea52f08f12642c3df5155b6dcfd069ad1", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "psr/log": "~1.0" - }, - "suggest": { - "psr/log": "For using debug logging in loaders" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Templating\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Templating Component", - "homepage": "https://symfony.com", - "time": "2016-05-13 18:13:23" - }, - { - "name": "symfony/translation", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "3c589e93013e2808758f61b02755afc113f3be44" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/3c589e93013e2808758f61b02755afc113f3be44", - "reference": "3c589e93013e2808758f61b02755afc113f3be44", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/config": "<2.8" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/intl": "~2.8|~3.0", - "symfony/yaml": "~2.8|~3.0" - }, - "suggest": { - "psr/log": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Translation Component", - "homepage": "https://symfony.com", - "time": "2016-06-29 05:43:10" - }, - { - "name": "symfony/twig-bridge", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/twig-bridge.git", - "reference": "2074780d5f701d44e99e64f8e319bd1e4dd008e3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/2074780d5f701d44e99e64f8e319bd1e4dd008e3", - "reference": "2074780d5f701d44e99e64f8e319bd1e4dd008e3", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "twig/twig": "~1.23|~2.0" - }, - "require-dev": { - "symfony/asset": "~2.8|~3.0", - "symfony/console": "~2.8|~3.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/finder": "~2.8|~3.0", - "symfony/form": "~3.0.4", - "symfony/http-kernel": "~2.8|~3.0", - "symfony/polyfill-intl-icu": "~1.0", - "symfony/routing": "~2.8|~3.0", - "symfony/security": "~2.8|~3.0", - "symfony/security-acl": "~2.8|~3.0", - "symfony/stopwatch": "~2.8|~3.0", - "symfony/templating": "~2.8|~3.0", - "symfony/translation": "~2.8|~3.0", - "symfony/var-dumper": "~2.8|~3.0", - "symfony/yaml": "~2.8|~3.0" - }, - "suggest": { - "symfony/asset": "For using the AssetExtension", - "symfony/expression-language": "For using the ExpressionExtension", - "symfony/finder": "", - "symfony/form": "For using the FormExtension", - "symfony/http-kernel": "For using the HttpKernelExtension", - "symfony/routing": "For using the RoutingExtension", - "symfony/security": "For using the SecurityExtension", - "symfony/stopwatch": "For using the StopwatchExtension", - "symfony/templating": "For using the TwigEngine", - "symfony/translation": "For using the TranslationExtension", - "symfony/var-dumper": "For using the DumpExtension", - "symfony/yaml": "For using the YamlExtension" - }, - "type": "symfony-bridge", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Bridge\\Twig\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Twig Bridge", - "homepage": "https://symfony.com", - "time": "2016-06-29 05:43:10" - }, - { - "name": "symfony/validator", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/validator.git", - "reference": "9ec4c9b35fcdda77127364d442bc9c51927c2f97" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/9ec4c9b35fcdda77127364d442bc9c51927c2f97", - "reference": "9ec4c9b35fcdda77127364d442bc9c51927c2f97", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/polyfill-mbstring": "~1.0", - "symfony/translation": "~2.8|~3.0" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/cache": "~1.0", - "egulias/email-validator": "~1.2,>=1.2.8|~2.0", - "symfony/cache": "~3.1", - "symfony/config": "~2.8|~3.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/http-foundation": "~2.8|~3.0", - "symfony/intl": "~2.8|~3.0", - "symfony/yaml": "~2.8|~3.0" - }, - "suggest": { - "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", - "doctrine/cache": "For using the default cached annotation reader and metadata cache.", - "egulias/email-validator": "Strict (RFC compliant) email validation", - "psr/cache-implementation": "For using the metadata cache.", - "symfony/config": "", - "symfony/expression-language": "For using the Expression validator", - "symfony/http-foundation": "", - "symfony/intl": "", - "symfony/property-access": "For using the Expression validator", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Validator\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Validator Component", - "homepage": "https://symfony.com", - "time": "2016-06-29 15:37:25" + "time": "2016-06-29 05:41:56" }, { "name": "symfony/var-dumper", - "version": "dev-master", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "f78f6e278113c8591f4ef8faf013be39df9cef0f" + "reference": "39492b8b8fe514163e677bf154fd80f6cc995759" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/f78f6e278113c8591f4ef8faf013be39df9cef0f", - "reference": "f78f6e278113c8591f4ef8faf013be39df9cef0f", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/39492b8b8fe514163e677bf154fd80f6cc995759", + "reference": "39492b8b8fe514163e677bf154fd80f6cc995759", "shasum": "" }, "require": { @@ -4099,7 +2505,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -4133,7 +2539,7 @@ "debug", "dump" ], - "time": "2016-06-29 05:43:32" + "time": "2016-06-29 05:41:56" }, { "name": "texthtml/whoops-pimple", @@ -4224,79 +2630,15 @@ "whoops" ], "time": "2015-04-09 08:49:20" - }, - { - "name": "twig/twig", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "cf96ecf366eb24cfe680b62f9134b5ddc9b86818" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/cf96ecf366eb24cfe680b62f9134b5ddc9b86818", - "reference": "cf96ecf366eb24cfe680b62f9134b5ddc9b86818", - "shasum": "" - }, - "require": { - "php": ">=5.5", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "symfony/debug": "~2.7", - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "psr-0": { - "Twig_": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - }, - { - "name": "Twig Team", - "homepage": "http://twig.sensiolabs.org/contributors", - "role": "Contributors" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "http://twig.sensiolabs.org", - "keywords": [ - "templating" - ], - "time": "2016-05-30 09:07:11" } ], "aliases": [], - "minimum-stability": "dev", - "stability-flags": { - "groovey/config": 20 - }, + "minimum-stability": "stable", + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.5.9" + "php": ">=5.6.0" }, "platform-dev": [] } diff --git a/data/bad.schema.json b/data/bad.schema.json new file mode 100644 index 0000000..928d2a0 --- /dev/null +++ b/data/bad.schema.json @@ -0,0 +1 @@ +{"array":"neat"} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..29125c3 --- /dev/null +++ b/package.json @@ -0,0 +1,14 @@ +{ + "name": "resume.php", + "author": "R. Eric Wheeler ", + "private": true, + "homepage": "https://code.reric.me", + "devDependencies": { + "grunt": "^1.0.1", + "grunt-contrib-less": "^1.3.0", + "grunt-contrib-watch": "^1.0.0", + "grunt-phpunit": "^0.3.6", + "less-plugin-autoprefix": "^1.5.1", + "main-bower-files": "^2.13.1" + } +} diff --git a/src/Sikofitt/Command/SchemaValidationCommand.php b/src/Sikofitt/Command/SchemaValidationCommand.php new file mode 100644 index 0000000..0fe4317 --- /dev/null +++ b/src/Sikofitt/Command/SchemaValidationCommand.php @@ -0,0 +1,87 @@ +setName ('resume:schema:validate') + ->setDescription ('Validates resume.json schema') + ->setProcessTitle ('Validating Schema'); + } + + /** + * Unset parameters that we need to possibly get. + * + * @param InputInterface $input + * @param OutputInterface $output + */ + public function interact (InputInterface $input, OutputInterface $output) + { + + $io = new SymfonyStyle($input, $output); + $this->file = $io->ask('Path to file? '); + $this->schema = $io->ask('Path to schema? '); + + } + + /** + * Command execute logic. + * + * @param InputInterface $input + * @param OutputInterface $output + * + * @return void + */ + public function execute (InputInterface $input, OutputInterface $output) + { + $validator = new JsonValidator(); + $decoder = new JsonDecoder(); + $io = new SymfonyStyle($input, $output); + $dataDir = dirname(dirname(dirname(__DIR__))) . '/data/'; + + try { + $decoded = $decoder->decodeFile($dataDir . $this->file); + $errors = $validator->validate ($decoded, $dataDir . $this->schema); + } catch(\Exception $e) { + $class = new \ReflectionClass($e); + $io->block([$class->getName(), $e->getMessage()], 'Exception', 'error'); + exit(255); + } + if(isset($errors) && !empty($errors)) { + $io->block($errors, 'Error', 'error'); + } else { + $io->block([$this->file, 'There were no errors reported.'], 'Valid Schema', 'fg=black;bg=green'); + + + } + } + + +} \ No newline at end of file diff --git a/src/Sikofitt/Config.php b/src/Sikofitt/Config.php deleted file mode 100644 index db5ead0..0000000 --- a/src/Sikofitt/Config.php +++ /dev/null @@ -1,25 +0,0 @@ - [ - 'debug' => true, - 'base_dir' => dirname(dirname(__DIR__)), - ], - ]; - } -} \ No newline at end of file diff --git a/src/Sikofitt/Config/ConfigLoader.php b/src/Sikofitt/Config/ConfigLoader.php deleted file mode 100644 index 0045506..0000000 --- a/src/Sikofitt/Config/ConfigLoader.php +++ /dev/null @@ -1,25 +0,0 @@ -testing = explode("\\", $r->getName()); - $this->testing[] = __DIR__; - return $this->testing; - } -} \ No newline at end of file diff --git a/src/Sikofitt/Config/ConfigServiceProvider.php b/src/Sikofitt/Config/ConfigServiceProvider.php new file mode 100644 index 0000000..24a1f06 --- /dev/null +++ b/src/Sikofitt/Config/ConfigServiceProvider.php @@ -0,0 +1,29 @@ +get ($name); + } else { + $this['config']->set($name, $value); + } + } + +} \ No newline at end of file diff --git a/src/Sikofitt/Json/ResumeBuilder.php b/src/Sikofitt/Json/ResumeBuilder.php new file mode 100644 index 0000000..0b55be1 --- /dev/null +++ b/src/Sikofitt/Json/ResumeBuilder.php @@ -0,0 +1,64 @@ +app = $app; + } + + public function toJson ($resumeArray, array $options = array ()) + { + $encoder = new JsonEncoder(); + $validator = new JsonValidator(); + if(!isset($options['file'])) { + throw new \InvalidArgumentException('file is a required argument.'); + } + + $errors = $validator->validate((object)$resumeArray, $options['app']->getResumeSchema()); + dump($errors); + try { + // $encoder->encodeFile ($resumeArray, 'test.json'); + + } catch (\Exception $e) { + $r = new \ReflectionClass($e); + $exceptionClass = $r->getName(); + return new $exceptionClass($e->getMessage()); + } + + + + } + + public function fromJson ($resumeJson, array $options = array ()) + { + $decoder = new JsonDecoder(); + $resumeObject = $decoder->decodeFile($this->app->getResumeJson(), $this->app->getResumeSchema()); + return $resumeObject; + } +} \ No newline at end of file diff --git a/src/Sikofitt/less/resume.less b/src/Sikofitt/less/resume.less new file mode 100644 index 0000000..6851c36 --- /dev/null +++ b/src/Sikofitt/less/resume.less @@ -0,0 +1 @@ +@import 'uikit.less'; \ No newline at end of file diff --git a/src/Silex/Api/BootableProviderInterface.php b/src/Silex/Api/BootableProviderInterface.php deleted file mode 100644 index 739e04d..0000000 --- a/src/Silex/Api/BootableProviderInterface.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Api; - -use Silex\Application; - -/** - * Interface for bootable service providers. - * - * @author Fabien Potencier - */ -interface BootableProviderInterface -{ - /** - * Bootstraps the application. - * - * This method is called after all services are registered - * and should be used for "dynamic" configuration (whenever - * a service must be requested). - * - * @param Application $app - */ - public function boot(Application $app); -} diff --git a/src/Silex/Api/ControllerProviderInterface.php b/src/Silex/Api/ControllerProviderInterface.php deleted file mode 100644 index 28d9d0e..0000000 --- a/src/Silex/Api/ControllerProviderInterface.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Api; - -use Silex\Application; -use Silex\ControllerCollection; - -/** - * Interface for controller providers. - * - * @author Fabien Potencier - */ -interface ControllerProviderInterface -{ - /** - * Returns routes to connect to the given application. - * - * @param Application $app An Application instance - * - * @return ControllerCollection A ControllerCollection instance - */ - public function connect(Application $app); -} diff --git a/src/Silex/Api/EventListenerProviderInterface.php b/src/Silex/Api/EventListenerProviderInterface.php deleted file mode 100644 index f3e6255..0000000 --- a/src/Silex/Api/EventListenerProviderInterface.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Api; - -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Pimple\Container; - -/** - * Interface for event listener providers. - * - * @author Fabien Potencier - */ -interface EventListenerProviderInterface -{ - public function subscribe(Container $app, EventDispatcherInterface $dispatcher); -} diff --git a/src/Silex/Api/LICENSE b/src/Silex/Api/LICENSE deleted file mode 100644 index bc6ad04..0000000 --- a/src/Silex/Api/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010-2015 Fabien Potencier - -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/src/Silex/Api/composer.json b/src/Silex/Api/composer.json deleted file mode 100644 index da53e8f..0000000 --- a/src/Silex/Api/composer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "minimum-stability": "dev", - "name": "silex/api", - "description": "The Silex interfaces", - "keywords": ["microframework"], - "homepage": "http://silex.sensiolabs.org", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - } - ], - "require": { - "php": ">=5.5.9", - "pimple/pimple": "~3.0" - }, - "suggest": { - "symfony/event-dispatcher": "For EventListenerProviderInterface", - "silex/silex": "For BootableProviderInterface and ControllerProviderInterface" - }, - "autoload": { - "psr-4": { "Silex\\Api\\": "" } - }, - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - } -} diff --git a/src/Silex/AppArgumentValueResolver.php b/src/Silex/AppArgumentValueResolver.php deleted file mode 100644 index d6449b4..0000000 --- a/src/Silex/AppArgumentValueResolver.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface; -use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata; - -/** - * HttpKernel Argument Resolver for Silex. - * - * @author Romain Neutron - */ -class AppArgumentValueResolver implements ArgumentValueResolverInterface -{ - private $app; - - public function __construct(Application $app) - { - $this->app = $app; - } - - /** - * {@inheritdoc} - */ - public function supports(Request $request, ArgumentMetadata $argument) - { - return $argument->getType() === Application::class || (null !== $argument->getType() && in_array(Application::class, class_parents($argument->getType()), true)); - } - - /** - * {@inheritdoc} - */ - public function resolve(Request $request, ArgumentMetadata $argument) - { - yield $this->app; - } -} diff --git a/src/Silex/Application.php b/src/Silex/Application.php deleted file mode 100644 index 90b7d00..0000000 --- a/src/Silex/Application.php +++ /dev/null @@ -1,506 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\HttpFoundation\BinaryFileResponse; -use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpKernel\TerminableInterface; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; -use Symfony\Component\HttpKernel\Event\GetResponseEvent; -use Symfony\Component\HttpKernel\Event\PostResponseEvent; -use Symfony\Component\HttpKernel\Exception\HttpException; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\HttpFoundation\StreamedResponse; -use Symfony\Component\HttpFoundation\JsonResponse; -use Silex\Api\BootableProviderInterface; -use Silex\Api\EventListenerProviderInterface; -use Silex\Api\ControllerProviderInterface; -use Silex\Provider\ExceptionHandlerServiceProvider; -use Silex\Provider\RoutingServiceProvider; -use Silex\Provider\HttpKernelServiceProvider; - -/** - * The Silex framework class. - * - * @author Fabien Potencier - */ -class Application extends Container implements HttpKernelInterface, TerminableInterface -{ - const VERSION = '2.0.2'; - - const EARLY_EVENT = 512; - const LATE_EVENT = -512; - - protected $providers = array(); - protected $booted = false; - - /** - * Instantiate a new Application. - * - * Objects and parameters can be passed as argument to the constructor. - * - * @param array $values The parameters or objects. - */ - public function __construct(array $values = array()) - { - parent::__construct(); - - $this['request.http_port'] = 80; - $this['request.https_port'] = 443; - $this['debug'] = false; - $this['charset'] = 'UTF-8'; - $this['logger'] = null; - - $this->register(new HttpKernelServiceProvider()); - $this->register(new RoutingServiceProvider()); - $this->register(new ExceptionHandlerServiceProvider()); - - foreach ($values as $key => $value) { - $this[$key] = $value; - } - } - - /** - * Registers a service provider. - * - * @param ServiceProviderInterface $provider A ServiceProviderInterface instance - * @param array $values An array of values that customizes the provider - * - * @return Application - */ - public function register(ServiceProviderInterface $provider, array $values = array()) - { - $this->providers[] = $provider; - - parent::register($provider, $values); - - return $this; - } - - /** - * Boots all service providers. - * - * This method is automatically called by handle(), but you can use it - * to boot all service providers when not handling a request. - */ - public function boot() - { - if ($this->booted) { - return; - } - - $this->booted = true; - - foreach ($this->providers as $provider) { - if ($provider instanceof EventListenerProviderInterface) { - $provider->subscribe($this, $this['dispatcher']); - } - - if ($provider instanceof BootableProviderInterface) { - $provider->boot($this); - } - } - } - - /** - * Maps a pattern to a callable. - * - * You can optionally specify HTTP methods that should be matched. - * - * @param string $pattern Matched route pattern - * @param mixed $to Callback that returns the response when matched - * - * @return Controller - */ - public function match($pattern, $to = null) - { - return $this['controllers']->match($pattern, $to); - } - - /** - * Maps a GET request to a callable. - * - * @param string $pattern Matched route pattern - * @param mixed $to Callback that returns the response when matched - * - * @return Controller - */ - public function get($pattern, $to = null) - { - return $this['controllers']->get($pattern, $to); - } - - /** - * Maps a POST request to a callable. - * - * @param string $pattern Matched route pattern - * @param mixed $to Callback that returns the response when matched - * - * @return Controller - */ - public function post($pattern, $to = null) - { - return $this['controllers']->post($pattern, $to); - } - - /** - * Maps a PUT request to a callable. - * - * @param string $pattern Matched route pattern - * @param mixed $to Callback that returns the response when matched - * - * @return Controller - */ - public function put($pattern, $to = null) - { - return $this['controllers']->put($pattern, $to); - } - - /** - * Maps a DELETE request to a callable. - * - * @param string $pattern Matched route pattern - * @param mixed $to Callback that returns the response when matched - * - * @return Controller - */ - public function delete($pattern, $to = null) - { - return $this['controllers']->delete($pattern, $to); - } - - /** - * Maps an OPTIONS request to a callable. - * - * @param string $pattern Matched route pattern - * @param mixed $to Callback that returns the response when matched - * - * @return Controller - */ - public function options($pattern, $to = null) - { - return $this['controllers']->options($pattern, $to); - } - - /** - * Maps a PATCH request to a callable. - * - * @param string $pattern Matched route pattern - * @param mixed $to Callback that returns the response when matched - * - * @return Controller - */ - public function patch($pattern, $to = null) - { - return $this['controllers']->patch($pattern, $to); - } - - /** - * Adds an event listener that listens on the specified events. - * - * @param string $eventName The event to listen on - * @param callable $callback The listener - * @param int $priority The higher this value, the earlier an event - * listener will be triggered in the chain (defaults to 0) - */ - public function on($eventName, $callback, $priority = 0) - { - if ($this->booted) { - $this['dispatcher']->addListener($eventName, $this['callback_resolver']->resolveCallback($callback), $priority); - - return; - } - - $this->extend('dispatcher', function (EventDispatcherInterface $dispatcher, $app) use ($callback, $priority, $eventName) { - $dispatcher->addListener($eventName, $app['callback_resolver']->resolveCallback($callback), $priority); - - return $dispatcher; - }); - } - - /** - * Registers a before filter. - * - * Before filters are run before any route has been matched. - * - * @param mixed $callback Before filter callback - * @param int $priority The higher this value, the earlier an event - * listener will be triggered in the chain (defaults to 0) - */ - public function before($callback, $priority = 0) - { - $app = $this; - - $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($callback, $app) { - if (!$event->isMasterRequest()) { - return; - } - - $ret = call_user_func($app['callback_resolver']->resolveCallback($callback), $event->getRequest(), $app); - - if ($ret instanceof Response) { - $event->setResponse($ret); - } - }, $priority); - } - - /** - * Registers an after filter. - * - * After filters are run after the controller has been executed. - * - * @param mixed $callback After filter callback - * @param int $priority The higher this value, the earlier an event - * listener will be triggered in the chain (defaults to 0) - */ - public function after($callback, $priority = 0) - { - $app = $this; - - $this->on(KernelEvents::RESPONSE, function (FilterResponseEvent $event) use ($callback, $app) { - if (!$event->isMasterRequest()) { - return; - } - - $response = call_user_func($app['callback_resolver']->resolveCallback($callback), $event->getRequest(), $event->getResponse(), $app); - if ($response instanceof Response) { - $event->setResponse($response); - } elseif (null !== $response) { - throw new \RuntimeException('An after middleware returned an invalid response value. Must return null or an instance of Response.'); - } - }, $priority); - } - - /** - * Registers a finish filter. - * - * Finish filters are run after the response has been sent. - * - * @param mixed $callback Finish filter callback - * @param int $priority The higher this value, the earlier an event - * listener will be triggered in the chain (defaults to 0) - */ - public function finish($callback, $priority = 0) - { - $app = $this; - - $this->on(KernelEvents::TERMINATE, function (PostResponseEvent $event) use ($callback, $app) { - call_user_func($app['callback_resolver']->resolveCallback($callback), $event->getRequest(), $event->getResponse(), $app); - }, $priority); - } - - /** - * Aborts the current request by sending a proper HTTP error. - * - * @param int $statusCode The HTTP status code - * @param string $message The status message - * @param array $headers An array of HTTP headers - */ - public function abort($statusCode, $message = '', array $headers = array()) - { - throw new HttpException($statusCode, $message, null, $headers); - } - - /** - * Registers an error handler. - * - * Error handlers are simple callables which take a single Exception - * as an argument. If a controller throws an exception, an error handler - * can return a specific response. - * - * When an exception occurs, all handlers will be called, until one returns - * something (a string or a Response object), at which point that will be - * returned to the client. - * - * For this reason you should add logging handlers before output handlers. - * - * @param mixed $callback Error handler callback, takes an Exception argument - * @param int $priority The higher this value, the earlier an event - * listener will be triggered in the chain (defaults to -8) - */ - public function error($callback, $priority = -8) - { - $this->on(KernelEvents::EXCEPTION, new ExceptionListenerWrapper($this, $callback), $priority); - } - - /** - * Registers a view handler. - * - * View handlers are simple callables which take a controller result and the - * request as arguments, whenever a controller returns a value that is not - * an instance of Response. When this occurs, all suitable handlers will be - * called, until one returns a Response object. - * - * @param mixed $callback View handler callback - * @param int $priority The higher this value, the earlier an event - * listener will be triggered in the chain (defaults to 0) - */ - public function view($callback, $priority = 0) - { - $this->on(KernelEvents::VIEW, new ViewListenerWrapper($this, $callback), $priority); - } - - /** - * Flushes the controller collection. - */ - public function flush() - { - $this['routes']->addCollection($this['controllers']->flush()); - } - - /** - * Redirects the user to another URL. - * - * @param string $url The URL to redirect to - * @param int $status The status code (302 by default) - * - * @return RedirectResponse - */ - public function redirect($url, $status = 302) - { - return new RedirectResponse($url, $status); - } - - /** - * Creates a streaming response. - * - * @param mixed $callback A valid PHP callback - * @param int $status The response status code - * @param array $headers An array of response headers - * - * @return StreamedResponse - */ - public function stream($callback = null, $status = 200, array $headers = array()) - { - return new StreamedResponse($callback, $status, $headers); - } - - /** - * Escapes a text for HTML. - * - * @param string $text The input text to be escaped - * @param int $flags The flags (@see htmlspecialchars) - * @param string $charset The charset - * @param bool $doubleEncode Whether to try to avoid double escaping or not - * - * @return string Escaped text - */ - public function escape($text, $flags = ENT_COMPAT, $charset = null, $doubleEncode = true) - { - return htmlspecialchars($text, $flags, $charset ?: $this['charset'], $doubleEncode); - } - - /** - * Convert some data into a JSON response. - * - * @param mixed $data The response data - * @param int $status The response status code - * @param array $headers An array of response headers - * - * @return JsonResponse - */ - public function json($data = array(), $status = 200, array $headers = array()) - { - return new JsonResponse($data, $status, $headers); - } - - /** - * Sends a file. - * - * @param \SplFileInfo|string $file The file to stream - * @param int $status The response status code - * @param array $headers An array of response headers - * @param null|string $contentDisposition The type of Content-Disposition to set automatically with the filename - * - * @return BinaryFileResponse - */ - public function sendFile($file, $status = 200, array $headers = array(), $contentDisposition = null) - { - return new BinaryFileResponse($file, $status, $headers, true, $contentDisposition); - } - - /** - * Mounts controllers under the given route prefix. - * - * @param string $prefix The route prefix - * @param ControllerCollection|callable|ControllerProviderInterface $controllers A ControllerCollection, a callable, or a ControllerProviderInterface instance - * - * @return Application - * - * @throws \LogicException - */ - public function mount($prefix, $controllers) - { - if ($controllers instanceof ControllerProviderInterface) { - $connectedControllers = $controllers->connect($this); - - if (!$connectedControllers instanceof ControllerCollection) { - throw new \LogicException(sprintf('The method "%s::connect" must return a "ControllerCollection" instance. Got: "%s"', get_class($controllers), is_object($connectedControllers) ? get_class($connectedControllers) : gettype($connectedControllers))); - } - - $controllers = $connectedControllers; - } elseif (!$controllers instanceof ControllerCollection && !is_callable($controllers)) { - throw new \LogicException('The "mount" method takes either a "ControllerCollection" instance, "ControllerProviderInterface" instance, or a callable.'); - } - - $this['controllers']->mount($prefix, $controllers); - - return $this; - } - - /** - * Handles the request and delivers the response. - * - * @param Request|null $request Request to process - */ - public function run(Request $request = null) - { - if (null === $request) { - $request = Request::createFromGlobals(); - } - - $response = $this->handle($request); - $response->send(); - $this->terminate($request, $response); - } - - /** - * {@inheritdoc} - * - * If you call this method directly instead of run(), you must call the - * terminate() method yourself if you want the finish filters to be run. - */ - public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) - { - if (!$this->booted) { - $this->boot(); - } - - $this->flush(); - - return $this['kernel']->handle($request, $type, $catch); - } - - /** - * {@inheritdoc} - */ - public function terminate(Request $request, Response $response) - { - $this['kernel']->terminate($request, $response); - } -} diff --git a/src/Silex/Application/FormTrait.php b/src/Silex/Application/FormTrait.php deleted file mode 100644 index 2eeb23e..0000000 --- a/src/Silex/Application/FormTrait.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Application; - -use Symfony\Component\Form; -use Symfony\Component\Form\Extension\Core\Type\FormType; -use Symfony\Component\Form\FormBuilder; -use Symfony\Component\OptionsResolver\OptionsResolver\FormTypeInterface; - -/** - * Form trait. - * - * @author Fabien Potencier - * @author David Berlioz - */ -trait FormTrait -{ - /** - * Creates and returns a form builder instance. - * - * @param mixed $data The initial data for the form - * @param array $options Options for the form - * @param string|FormTypeInterface $type Type of the form - * - * @return FormBuilder - */ - public function form($data = null, array $options = array(), $type = null) - { - return $this['form.factory']->createBuilder($type ?: FormType::class, $data, $options); - } - - /** - * Creates and returns a named form builder instance. - * - * @param string $name - * @param mixed $data The initial data for the form - * @param array $options Options for the form - * @param string|FormTypeInterface $type Type of the form - * - * @return FormBuilder - */ - public function namedForm($name, $data = null, array $options = array(), $type = null) - { - return $this['form.factory']->createNamedBuilder($name, $type ?: FormType::class, $data, $options); - } -} diff --git a/src/Silex/Application/MonologTrait.php b/src/Silex/Application/MonologTrait.php deleted file mode 100644 index 18cb54c..0000000 --- a/src/Silex/Application/MonologTrait.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Application; - -use Monolog\Logger; - -/** - * Monolog trait. - * - * @author Fabien Potencier - */ -trait MonologTrait -{ - /** - * Adds a log record. - * - * @param string $message The log message - * @param array $context The log context - * @param int $level The logging level - * - * @return bool Whether the record has been processed - */ - public function log($message, array $context = array(), $level = Logger::INFO) - { - return $this['monolog']->addRecord($level, $message, $context); - } -} diff --git a/src/Silex/Application/SecurityTrait.php b/src/Silex/Application/SecurityTrait.php deleted file mode 100644 index 43ce555..0000000 --- a/src/Silex/Application/SecurityTrait.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Application; - -use Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException; -use Symfony\Component\Security\Core\User\UserInterface; - -/** - * Security trait. - * - * @author Fabien Potencier - */ -trait SecurityTrait -{ - /** - * Encodes the raw password. - * - * @param UserInterface $user A UserInterface instance - * @param string $password The password to encode - * - * @return string The encoded password - * - * @throws \RuntimeException when no password encoder could be found for the user - */ - public function encodePassword(UserInterface $user, $password) - { - return $this['security.encoder_factory']->getEncoder($user)->encodePassword($password, $user->getSalt()); - } - - /** - * Checks if the attributes are granted against the current authentication token and optionally supplied object. - * - * @param mixed $attributes - * @param mixed $object - * - * @return bool - * - * @throws AuthenticationCredentialsNotFoundException when the token storage has no authentication token. - */ - public function isGranted($attributes, $object = null) - { - return $this['security.authorization_checker']->isGranted($attributes, $object); - } -} diff --git a/src/Silex/Application/SwiftmailerTrait.php b/src/Silex/Application/SwiftmailerTrait.php deleted file mode 100644 index 157f94d..0000000 --- a/src/Silex/Application/SwiftmailerTrait.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Application; - -/** - * Swiftmailer trait. - * - * @author Fabien Potencier - */ -trait SwiftmailerTrait -{ - /** - * Sends an email. - * - * @param \Swift_Message $message A \Swift_Message instance - * @param array $failedRecipients An array of failures by-reference - * - * @return int The number of sent messages - */ - public function mail(\Swift_Message $message, &$failedRecipients = null) - { - return $this['mailer']->send($message, $failedRecipients); - } -} diff --git a/src/Silex/Application/TranslationTrait.php b/src/Silex/Application/TranslationTrait.php deleted file mode 100644 index 8b6e818..0000000 --- a/src/Silex/Application/TranslationTrait.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Application; - -/** - * Translation trait. - * - * @author Fabien Potencier - */ -trait TranslationTrait -{ - /** - * Translates the given message. - * - * @param string $id The message id - * @param array $parameters An array of parameters for the message - * @param string $domain The domain for the message - * @param string $locale The locale - * - * @return string The translated string - */ - public function trans($id, array $parameters = array(), $domain = 'messages', $locale = null) - { - return $this['translator']->trans($id, $parameters, $domain, $locale); - } - - /** - * Translates the given choice message by choosing a translation according to a number. - * - * @param string $id The message id - * @param int $number The number to use to find the indice of the message - * @param array $parameters An array of parameters for the message - * @param string $domain The domain for the message - * @param string $locale The locale - * - * @return string The translated string - */ - public function transChoice($id, $number, array $parameters = array(), $domain = 'messages', $locale = null) - { - return $this['translator']->transChoice($id, $number, $parameters, $domain, $locale); - } -} diff --git a/src/Silex/Application/TwigTrait.php b/src/Silex/Application/TwigTrait.php deleted file mode 100644 index cb4127d..0000000 --- a/src/Silex/Application/TwigTrait.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Application; - -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\StreamedResponse; - -/** - * Twig trait. - * - * @author Fabien Potencier - */ -trait TwigTrait -{ - /** - * Renders a view and returns a Response. - * - * To stream a view, pass an instance of StreamedResponse as a third argument. - * - * @param string $view The view name - * @param array $parameters An array of parameters to pass to the view - * @param Response $response A Response instance - * - * @return Response A Response instance - */ - public function render($view, array $parameters = array(), Response $response = null) - { - $twig = $this['twig']; - - if ($response instanceof StreamedResponse) { - $response->setCallback(function () use ($twig, $view, $parameters) { - $twig->display($view, $parameters); - }); - } else { - if (null === $response) { - $response = new Response(); - } - $response->setContent($twig->render($view, $parameters)); - } - - return $response; - } - - /** - * Renders a view. - * - * @param string $view The view name - * @param array $parameters An array of parameters to pass to the view - * - * @return string The rendered view - */ - public function renderView($view, array $parameters = array()) - { - return $this['twig']->render($view, $parameters); - } -} diff --git a/src/Silex/Application/UrlGeneratorTrait.php b/src/Silex/Application/UrlGeneratorTrait.php deleted file mode 100644 index 7ccdf8a..0000000 --- a/src/Silex/Application/UrlGeneratorTrait.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Application; - -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; - -/** - * UrlGenerator trait. - * - * @author Fabien Potencier - */ -trait UrlGeneratorTrait -{ - /** - * Generates a path from the given parameters. - * - * @param string $route The name of the route - * @param mixed $parameters An array of parameters - * - * @return string The generated path - */ - public function path($route, $parameters = array()) - { - return $this['url_generator']->generate($route, $parameters, UrlGeneratorInterface::ABSOLUTE_PATH); - } - - /** - * Generates an absolute URL from the given parameters. - * - * @param string $route The name of the route - * @param mixed $parameters An array of parameters - * - * @return string The generated URL - */ - public function url($route, $parameters = array()) - { - return $this['url_generator']->generate($route, $parameters, UrlGeneratorInterface::ABSOLUTE_URL); - } -} diff --git a/src/Silex/CallbackResolver.php b/src/Silex/CallbackResolver.php deleted file mode 100644 index 692901c..0000000 --- a/src/Silex/CallbackResolver.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex; - -use Pimple\Container; - -class CallbackResolver -{ - const SERVICE_PATTERN = "/[A-Za-z0-9\._\-]+:[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/"; - - private $app; - - public function __construct(Container $app) - { - $this->app = $app; - } - - /** - * Returns true if the string is a valid service method representation. - * - * @param string $name - * - * @return bool - */ - public function isValid($name) - { - return is_string($name) && (preg_match(static::SERVICE_PATTERN, $name) || isset($this->app[$name])); - } - - /** - * Returns a callable given its string representation. - * - * @param string $name - * - * @return callable - * - * @throws \InvalidArgumentException In case the method does not exist. - */ - public function convertCallback($name) - { - if (preg_match(static::SERVICE_PATTERN, $name)) { - list($service, $method) = explode(':', $name, 2); - $callback = array($this->app[$service], $method); - } else { - $service = $name; - $callback = $this->app[$name]; - } - - if (!is_callable($callback)) { - throw new \InvalidArgumentException(sprintf('Service "%s" is not callable.', $service)); - } - - return $callback; - } - - /** - * Returns a callable given its string representation if it is a valid service method. - * - * @param string $name - * - * @return string|callable A callable value or the string passed in - * - * @throws \InvalidArgumentException In case the method does not exist. - */ - public function resolveCallback($name) - { - return $this->isValid($name) ? $this->convertCallback($name) : $name; - } -} diff --git a/src/Silex/Controller.php b/src/Silex/Controller.php deleted file mode 100644 index 9a80755..0000000 --- a/src/Silex/Controller.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex; - -use Silex\Exception\ControllerFrozenException; - -/** - * A wrapper for a controller, mapped to a route. - * - * __call() forwards method-calls to Route, but returns instance of Controller - * listing Route's methods below, so that IDEs know they are valid - * - * @method Controller assert(string $variable, string $regexp) - * @method Controller value(string $variable, mixed $default) - * @method Controller convert(string $variable, mixed $callback) - * @method Controller method(string $method) - * @method Controller requireHttp() - * @method Controller requireHttps() - * @method Controller before(mixed $callback) - * @method Controller after(mixed $callback) - * @method Controller when(string $condition) - * - * @author Igor Wiedler - */ -class Controller -{ - private $route; - private $routeName; - private $isFrozen = false; - - /** - * Constructor. - * - * @param Route $route - */ - public function __construct(Route $route) - { - $this->route = $route; - } - - /** - * Gets the controller's route. - * - * @return Route - */ - public function getRoute() - { - return $this->route; - } - - /** - * Gets the controller's route name. - * - * @return string - */ - public function getRouteName() - { - return $this->routeName; - } - - /** - * Sets the controller's route. - * - * @param string $routeName - * - * @return Controller $this The current Controller instance - */ - public function bind($routeName) - { - if ($this->isFrozen) { - throw new ControllerFrozenException(sprintf('Calling %s on frozen %s instance.', __METHOD__, __CLASS__)); - } - - $this->routeName = $routeName; - - return $this; - } - - public function __call($method, $arguments) - { - if (!method_exists($this->route, $method)) { - throw new \BadMethodCallException(sprintf('Method "%s::%s" does not exist.', get_class($this->route), $method)); - } - - call_user_func_array(array($this->route, $method), $arguments); - - return $this; - } - - /** - * Freezes the controller. - * - * Once the controller is frozen, you can no longer change the route name - */ - public function freeze() - { - $this->isFrozen = true; - } - - public function generateRouteName($prefix) - { - $methods = implode('_', $this->route->getMethods()).'_'; - - $routeName = $methods.$prefix.$this->route->getPath(); - $routeName = str_replace(array('/', ':', '|', '-'), '_', $routeName); - $routeName = preg_replace('/[^a-z0-9A-Z_.]+/', '', $routeName); - - // Collapse consecutive underscores down into a single underscore. - $routeName = preg_replace('/_+/', '_', $routeName); - - return $routeName; - } -} diff --git a/src/Silex/ControllerCollection.php b/src/Silex/ControllerCollection.php deleted file mode 100644 index 4036896..0000000 --- a/src/Silex/ControllerCollection.php +++ /dev/null @@ -1,239 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex; - -use Symfony\Component\Routing\RouteCollection; -use Symfony\Component\HttpFoundation\Request; - -/** - * Builds Silex controllers. - * - * It acts as a staging area for routes. You are able to set the route name - * until flush() is called, at which point all controllers are frozen and - * converted to a RouteCollection. - * - * __call() forwards method-calls to Route, but returns instance of ControllerCollection - * listing Route's methods below, so that IDEs know they are valid - * - * @method ControllerCollection assert(string $variable, string $regexp) - * @method ControllerCollection value(string $variable, mixed $default) - * @method ControllerCollection convert(string $variable, mixed $callback) - * @method ControllerCollection method(string $method) - * @method ControllerCollection requireHttp() - * @method ControllerCollection requireHttps() - * @method ControllerCollection before(mixed $callback) - * @method ControllerCollection after(mixed $callback) - * @method ControllerCollection when(string $condition) - * - * @author Igor Wiedler - * @author Fabien Potencier - */ -class ControllerCollection -{ - protected $controllers = array(); - protected $defaultRoute; - protected $defaultController; - protected $prefix; - protected $routesFactory; - protected $controllersFactory; - - public function __construct(Route $defaultRoute, RouteCollection $routesFactory = null, $controllersFactory = null) - { - $this->defaultRoute = $defaultRoute; - $this->routesFactory = $routesFactory; - $this->controllersFactory = $controllersFactory; - $this->defaultController = function (Request $request) { - throw new \LogicException(sprintf('The "%s" route must have code to run when it matches.', $request->attributes->get('_route'))); - }; - } - - /** - * Mounts controllers under the given route prefix. - * - * @param string $prefix The route prefix - * @param ControllerCollection|callable $controllers A ControllerCollection instance or a callable for defining routes - * - * @throws \LogicException - */ - public function mount($prefix, $controllers) - { - if (is_callable($controllers)) { - $collection = $this->controllersFactory ? call_user_func($this->controllersFactory) : new static(new Route(), new RouteCollection()); - call_user_func($controllers, $collection); - $controllers = $collection; - } elseif (!$controllers instanceof self) { - throw new \LogicException('The "mount" method takes either a "ControllerCollection" instance or callable.'); - } - - $controllers->prefix = $prefix; - - $this->controllers[] = $controllers; - } - - /** - * Maps a pattern to a callable. - * - * You can optionally specify HTTP methods that should be matched. - * - * @param string $pattern Matched route pattern - * @param mixed $to Callback that returns the response when matched - * - * @return Controller - */ - public function match($pattern, $to = null) - { - $route = clone $this->defaultRoute; - $route->setPath($pattern); - $this->controllers[] = $controller = new Controller($route); - $route->setDefault('_controller', null === $to ? $this->defaultController : $to); - - return $controller; - } - - /** - * Maps a GET request to a callable. - * - * @param string $pattern Matched route pattern - * @param mixed $to Callback that returns the response when matched - * - * @return Controller - */ - public function get($pattern, $to = null) - { - return $this->match($pattern, $to)->method('GET'); - } - - /** - * Maps a POST request to a callable. - * - * @param string $pattern Matched route pattern - * @param mixed $to Callback that returns the response when matched - * - * @return Controller - */ - public function post($pattern, $to = null) - { - return $this->match($pattern, $to)->method('POST'); - } - - /** - * Maps a PUT request to a callable. - * - * @param string $pattern Matched route pattern - * @param mixed $to Callback that returns the response when matched - * - * @return Controller - */ - public function put($pattern, $to = null) - { - return $this->match($pattern, $to)->method('PUT'); - } - - /** - * Maps a DELETE request to a callable. - * - * @param string $pattern Matched route pattern - * @param mixed $to Callback that returns the response when matched - * - * @return Controller - */ - public function delete($pattern, $to = null) - { - return $this->match($pattern, $to)->method('DELETE'); - } - - /** - * Maps an OPTIONS request to a callable. - * - * @param string $pattern Matched route pattern - * @param mixed $to Callback that returns the response when matched - * - * @return Controller - */ - public function options($pattern, $to = null) - { - return $this->match($pattern, $to)->method('OPTIONS'); - } - - /** - * Maps a PATCH request to a callable. - * - * @param string $pattern Matched route pattern - * @param mixed $to Callback that returns the response when matched - * - * @return Controller - */ - public function patch($pattern, $to = null) - { - return $this->match($pattern, $to)->method('PATCH'); - } - - public function __call($method, $arguments) - { - if (!method_exists($this->defaultRoute, $method)) { - throw new \BadMethodCallException(sprintf('Method "%s::%s" does not exist.', get_class($this->defaultRoute), $method)); - } - - call_user_func_array(array($this->defaultRoute, $method), $arguments); - - foreach ($this->controllers as $controller) { - call_user_func_array(array($controller, $method), $arguments); - } - - return $this; - } - - /** - * Persists and freezes staged controllers. - * - * @return RouteCollection A RouteCollection instance - */ - public function flush() - { - if (null === $this->routesFactory) { - $routes = new RouteCollection(); - } else { - $routes = $this->routesFactory; - } - - return $this->doFlush('', $routes); - } - - private function doFlush($prefix, RouteCollection $routes) - { - if ($prefix !== '') { - $prefix = '/'.trim(trim($prefix), '/'); - } - - foreach ($this->controllers as $controller) { - if ($controller instanceof Controller) { - $controller->getRoute()->setPath($prefix.$controller->getRoute()->getPath()); - if (!$name = $controller->getRouteName()) { - $name = $base = $controller->generateRouteName(''); - $i = 0; - while ($routes->get($name)) { - $name = $base.'_'.++$i; - } - $controller->bind($name); - } - $routes->add($name, $controller->getRoute()); - $controller->freeze(); - } else { - $controller->doFlush($prefix.$controller->prefix, $routes); - } - } - - $this->controllers = array(); - - return $routes; - } -} diff --git a/src/Silex/ControllerResolver.php b/src/Silex/ControllerResolver.php deleted file mode 100644 index 0a95e15..0000000 --- a/src/Silex/ControllerResolver.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex; - -use Psr\Log\LoggerInterface; -use Symfony\Component\HttpKernel\Controller\ControllerResolver as BaseControllerResolver; -use Symfony\Component\HttpFoundation\Request; - -/** - * Adds Application as a valid argument for controllers. - * - * @author Fabien Potencier - * - * @deprecated This class can be dropped once Symfony 3.0 is not supported anymore. - */ -class ControllerResolver extends BaseControllerResolver -{ - protected $app; - - /** - * Constructor. - * - * @param Application $app An Application instance - * @param LoggerInterface $logger A LoggerInterface instance - */ - public function __construct(Application $app, LoggerInterface $logger = null) - { - $this->app = $app; - - parent::__construct($logger); - } - - protected function doGetArguments(Request $request, $controller, array $parameters) - { - foreach ($parameters as $param) { - if ($param->getClass() && $param->getClass()->isInstance($this->app)) { - $request->attributes->set($param->getName(), $this->app); - - break; - } - } - - return parent::doGetArguments($request, $controller, $parameters); - } -} diff --git a/src/Silex/EventListener/ConverterListener.php b/src/Silex/EventListener/ConverterListener.php deleted file mode 100644 index 2fa93c1..0000000 --- a/src/Silex/EventListener/ConverterListener.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\EventListener; - -use Silex\CallbackResolver; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\HttpKernel\Event\FilterControllerEvent; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\Routing\RouteCollection; - -/** - * Handles converters. - * - * @author Fabien Potencier - */ -class ConverterListener implements EventSubscriberInterface -{ - protected $routes; - protected $callbackResolver; - - /** - * Constructor. - * - * @param RouteCollection $routes A RouteCollection instance - * @param CallbackResolver $callbackResolver A CallbackResolver instance - */ - public function __construct(RouteCollection $routes, CallbackResolver $callbackResolver) - { - $this->routes = $routes; - $this->callbackResolver = $callbackResolver; - } - - /** - * Handles converters. - * - * @param FilterControllerEvent $event The event to handle - */ - public function onKernelController(FilterControllerEvent $event) - { - $request = $event->getRequest(); - $route = $this->routes->get($request->attributes->get('_route')); - if ($route && $converters = $route->getOption('_converters')) { - foreach ($converters as $name => $callback) { - $callback = $this->callbackResolver->resolveCallback($callback); - - $request->attributes->set($name, call_user_func($callback, $request->attributes->get($name), $request)); - } - } - } - - public static function getSubscribedEvents() - { - return array( - KernelEvents::CONTROLLER => 'onKernelController', - ); - } -} diff --git a/src/Silex/EventListener/LogListener.php b/src/Silex/EventListener/LogListener.php deleted file mode 100644 index 5f3cc90..0000000 --- a/src/Silex/EventListener/LogListener.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\EventListener; - -use Psr\Log\LoggerInterface; -use Psr\Log\LogLevel; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpKernel\Event\GetResponseEvent; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; -use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\RedirectResponse; - -/** - * Logs request, response, and exceptions. - */ -class LogListener implements EventSubscriberInterface -{ - protected $logger; - protected $exceptionLogFilter; - - public function __construct(LoggerInterface $logger, $exceptionLogFilter = null) - { - $this->logger = $logger; - if (null === $exceptionLogFilter) { - $exceptionLogFilter = function (\Exception $e) { - if ($e instanceof HttpExceptionInterface && $e->getStatusCode() < 500) { - return LogLevel::ERROR; - } - - return LogLevel::CRITICAL; - }; - } - - $this->exceptionLogFilter = $exceptionLogFilter; - } - - /** - * Logs master requests on event KernelEvents::REQUEST. - * - * @param GetResponseEvent $event - */ - public function onKernelRequest(GetResponseEvent $event) - { - if (!$event->isMasterRequest()) { - return; - } - - $this->logRequest($event->getRequest()); - } - - /** - * Logs master response on event KernelEvents::RESPONSE. - * - * @param FilterResponseEvent $event - */ - public function onKernelResponse(FilterResponseEvent $event) - { - if (!$event->isMasterRequest()) { - return; - } - - $this->logResponse($event->getResponse()); - } - - /** - * Logs uncaught exceptions on event KernelEvents::EXCEPTION. - * - * @param GetResponseForExceptionEvent $event - */ - public function onKernelException(GetResponseForExceptionEvent $event) - { - $this->logException($event->getException()); - } - - /** - * Logs a request. - * - * @param Request $request - */ - protected function logRequest(Request $request) - { - $this->logger->log(LogLevel::DEBUG, '> '.$request->getMethod().' '.$request->getRequestUri()); - } - - /** - * Logs a response. - * - * @param Response $response - */ - protected function logResponse(Response $response) - { - $message = '< '.$response->getStatusCode(); - - if ($response instanceof RedirectResponse) { - $message .= ' '.$response->getTargetUrl(); - } - - $this->logger->log(LogLevel::DEBUG, $message); - } - - /** - * Logs an exception. - */ - protected function logException(\Exception $e) - { - $this->logger->log(call_user_func($this->exceptionLogFilter, $e), sprintf('%s: %s (uncaught exception) at %s line %s', get_class($e), $e->getMessage(), $e->getFile(), $e->getLine()), array('exception' => $e)); - } - - public static function getSubscribedEvents() - { - return array( - KernelEvents::REQUEST => array('onKernelRequest', 0), - KernelEvents::RESPONSE => array('onKernelResponse', 0), - /* - * Priority -4 is used to come after those from SecurityServiceProvider (0) - * but before the error handlers added with Silex\Application::error (defaults to -8) - */ - KernelEvents::EXCEPTION => array('onKernelException', -4), - ); - } -} diff --git a/src/Silex/EventListener/MiddlewareListener.php b/src/Silex/EventListener/MiddlewareListener.php deleted file mode 100644 index 9b28ff1..0000000 --- a/src/Silex/EventListener/MiddlewareListener.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\EventListener; - -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\HttpKernel\Event\GetResponseEvent; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Silex\Application; - -/** - * Manages the route middlewares. - * - * @author Fabien Potencier - */ -class MiddlewareListener implements EventSubscriberInterface -{ - protected $app; - - /** - * Constructor. - * - * @param Application $app An Application instance - */ - public function __construct(Application $app) - { - $this->app = $app; - } - - /** - * Runs before filters. - * - * @param GetResponseEvent $event The event to handle - */ - public function onKernelRequest(GetResponseEvent $event) - { - $request = $event->getRequest(); - $routeName = $request->attributes->get('_route'); - if (!$route = $this->app['routes']->get($routeName)) { - return; - } - - foreach ((array) $route->getOption('_before_middlewares') as $callback) { - $ret = call_user_func($this->app['callback_resolver']->resolveCallback($callback), $request, $this->app); - if ($ret instanceof Response) { - $event->setResponse($ret); - - return; - } elseif (null !== $ret) { - throw new \RuntimeException(sprintf('A before middleware for route "%s" returned an invalid response value. Must return null or an instance of Response.', $routeName)); - } - } - } - - /** - * Runs after filters. - * - * @param FilterResponseEvent $event The event to handle - */ - public function onKernelResponse(FilterResponseEvent $event) - { - $request = $event->getRequest(); - $routeName = $request->attributes->get('_route'); - if (!$route = $this->app['routes']->get($routeName)) { - return; - } - - foreach ((array) $route->getOption('_after_middlewares') as $callback) { - $response = call_user_func($this->app['callback_resolver']->resolveCallback($callback), $request, $event->getResponse(), $this->app); - if ($response instanceof Response) { - $event->setResponse($response); - } elseif (null !== $response) { - throw new \RuntimeException(sprintf('An after middleware for route "%s" returned an invalid response value. Must return null or an instance of Response.', $routeName)); - } - } - } - - public static function getSubscribedEvents() - { - return array( - // this must be executed after the late events defined with before() (and their priority is -512) - KernelEvents::REQUEST => array('onKernelRequest', -1024), - KernelEvents::RESPONSE => array('onKernelResponse', 128), - ); - } -} diff --git a/src/Silex/EventListener/StringToResponseListener.php b/src/Silex/EventListener/StringToResponseListener.php deleted file mode 100644 index 9fdba5f..0000000 --- a/src/Silex/EventListener/StringToResponseListener.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\EventListener; - -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpFoundation\Response; - -/** - * Converts string responses to proper Response instances. - * - * @author Fabien Potencier - */ -class StringToResponseListener implements EventSubscriberInterface -{ - /** - * Handles string responses. - * - * @param GetResponseForControllerResultEvent $event The event to handle - */ - public function onKernelView(GetResponseForControllerResultEvent $event) - { - $response = $event->getControllerResult(); - - if (!( - null === $response - || is_array($response) - || $response instanceof Response - || (is_object($response) && !method_exists($response, '__toString')) - )) { - $event->setResponse(new Response((string) $response)); - } - } - - public static function getSubscribedEvents() - { - return array( - KernelEvents::VIEW => array('onKernelView', -10), - ); - } -} diff --git a/src/Silex/Exception/ControllerFrozenException.php b/src/Silex/Exception/ControllerFrozenException.php deleted file mode 100644 index 7f0d65f..0000000 --- a/src/Silex/Exception/ControllerFrozenException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Exception; - -/** - * Exception, is thrown when a frozen controller is modified. - * - * @author Igor Wiedler - */ -class ControllerFrozenException extends \RuntimeException -{ -} diff --git a/src/Silex/ExceptionHandler.php b/src/Silex/ExceptionHandler.php deleted file mode 100644 index 34eb893..0000000 --- a/src/Silex/ExceptionHandler.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex; - -use Symfony\Component\Debug\ExceptionHandler as DebugExceptionHandler; -use Symfony\Component\Debug\Exception\FlattenException; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; -use Symfony\Component\HttpKernel\KernelEvents; - -/** - * Default exception handler. - * - * @author Fabien Potencier - */ -class ExceptionHandler implements EventSubscriberInterface -{ - protected $debug; - - public function __construct($debug) - { - $this->debug = $debug; - } - - public function onSilexError(GetResponseForExceptionEvent $event) - { - $handler = new DebugExceptionHandler($this->debug); - - $exception = $event->getException(); - if (!$exception instanceof FlattenException) { - $exception = FlattenException::create($exception); - } - - $response = Response::create($handler->getHtml($exception), $exception->getStatusCode(), $exception->getHeaders())->setCharset(ini_get('default_charset')); - - $event->setResponse($response); - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() - { - return array(KernelEvents::EXCEPTION => array('onSilexError', -255)); - } -} diff --git a/src/Silex/ExceptionListenerWrapper.php b/src/Silex/ExceptionListenerWrapper.php deleted file mode 100644 index e0d527b..0000000 --- a/src/Silex/ExceptionListenerWrapper.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex; - -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; -use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; - -/** - * Wraps exception listeners. - * - * @author Fabien Potencier - */ -class ExceptionListenerWrapper -{ - protected $app; - protected $callback; - - /** - * Constructor. - * - * @param Application $app An Application instance - * @param callable $callback - */ - public function __construct(Application $app, $callback) - { - $this->app = $app; - $this->callback = $callback; - } - - public function __invoke(GetResponseForExceptionEvent $event) - { - $exception = $event->getException(); - $this->callback = $this->app['callback_resolver']->resolveCallback($this->callback); - - if (!$this->shouldRun($exception)) { - return; - } - - $code = $exception instanceof HttpExceptionInterface ? $exception->getStatusCode() : 500; - - $response = call_user_func($this->callback, $exception, $event->getRequest(), $code); - - $this->ensureResponse($response, $event); - } - - protected function shouldRun(\Exception $exception) - { - if (is_array($this->callback)) { - $callbackReflection = new \ReflectionMethod($this->callback[0], $this->callback[1]); - } elseif (is_object($this->callback) && !$this->callback instanceof \Closure) { - $callbackReflection = new \ReflectionObject($this->callback); - $callbackReflection = $callbackReflection->getMethod('__invoke'); - } else { - $callbackReflection = new \ReflectionFunction($this->callback); - } - - if ($callbackReflection->getNumberOfParameters() > 0) { - $parameters = $callbackReflection->getParameters(); - $expectedException = $parameters[0]; - if ($expectedException->getClass() && !$expectedException->getClass()->isInstance($exception)) { - return false; - } - } - - return true; - } - - protected function ensureResponse($response, GetResponseForExceptionEvent $event) - { - if ($response instanceof Response) { - $event->setResponse($response); - } else { - $viewEvent = new GetResponseForControllerResultEvent($this->app['kernel'], $event->getRequest(), $event->getRequestType(), $response); - $this->app['dispatcher']->dispatch(KernelEvents::VIEW, $viewEvent); - - if ($viewEvent->hasResponse()) { - $event->setResponse($viewEvent->getResponse()); - } - } - } -} diff --git a/src/Silex/Provider/AssetServiceProvider.php b/src/Silex/Provider/AssetServiceProvider.php deleted file mode 100644 index 6793f67..0000000 --- a/src/Silex/Provider/AssetServiceProvider.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Symfony\Component\Asset\Packages; -use Symfony\Component\Asset\Package; -use Symfony\Component\Asset\PathPackage; -use Symfony\Component\Asset\UrlPackage; -use Symfony\Component\Asset\Context\RequestStackContext; -use Symfony\Component\Asset\VersionStrategy\EmptyVersionStrategy; -use Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy; - -/** - * Symfony Asset component Provider. - * - * @author Fabien Potencier - */ -class AssetServiceProvider implements ServiceProviderInterface -{ - public function register(Container $app) - { - $app['assets.packages'] = function ($app) { - $packages = array(); - foreach ($app['assets.named_packages'] as $name => $package) { - $version = $app['assets.strategy_factory'](isset($package['version']) ? $package['version'] : '', isset($package['version_format']) ? $package['version_format'] : null); - - $packages[$name] = $app['assets.package_factory'](isset($package['base_path']) ? $package['base_path'] : '', isset($package['base_urls']) ? $package['base_urls'] : array(), $version, $name); - } - - return new Packages($app['assets.default_package'], $packages); - }; - - $app['assets.default_package'] = function ($app) { - $version = $app['assets.strategy_factory']($app['assets.version'], $app['assets.version_format']); - - return $app['assets.package_factory']($app['assets.base_path'], $app['assets.base_urls'], $version, 'default'); - }; - - $app['assets.context'] = function ($app) { - return new RequestStackContext($app['request_stack']); - }; - - $app['assets.base_path'] = ''; - $app['assets.base_urls'] = array(); - $app['assets.version'] = null; - $app['assets.version_format'] = null; - - $app['assets.named_packages'] = array(); - - // prototypes - - $app['assets.strategy_factory'] = $app->protect(function ($version, $format) use ($app) { - if (!$version) { - return new EmptyVersionStrategy(); - } - - return new StaticVersionStrategy($version, $format); - }); - - $app['assets.package_factory'] = $app->protect(function ($basePath, $baseUrls, $version, $name) use ($app) { - if ($basePath && $baseUrls) { - throw new \LogicException(sprintf('Asset package "%s" cannot have base URLs and base paths.', $name)); - } - - if (!$baseUrls) { - return new PathPackage($basePath, $version, $app['assets.context']); - } - - return new UrlPackage($baseUrls, $version, $app['assets.context']); - }); - } -} diff --git a/src/Silex/Provider/CsrfServiceProvider.php b/src/Silex/Provider/CsrfServiceProvider.php deleted file mode 100644 index eb6e882..0000000 --- a/src/Silex/Provider/CsrfServiceProvider.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Symfony\Component\Security\Csrf\CsrfTokenManager; -use Symfony\Component\Security\Csrf\TokenGenerator\UriSafeTokenGenerator; -use Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage; -use Symfony\Component\Security\Csrf\TokenStorage\NativeSessionTokenStorage; - -/** - * Symfony CSRF Security component Provider. - * - * @author Fabien Potencier - */ -class CsrfServiceProvider implements ServiceProviderInterface -{ - public function register(Container $app) - { - $app['csrf.token_manager'] = function ($app) { - return new CsrfTokenManager($app['csrf.token_generator'], $app['csrf.token_storage']); - }; - - $app['csrf.token_storage'] = function ($app) { - if (isset($app['session'])) { - return new SessionTokenStorage($app['session'], $app['csrf.session_namespace']); - } - - return new NativeSessionTokenStorage($app['csrf.session_namespace']); - }; - - $app['csrf.token_generator'] = function ($app) { - return new UriSafeTokenGenerator(); - }; - - $app['csrf.session_namespace'] = '_csrf'; - } -} diff --git a/src/Silex/Provider/DoctrineServiceProvider.php b/src/Silex/Provider/DoctrineServiceProvider.php deleted file mode 100644 index 9c71d5b..0000000 --- a/src/Silex/Provider/DoctrineServiceProvider.php +++ /dev/null @@ -1,129 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Doctrine\DBAL\DriverManager; -use Doctrine\DBAL\Configuration; -use Doctrine\Common\EventManager; -use Symfony\Bridge\Doctrine\Logger\DbalLogger; - -/** - * Doctrine DBAL Provider. - * - * @author Fabien Potencier - */ -class DoctrineServiceProvider implements ServiceProviderInterface -{ - public function register(Container $app) - { - $app['db.default_options'] = array( - 'driver' => 'pdo_mysql', - 'dbname' => null, - 'host' => 'localhost', - 'user' => 'root', - 'password' => null, - ); - - $app['dbs.options.initializer'] = $app->protect(function () use ($app) { - static $initialized = false; - - if ($initialized) { - return; - } - - $initialized = true; - - if (!isset($app['dbs.options'])) { - $app['dbs.options'] = array('default' => isset($app['db.options']) ? $app['db.options'] : array()); - } - - $tmp = $app['dbs.options']; - foreach ($tmp as $name => &$options) { - $options = array_replace($app['db.default_options'], $options); - - if (!isset($app['dbs.default'])) { - $app['dbs.default'] = $name; - } - } - $app['dbs.options'] = $tmp; - }); - - $app['dbs'] = function ($app) { - $app['dbs.options.initializer'](); - - $dbs = new Container(); - foreach ($app['dbs.options'] as $name => $options) { - if ($app['dbs.default'] === $name) { - // we use shortcuts here in case the default has been overridden - $config = $app['db.config']; - $manager = $app['db.event_manager']; - } else { - $config = $app['dbs.config'][$name]; - $manager = $app['dbs.event_manager'][$name]; - } - - $dbs[$name] = function ($dbs) use ($options, $config, $manager) { - return DriverManager::getConnection($options, $config, $manager); - }; - } - - return $dbs; - }; - - $app['dbs.config'] = function ($app) { - $app['dbs.options.initializer'](); - - $configs = new Container(); - $addLogger = isset($app['logger']) && null !== $app['logger'] && class_exists('Symfony\Bridge\Doctrine\Logger\DbalLogger'); - foreach ($app['dbs.options'] as $name => $options) { - $configs[$name] = new Configuration(); - if ($addLogger) { - $configs[$name]->setSQLLogger(new DbalLogger($app['logger'], isset($app['stopwatch']) ? $app['stopwatch'] : null)); - } - } - - return $configs; - }; - - $app['dbs.event_manager'] = function ($app) { - $app['dbs.options.initializer'](); - - $managers = new Container(); - foreach ($app['dbs.options'] as $name => $options) { - $managers[$name] = new EventManager(); - } - - return $managers; - }; - - // shortcuts for the "first" DB - $app['db'] = function ($app) { - $dbs = $app['dbs']; - - return $dbs[$app['dbs.default']]; - }; - - $app['db.config'] = function ($app) { - $dbs = $app['dbs.config']; - - return $dbs[$app['dbs.default']]; - }; - - $app['db.event_manager'] = function ($app) { - $dbs = $app['dbs.event_manager']; - - return $dbs[$app['dbs.default']]; - }; - } -} diff --git a/src/Silex/Provider/ExceptionHandlerServiceProvider.php b/src/Silex/Provider/ExceptionHandlerServiceProvider.php deleted file mode 100644 index 1c6f202..0000000 --- a/src/Silex/Provider/ExceptionHandlerServiceProvider.php +++ /dev/null @@ -1,32 +0,0 @@ -addSubscriber($app['exception_handler']); - } - } -} diff --git a/src/Silex/Provider/Form/SilexFormExtension.php b/src/Silex/Provider/Form/SilexFormExtension.php deleted file mode 100644 index 12efbdf..0000000 --- a/src/Silex/Provider/Form/SilexFormExtension.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider\Form; - -use Pimple\Container; -use Symfony\Component\Form\Exception\InvalidArgumentException; -use Symfony\Component\Form\FormExtensionInterface; -use Symfony\Component\Form\FormTypeGuesserChain; - -class SilexFormExtension implements FormExtensionInterface -{ - private $app; - private $types; - private $typeExtensions; - private $guessers; - private $guesserLoaded = false; - private $guesser; - - public function __construct(Container $app, array $types, array $typeExtensions, array $guessers) - { - $this->app = $app; - $this->setTypes($types); - $this->setTypeExtensions($typeExtensions); - $this->setGuessers($guessers); - } - - public function getType($name) - { - if (!isset($this->types[$name])) { - throw new InvalidArgumentException(sprintf('The type "%s" is not the name of a registered form type.', $name)); - } - if (!is_object($this->types[$name])) { - $this->types[$name] = $this->app[$this->types[$name]]; - } - - return $this->types[$name]; - } - - public function hasType($name) - { - return isset($this->types[$name]); - } - - public function getTypeExtensions($name) - { - return isset($this->typeExtensions[$name]) ? $this->typeExtensions[$name] : []; - } - - public function hasTypeExtensions($name) - { - return isset($this->typeExtensions[$name]); - } - - public function getTypeGuesser() - { - if (!$this->guesserLoaded) { - $this->guesserLoaded = true; - - if ($this->guessers) { - $guessers = []; - foreach ($this->guessers as $guesser) { - if (!is_object($guesser)) { - $guesser = $this->app[$guesser]; - } - $guessers[] = $guesser; - } - $this->guesser = new FormTypeGuesserChain($guessers); - } - } - - return $this->guesser; - } - - private function setTypes(array $types) - { - $this->types = []; - foreach ($types as $type) { - if (!is_object($type)) { - if (!isset($this->app[$type])) { - throw new InvalidArgumentException(sprintf('Invalid form type. The silex service "%s" does not exist.', $type)); - } - $this->types[$type] = $type; - } else { - $this->types[get_class($type)] = $type; - } - } - } - - private function setTypeExtensions(array $typeExtensions) - { - $this->typeExtensions = []; - foreach ($typeExtensions as $extension) { - if (!is_object($extension)) { - if (!isset($this->app[$extension])) { - throw new InvalidArgumentException(sprintf('Invalid form type extension. The silex service "%s" does not exist.', $extension)); - } - $extension = $this->app[$extension]; - } - $this->typeExtensions[$extension->getExtendedType()][] = $extension; - } - } - - private function setGuessers(array $guessers) - { - $this->guessers = []; - foreach ($guessers as $guesser) { - if (!is_object($guesser) && !isset($this->app[$guesser])) { - throw new InvalidArgumentException(sprintf('Invalid form type guesser. The silex service "%s" does not exist.', $guesser)); - } - $this->guessers[] = $guesser; - } - } -} diff --git a/src/Silex/Provider/FormServiceProvider.php b/src/Silex/Provider/FormServiceProvider.php deleted file mode 100644 index 26ca42b..0000000 --- a/src/Silex/Provider/FormServiceProvider.php +++ /dev/null @@ -1,88 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Symfony\Component\Form\Extension\Csrf\CsrfExtension; -use Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationExtension; -use Symfony\Component\Form\Extension\Validator\ValidatorExtension as FormValidatorExtension; -use Symfony\Component\Form\Forms; -use Symfony\Component\Form\ResolvedFormTypeFactory; - -/** - * Symfony Form component Provider. - * - * @author Fabien Potencier - */ -class FormServiceProvider implements ServiceProviderInterface -{ - public function register(Container $app) - { - if (!class_exists('Locale')) { - throw new \RuntimeException('You must either install the PHP intl extension or the Symfony Intl Component to use the Form extension.'); - } - - $app['form.types'] = function ($app) { - return array(); - }; - - $app['form.type.extensions'] = function ($app) { - return array(); - }; - - $app['form.type.guessers'] = function ($app) { - return array(); - }; - - $app['form.extension.csrf'] = function ($app) { - if (isset($app['translator'])) { - return new CsrfExtension($app['csrf.token_manager'], $app['translator']); - } - - return new CsrfExtension($app['csrf.token_manager']); - }; - - $app['form.extension.silex'] = function ($app) { - return new Form\SilexFormExtension($app, $app['form.types'], $app['form.type.extensions'], $app['form.type.guessers']); - }; - - $app['form.extensions'] = function ($app) { - $extensions = array( - new HttpFoundationExtension(), - ); - - if (isset($app['csrf.token_manager'])) { - $extensions[] = $app['form.extension.csrf']; - } - - if (isset($app['validator'])) { - $extensions[] = new FormValidatorExtension($app['validator']); - } - $extensions[] = $app['form.extension.silex']; - - return $extensions; - }; - - $app['form.factory'] = function ($app) { - return Forms::createFormFactoryBuilder() - ->addExtensions($app['form.extensions']) - ->setResolvedTypeFactory($app['form.resolved_type_factory']) - ->getFormFactory() - ; - }; - - $app['form.resolved_type_factory'] = function ($app) { - return new ResolvedFormTypeFactory(); - }; - } -} diff --git a/src/Silex/Provider/HttpCache/HttpCache.php b/src/Silex/Provider/HttpCache/HttpCache.php deleted file mode 100644 index b0ebb5c..0000000 --- a/src/Silex/Provider/HttpCache/HttpCache.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider\HttpCache; - -use Symfony\Component\HttpKernel\HttpCache\HttpCache as BaseHttpCache; -use Symfony\Component\HttpFoundation\Request; - -/** - * HTTP Cache extension to allow using the run() shortcut. - * - * @author Fabien Potencier - */ -class HttpCache extends BaseHttpCache -{ - /** - * Handles the Request and delivers the Response. - * - * @param Request $request The Request object - */ - public function run(Request $request = null) - { - if (null === $request) { - $request = Request::createFromGlobals(); - } - - $response = $this->handle($request); - $response->send(); - $this->terminate($request, $response); - } -} diff --git a/src/Silex/Provider/HttpCacheServiceProvider.php b/src/Silex/Provider/HttpCacheServiceProvider.php deleted file mode 100644 index 8b3f37e..0000000 --- a/src/Silex/Provider/HttpCacheServiceProvider.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Silex\Provider\HttpCache\HttpCache; -use Silex\Api\EventListenerProviderInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\HttpKernel\HttpCache\Esi; -use Symfony\Component\HttpKernel\HttpCache\Store; -use Symfony\Component\HttpKernel\EventListener\SurrogateListener; - -/** - * Symfony HttpKernel component Provider for HTTP cache. - * - * @author Fabien Potencier - */ -class HttpCacheServiceProvider implements ServiceProviderInterface, EventListenerProviderInterface -{ - public function register(Container $app) - { - $app['http_cache'] = function ($app) { - $app['http_cache.options'] = array_replace( - array( - 'debug' => $app['debug'], - ), $app['http_cache.options'] - ); - - return new HttpCache($app, $app['http_cache.store'], $app['http_cache.esi'], $app['http_cache.options']); - }; - - $app['http_cache.esi'] = function ($app) { - return new Esi(); - }; - - $app['http_cache.store'] = function ($app) { - return new Store($app['http_cache.cache_dir']); - }; - - $app['http_cache.esi_listener'] = function ($app) { - return new SurrogateListener($app['http_cache.esi']); - }; - - $app['http_cache.options'] = array(); - } - - public function subscribe(Container $app, EventDispatcherInterface $dispatcher) - { - $dispatcher->addSubscriber($app['http_cache.esi_listener']); - } -} diff --git a/src/Silex/Provider/HttpFragmentServiceProvider.php b/src/Silex/Provider/HttpFragmentServiceProvider.php deleted file mode 100644 index 9a641f4..0000000 --- a/src/Silex/Provider/HttpFragmentServiceProvider.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Silex\Api\EventListenerProviderInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\HttpKernel\Fragment\FragmentHandler; -use Symfony\Component\HttpKernel\Fragment\InlineFragmentRenderer; -use Symfony\Component\HttpKernel\Fragment\EsiFragmentRenderer; -use Symfony\Component\HttpKernel\Fragment\HIncludeFragmentRenderer; -use Symfony\Component\HttpKernel\EventListener\FragmentListener; -use Symfony\Component\HttpKernel\Kernel; -use Symfony\Component\HttpKernel\UriSigner; - -/** - * HttpKernel Fragment integration for Silex. - * - * @author Fabien Potencier - */ -class HttpFragmentServiceProvider implements ServiceProviderInterface, EventListenerProviderInterface -{ - public function register(Container $app) - { - $app['fragment.handler'] = function ($app) { - return new FragmentHandler($app['request_stack'], $app['fragment.renderers'], $app['debug']); - }; - - $app['fragment.renderer.inline'] = function ($app) { - $renderer = new InlineFragmentRenderer($app['kernel'], $app['dispatcher']); - $renderer->setFragmentPath($app['fragment.path']); - - return $renderer; - }; - - $app['fragment.renderer.hinclude'] = function ($app) { - $renderer = new HIncludeFragmentRenderer(null, $app['uri_signer'], $app['fragment.renderer.hinclude.global_template'], $app['charset']); - $renderer->setFragmentPath($app['fragment.path']); - - return $renderer; - }; - - $app['fragment.renderer.esi'] = function ($app) { - $renderer = new EsiFragmentRenderer($app['http_cache.esi'], $app['fragment.renderer.inline']); - $renderer->setFragmentPath($app['fragment.path']); - - return $renderer; - }; - - $app['fragment.listener'] = function ($app) { - return new FragmentListener($app['uri_signer'], $app['fragment.path']); - }; - - $app['uri_signer'] = function ($app) { - return new UriSigner($app['uri_signer.secret']); - }; - - $app['uri_signer.secret'] = md5(__DIR__); - $app['fragment.path'] = '/_fragment'; - $app['fragment.renderer.hinclude.global_template'] = null; - $app['fragment.renderers'] = function ($app) { - $renderers = array($app['fragment.renderer.inline'], $app['fragment.renderer.hinclude']); - - if (isset($app['http_cache.esi'])) { - $renderers[] = $app['fragment.renderer.esi']; - } - - return $renderers; - }; - } - - public function subscribe(Container $app, EventDispatcherInterface $dispatcher) - { - $dispatcher->addSubscriber($app['fragment.listener']); - } -} diff --git a/src/Silex/Provider/HttpKernelServiceProvider.php b/src/Silex/Provider/HttpKernelServiceProvider.php deleted file mode 100644 index 226ed1d..0000000 --- a/src/Silex/Provider/HttpKernelServiceProvider.php +++ /dev/null @@ -1,95 +0,0 @@ -= 30100) { - return new SfControllerResolver($app['logger']); - } - - return new ControllerResolver($app, $app['logger']); - }; - - if (Kernel::VERSION_ID >= 30100) { - $app['argument_metadata_factory'] = function ($app) { - return new ArgumentMetadataFactory(); - }; - $app['argument_value_resolvers'] = function ($app) { - if (Kernel::VERSION_ID < 30200) { - return array( - new AppArgumentValueResolver($app), - new RequestAttributeValueResolver(), - new RequestValueResolver(), - new DefaultValueResolver(), - new VariadicValueResolver(), - ); - } - - return array_merge(array(new AppArgumentValueResolver($app)), ArgumentResolver::getDefaultArgumentValueResolvers()); - }; - } - - $app['argument_resolver'] = function ($app) { - if (Kernel::VERSION_ID >= 30100) { - return new ArgumentResolver($app['argument_metadata_factory'], $app['argument_value_resolvers']); - } - }; - - $app['kernel'] = function ($app) { - return new HttpKernel($app['dispatcher'], $app['resolver'], $app['request_stack'], $app['argument_resolver']); - }; - - $app['request_stack'] = function () { - return new RequestStack(); - }; - - $app['dispatcher'] = function () { - return new EventDispatcher(); - }; - - $app['callback_resolver'] = function ($app) { - return new CallbackResolver($app); - }; - } - - /** - * {@inheritdoc} - */ - public function subscribe(Container $app, EventDispatcherInterface $dispatcher) - { - $dispatcher->addSubscriber(new ResponseListener($app['charset'])); - $dispatcher->addSubscriber(new MiddlewareListener($app)); - $dispatcher->addSubscriber(new ConverterListener($app['routes'], $app['callback_resolver'])); - $dispatcher->addSubscriber(new StringToResponseListener()); - } -} diff --git a/src/Silex/Provider/LICENSE b/src/Silex/Provider/LICENSE deleted file mode 100644 index bc6ad04..0000000 --- a/src/Silex/Provider/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010-2015 Fabien Potencier - -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/src/Silex/Provider/Locale/LocaleListener.php b/src/Silex/Provider/Locale/LocaleListener.php deleted file mode 100644 index d500264..0000000 --- a/src/Silex/Provider/Locale/LocaleListener.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider\Locale; - -use Pimple\Container; -use Symfony\Component\HttpKernel\Event\GetResponseEvent; -use Symfony\Component\HttpKernel\Event\FinishRequestEvent; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\Routing\RequestContext; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * Initializes the locale based on the current request. - * - * @author Fabien Potencier - * @author Jérôme Tamarelle - */ -class LocaleListener implements EventSubscriberInterface -{ - private $app; - private $defaultLocale; - private $requestStack; - private $requestContext; - - public function __construct(Container $app, $defaultLocale = 'en', RequestStack $requestStack, RequestContext $requestContext = null) - { - $this->app = $app; - $this->defaultLocale = $defaultLocale; - $this->requestStack = $requestStack; - $this->requestContext = $requestContext; - } - - public function onKernelRequest(GetResponseEvent $event) - { - $request = $event->getRequest(); - $request->setDefaultLocale($this->defaultLocale); - - $this->setLocale($request); - $this->setRouterContext($request); - - $this->app['locale'] = $request->getLocale(); - } - - public function onKernelFinishRequest(FinishRequestEvent $event) - { - if (null !== $parentRequest = $this->requestStack->getParentRequest()) { - $this->setRouterContext($parentRequest); - } - } - - private function setLocale(Request $request) - { - if ($locale = $request->attributes->get('_locale')) { - $request->setLocale($locale); - } - } - - private function setRouterContext(Request $request) - { - if (null !== $this->requestContext) { - $this->requestContext->setParameter('_locale', $request->getLocale()); - } - } - - public static function getSubscribedEvents() - { - return array( - // must be registered after the Router to have access to the _locale - KernelEvents::REQUEST => array(array('onKernelRequest', 16)), - KernelEvents::FINISH_REQUEST => array(array('onKernelFinishRequest', 0)), - ); - } -} diff --git a/src/Silex/Provider/LocaleServiceProvider.php b/src/Silex/Provider/LocaleServiceProvider.php deleted file mode 100644 index ddea81b..0000000 --- a/src/Silex/Provider/LocaleServiceProvider.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Silex\Api\EventListenerProviderInterface; -use Silex\Provider\Locale\LocaleListener; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; - -/** - * Locale Provider. - * - * @author Fabien Potencier - */ -class LocaleServiceProvider implements ServiceProviderInterface, EventListenerProviderInterface -{ - public function register(Container $app) - { - $app['locale.listener'] = function ($app) { - return new LocaleListener($app, $app['locale'], $app['request_stack'], isset($app['request_context']) ? $app['request_context'] : null); - }; - - $app['locale'] = 'en'; - } - - public function subscribe(Container $app, EventDispatcherInterface $dispatcher) - { - $dispatcher->addSubscriber($app['locale.listener']); - } -} diff --git a/src/Silex/Provider/MonologServiceProvider.php b/src/Silex/Provider/MonologServiceProvider.php deleted file mode 100644 index 34654e9..0000000 --- a/src/Silex/Provider/MonologServiceProvider.php +++ /dev/null @@ -1,139 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Monolog\Formatter\LineFormatter; -use Monolog\Logger; -use Monolog\Handler; -use Monolog\ErrorHandler; -use Silex\Application; -use Silex\Api\BootableProviderInterface; -use Symfony\Bridge\Monolog\Handler\DebugHandler; -use Symfony\Bridge\Monolog\Handler\FingersCrossed\NotFoundActivationStrategy; -use Silex\EventListener\LogListener; - -/** - * Monolog Provider. - * - * @author Fabien Potencier - */ -class MonologServiceProvider implements ServiceProviderInterface, BootableProviderInterface -{ - public function register(Container $app) - { - $app['logger'] = function () use ($app) { - return $app['monolog']; - }; - - if ($bridge = class_exists('Symfony\Bridge\Monolog\Logger')) { - $app['monolog.handler.debug'] = function () use ($app) { - $level = MonologServiceProvider::translateLevel($app['monolog.level']); - - return new DebugHandler($level); - }; - - if (isset($app['request_stack'])) { - $app['monolog.not_found_activation_strategy'] = function () use ($app) { - return new NotFoundActivationStrategy($app['request_stack'], array('^/'), $app['monolog.level']); - }; - } - } - - $app['monolog.logger.class'] = $bridge ? 'Symfony\Bridge\Monolog\Logger' : 'Monolog\Logger'; - - $app['monolog'] = function ($app) { - $log = new $app['monolog.logger.class']($app['monolog.name']); - - $handler = new Handler\GroupHandler($app['monolog.handlers']); - if (isset($app['monolog.not_found_activation_strategy'])) { - $handler = new Handler\FingersCrossedHandler($handler, $app['monolog.not_found_activation_strategy']); - } - - $log->pushHandler($handler); - - if ($app['debug'] && isset($app['monolog.handler.debug'])) { - $log->pushHandler($app['monolog.handler.debug']); - } - - return $log; - }; - - $app['monolog.formatter'] = function () { - return new LineFormatter(); - }; - - $app['monolog.handler'] = $defaultHandler = function () use ($app) { - $level = MonologServiceProvider::translateLevel($app['monolog.level']); - - $handler = new Handler\StreamHandler($app['monolog.logfile'], $level, $app['monolog.bubble'], $app['monolog.permission']); - $handler->setFormatter($app['monolog.formatter']); - - return $handler; - }; - - $app['monolog.handlers'] = function () use ($app, $defaultHandler) { - $handlers = array(); - - // enables the default handler if a logfile was set or the monolog.handler service was redefined - if ($app['monolog.logfile'] || $defaultHandler !== $app->raw('monolog.handler')) { - $handlers[] = $app['monolog.handler']; - } - - return $handlers; - }; - - $app['monolog.level'] = function () { - return Logger::DEBUG; - }; - - $app['monolog.listener'] = function () use ($app) { - return new LogListener($app['logger'], $app['monolog.exception.logger_filter']); - }; - - $app['monolog.name'] = 'app'; - $app['monolog.bubble'] = true; - $app['monolog.permission'] = null; - $app['monolog.exception.logger_filter'] = null; - $app['monolog.logfile'] = null; - $app['monolog.use_error_handler'] = !$app['debug']; - } - - public function boot(Application $app) - { - if ($app['monolog.use_error_handler']) { - ErrorHandler::register($app['monolog']); - } - - if (isset($app['monolog.listener'])) { - $app['dispatcher']->addSubscriber($app['monolog.listener']); - } - } - - public static function translateLevel($name) - { - // level is already translated to logger constant, return as-is - if (is_int($name)) { - return $name; - } - - $levels = Logger::getLevels(); - $upper = strtoupper($name); - - if (!isset($levels[$upper])) { - throw new \InvalidArgumentException("Provided logging level '$name' does not exist. Must be a valid monolog logging level."); - } - - return $levels[$upper]; - } -} diff --git a/src/Silex/Provider/RememberMeServiceProvider.php b/src/Silex/Provider/RememberMeServiceProvider.php deleted file mode 100644 index 766631c..0000000 --- a/src/Silex/Provider/RememberMeServiceProvider.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Silex\Api\EventListenerProviderInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\Security\Core\Authentication\Provider\RememberMeAuthenticationProvider; -use Symfony\Component\Security\Http\Firewall\RememberMeListener; -use Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices; -use Symfony\Component\Security\Http\RememberMe\ResponseListener; - -/** - * Remember-me authentication for the SecurityServiceProvider. - * - * @author Jérôme Tamarelle - */ -class RememberMeServiceProvider implements ServiceProviderInterface, EventListenerProviderInterface -{ - public function register(Container $app) - { - $app['security.remember_me.response_listener'] = function ($app) { - if (!isset($app['security.token_storage'])) { - throw new \LogicException('You must register the SecurityServiceProvider to use the RememberMeServiceProvider'); - } - - return new ResponseListener(); - }; - - $app['security.authentication_listener.factory.remember_me'] = $app->protect(function ($name, $options) use ($app) { - if (empty($options['key'])) { - $options['key'] = $name; - } - - if (!isset($app['security.remember_me.service.'.$name])) { - $app['security.remember_me.service.'.$name] = $app['security.remember_me.service._proto']($name, $options); - } - - if (!isset($app['security.authentication_listener.'.$name.'.remember_me'])) { - $app['security.authentication_listener.'.$name.'.remember_me'] = $app['security.authentication_listener.remember_me._proto']($name, $options); - } - - if (!isset($app['security.authentication_provider.'.$name.'.remember_me'])) { - $app['security.authentication_provider.'.$name.'.remember_me'] = $app['security.authentication_provider.remember_me._proto']($name, $options); - } - - return array( - 'security.authentication_provider.'.$name.'.remember_me', - 'security.authentication_listener.'.$name.'.remember_me', - null, // entry point - 'remember_me', - ); - }); - - $app['security.remember_me.service._proto'] = $app->protect(function ($providerKey, $options) use ($app) { - return function () use ($providerKey, $options, $app) { - $options = array_replace(array( - 'name' => 'REMEMBERME', - 'lifetime' => 31536000, - 'path' => '/', - 'domain' => null, - 'secure' => false, - 'httponly' => true, - 'always_remember_me' => false, - 'remember_me_parameter' => '_remember_me', - ), $options); - - return new TokenBasedRememberMeServices(array($app['security.user_provider.'.$providerKey]), $options['key'], $providerKey, $options, $app['logger']); - }; - }); - - $app['security.authentication_listener.remember_me._proto'] = $app->protect(function ($providerKey) use ($app) { - return function () use ($app, $providerKey) { - $listener = new RememberMeListener( - $app['security.token_storage'], - $app['security.remember_me.service.'.$providerKey], - $app['security.authentication_manager'], - $app['logger'], - $app['dispatcher'] - ); - - return $listener; - }; - }); - - $app['security.authentication_provider.remember_me._proto'] = $app->protect(function ($name, $options) use ($app) { - return function () use ($app, $name, $options) { - return new RememberMeAuthenticationProvider($app['security.user_checker'], $options['key'], $name); - }; - }); - } - - public function subscribe(Container $app, EventDispatcherInterface $dispatcher) - { - $dispatcher->addSubscriber($app['security.remember_me.response_listener']); - } -} diff --git a/src/Silex/Provider/Routing/LazyRequestMatcher.php b/src/Silex/Provider/Routing/LazyRequestMatcher.php deleted file mode 100644 index 6837c79..0000000 --- a/src/Silex/Provider/Routing/LazyRequestMatcher.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider\Routing; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Routing\Matcher\RequestMatcherInterface; -use Symfony\Component\Routing\Matcher\UrlMatcherInterface; - -/** - * Implements a lazy UrlMatcher. - * - * @author Igor Wiedler - * @author Jérôme Tamarelle - */ -class LazyRequestMatcher implements RequestMatcherInterface -{ - private $factory; - - public function __construct(\Closure $factory) - { - $this->factory = $factory; - } - - /** - * Returns the corresponding RequestMatcherInterface instance. - * - * @return UrlMatcherInterface - */ - public function getRequestMatcher() - { - $matcher = call_user_func($this->factory); - if (!$matcher instanceof RequestMatcherInterface) { - throw new \LogicException("Factory supplied to LazyRequestMatcher must return implementation of Symfony\Component\Routing\RequestMatcherInterface."); - } - - return $matcher; - } - - /** - * {@inheritdoc} - */ - public function matchRequest(Request $request) - { - return $this->getRequestMatcher()->matchRequest($request); - } -} diff --git a/src/Silex/Provider/Routing/RedirectableUrlMatcher.php b/src/Silex/Provider/Routing/RedirectableUrlMatcher.php deleted file mode 100644 index 021328b..0000000 --- a/src/Silex/Provider/Routing/RedirectableUrlMatcher.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider\Routing; - -use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\Routing\Matcher\RedirectableUrlMatcher as BaseRedirectableUrlMatcher; - -/** - * Implements the RedirectableUrlMatcherInterface for Silex. - * - * @author Fabien Potencier - */ -class RedirectableUrlMatcher extends BaseRedirectableUrlMatcher -{ - /** - * {@inheritdoc} - */ - public function redirect($path, $route, $scheme = null) - { - $url = $this->context->getBaseUrl().$path; - $query = $this->context->getQueryString() ?: ''; - - if ($query !== '') { - $url .= '?'.$query; - } - - if ($this->context->getHost()) { - if ($scheme) { - $port = ''; - if ('http' === $scheme && 80 != $this->context->getHttpPort()) { - $port = ':'.$this->context->getHttpPort(); - } elseif ('https' === $scheme && 443 != $this->context->getHttpsPort()) { - $port = ':'.$this->context->getHttpsPort(); - } - - $url = $scheme.'://'.$this->context->getHost().$port.$url; - } - } - - return array( - '_controller' => function ($url) { return new RedirectResponse($url, 301); }, - '_route' => null, - 'url' => $url, - ); - } -} diff --git a/src/Silex/Provider/RoutingServiceProvider.php b/src/Silex/Provider/RoutingServiceProvider.php deleted file mode 100644 index d040ba0..0000000 --- a/src/Silex/Provider/RoutingServiceProvider.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Silex\ControllerCollection; -use Silex\Api\EventListenerProviderInterface; -use Silex\Provider\Routing\RedirectableUrlMatcher; -use Silex\Provider\Routing\LazyRequestMatcher; -use Symfony\Component\Routing\RouteCollection; -use Symfony\Component\Routing\Generator\UrlGenerator; -use Symfony\Component\Routing\RequestContext; -use Symfony\Component\HttpKernel\EventListener\RouterListener; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; - -/** - * Symfony Routing component Provider. - * - * @author Fabien Potencier - */ -class RoutingServiceProvider implements ServiceProviderInterface, EventListenerProviderInterface -{ - public function register(Container $app) - { - $app['route_class'] = 'Silex\\Route'; - - $app['route_factory'] = $app->factory(function ($app) { - return new $app['route_class'](); - }); - - $app['routes_factory'] = $app->factory(function () { - return new RouteCollection(); - }); - - $app['routes'] = function ($app) { - return $app['routes_factory']; - }; - $app['url_generator'] = function ($app) { - return new UrlGenerator($app['routes'], $app['request_context']); - }; - - $app['request_matcher'] = function ($app) { - return new RedirectableUrlMatcher($app['routes'], $app['request_context']); - }; - - $app['request_context'] = function ($app) { - $context = new RequestContext(); - - $context->setHttpPort(isset($app['request.http_port']) ? $app['request.http_port'] : 80); - $context->setHttpsPort(isset($app['request.https_port']) ? $app['request.https_port'] : 443); - - return $context; - }; - - $app['controllers'] = function ($app) { - return $app['controllers_factory']; - }; - - $controllers_factory = function () use ($app, &$controllers_factory) { - return new ControllerCollection($app['route_factory'], $app['routes_factory'], $controllers_factory); - }; - $app['controllers_factory'] = $app->factory($controllers_factory); - - $app['routing.listener'] = function ($app) { - $urlMatcher = new LazyRequestMatcher(function () use ($app) { - return $app['request_matcher']; - }); - - return new RouterListener($urlMatcher, $app['request_stack'], $app['request_context'], $app['logger']); - }; - } - - public function subscribe(Container $app, EventDispatcherInterface $dispatcher) - { - $dispatcher->addSubscriber($app['routing.listener']); - } -} diff --git a/src/Silex/Provider/SecurityServiceProvider.php b/src/Silex/Provider/SecurityServiceProvider.php deleted file mode 100644 index ee7d34b..0000000 --- a/src/Silex/Provider/SecurityServiceProvider.php +++ /dev/null @@ -1,684 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Silex\Application; -use Silex\Api\BootableProviderInterface; -use Silex\Api\ControllerProviderInterface; -use Silex\Api\EventListenerProviderInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\HttpFoundation\RequestMatcher; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Security\Core\Security; -use Symfony\Component\Security\Core\User\UserChecker; -use Symfony\Component\Security\Core\User\InMemoryUserProvider; -use Symfony\Component\Security\Core\Encoder\EncoderFactory; -use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder; -use Symfony\Component\Security\Core\Encoder\BCryptPasswordEncoder; -use Symfony\Component\Security\Core\Encoder\Pbkdf2PasswordEncoder; -use Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider; -use Symfony\Component\Security\Core\Authentication\Provider\AnonymousAuthenticationProvider; -use Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager; -use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver; -use Symfony\Component\Security\Http\Authentication\DefaultAuthenticationSuccessHandler; -use Symfony\Component\Security\Http\Authentication\DefaultAuthenticationFailureHandler; -use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; -use Symfony\Component\Security\Core\Authorization\AuthorizationChecker; -use Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter; -use Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter; -use Symfony\Component\Security\Core\Authorization\AccessDecisionManager; -use Symfony\Component\Security\Core\Role\RoleHierarchy; -use Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator; -use Symfony\Component\Security\Http\Firewall; -use Symfony\Component\Security\Http\FirewallMap; -use Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener; -use Symfony\Component\Security\Http\Firewall\AccessListener; -use Symfony\Component\Security\Http\Firewall\BasicAuthenticationListener; -use Symfony\Component\Security\Http\Firewall\LogoutListener; -use Symfony\Component\Security\Http\Firewall\SwitchUserListener; -use Symfony\Component\Security\Http\Firewall\AnonymousAuthenticationListener; -use Symfony\Component\Security\Http\Firewall\ContextListener; -use Symfony\Component\Security\Http\Firewall\ExceptionListener; -use Symfony\Component\Security\Http\Firewall\ChannelListener; -use Symfony\Component\Security\Http\EntryPoint\FormAuthenticationEntryPoint; -use Symfony\Component\Security\Http\EntryPoint\BasicAuthenticationEntryPoint; -use Symfony\Component\Security\Http\EntryPoint\RetryAuthenticationEntryPoint; -use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy; -use Symfony\Component\Security\Http\Logout\SessionLogoutHandler; -use Symfony\Component\Security\Http\Logout\DefaultLogoutSuccessHandler; -use Symfony\Component\Security\Http\AccessMap; -use Symfony\Component\Security\Http\HttpUtils; -use Symfony\Component\Security\Guard\GuardAuthenticatorHandler; -use Symfony\Component\Security\Guard\Firewall\GuardAuthenticationListener; -use Symfony\Component\Security\Guard\Provider\GuardAuthenticationProvider; - -/** - * Symfony Security component Provider. - * - * @author Fabien Potencier - */ -class SecurityServiceProvider implements ServiceProviderInterface, EventListenerProviderInterface, ControllerProviderInterface, BootableProviderInterface -{ - protected $fakeRoutes; - - public function register(Container $app) - { - // used to register routes for login_check and logout - $this->fakeRoutes = array(); - - $that = $this; - - $app['security.role_hierarchy'] = array(); - $app['security.access_rules'] = array(); - $app['security.hide_user_not_found'] = true; - $app['security.encoder.bcrypt.cost'] = 13; - - $app['security.authorization_checker'] = function ($app) { - return new AuthorizationChecker($app['security.token_storage'], $app['security.authentication_manager'], $app['security.access_manager']); - }; - - $app['security.token_storage'] = function ($app) { - return new TokenStorage(); - }; - - $app['user'] = $app->factory(function ($app) { - if (null === $token = $app['security.token_storage']->getToken()) { - return; - } - - if (!is_object($user = $token->getUser())) { - return; - } - - return $user; - }); - - $app['security.authentication_manager'] = function ($app) { - $manager = new AuthenticationProviderManager($app['security.authentication_providers']); - $manager->setEventDispatcher($app['dispatcher']); - - return $manager; - }; - - // by default, all users use the digest encoder - $app['security.encoder_factory'] = function ($app) { - return new EncoderFactory(array( - 'Symfony\Component\Security\Core\User\UserInterface' => $app['security.default_encoder'], - )); - }; - - // by default, all users use the BCrypt encoder - $app['security.default_encoder'] = function ($app) { - return $app['security.encoder.bcrypt']; - }; - - $app['security.encoder.digest'] = function ($app) { - return new MessageDigestPasswordEncoder(); - }; - - $app['security.encoder.bcrypt'] = function ($app) { - return new BCryptPasswordEncoder($app['security.encoder.bcrypt.cost']); - }; - - $app['security.encoder.pbkdf2'] = function ($app) { - return new Pbkdf2PasswordEncoder(); - }; - - $app['security.user_checker'] = function ($app) { - return new UserChecker(); - }; - - $app['security.access_manager'] = function ($app) { - return new AccessDecisionManager($app['security.voters']); - }; - - $app['security.voters'] = function ($app) { - return array( - new RoleHierarchyVoter(new RoleHierarchy($app['security.role_hierarchy'])), - new AuthenticatedVoter($app['security.trust_resolver']), - ); - }; - - $app['security.firewall'] = function ($app) { - return new Firewall($app['security.firewall_map'], $app['dispatcher']); - }; - - $app['security.channel_listener'] = function ($app) { - return new ChannelListener( - $app['security.access_map'], - new RetryAuthenticationEntryPoint( - isset($app['request.http_port']) ? $app['request.http_port'] : 80, - isset($app['request.https_port']) ? $app['request.https_port'] : 443 - ), - $app['logger'] - ); - }; - - // generate the build-in authentication factories - foreach (array('logout', 'pre_auth', 'guard', 'form', 'http', 'remember_me', 'anonymous') as $type) { - $entryPoint = null; - if ('http' === $type) { - $entryPoint = 'http'; - } elseif ('form' === $type) { - $entryPoint = 'form'; - } elseif ('guard' === $type) { - $entryPoint = 'guard'; - } - - $app['security.authentication_listener.factory.'.$type] = $app->protect(function ($name, $options) use ($type, $app, $entryPoint) { - if ($entryPoint && !isset($app['security.entry_point.'.$name.'.'.$entryPoint])) { - $app['security.entry_point.'.$name.'.'.$entryPoint] = $app['security.entry_point.'.$entryPoint.'._proto']($name, $options); - } - - if (!isset($app['security.authentication_listener.'.$name.'.'.$type])) { - $app['security.authentication_listener.'.$name.'.'.$type] = $app['security.authentication_listener.'.$type.'._proto']($name, $options); - } - - $provider = 'dao'; - if ('anonymous' === $type) { - $provider = 'anonymous'; - } elseif ('guard' === $type) { - $provider = 'guard'; - } - if (!isset($app['security.authentication_provider.'.$name.'.'.$provider])) { - $app['security.authentication_provider.'.$name.'.'.$provider] = $app['security.authentication_provider.'.$provider.'._proto']($name, $options); - } - - return array( - 'security.authentication_provider.'.$name.'.'.$provider, - 'security.authentication_listener.'.$name.'.'.$type, - $entryPoint ? 'security.entry_point.'.$name.'.'.$entryPoint : null, - $type, - ); - }); - } - - $app['security.firewall_map'] = function ($app) { - $positions = array('logout', 'pre_auth', 'guard', 'form', 'http', 'remember_me', 'anonymous'); - $providers = array(); - $configs = array(); - foreach ($app['security.firewalls'] as $name => $firewall) { - $entryPoint = null; - $pattern = isset($firewall['pattern']) ? $firewall['pattern'] : null; - $users = isset($firewall['users']) ? $firewall['users'] : array(); - $security = isset($firewall['security']) ? (bool) $firewall['security'] : true; - $stateless = isset($firewall['stateless']) ? (bool) $firewall['stateless'] : false; - $context = isset($firewall['context']) ? $firewall['context'] : $name; - unset($firewall['pattern'], $firewall['users'], $firewall['security'], $firewall['stateless'], $firewall['context']); - - $protected = false === $security ? false : count($firewall); - - $listeners = array('security.channel_listener'); - - if ($protected) { - if (!isset($app['security.context_listener.'.$name])) { - if (!isset($app['security.user_provider.'.$name])) { - $app['security.user_provider.'.$name] = is_array($users) ? $app['security.user_provider.inmemory._proto']($users) : $users; - } - - $app['security.context_listener.'.$name] = $app['security.context_listener._proto']($name, array($app['security.user_provider.'.$name])); - } - - if (false === $stateless) { - $listeners[] = 'security.context_listener.'.$context; - } - - $factories = array(); - foreach ($positions as $position) { - $factories[$position] = array(); - } - - foreach ($firewall as $type => $options) { - if ('switch_user' === $type) { - continue; - } - - // normalize options - if (!is_array($options)) { - if (!$options) { - continue; - } - - $options = array(); - } - - if (!isset($app['security.authentication_listener.factory.'.$type])) { - throw new \LogicException(sprintf('The "%s" authentication entry is not registered.', $type)); - } - - $options['stateless'] = $stateless; - - list($providerId, $listenerId, $entryPointId, $position) = $app['security.authentication_listener.factory.'.$type]($name, $options); - - if (null !== $entryPointId) { - $entryPoint = $entryPointId; - } - - $factories[$position][] = $listenerId; - $providers[] = $providerId; - } - - foreach ($positions as $position) { - foreach ($factories[$position] as $listener) { - $listeners[] = $listener; - } - } - - $listeners[] = 'security.access_listener'; - - if (isset($firewall['switch_user'])) { - $app['security.switch_user.'.$name] = $app['security.authentication_listener.switch_user._proto']($name, $firewall['switch_user']); - - $listeners[] = 'security.switch_user.'.$name; - } - - if (!isset($app['security.exception_listener.'.$name])) { - if (null == $entryPoint) { - $app[$entryPoint = 'security.entry_point.'.$name.'.form'] = $app['security.entry_point.form._proto']($name, array()); - } - $accessDeniedHandler = null; - if (isset($app['security.access_denied_handler.'.$name])) { - $accessDeniedHandler = $app['security.access_denied_handler.'.$name]; - } - $app['security.exception_listener.'.$name] = $app['security.exception_listener._proto']($entryPoint, $name, $accessDeniedHandler); - } - } - - $configs[$name] = array($pattern, $listeners, $protected); - } - - $app['security.authentication_providers'] = array_map(function ($provider) use ($app) { - return $app[$provider]; - }, array_unique($providers)); - - $map = new FirewallMap(); - foreach ($configs as $name => $config) { - $map->add( - is_string($config[0]) ? new RequestMatcher($config[0]) : $config[0], - array_map(function ($listenerId) use ($app, $name) { - $listener = $app[$listenerId]; - - if (isset($app['security.remember_me.service.'.$name])) { - if ($listener instanceof AbstractAuthenticationListener || $listener instanceof GuardAuthenticationListener) { - $listener->setRememberMeServices($app['security.remember_me.service.'.$name]); - } - if ($listener instanceof LogoutListener) { - $listener->addHandler($app['security.remember_me.service.'.$name]); - } - } - - return $listener; - }, $config[1]), - $config[2] ? $app['security.exception_listener.'.$name] : null - ); - } - - return $map; - }; - - $app['security.access_listener'] = function ($app) { - return new AccessListener( - $app['security.token_storage'], - $app['security.access_manager'], - $app['security.access_map'], - $app['security.authentication_manager'], - $app['logger'] - ); - }; - - $app['security.access_map'] = function ($app) { - $map = new AccessMap(); - - foreach ($app['security.access_rules'] as $rule) { - if (is_string($rule[0])) { - $rule[0] = new RequestMatcher($rule[0]); - } elseif (is_array($rule[0])) { - $rule[0] += [ - 'path' => null, - 'host' => null, - 'methods' => null, - 'ips' => null, - 'attributes' => array(), - 'schemes' => null, - ]; - $rule[0] = new RequestMatcher($rule[0]['path'], $rule[0]['host'], $rule[0]['methods'], $rule[0]['ips'], $rule[0]['attributes'], $rule[0]['schemes']); - } - $map->add($rule[0], (array) $rule[1], isset($rule[2]) ? $rule[2] : null); - } - - return $map; - }; - - $app['security.trust_resolver'] = function ($app) { - return new AuthenticationTrustResolver('Symfony\Component\Security\Core\Authentication\Token\AnonymousToken', 'Symfony\Component\Security\Core\Authentication\Token\RememberMeToken'); - }; - - $app['security.session_strategy'] = function ($app) { - return new SessionAuthenticationStrategy(SessionAuthenticationStrategy::MIGRATE); - }; - - $app['security.http_utils'] = function ($app) { - return new HttpUtils($app['url_generator'], $app['request_matcher']); - }; - - $app['security.last_error'] = $app->protect(function (Request $request) { - if ($request->attributes->has(Security::AUTHENTICATION_ERROR)) { - return $request->attributes->get(Security::AUTHENTICATION_ERROR)->getMessage(); - } - - $session = $request->getSession(); - if ($session && $session->has(Security::AUTHENTICATION_ERROR)) { - $message = $session->get(Security::AUTHENTICATION_ERROR)->getMessage(); - $session->remove(Security::AUTHENTICATION_ERROR); - - return $message; - } - }); - - // prototypes (used by the Firewall Map) - - $app['security.context_listener._proto'] = $app->protect(function ($providerKey, $userProviders) use ($app) { - return function () use ($app, $userProviders, $providerKey) { - return new ContextListener( - $app['security.token_storage'], - $userProviders, - $providerKey, - $app['logger'], - $app['dispatcher'] - ); - }; - }); - - $app['security.user_provider.inmemory._proto'] = $app->protect(function ($params) use ($app) { - return function () use ($app, $params) { - $users = array(); - foreach ($params as $name => $user) { - $users[$name] = array('roles' => (array) $user[0], 'password' => $user[1]); - } - - return new InMemoryUserProvider($users); - }; - }); - - $app['security.exception_listener._proto'] = $app->protect(function ($entryPoint, $name, $accessDeniedHandler = null) use ($app) { - return function () use ($app, $entryPoint, $name, $accessDeniedHandler) { - return new ExceptionListener( - $app['security.token_storage'], - $app['security.trust_resolver'], - $app['security.http_utils'], - $name, - $app[$entryPoint], - null, // errorPage - $accessDeniedHandler, - $app['logger'] - ); - }; - }); - - $app['security.authentication.success_handler._proto'] = $app->protect(function ($name, $options) use ($app) { - return function () use ($name, $options, $app) { - $handler = new DefaultAuthenticationSuccessHandler( - $app['security.http_utils'], - $options - ); - $handler->setProviderKey($name); - - return $handler; - }; - }); - - $app['security.authentication.failure_handler._proto'] = $app->protect(function ($name, $options) use ($app) { - return function () use ($name, $options, $app) { - return new DefaultAuthenticationFailureHandler( - $app, - $app['security.http_utils'], - $options, - $app['logger'] - ); - }; - }); - - $app['security.authentication_listener.guard._proto'] = $app->protect(function ($providerKey, $options) use ($app, $that) { - return function () use ($app, $providerKey, $options, $that) { - if (!isset($app['security.authentication.guard_handler'])) { - $app['security.authentication.guard_handler'] = new GuardAuthenticatorHandler($app['security.token_storage'], $app['dispatcher']); - } - - $authenticators = array(); - foreach ($options['authenticators'] as $authenticatorId) { - $authenticators[] = $app[$authenticatorId]; - } - - return new GuardAuthenticationListener( - $app['security.authentication.guard_handler'], - $app['security.authentication_manager'], - $providerKey, - $authenticators, - $app['logger'] - ); - }; - }); - - $app['security.authentication_listener.form._proto'] = $app->protect(function ($name, $options) use ($app, $that) { - return function () use ($app, $name, $options, $that) { - $that->addFakeRoute( - 'match', - $tmp = isset($options['check_path']) ? $options['check_path'] : '/login_check', - str_replace('/', '_', ltrim($tmp, '/')) - ); - - $class = isset($options['listener_class']) ? $options['listener_class'] : 'Symfony\\Component\\Security\\Http\\Firewall\\UsernamePasswordFormAuthenticationListener'; - - if (!isset($app['security.authentication.success_handler.'.$name])) { - $app['security.authentication.success_handler.'.$name] = $app['security.authentication.success_handler._proto']($name, $options); - } - - if (!isset($app['security.authentication.failure_handler.'.$name])) { - $app['security.authentication.failure_handler.'.$name] = $app['security.authentication.failure_handler._proto']($name, $options); - } - - return new $class( - $app['security.token_storage'], - $app['security.authentication_manager'], - isset($app['security.session_strategy.'.$name]) ? $app['security.session_strategy.'.$name] : $app['security.session_strategy'], - $app['security.http_utils'], - $name, - $app['security.authentication.success_handler.'.$name], - $app['security.authentication.failure_handler.'.$name], - $options, - $app['logger'], - $app['dispatcher'], - isset($options['with_csrf']) && $options['with_csrf'] && isset($app['csrf.token_manager']) ? $app['csrf.token_manager'] : null - ); - }; - }); - - $app['security.authentication_listener.http._proto'] = $app->protect(function ($providerKey, $options) use ($app) { - return function () use ($app, $providerKey, $options) { - return new BasicAuthenticationListener( - $app['security.token_storage'], - $app['security.authentication_manager'], - $providerKey, - $app['security.entry_point.'.$providerKey.'.http'], - $app['logger'] - ); - }; - }); - - $app['security.authentication_listener.anonymous._proto'] = $app->protect(function ($providerKey, $options) use ($app) { - return function () use ($app, $providerKey, $options) { - return new AnonymousAuthenticationListener( - $app['security.token_storage'], - $providerKey, - $app['logger'] - ); - }; - }); - - $app['security.authentication.logout_handler._proto'] = $app->protect(function ($name, $options) use ($app) { - return function () use ($name, $options, $app) { - return new DefaultLogoutSuccessHandler( - $app['security.http_utils'], - isset($options['target_url']) ? $options['target_url'] : '/' - ); - }; - }); - - $app['security.authentication_listener.logout._proto'] = $app->protect(function ($name, $options) use ($app, $that) { - return function () use ($app, $name, $options, $that) { - $that->addFakeRoute( - 'get', - $tmp = isset($options['logout_path']) ? $options['logout_path'] : '/logout', - str_replace('/', '_', ltrim($tmp, '/')) - ); - - if (!isset($app['security.authentication.logout_handler.'.$name])) { - $app['security.authentication.logout_handler.'.$name] = $app['security.authentication.logout_handler._proto']($name, $options); - } - - $listener = new LogoutListener( - $app['security.token_storage'], - $app['security.http_utils'], - $app['security.authentication.logout_handler.'.$name], - $options, - isset($options['with_csrf']) && $options['with_csrf'] && isset($app['csrf.token_manager']) ? $app['csrf.token_manager'] : null - ); - - $invalidateSession = isset($options['invalidate_session']) ? $options['invalidate_session'] : true; - if (true === $invalidateSession && false === $options['stateless']) { - $listener->addHandler(new SessionLogoutHandler()); - } - - return $listener; - }; - }); - - $app['security.authentication_listener.switch_user._proto'] = $app->protect(function ($name, $options) use ($app, $that) { - return function () use ($app, $name, $options, $that) { - return new SwitchUserListener( - $app['security.token_storage'], - $app['security.user_provider.'.$name], - $app['security.user_checker'], - $name, - $app['security.access_manager'], - $app['logger'], - isset($options['parameter']) ? $options['parameter'] : '_switch_user', - isset($options['role']) ? $options['role'] : 'ROLE_ALLOWED_TO_SWITCH', - $app['dispatcher'] - ); - }; - }); - - $app['security.entry_point.form._proto'] = $app->protect(function ($name, array $options) use ($app) { - return function () use ($app, $options) { - $loginPath = isset($options['login_path']) ? $options['login_path'] : '/login'; - $useForward = isset($options['use_forward']) ? $options['use_forward'] : false; - - return new FormAuthenticationEntryPoint($app, $app['security.http_utils'], $loginPath, $useForward); - }; - }); - - $app['security.entry_point.http._proto'] = $app->protect(function ($name, array $options) use ($app) { - return function () use ($app, $name, $options) { - return new BasicAuthenticationEntryPoint(isset($options['real_name']) ? $options['real_name'] : 'Secured'); - }; - }); - - $app['security.entry_point.guard._proto'] = $app->protect(function ($name, array $options) use ($app) { - if (isset($options['entry_point'])) { - // if it's configured explicitly, use it! - return $app[$options['entry_point']]; - } - $authenticatorIds = $options['authenticators']; - if (count($authenticatorIds) == 1) { - // if there is only one authenticator, use that as the entry point - return $app[reset($authenticatorIds)]; - } - // we have multiple entry points - we must ask them to configure one - throw new \LogicException(sprintf( - 'Because you have multiple guard configurators, you need to set the "guard.entry_point" key to one of you configurators (%s)', - implode(', ', $authenticatorIds) - )); - }); - - $app['security.authentication_provider.dao._proto'] = $app->protect(function ($name, $options) use ($app) { - return function () use ($app, $name) { - return new DaoAuthenticationProvider( - $app['security.user_provider.'.$name], - $app['security.user_checker'], - $name, - $app['security.encoder_factory'], - $app['security.hide_user_not_found'] - ); - }; - }); - - $app['security.authentication_provider.guard._proto'] = $app->protect(function ($name, $options) use ($app) { - return function () use ($app, $name, $options) { - $authenticators = array(); - foreach ($options['authenticators'] as $authenticatorId) { - $authenticators[] = $app[$authenticatorId]; - } - - return new GuardAuthenticationProvider( - $authenticators, - $app['security.user_provider.'.$name], - $name, - $app['security.user_checker'] - ); - }; - }); - - $app['security.authentication_provider.anonymous._proto'] = $app->protect(function ($name, $options) use ($app) { - return function () use ($app, $name) { - return new AnonymousAuthenticationProvider($name); - }; - }); - - if (isset($app['validator'])) { - $app['security.validator.user_password_validator'] = function ($app) { - return new UserPasswordValidator($app['security.token_storage'], $app['security.encoder_factory']); - }; - - $app['validator.validator_service_ids'] = array_merge($app['validator.validator_service_ids'], array('security.validator.user_password' => 'security.validator.user_password_validator')); - } - } - - public function subscribe(Container $app, EventDispatcherInterface $dispatcher) - { - $dispatcher->addSubscriber($app['security.firewall']); - } - - public function connect(Application $app) - { - $controllers = $app['controllers_factory']; - foreach ($this->fakeRoutes as $route) { - list($method, $pattern, $name) = $route; - - $controllers->$method($pattern)->run(null)->bind($name); - } - - return $controllers; - } - - public function boot(Application $app) - { - $app->mount('/', $this->connect($app)); - } - - public function addFakeRoute($method, $pattern, $name) - { - $this->fakeRoutes[] = array($method, $pattern, $name); - } -} diff --git a/src/Silex/Provider/SerializerServiceProvider.php b/src/Silex/Provider/SerializerServiceProvider.php deleted file mode 100644 index 8986abe..0000000 --- a/src/Silex/Provider/SerializerServiceProvider.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Symfony\Component\Serializer\Serializer; -use Symfony\Component\Serializer\Encoder\JsonEncoder; -use Symfony\Component\Serializer\Encoder\XmlEncoder; -use Symfony\Component\Serializer\Normalizer\CustomNormalizer; -use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer; - -/** - * Symfony Serializer component Provider. - * - * @author Fabien Potencier - * @author Marijn Huizendveld - */ -class SerializerServiceProvider implements ServiceProviderInterface -{ - /** - * {@inheritdoc} - * - * This method registers a serializer service. {@link http://api.symfony.com/master/Symfony/Component/Serializer/Serializer.html - * The service is provided by the Symfony Serializer component}. - */ - public function register(Container $app) - { - $app['serializer'] = function ($app) { - return new Serializer($app['serializer.normalizers'], $app['serializer.encoders']); - }; - - $app['serializer.encoders'] = function () { - return array(new JsonEncoder(), new XmlEncoder()); - }; - - $app['serializer.normalizers'] = function () { - return array(new CustomNormalizer(), new GetSetMethodNormalizer()); - }; - } -} diff --git a/src/Silex/Provider/ServiceControllerServiceProvider.php b/src/Silex/Provider/ServiceControllerServiceProvider.php deleted file mode 100644 index 1c38adc..0000000 --- a/src/Silex/Provider/ServiceControllerServiceProvider.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Silex\ServiceControllerResolver; - -class ServiceControllerServiceProvider implements ServiceProviderInterface -{ - public function register(Container $app) - { - $app->extend('resolver', function ($resolver, $app) { - return new ServiceControllerResolver($resolver, $app['callback_resolver']); - }); - } -} diff --git a/src/Silex/Provider/Session/SessionListener.php b/src/Silex/Provider/Session/SessionListener.php deleted file mode 100644 index aba4c4e..0000000 --- a/src/Silex/Provider/Session/SessionListener.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider\Session; - -use Pimple\Container; -use Symfony\Component\HttpKernel\EventListener\SessionListener as BaseSessionListener; - -/** - * Sets the session in the request. - * - * @author Fabien Potencier - */ -class SessionListener extends BaseSessionListener -{ - private $app; - - public function __construct(Container $app) - { - $this->app = $app; - } - - protected function getSession() - { - if (!isset($this->app['session'])) { - return; - } - - return $this->app['session']; - } -} diff --git a/src/Silex/Provider/Session/TestSessionListener.php b/src/Silex/Provider/Session/TestSessionListener.php deleted file mode 100644 index ab98eb1..0000000 --- a/src/Silex/Provider/Session/TestSessionListener.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider\Session; - -use Pimple\Container; -use Symfony\Component\HttpKernel\EventListener\TestSessionListener as BaseTestSessionListener; - -/** - * Simulates sessions for testing purpose. - * - * @author Fabien Potencier - */ -class TestSessionListener extends BaseTestSessionListener -{ - private $app; - - public function __construct(Container $app) - { - $this->app = $app; - } - - protected function getSession() - { - if (!isset($this->app['session'])) { - return; - } - - return $this->app['session']; - } -} diff --git a/src/Silex/Provider/SessionServiceProvider.php b/src/Silex/Provider/SessionServiceProvider.php deleted file mode 100644 index a51e230..0000000 --- a/src/Silex/Provider/SessionServiceProvider.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Silex\Api\EventListenerProviderInterface; -use Silex\Provider\Session\SessionListener; -use Silex\Provider\Session\TestSessionListener; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler; -use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; -use Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage; -use Symfony\Component\HttpFoundation\Session\Session; - -/** - * Symfony HttpFoundation component Provider for sessions. - * - * @author Fabien Potencier - */ -class SessionServiceProvider implements ServiceProviderInterface, EventListenerProviderInterface -{ - public function register(Container $app) - { - $app['session.test'] = false; - - $app['session'] = function ($app) { - return new Session($app['session.storage'], $app['session.attribute_bag'], $app['session.flash_bag']); - }; - - $app['session.storage'] = function ($app) { - if ($app['session.test']) { - return $app['session.storage.test']; - } - - return $app['session.storage.native']; - }; - - $app['session.storage.handler'] = function ($app) { - return new NativeFileSessionHandler($app['session.storage.save_path']); - }; - - $app['session.storage.native'] = function ($app) { - return new NativeSessionStorage( - $app['session.storage.options'], - $app['session.storage.handler'] - ); - }; - - $app['session.listener'] = function ($app) { - return new SessionListener($app); - }; - - $app['session.storage.test'] = function () { - return new MockFileSessionStorage(); - }; - - $app['session.listener.test'] = function ($app) { - return new TestSessionListener($app); - }; - - $app['session.storage.options'] = array(); - $app['session.default_locale'] = 'en'; - $app['session.storage.save_path'] = null; - $app['session.attribute_bag'] = null; - $app['session.flash_bag'] = null; - } - - public function subscribe(Container $app, EventDispatcherInterface $dispatcher) - { - $dispatcher->addSubscriber($app['session.listener']); - - if ($app['session.test']) { - $app['dispatcher']->addSubscriber($app['session.listener.test']); - } - } -} diff --git a/src/Silex/Provider/SwiftmailerServiceProvider.php b/src/Silex/Provider/SwiftmailerServiceProvider.php deleted file mode 100644 index 9bd7c78..0000000 --- a/src/Silex/Provider/SwiftmailerServiceProvider.php +++ /dev/null @@ -1,126 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Silex\Api\EventListenerProviderInterface; -use Symfony\Component\Console\ConsoleEvents; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\HttpKernel\Event\PostResponseEvent; - -/** - * Swiftmailer Provider. - * - * @author Fabien Potencier - */ -class SwiftmailerServiceProvider implements ServiceProviderInterface, EventListenerProviderInterface -{ - public function register(Container $app) - { - $app['swiftmailer.options'] = array(); - $app['swiftmailer.use_spool'] = true; - - $app['mailer.initialized'] = false; - - $app['mailer'] = function ($app) { - $app['mailer.initialized'] = true; - $transport = $app['swiftmailer.use_spool'] ? $app['swiftmailer.spooltransport'] : $app['swiftmailer.transport']; - - return new \Swift_Mailer($transport); - }; - - $app['swiftmailer.spooltransport'] = function ($app) { - return new \Swift_Transport_SpoolTransport($app['swiftmailer.transport.eventdispatcher'], $app['swiftmailer.spool']); - }; - - $app['swiftmailer.spool'] = function ($app) { - return new \Swift_MemorySpool(); - }; - - $app['swiftmailer.transport'] = function ($app) { - $transport = new \Swift_Transport_EsmtpTransport( - $app['swiftmailer.transport.buffer'], - array($app['swiftmailer.transport.authhandler']), - $app['swiftmailer.transport.eventdispatcher'] - ); - - $options = $app['swiftmailer.options'] = array_replace(array( - 'host' => 'localhost', - 'port' => 25, - 'username' => '', - 'password' => '', - 'encryption' => null, - 'auth_mode' => null, - ), $app['swiftmailer.options']); - - $transport->setHost($options['host']); - $transport->setPort($options['port']); - $transport->setEncryption($options['encryption']); - $transport->setUsername($options['username']); - $transport->setPassword($options['password']); - $transport->setAuthMode($options['auth_mode']); - - if (null !== $app['swiftmailer.sender_address']) { - $transport->registerPlugin(new \Swift_Plugins_ImpersonatePlugin($app['swiftmailer.sender_address'])); - } - - if (!empty($app['swiftmailer.delivery_addresses'])) { - $transport->registerPlugin(new \Swift_Plugins_RedirectingPlugin( - $app['swiftmailer.delivery_addresses'], - $app['swiftmailer.delivery_whitelist'] - )); - } - - return $transport; - }; - - $app['swiftmailer.transport.buffer'] = function () { - return new \Swift_Transport_StreamBuffer(new \Swift_StreamFilters_StringReplacementFilterFactory()); - }; - - $app['swiftmailer.transport.authhandler'] = function () { - return new \Swift_Transport_Esmtp_AuthHandler(array( - new \Swift_Transport_Esmtp_Auth_CramMd5Authenticator(), - new \Swift_Transport_Esmtp_Auth_LoginAuthenticator(), - new \Swift_Transport_Esmtp_Auth_PlainAuthenticator(), - )); - }; - - $app['swiftmailer.transport.eventdispatcher'] = function () { - return new \Swift_Events_SimpleEventDispatcher(); - }; - - $app['swiftmailer.sender_address'] = null; - $app['swiftmailer.delivery_addresses'] = []; - $app['swiftmailer.delivery_whitelist'] = []; - } - - public function subscribe(Container $app, EventDispatcherInterface $dispatcher) - { - // Event has no typehint as it can be either a PostResponseEvent or a ConsoleTerminateEvent - $onTerminate = function ($event) use ($app) { - // To speed things up (by avoiding Swift Mailer initialization), flush - // messages only if our mailer has been created (potentially used) - if ($app['mailer.initialized'] && $app['swiftmailer.use_spool'] && $app['swiftmailer.spooltransport'] instanceof \Swift_Transport_SpoolTransport) { - $app['swiftmailer.spooltransport']->getSpool()->flushQueue($app['swiftmailer.transport']); - } - }; - - $dispatcher->addListener(KernelEvents::TERMINATE, $onTerminate); - - if (class_exists('Symfony\Component\Console\ConsoleEvents')) { - $dispatcher->addListener(ConsoleEvents::TERMINATE, $onTerminate); - } - } -} diff --git a/src/Silex/Provider/TranslationServiceProvider.php b/src/Silex/Provider/TranslationServiceProvider.php deleted file mode 100644 index 0b8a895..0000000 --- a/src/Silex/Provider/TranslationServiceProvider.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Symfony\Component\Translation\Translator; -use Symfony\Component\Translation\MessageSelector; -use Symfony\Component\Translation\Loader\ArrayLoader; -use Symfony\Component\Translation\Loader\XliffFileLoader; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\HttpKernel\EventListener\TranslatorListener; -use Silex\Api\EventListenerProviderInterface; - -/** - * Symfony Translation component Provider. - * - * @author Fabien Potencier - */ -class TranslationServiceProvider implements ServiceProviderInterface, EventListenerProviderInterface -{ - public function register(Container $app) - { - $app['translator'] = function ($app) { - if (!isset($app['locale'])) { - throw new \LogicException('You must define \'locale\' parameter or register the LocaleServiceProvider to use the TranslationServiceProvider'); - } - - $translator = new Translator($app['locale'], $app['translator.message_selector'], $app['translator.cache_dir'], $app['debug']); - $translator->setFallbackLocales($app['locale_fallbacks']); - $translator->addLoader('array', new ArrayLoader()); - $translator->addLoader('xliff', new XliffFileLoader()); - - if (isset($app['validator'])) { - $r = new \ReflectionClass('Symfony\Component\Validator\Validation'); - $file = dirname($r->getFilename()).'/Resources/translations/validators.'.$app['locale'].'.xlf'; - if (file_exists($file)) { - $translator->addResource('xliff', $file, $app['locale'], 'validators'); - } - } - - if (isset($app['form.factory'])) { - $r = new \ReflectionClass('Symfony\Component\Form\Form'); - $file = dirname($r->getFilename()).'/Resources/translations/validators.'.$app['locale'].'.xlf'; - if (file_exists($file)) { - $translator->addResource('xliff', $file, $app['locale'], 'validators'); - } - } - - // Register default resources - foreach ($app['translator.resources'] as $resource) { - $translator->addResource($resource[0], $resource[1], $resource[2], $resource[3]); - } - - foreach ($app['translator.domains'] as $domain => $data) { - foreach ($data as $locale => $messages) { - $translator->addResource('array', $messages, $locale, $domain); - } - } - - return $translator; - }; - - if (isset($app['request_stack'])) { - $app['translator.listener'] = function ($app) { - return new TranslatorListener($app['translator'], $app['request_stack']); - }; - } - - $app['translator.message_selector'] = function () { - return new MessageSelector(); - }; - - $app['translator.resources'] = $app->protect(function ($app) { - return array(); - }); - - $app['translator.domains'] = array(); - $app['locale_fallbacks'] = array('en'); - $app['translator.cache_dir'] = null; - } - - public function subscribe(Container $app, EventDispatcherInterface $dispatcher) - { - if (isset($app['translator.listener'])) { - $dispatcher->addSubscriber($app['translator.listener']); - } - } -} diff --git a/src/Silex/Provider/TwigServiceProvider.php b/src/Silex/Provider/TwigServiceProvider.php deleted file mode 100644 index 22f7cad..0000000 --- a/src/Silex/Provider/TwigServiceProvider.php +++ /dev/null @@ -1,145 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Symfony\Bridge\Twig\AppVariable; -use Symfony\Bridge\Twig\Extension\AssetExtension; -use Symfony\Bridge\Twig\Extension\DumpExtension; -use Symfony\Bridge\Twig\Extension\RoutingExtension; -use Symfony\Bridge\Twig\Extension\TranslationExtension; -use Symfony\Bridge\Twig\Extension\FormExtension; -use Symfony\Bridge\Twig\Extension\SecurityExtension; -use Symfony\Bridge\Twig\Extension\HttpFoundationExtension; -use Symfony\Bridge\Twig\Extension\HttpKernelExtension; -use Symfony\Bridge\Twig\Form\TwigRendererEngine; -use Symfony\Bridge\Twig\Form\TwigRenderer; - -/** - * Twig integration for Silex. - * - * @author Fabien Potencier - */ -class TwigServiceProvider implements ServiceProviderInterface -{ - public function register(Container $app) - { - $app['twig.options'] = array(); - $app['twig.form.templates'] = array('form_div_layout.html.twig'); - $app['twig.path'] = array(); - $app['twig.templates'] = array(); - - $app['twig.app_variable'] = function ($app) { - $var = new AppVariable(); - if (isset($app['security.token_storage'])) { - $var->setTokenStorage($app['security.token_storage']); - } - if (isset($app['request_stack'])) { - $var->setRequestStack($app['request_stack']); - } - $var->setDebug($app['debug']); - - return $var; - }; - - $app['twig'] = function ($app) { - $app['twig.options'] = array_replace( - array( - 'charset' => $app['charset'], - 'debug' => $app['debug'], - 'strict_variables' => $app['debug'], - ), $app['twig.options'] - ); - - $twig = $app['twig.environment_factory']($app); - // registered for BC, but should not be used anymore - // deprecated and should probably be removed in Silex 3.0 - $twig->addGlobal('app', $app); - - if ($app['debug']) { - $twig->addExtension(new \Twig_Extension_Debug()); - } - - if (class_exists('Symfony\Bridge\Twig\Extension\RoutingExtension')) { - $twig->addGlobal('global', $app['twig.app_variable']); - - if (isset($app['request_stack'])) { - $twig->addExtension(new HttpFoundationExtension($app['request_stack'])); - $twig->addExtension(new RoutingExtension($app['url_generator'])); - } - - if (isset($app['translator'])) { - $twig->addExtension(new TranslationExtension($app['translator'])); - } - - if (isset($app['security.authorization_checker'])) { - $twig->addExtension(new SecurityExtension($app['security.authorization_checker'])); - } - - if (isset($app['fragment.handler'])) { - $app['fragment.renderer.hinclude']->setTemplating($twig); - - $twig->addExtension(new HttpKernelExtension($app['fragment.handler'])); - } - - if (isset($app['assets.packages'])) { - $twig->addExtension(new AssetExtension($app['assets.packages'])); - } - - if (isset($app['form.factory'])) { - $app['twig.form.engine'] = function ($app) { - return new TwigRendererEngine($app['twig.form.templates']); - }; - - $app['twig.form.renderer'] = function ($app) { - $csrfTokenManager = isset($app['csrf.token_manager']) ? $app['csrf.token_manager'] : null; - - return new TwigRenderer($app['twig.form.engine'], $csrfTokenManager); - }; - - $twig->addExtension(new FormExtension($app['twig.form.renderer'])); - - // add loader for Symfony built-in form templates - $reflected = new \ReflectionClass('Symfony\Bridge\Twig\Extension\FormExtension'); - $path = dirname($reflected->getFileName()).'/../Resources/views/Form'; - $app['twig.loader']->addLoader(new \Twig_Loader_Filesystem($path)); - } - - if (isset($app['var_dumper.cloner'])) { - $twig->addExtension(new DumpExtension($app['var_dumper.cloner'])); - } - } - - return $twig; - }; - - $app['twig.loader.filesystem'] = function ($app) { - return new \Twig_Loader_Filesystem($app['twig.path']); - }; - - $app['twig.loader.array'] = function ($app) { - return new \Twig_Loader_Array($app['twig.templates']); - }; - - $app['twig.loader'] = function ($app) { - return new \Twig_Loader_Chain(array( - $app['twig.loader.array'], - $app['twig.loader.filesystem'], - )); - }; - - $app['twig.environment_factory'] = $app->protect(function ($app) { - return new \Twig_Environment($app['twig.loader'], $app['twig.options']); - }); - } -} diff --git a/src/Silex/Provider/Validator/ConstraintValidatorFactory.php b/src/Silex/Provider/Validator/ConstraintValidatorFactory.php deleted file mode 100644 index 9f5e499..0000000 --- a/src/Silex/Provider/Validator/ConstraintValidatorFactory.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider\Validator; - -use Pimple\Container; -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintValidatorFactory as BaseConstraintValidatorFactory; - -/** - * Uses a service container to create constraint validators with dependencies. - * - * @author Kris Wallsmith - * @author Alex Kalyvitis - */ -class ConstraintValidatorFactory extends BaseConstraintValidatorFactory -{ - /** - * @var Container - */ - protected $container; - - /** - * @var array - */ - protected $serviceNames; - - /** - * Constructor. - * - * @param Container $container DI container - * @param array $serviceNames Validator service names - */ - public function __construct(Container $container, array $serviceNames = array(), $propertyAccessor = null) - { - parent::__construct($propertyAccessor); - - $this->container = $container; - $this->serviceNames = $serviceNames; - } - - /** - * {@inheritdoc} - */ - public function getInstance(Constraint $constraint) - { - $name = $constraint->validatedBy(); - - if (isset($this->serviceNames[$name])) { - return $this->container[$this->serviceNames[$name]]; - } - - return parent::getInstance($constraint); - } -} diff --git a/src/Silex/Provider/ValidatorServiceProvider.php b/src/Silex/Provider/ValidatorServiceProvider.php deleted file mode 100644 index d89a3cb..0000000 --- a/src/Silex/Provider/ValidatorServiceProvider.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Silex\Provider\Validator\ConstraintValidatorFactory; -use Symfony\Component\Validator\Validator; -use Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory; -use Symfony\Component\Validator\Mapping\Loader\StaticMethodLoader; -use Symfony\Component\Validator\Validation; - -/** - * Symfony Validator component Provider. - * - * @author Fabien Potencier - */ -class ValidatorServiceProvider implements ServiceProviderInterface -{ - public function register(Container $app) - { - $app['validator'] = function ($app) { - return $app['validator.builder']->getValidator(); - }; - - $app['validator.builder'] = function ($app) { - $builder = Validation::createValidatorBuilder(); - $builder->setConstraintValidatorFactory($app['validator.validator_factory']); - $builder->setTranslationDomain('validators'); - $builder->addObjectInitializers($app['validator.object_initializers']); - $builder->setMetadataFactory($app['validator.mapping.class_metadata_factory']); - if (isset($app['translator'])) { - $builder->setTranslator($app['translator']); - } - - return $builder; - }; - - $app['validator.mapping.class_metadata_factory'] = function ($app) { - return new LazyLoadingMetadataFactory(new StaticMethodLoader()); - }; - - $app['validator.validator_factory'] = function () use ($app) { - return new ConstraintValidatorFactory($app, $app['validator.validator_service_ids']); - }; - - $app['validator.object_initializers'] = function ($app) { - return array(); - }; - - $app['validator.validator_service_ids'] = array(); - } -} diff --git a/src/Silex/Provider/VarDumperServiceProvider.php b/src/Silex/Provider/VarDumperServiceProvider.php deleted file mode 100644 index 7c40b5e..0000000 --- a/src/Silex/Provider/VarDumperServiceProvider.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Provider; - -use Pimple\Container; -use Pimple\ServiceProviderInterface; -use Silex\Application; -use Silex\Api\BootableProviderInterface; -use Symfony\Component\VarDumper\VarDumper; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\CliDumper; - -/** - * Symfony Var Dumper component Provider. - * - * @author Fabien Potencier - */ -class VarDumperServiceProvider implements ServiceProviderInterface, BootableProviderInterface -{ - public function register(Container $app) - { - $app['var_dumper.cli_dumper'] = function ($app) { - return new CliDumper($app['var_dumper.dump_destination'], $app['charset']); - }; - - $app['var_dumper.cloner'] = function ($app) { - return new VarCloner(); - }; - - $app['var_dumper.dump_destination'] = null; - } - - public function boot(Application $app) - { - if (!$app['debug']) { - return; - } - - // This code is here to lazy load the dump stack. This default - // configuration for CLI mode is overridden in HTTP mode on - // 'kernel.request' event - VarDumper::setHandler(function ($var) use ($app) { - VarDumper::setHandler($handler = function ($var) use ($app) { - $app['var_dumper.cli_dumper']->dump($app['var_dumper.cloner']->cloneVar($var)); - }); - $handler($var); - }); - } -} diff --git a/src/Silex/Provider/composer.json b/src/Silex/Provider/composer.json deleted file mode 100644 index 50d3e5c..0000000 --- a/src/Silex/Provider/composer.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "minimum-stability": "dev", - "name": "silex/providers", - "description": "The Silex providers", - "keywords": ["microframework"], - "homepage": "http://silex.sensiolabs.org", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - } - ], - "require": { - "php": ">=5.5.9", - "pimple/pimple": "~3.0", - "silex/api": "~2.0" - }, - "autoload": { - "psr-4": { "Silex\\Provider\\": "" } - }, - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - } -} diff --git a/src/Silex/Route.php b/src/Silex/Route.php deleted file mode 100644 index 99e82d8..0000000 --- a/src/Silex/Route.php +++ /dev/null @@ -1,202 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex; - -use Symfony\Component\Routing\Route as BaseRoute; - -/** - * A wrapper for a controller, mapped to a route. - * - * @author Fabien Potencier - */ -class Route extends BaseRoute -{ - /** - * Constructor. - * - * Available options: - * - * * compiler_class: A class name able to compile this route instance (RouteCompiler by default) - * - * @param string $path The path pattern to match - * @param array $defaults An array of default parameter values - * @param array $requirements An array of requirements for parameters (regexes) - * @param array $options An array of options - * @param string $host The host pattern to match - * @param string|array $schemes A required URI scheme or an array of restricted schemes - * @param string|array $methods A required HTTP method or an array of restricted methods - */ - public function __construct($path = '/', array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array()) - { - // overridden constructor to make $path optional - parent::__construct($path, $defaults, $requirements, $options, $host, $schemes, $methods); - } - - /** - * Sets the route code that should be executed when matched. - * - * @param callable $to PHP callback that returns the response when matched - * - * @return Route $this The current Route instance - */ - public function run($to) - { - $this->setDefault('_controller', $to); - - return $this; - } - - /** - * Sets the requirement for a route variable. - * - * @param string $variable The variable name - * @param string $regexp The regexp to apply - * - * @return Route $this The current route instance - */ - public function assert($variable, $regexp) - { - $this->setRequirement($variable, $regexp); - - return $this; - } - - /** - * Sets the default value for a route variable. - * - * @param string $variable The variable name - * @param mixed $default The default value - * - * @return Route $this The current Route instance - */ - public function value($variable, $default) - { - $this->setDefault($variable, $default); - - return $this; - } - - /** - * Sets a converter for a route variable. - * - * @param string $variable The variable name - * @param mixed $callback A PHP callback that converts the original value - * - * @return Route $this The current Route instance - */ - public function convert($variable, $callback) - { - $converters = $this->getOption('_converters'); - $converters[$variable] = $callback; - $this->setOption('_converters', $converters); - - return $this; - } - - /** - * Sets the requirement for the HTTP method. - * - * @param string $method The HTTP method name. Multiple methods can be supplied, delimited by a pipe character '|', eg. 'GET|POST' - * - * @return Route $this The current Route instance - */ - public function method($method) - { - $this->setMethods(explode('|', $method)); - - return $this; - } - - /** - * Sets the requirement of host on this Route. - * - * @param string $host The host for which this route should be enabled - * - * @return Route $this The current Route instance - */ - public function host($host) - { - $this->setHost($host); - - return $this; - } - - /** - * Sets the requirement of HTTP (no HTTPS) on this Route. - * - * @return Route $this The current Route instance - */ - public function requireHttp() - { - $this->setSchemes('http'); - - return $this; - } - - /** - * Sets the requirement of HTTPS on this Route. - * - * @return Route $this The current Route instance - */ - public function requireHttps() - { - $this->setSchemes('https'); - - return $this; - } - - /** - * Sets a callback to handle before triggering the route callback. - * - * @param mixed $callback A PHP callback to be triggered when the Route is matched, just before the route callback - * - * @return Route $this The current Route instance - */ - public function before($callback) - { - $callbacks = $this->getOption('_before_middlewares'); - $callbacks[] = $callback; - $this->setOption('_before_middlewares', $callbacks); - - return $this; - } - - /** - * Sets a callback to handle after the route callback. - * - * @param mixed $callback A PHP callback to be triggered after the route callback - * - * @return Route $this The current Route instance - */ - public function after($callback) - { - $callbacks = $this->getOption('_after_middlewares'); - $callbacks[] = $callback; - $this->setOption('_after_middlewares', $callbacks); - - return $this; - } - - /** - * Sets a condition for the route to match. - * - * @param string $condition The condition - * - * @return Route $this The current Route instance - */ - public function when($condition) - { - $this->setCondition($condition); - - return $this; - } -} diff --git a/src/Silex/Route/SecurityTrait.php b/src/Silex/Route/SecurityTrait.php deleted file mode 100644 index d42ba2f..0000000 --- a/src/Silex/Route/SecurityTrait.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex\Route; - -use Symfony\Component\Security\Core\Exception\AccessDeniedException; - -/** - * Security trait. - * - * @author Fabien Potencier - */ -trait SecurityTrait -{ - public function secure($roles) - { - $this->before(function ($request, $app) use ($roles) { - if (!$app['security.authorization_checker']->isGranted($roles)) { - throw new AccessDeniedException(); - } - }); - } -} diff --git a/src/Silex/ServiceControllerResolver.php b/src/Silex/ServiceControllerResolver.php deleted file mode 100644 index 87f91b0..0000000 --- a/src/Silex/ServiceControllerResolver.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; - -/** - * Enables name_of_service:method_name syntax for declaring controllers. - * - * @link http://silex.sensiolabs.org/doc/providers/service_controller.html - */ -class ServiceControllerResolver implements ControllerResolverInterface -{ - protected $controllerResolver; - protected $callbackResolver; - - /** - * Constructor. - * - * @param ControllerResolverInterface $controllerResolver A ControllerResolverInterface instance to delegate to - * @param CallbackResolver $callbackResolver A service resolver instance - */ - public function __construct(ControllerResolverInterface $controllerResolver, CallbackResolver $callbackResolver) - { - $this->controllerResolver = $controllerResolver; - $this->callbackResolver = $callbackResolver; - } - - /** - * {@inheritdoc} - */ - public function getController(Request $request) - { - $controller = $request->attributes->get('_controller', null); - - if (!$this->callbackResolver->isValid($controller)) { - return $this->controllerResolver->getController($request); - } - - return $this->callbackResolver->convertCallback($controller); - } - - /** - * {@inheritdoc} - */ - public function getArguments(Request $request, $controller) - { - return $this->controllerResolver->getArguments($request, $controller); - } -} diff --git a/src/Silex/ViewListenerWrapper.php b/src/Silex/ViewListenerWrapper.php deleted file mode 100644 index a67ec93..0000000 --- a/src/Silex/ViewListenerWrapper.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex; - -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; - -/** - * Wraps view listeners. - * - * @author Dave Marshall - */ -class ViewListenerWrapper -{ - private $app; - private $callback; - - /** - * Constructor. - * - * @param Application $app An Application instance - * @param mixed $callback - */ - public function __construct(Application $app, $callback) - { - $this->app = $app; - $this->callback = $callback; - } - - public function __invoke(GetResponseForControllerResultEvent $event) - { - $controllerResult = $event->getControllerResult(); - $callback = $this->app['callback_resolver']->resolveCallback($this->callback); - - if (!$this->shouldRun($callback, $controllerResult)) { - return; - } - - $response = call_user_func($callback, $controllerResult, $event->getRequest()); - - if ($response instanceof Response) { - $event->setResponse($response); - } elseif (null !== $response) { - $event->setControllerResult($response); - } - } - - private function shouldRun($callback, $controllerResult) - { - if (is_array($callback)) { - $callbackReflection = new \ReflectionMethod($callback[0], $callback[1]); - } elseif (is_object($callback) && !$callback instanceof \Closure) { - $callbackReflection = new \ReflectionObject($callback); - $callbackReflection = $callbackReflection->getMethod('__invoke'); - } else { - $callbackReflection = new \ReflectionFunction($callback); - } - - if ($callbackReflection->getNumberOfParameters() > 0) { - $parameters = $callbackReflection->getParameters(); - $expectedControllerResult = $parameters[0]; - - if ($expectedControllerResult->getClass() && (!is_object($controllerResult) || !$expectedControllerResult->getClass()->isInstance($controllerResult))) { - return false; - } - - if ($expectedControllerResult->isArray() && !is_array($controllerResult)) { - return false; - } - - if (method_exists($expectedControllerResult, 'isCallable') && $expectedControllerResult->isCallable() && !is_callable($controllerResult)) { - return false; - } - } - - return true; - } -} diff --git a/src/Silex/WebTestCase.php b/src/Silex/WebTestCase.php deleted file mode 100644 index 644bb05..0000000 --- a/src/Silex/WebTestCase.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Silex; - -use Symfony\Component\HttpKernel\Client; -use Symfony\Component\HttpKernel\HttpKernelInterface; - -/** - * WebTestCase is the base class for functional tests. - * - * @author Igor Wiedler - */ -abstract class WebTestCase extends \PHPUnit_Framework_TestCase -{ - /** - * HttpKernelInterface instance. - * - * @var HttpKernelInterface - */ - protected $app; - - /** - * PHPUnit setUp for setting up the application. - * - * Note: Child classes that define a setUp method must call - * parent::setUp(). - */ - protected function setUp() - { - $this->app = $this->createApplication(); - } - - /** - * Creates the application. - * - * @return HttpKernelInterface - */ - abstract public function createApplication(); - - /** - * Creates a Client. - * - * @param array $server Server parameters - * - * @return Client A Client instance - */ - public function createClient(array $server = array()) - { - if (!class_exists('Symfony\Component\BrowserKit\Client')) { - throw new \LogicException('Component "symfony/browser-kit" is required by WebTestCase.'.PHP_EOL.'Run composer require symfony/browser-kit'); - } - - return new Client($this->app, $server); - } -} diff --git a/web/index.php b/web/index.php index 4237d32..e4c78b4 100644 --- a/web/index.php +++ b/web/index.php @@ -1,44 +1,57 @@ register(new TwigServiceProvider(), [ - 'twig.path' => __DIR__.'/../views', +define ('APP_ROOT', __DIR__ . '/../'); +define ('SCHEMA_URL', 'https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json'); +$app = new App(); +$app->register(new Sikofitt\Config\ConfigServiceProvider(), [ + 'config.path' => $app->getConfDirectory(), ]); -$app['config'] = function($app) { - $configFromFiles = \Noodlehaus\Config::load(APP_ROOT . 'config'); - $defaultOptions = new \Sikofitt\Config($configFromFiles->all()); - return $defaultOptions; + +$app->register (new TwigServiceProvider(), [ + 'twig.path' => APP_ROOT . 'app/views', +]); +$app['conf'] = function ($app) { + }; -$app->register(new WhoopsServiceProvider()); -$app->register(new \Silex\Provider\AssetServiceProvider()); -$app->register(new \Silex\Provider\MonologServiceProvider()); -$app->register(new \Silex\Provider\VarDumperServiceProvider()); -$app->register(new \Silex\Provider\HttpKernelServiceProvider()); -$app['json.decoder'] = function($app) { + +$app->register (new WhoopsServiceProvider()); +$app->register (new \Silex\Provider\AssetServiceProvider()); +$app->register (new \Silex\Provider\MonologServiceProvider()); +$app->register (new \Silex\Provider\VarDumperServiceProvider()); +$app->register (new \Silex\Provider\HttpKernelServiceProvider()); + +$app['json.decoder'] = function ($app) { return new Webmozart\Json\JsonDecoder(); }; -$app['json.encoder'] = function($app) { +$app['json.encoder'] = function ($app) { return new Webmozart\Json\JsonEncoder(); }; -$app['json.validator'] = function($app) { +$app['json.validator'] = function ($app) { return new Webmozart\Json\JsonValidator(); }; -$app->get('/', function() use($app) { +$app->get ('/', function () use ($app) { + $jsonErrors = []; + $resume = new ResumeBuilder($app); + $json = $resume->toJson(['array' => 'neat'], ['app' => $app, 'file' => 'resume.json']); + //$app['config']->set ('app.name', 'Groovey'); - $decoded = $app['json.decoder']->decodeFile(APP_ROOT . 'resume.json', APP_ROOT . 'resume.schema.json'); - dump($app['config']->get('app.debug')); - return $app['twig']->render('base.html.twig', ['resume' => $decoded]); + $decoded = []; + $app->config('app.value', 'myvalue'); + dump($app->config('app')); + return $app['twig']->render ('base.html.twig', ['resume' => $decoded, 'errors' => $jsonErrors]); }); -$app->run(); +$app->run (); diff --git a/web/index.php~ b/web/index.php~ deleted file mode 100644 index 683c610..0000000 --- a/web/index.php~ +++ /dev/null @@ -1,11 +0,0 @@ -get('/hello', function () { - return 'Hello!'; -}); - -$app->run();