diff --git a/README.md b/README.md index dad4f89..376a9c6 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,11 @@ or add ``` to the require section of your `composer.json` file. +Apply migrations +```bash +$ ./yii migrate --migrationPath=@vendor/yiimaker/yii2-banner/src/migrations +``` + Usage ----- diff --git a/codeception.yml b/codeception.yml index 574a6c7..4cc3351 100644 --- a/codeception.yml +++ b/codeception.yml @@ -15,4 +15,12 @@ extensions: modules: config: Yii2: - configFile: 'tests/_config/app.php' \ No newline at end of file + configFile: 'tests/_config/app.php' + Db: + dsn: 'sqlite:tests/_output/test.db' + user: '' + password: '' + dump: 'tests/_data/dump.sql' + cleanup: true, + populate: true, + reconnect: true \ No newline at end of file diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..e4dcb19 --- /dev/null +++ b/composer.lock @@ -0,0 +1,3097 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "136d62ce53205452beba75552ba8749b", + "content-hash": "b02555c18dfafedb311591c823dfefc8", + "packages": [ + { + "name": "bower-asset/bootstrap", + "version": "v3.3.7", + "source": { + "type": "git", + "url": "https://github.com/twbs/bootstrap.git", + "reference": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twbs/bootstrap/zipball/0b9c4a4007c44201dce9a6cc1a38407005c26c86", + "reference": "0b9c4a4007c44201dce9a6cc1a38407005c26c86", + "shasum": null + }, + "require": { + "bower-asset/jquery": ">=1.9.1,<4.0" + }, + "type": "bower-asset", + "license": [ + "MIT" + ] + }, + { + "name": "bower-asset/jquery", + "version": "2.2.4", + "source": { + "type": "git", + "url": "https://github.com/jquery/jquery-dist.git", + "reference": "c0185ab7c75aab88762c5aae780b9d83b80eda72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jquery/jquery-dist/zipball/c0185ab7c75aab88762c5aae780b9d83b80eda72", + "reference": "c0185ab7c75aab88762c5aae780b9d83b80eda72", + "shasum": null + }, + "type": "bower-asset", + "license": [ + "MIT" + ] + }, + { + "name": "bower-asset/jquery.inputmask", + "version": "3.3.10", + "source": { + "type": "git", + "url": "https://github.com/RobinHerbots/Inputmask.git", + "reference": "14873e5775964275d13621cbe2b52e4448af3707" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/RobinHerbots/Inputmask/zipball/14873e5775964275d13621cbe2b52e4448af3707", + "reference": "14873e5775964275d13621cbe2b52e4448af3707", + "shasum": null + }, + "require": { + "bower-asset/jquery": ">=1.7" + }, + "type": "bower-asset", + "license": [ + "http://opensource.org/licenses/mit-license.php" + ] + }, + { + "name": "bower-asset/punycode", + "version": "v1.3.2", + "source": { + "type": "git", + "url": "https://github.com/bestiejs/punycode.js.git", + "reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bestiejs/punycode.js/zipball/38c8d3131a82567bfef18da09f7f4db68c84f8a3", + "reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3", + "shasum": null + }, + "type": "bower-asset" + }, + { + "name": "bower-asset/yii2-pjax", + "version": "2.0.7.1", + "source": { + "type": "git", + "url": "https://github.com/yiisoft/jquery-pjax.git", + "reference": "aef7b953107264f00234902a3880eb50dafc48be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yiisoft/jquery-pjax/zipball/aef7b953107264f00234902a3880eb50dafc48be", + "reference": "aef7b953107264f00234902a3880eb50dafc48be", + "shasum": null + }, + "require": { + "bower-asset/jquery": ">=1.8" + }, + "type": "bower-asset", + "license": [ + "MIT" + ] + }, + { + "name": "cebe/markdown", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/cebe/markdown.git", + "reference": "25b28bae8a6f185b5030673af77b32e1163d5c6e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cebe/markdown/zipball/25b28bae8a6f185b5030673af77b32e1163d5c6e", + "reference": "25b28bae8a6f185b5030673af77b32e1163d5c6e", + "shasum": "" + }, + "require": { + "lib-pcre": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "cebe/indent": "*", + "facebook/xhprof": "*@dev", + "phpunit/phpunit": "4.1.*" + }, + "bin": [ + "bin/markdown" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "cebe\\markdown\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Carsten Brandt", + "email": "mail@cebe.cc", + "homepage": "http://cebe.cc/", + "role": "Creator" + } + ], + "description": "A super fast, highly extensible markdown parser for PHP", + "homepage": "https://github.com/cebe/markdown#readme", + "keywords": [ + "extensible", + "fast", + "gfm", + "markdown", + "markdown-extra" + ], + "time": "2017-07-16 21:13:23" + }, + { + "name": "ezyang/htmlpurifier", + "version": "v4.9.3", + "source": { + "type": "git", + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "95e1bae3182efc0f3422896a3236e991049dac69" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/95e1bae3182efc0f3422896a3236e991049dac69", + "reference": "95e1bae3182efc0f3422896a3236e991049dac69", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "require-dev": { + "simpletest/simpletest": "^1.1" + }, + "type": "library", + "autoload": { + "psr-0": { + "HTMLPurifier": "library/" + }, + "files": [ + "library/HTMLPurifier.composer.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL" + ], + "authors": [ + { + "name": "Edward Z. Yang", + "email": "admin@htmlpurifier.org", + "homepage": "http://ezyang.com" + } + ], + "description": "Standards compliant HTML filter written in PHP", + "homepage": "http://htmlpurifier.org/", + "keywords": [ + "html" + ], + "time": "2017-06-03 02:28:16" + }, + { + "name": "motion/yii2-language-provider", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/motion-web-production/yii2-language-provider.git", + "reference": "a3fccb0e4a536dbab2a06464b2907b5dcd11e3eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/motion-web-production/yii2-language-provider/zipball/a3fccb0e4a536dbab2a06464b2907b5dcd11e3eb", + "reference": "a3fccb0e4a536dbab2a06464b2907b5dcd11e3eb", + "shasum": "" + }, + "require": { + "yiisoft/yii2": "~2.0" + }, + "type": "yii2-extension", + "extra": { + "branch-alias": { + "dev-master": "1.0.0-dev" + } + }, + "autoload": { + "psr-4": { + "motion\\i18n\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Vladimir Kuprienko", + "email": "vldmr.kuprienko@gmail.com", + "role": "Developer" + } + ], + "description": "Language provider for Yii2", + "keywords": [ + "i18n", + "language", + "provider", + "yii2" + ], + "time": "2017-10-17 14:24:31" + }, + { + "name": "yiisoft/yii2", + "version": "2.0.12", + "source": { + "type": "git", + "url": "https://github.com/yiisoft/yii2-framework.git", + "reference": "70acbecc75cb26b6cd66d16be0b06e4b73db190d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/70acbecc75cb26b6cd66d16be0b06e4b73db190d", + "reference": "70acbecc75cb26b6cd66d16be0b06e4b73db190d", + "shasum": "" + }, + "require": { + "bower-asset/jquery": "2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable", + "bower-asset/jquery.inputmask": "~3.2.2 | ~3.3.5", + "bower-asset/punycode": "1.3.*", + "bower-asset/yii2-pjax": "~2.0.1", + "cebe/markdown": "~1.0.0 | ~1.1.0", + "ext-ctype": "*", + "ext-mbstring": "*", + "ezyang/htmlpurifier": "~4.6", + "lib-pcre": "*", + "php": ">=5.4.0", + "yiisoft/yii2-composer": "~2.0.4" + }, + "bin": [ + "yii" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "yii\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Qiang Xue", + "email": "qiang.xue@gmail.com", + "homepage": "http://www.yiiframework.com/", + "role": "Founder and project lead" + }, + { + "name": "Alexander Makarov", + "email": "sam@rmcreative.ru", + "homepage": "http://rmcreative.ru/", + "role": "Core framework development" + }, + { + "name": "Maurizio Domba", + "homepage": "http://mdomba.info/", + "role": "Core framework development" + }, + { + "name": "Carsten Brandt", + "email": "mail@cebe.cc", + "homepage": "http://cebe.cc/", + "role": "Core framework development" + }, + { + "name": "Timur Ruziev", + "email": "resurtm@gmail.com", + "homepage": "http://resurtm.com/", + "role": "Core framework development" + }, + { + "name": "Paul Klimov", + "email": "klimov.paul@gmail.com", + "role": "Core framework development" + }, + { + "name": "Dmitry Naumenko", + "email": "d.naumenko.a@gmail.com", + "role": "Core framework development" + }, + { + "name": "Boudewijn Vahrmeijer", + "email": "info@dynasource.eu", + "homepage": "http://dynasource.eu", + "role": "Core framework development" + } + ], + "description": "Yii PHP Framework Version 2", + "homepage": "http://www.yiiframework.com/", + "keywords": [ + "framework", + "yii2" + ], + "time": "2017-06-05 14:33:41" + }, + { + "name": "yiisoft/yii2-bootstrap", + "version": "2.0.7", + "source": { + "type": "git", + "url": "https://github.com/yiisoft/yii2-bootstrap.git", + "reference": "02a54d868343ed11d02f0f0f8cbbecb590e0cb3f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/02a54d868343ed11d02f0f0f8cbbecb590e0cb3f", + "reference": "02a54d868343ed11d02f0f0f8cbbecb590e0cb3f", + "shasum": "" + }, + "require": { + "bower-asset/bootstrap": "3.3.* | 3.2.* | 3.1.*", + "yiisoft/yii2": "~2.0.6" + }, + "type": "yii2-extension", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "yii\\bootstrap\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Qiang Xue", + "email": "qiang.xue@gmail.com" + } + ], + "description": "The Twitter Bootstrap extension for the Yii framework", + "keywords": [ + "bootstrap", + "yii2" + ], + "time": "2017-10-09 19:48:22" + }, + { + "name": "yiisoft/yii2-composer", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/yiisoft/yii2-composer.git", + "reference": "3f4923c2bde6caf3f5b88cc22fdd5770f52f8df2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/3f4923c2bde6caf3f5b88cc22fdd5770f52f8df2", + "reference": "3f4923c2bde6caf3f5b88cc22fdd5770f52f8df2", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0" + }, + "require-dev": { + "composer/composer": "^1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "yii\\composer\\Plugin", + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "yii\\composer\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Qiang Xue", + "email": "qiang.xue@gmail.com" + } + ], + "description": "The composer plugin for Yii extension installer", + "keywords": [ + "composer", + "extension installer", + "yii2" + ], + "time": "2016-12-20 13:26:02" + } + ], + "packages-dev": [ + { + "name": "behat/gherkin", + "version": "v4.4.5", + "source": { + "type": "git", + "url": "https://github.com/Behat/Gherkin.git", + "reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/5c14cff4f955b17d20d088dec1bde61c0539ec74", + "reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74", + "shasum": "" + }, + "require": { + "php": ">=5.3.1" + }, + "require-dev": { + "phpunit/phpunit": "~4.5|~5", + "symfony/phpunit-bridge": "~2.7|~3", + "symfony/yaml": "~2.3|~3" + }, + "suggest": { + "symfony/yaml": "If you want to parse features, represented in YAML files" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Gherkin": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Gherkin DSL parser for PHP 5.3", + "homepage": "http://behat.org/", + "keywords": [ + "BDD", + "Behat", + "Cucumber", + "DSL", + "gherkin", + "parser" + ], + "time": "2016-10-30 11:50:56" + }, + { + "name": "codeception/codeception", + "version": "2.3.6", + "source": { + "type": "git", + "url": "https://github.com/Codeception/Codeception.git", + "reference": "c3dd3b5d9e0b1ea6c2fcca52457736dc756716f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/c3dd3b5d9e0b1ea6c2fcca52457736dc756716f8", + "reference": "c3dd3b5d9e0b1ea6c2fcca52457736dc756716f8", + "shasum": "" + }, + "require": { + "behat/gherkin": "~4.4.0", + "ext-json": "*", + "ext-mbstring": "*", + "facebook/webdriver": ">=1.1.3 <2.0", + "guzzlehttp/guzzle": ">=4.1.4 <7.0", + "guzzlehttp/psr7": "~1.0", + "php": ">=5.4.0 <8.0", + "phpunit/php-code-coverage": ">=2.2.4 <6.0", + "phpunit/phpunit": ">4.8.20 <7.0", + "phpunit/phpunit-mock-objects": ">2.3 <5.0", + "sebastian/comparator": ">1.1 <3.0", + "sebastian/diff": ">=1.4 <3.0", + "stecman/symfony-console-completion": "^0.7.0", + "symfony/browser-kit": ">=2.7 <4.0", + "symfony/console": ">=2.7 <4.0", + "symfony/css-selector": ">=2.7 <4.0", + "symfony/dom-crawler": ">=2.7.5 <4.0", + "symfony/event-dispatcher": ">=2.7 <4.0", + "symfony/finder": ">=2.7 <4.0", + "symfony/yaml": ">=2.7 <4.0" + }, + "require-dev": { + "codeception/specify": "~0.3", + "facebook/graph-sdk": "~5.3", + "flow/jsonpath": "~0.2", + "league/factory-muffin": "^3.0", + "league/factory-muffin-faker": "^1.0", + "monolog/monolog": "~1.8", + "pda/pheanstalk": "~3.0", + "php-amqplib/php-amqplib": "~2.4", + "predis/predis": "^1.0", + "squizlabs/php_codesniffer": "~2.0", + "symfony/process": ">=2.7 <4.0", + "vlucas/phpdotenv": "^2.4.0" + }, + "suggest": { + "codeception/specify": "BDD-style code blocks", + "codeception/verify": "BDD-style assertions", + "flow/jsonpath": "For using JSONPath in REST module", + "league/factory-muffin": "For DataFactory module", + "league/factory-muffin-faker": "For Faker support in DataFactory module", + "phpseclib/phpseclib": "for SFTP option in FTP Module", + "symfony/phpunit-bridge": "For phpunit-bridge support" + }, + "bin": [ + "codecept" + ], + "type": "library", + "extra": { + "branch-alias": [] + }, + "autoload": { + "psr-4": { + "Codeception\\": "src\\Codeception", + "Codeception\\Extension\\": "ext" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Bodnarchuk", + "email": "davert@mail.ua", + "homepage": "http://codegyre.com" + } + ], + "description": "BDD-style testing framework", + "homepage": "http://codeception.com/", + "keywords": [ + "BDD", + "TDD", + "acceptance testing", + "functional testing", + "unit testing" + ], + "time": "2017-09-28 23:19:49" + }, + { + "name": "codeception/specify", + "version": "0.4.6", + "source": { + "type": "git", + "url": "https://github.com/Codeception/Specify.git", + "reference": "21b586f503ca444aa519dd9cafb32f113a05f286" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/Specify/zipball/21b586f503ca444aa519dd9cafb32f113a05f286", + "reference": "21b586f503ca444aa519dd9cafb32f113a05f286", + "shasum": "" + }, + "require": { + "myclabs/deep-copy": "~1.1", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Codeception\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Bodnarchuk", + "email": "davert.php@mailican.com" + } + ], + "description": "BDD code blocks for PHPUnit and Codeception", + "time": "2016-10-21 09:42:00" + }, + { + "name": "codeception/verify", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/Codeception/Verify.git", + "reference": "8a17273017e23a866df3fa2ad2b4182b7ce354f0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/Verify/zipball/8a17273017e23a866df3fa2ad2b4182b7ce354f0", + "reference": "8a17273017e23a866df3fa2ad2b4182b7ce354f0", + "shasum": "" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/Codeception/function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Bodnarchuk", + "email": "davert.php@mailican.com" + } + ], + "description": "BDD assertion library for PHPUnit", + "time": "2017-07-12 16:50:18" + }, + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14 21:17:01" + }, + { + "name": "facebook/webdriver", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/facebook/php-webdriver.git", + "reference": "eadb0b7a7c3e6578185197fd40158b08c3164c83" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/eadb0b7a7c3e6578185197fd40158b08c3164c83", + "reference": "eadb0b7a7c3e6578185197fd40158b08c3164c83", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-zip": "*", + "php": "^5.5 || ~7.0", + "symfony/process": "^2.8 || ^3.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.0", + "php-mock/php-mock-phpunit": "^1.1", + "phpunit/phpunit": "4.6.* || ~5.0", + "satooshi/php-coveralls": "^1.0", + "squizlabs/php_codesniffer": "^2.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-community": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "Facebook\\WebDriver\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "A PHP client for Selenium WebDriver", + "homepage": "https://github.com/facebook/php-webdriver", + "keywords": [ + "facebook", + "php", + "selenium", + "webdriver" + ], + "time": "2017-04-28 14:54:49" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.0 || ^5.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.2-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2017-06-22 18:50:49" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20 10:07:11" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2017-03-20 17:10:46" + }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2017-10-19 19:58:43" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2017-03-05 18:14:27" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2017-03-05 17:38:23" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2017-09-11 18:02:19" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.1.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/2d3d238c433cf69caeb4842e97a3223a116f94b2", + "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-08-30 18:51:59" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2017-07-14 14:27:02" + }, + { + "name": "phpspec/prophecy", + "version": "v1.7.2", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", + "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8 || ^5.6.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2017-09-04 11:05:03" + }, + { + "name": "phpunit/php-code-coverage", + "version": "5.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "8ed1902a57849e117b5651fc1a5c48110946c06b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/8ed1902a57849e117b5651fc1a5c48110946c06b", + "reference": "8ed1902a57849e117b5651fc1a5c48110946c06b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^1.4.11 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" + }, + "require-dev": { + "ext-xdebug": "^2.5", + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-xdebug": "^2.5.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2017-08-03 12:40:43" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2016-10-03 07:40:28" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21 13:50:34" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26 11:10:40" + }, + { + "name": "phpunit/php-token-stream", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9a02332089ac48e704c70f6cefed30c224e3c0b0", + "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-08-20 05:47:52" + }, + { + "name": "phpunit/phpunit", + "version": "6.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "06b28548fd2b4a20c3cd6e247dc86331a7d4db13" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/06b28548fd2b4a20c3cd6e247dc86331a7d4db13", + "reference": "06b28548fd2b4a20c3cd6e247dc86331a7d4db13", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.2.2", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^4.0.3", + "sebastian/comparator": "^2.0.2", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "^1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2017-10-16 13:18:59" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "2f789b59ab89669015ad984afa350c4ec577ade0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/2f789b59ab89669015ad984afa350c4ec577ade0", + "reference": "2f789b59ab89669015ad984afa350c4ec577ade0", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.0" + }, + "conflict": { + "phpunit/phpunit": "<6.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2017-08-03 14:08:16" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06 14:39:51" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10 12:19:37" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04 06:30:41" + }, + { + "name": "sebastian/comparator", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "ae068fede81d06e7bb9bb46a367210a3d3e1fe6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/ae068fede81d06e7bb9bb46a367210a3d3e1fe6a", + "reference": "ae068fede81d06e7bb9bb46a367210a3d3e1fe6a", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/diff": "^2.0", + "sebastian/exporter": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-08-03 07:14:59" + }, + { + "name": "sebastian/diff", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-08-03 08:09:46" + }, + { + "name": "sebastian/environment", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2017-07-01 08:51:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2017-04-03 13:19:02" + }, + { + "name": "sebastian/global-state", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2017-04-27 15:39:26" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-08-03 12:35:26" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29 09:07:27" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2017-03-03 06:23:57" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28 20:34:47" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03 07:35:21" + }, + { + "name": "stecman/symfony-console-completion", + "version": "0.7.0", + "source": { + "type": "git", + "url": "https://github.com/stecman/symfony-console-completion.git", + "reference": "5461d43e53092b3d3b9dbd9d999f2054730f4bbb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stecman/symfony-console-completion/zipball/5461d43e53092b3d3b9dbd9d999f2054730f4bbb", + "reference": "5461d43e53092b3d3b9dbd9d999f2054730f4bbb", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "symfony/console": "~2.3 || ~3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "Stecman\\Component\\Symfony\\Console\\BashCompletion\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Stephen Holdaway", + "email": "stephen@stecman.co.nz" + } + ], + "description": "Automatic BASH completion for Symfony Console Component based applications.", + "time": "2016-02-24 05:08:54" + }, + { + "name": "symfony/browser-kit", + "version": "v3.3.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/browser-kit.git", + "reference": "317d5bdf0127f06db7ea294186132b4f5b036839" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/317d5bdf0127f06db7ea294186132b4f5b036839", + "reference": "317d5bdf0127f06db7ea294186132b4f5b036839", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "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.3-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": "2017-10-02 06:42:24" + }, + { + "name": "symfony/console", + "version": "v3.3.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "116bc56e45a8e5572e51eb43ab58c769a352366c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/116bc56e45a8e5572e51eb43ab58c769a352366c", + "reference": "116bc56e45a8e5572e51eb43ab58c769a352366c", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.3", + "symfony/dependency-injection": "~3.3", + "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.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "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 Console Component", + "homepage": "https://symfony.com", + "time": "2017-10-02 06:42:24" + }, + { + "name": "symfony/css-selector", + "version": "v3.3.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "07447650225ca9223bd5c97180fe7c8267f7d332" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/07447650225ca9223bd5c97180fe7c8267f7d332", + "reference": "07447650225ca9223bd5c97180fe7c8267f7d332", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-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": "2017-10-02 06:42:24" + }, + { + "name": "symfony/debug", + "version": "v3.3.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd", + "reference": "eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "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 Debug Component", + "homepage": "https://symfony.com", + "time": "2017-10-02 06:42:24" + }, + { + "name": "symfony/dom-crawler", + "version": "v3.3.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/dom-crawler.git", + "reference": "40dafd42d5dad7fe5ad4e958413d92a207522ac1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/40dafd42d5dad7fe5ad4e958413d92a207522ac1", + "reference": "40dafd42d5dad7fe5ad4e958413d92a207522ac1", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "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.3-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": "2017-10-02 06:42:24" + }, + { + "name": "symfony/event-dispatcher", + "version": "v3.3.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "d7ba037e4b8221956ab1e221c73c9e27e05dd423" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d7ba037e4b8221956ab1e221c73c9e27e05dd423", + "reference": "d7ba037e4b8221956ab1e221c73c9e27e05dd423", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0", + "symfony/dependency-injection": "~3.3", + "symfony/expression-language": "~2.8|~3.0", + "symfony/stopwatch": "~2.8|~3.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "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 EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2017-10-02 06:42:24" + }, + { + "name": "symfony/finder", + "version": "v3.3.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "773e19a491d97926f236942484cb541560ce862d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/773e19a491d97926f236942484cb541560ce862d", + "reference": "773e19a491d97926f236942484cb541560ce862d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "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 Finder Component", + "homepage": "https://symfony.com", + "time": "2017-10-02 06:42:24" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "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 the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2017-10-11 12:05:26" + }, + { + "name": "symfony/process", + "version": "v3.3.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "fdf89e57a723a29baf536e288d6e232c059697b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/fdf89e57a723a29baf536e288d6e232c059697b1", + "reference": "fdf89e57a723a29baf536e288d6e232c059697b1", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "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 Process Component", + "homepage": "https://symfony.com", + "time": "2017-10-02 06:42:24" + }, + { + "name": "symfony/yaml", + "version": "v3.3.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46", + "reference": "8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "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.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "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 Yaml Component", + "homepage": "https://symfony.com", + "time": "2017-10-05 14:43:42" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2017-04-07 12:08:54" + }, + { + "name": "webmozart/assert", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2016-11-23 20:04:58" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "motion/yii2-language-provider": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.6.0" + }, + "platform-dev": [] +} diff --git a/src/.gitkeep b/src/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/backend/Module.php b/src/backend/Module.php new file mode 100644 index 0000000..66e80a2 --- /dev/null +++ b/src/backend/Module.php @@ -0,0 +1,113 @@ + + * @since 1.0 + */ +class Module extends \yii\base\Module +{ + /** + * @inheritdoc + */ + public $controllerNamespace = 'ymaker\banner\backend\controllers'; + + /** + * @var \motion\i18n\LanguageProviderInterface + */ + private $_languageProvider; + /** + * @var FileManagerInterface + */ + private $_fileManager; + /** + * @var BannerServiceInterface + */ + private $_service; + + + /** + * @param array $providerConfig + */ + public function setLanguageProvider(array $providerConfig) + { + $this->_languageProvider = $providerConfig; + } + + /** + * @param array $fileManagerConfig + */ + public function setFileManager(array $fileManagerConfig) + { + $this->_fileManager = $fileManagerConfig; + } + + /** + * @param BannerServiceInterface $service + */ + public function setService($service) + { + $this->_service = $service; + } + + /** + * @inheritdoc + */ + public function init() + { + if (empty($this->_languageProvider)) { + throw new InvalidConfigException('You should configure language provider'); + } + if (empty($this->_fileManager)) { + $this->_fileManager = ['class' => FileManager::class]; + } + if (empty($this->_service)) { + $this->_service = ['class' => BannerService::class]; + } + + $this->registerDependencies(); + } + + /** + * Register dependencies in container. + */ + protected function registerDependencies() + { + Yii::$container->setDefinitions([ + LanguageProviderInterface::class => $this->_languageProvider, + FileManagerInterface::class => $this->_fileManager, + BannerServiceInterface::class => $this->_service, + ]); + } + + /** + * Wrapper for `Yii::t()`. + * + * @param string $message + * @param array $params + * @param null|string $language + * @return string + */ + public static function t($message, $params = [], $language = null) + { + return Yii::t('back/banner', $message, $params, $language); + } +} diff --git a/src/backend/controllers/DefaultController.php b/src/backend/controllers/DefaultController.php new file mode 100644 index 0000000..9d23be7 --- /dev/null +++ b/src/backend/controllers/DefaultController.php @@ -0,0 +1,111 @@ + + * @since 1.0 + */ +class DefaultController extends Controller +{ + /** + * @var BannerServiceInterface + */ + private $_service; + + + /** + * @inheritdoc + * @param BannerService $service + */ + public function __construct($id, $module, BannerServiceInterface $service, $config = []) + { + $this->_service = $service; + parent::__construct($id, $module, $config); + } + + /** + * Renders banners list. + * + * @return string + */ + public function actionIndex() + { + return $this->render('index', [ + 'dataProvider' => $this->_service->getDataProvider(), + ]); + } + + /** + * Creates new banner. + * + * @return string + */ + public function actionCreate() + { + $model = $this->_service->getModel(); + $request = Yii::$app->getRequest(); + if ($request->getIsPost() && $this->_service->create($request->post())) { + return $this->redirect(['index']); + } + + return $this->render('create', compact('model')); + } + + /** + * Updates banner. + * + * @param int $id + * @return string|\yii\web\Response + */ + public function actionUpdate($id) + { + $model = $this->_service->getModel($id); + $request = Yii::$app->getRequest(); + if ($request->getIsPost() && $this->_service->update($request->post())) { + return $this->redirect(['view', 'id' => $id]); + } + + return $this->render('update', compact('model')); + } + + /** + * Renders details about banner. + * + * @param int $id Banner model ID. + * @return string + */ + public function actionView($id) + { + $model = $this->_service->getModel($id); + return $this->render('view', compact('model')); + } + + /** + * Delete banner. + * + * @param int $id + * @return \yii\web\Response + */ + public function actionDelete($id) + { + $message = $this->_service->delete($id) + ? 'Removed successfully' + : 'Error: banner not removed'; + Yii::$app->getSession()->setFlash('yii2-banner', compact('message')); + + return $this->redirect(['index']); + } +} diff --git a/src/backend/exceptions/FileUploadException.php b/src/backend/exceptions/FileUploadException.php new file mode 100644 index 0000000..0a53a7e --- /dev/null +++ b/src/backend/exceptions/FileUploadException.php @@ -0,0 +1,27 @@ + + * @since 1.0 + */ +class FileUploadException extends Exception +{ + /** + * @inheritdoc + */ + public function getName() + { + return 'File upload exception'; + } +} diff --git a/src/backend/helpers/ImageHelper.php b/src/backend/helpers/ImageHelper.php new file mode 100644 index 0000000..2f8a581 --- /dev/null +++ b/src/backend/helpers/ImageHelper.php @@ -0,0 +1,40 @@ + + * @since 1.0 + */ +class ImageHelper +{ + /** + * @var FileManagerInterface + */ + private static $_fileManager; + + + /** + * Returns URL to image. + * + * @param string $fileName + * @return string + */ + public static function getUrl($fileName) + { + if (self::$_fileManager === null) { + self::$_fileManager = Yii::$container->get(FileManagerInterface::class); + } + return self::$_fileManager->getImageUrl($fileName); + } +} diff --git a/src/backend/helpers/LanguageHelper.php b/src/backend/helpers/LanguageHelper.php new file mode 100644 index 0000000..6ae3d1b --- /dev/null +++ b/src/backend/helpers/LanguageHelper.php @@ -0,0 +1,32 @@ + + * @since 1.0 + */ +class LanguageHelper +{ + /** + * Returns languages locales list. + * + * @return array + */ + public static function getLocales() + { + /* @var LanguageProviderInterface $languageProvider */ + $languageProvider = Yii::$container->get(LanguageProviderInterface::class); + return array_column($languageProvider->getLanguages(), 'locale'); + } +} diff --git a/src/backend/models/entities/Banner.php b/src/backend/models/entities/Banner.php new file mode 100644 index 0000000..e234c6b --- /dev/null +++ b/src/backend/models/entities/Banner.php @@ -0,0 +1,104 @@ + + * @since 1.0 + */ +class Banner extends CommonBanner +{ + /** + * @inheritdoc + */ + public static function find() + { + return parent::find()->with('translations'); + } + + /** + * @inheritdoc + */ + public function loadDefaultValues($skipIfSet = true) + { + $this->slug = 'banner-' . (self::find()->count() + 1); + return parent::loadDefaultValues($skipIfSet); + } + + /** + * @inheritdoc + */ + public function behaviors() + { + $behaviors = parent::behaviors(); + $behaviors['timestamp'] = TimestampBehavior::class; + return $behaviors; + } + + /** + * @inheritdoc + */ + public function rules() + { + return [ + ['slug', 'required'], + ['slug', 'unique'], + ['slug', 'string', 'max' => 255], + + ['published', 'boolean'], + ['published', 'default', 'value' => true], + + ['views_count', 'integer'], + ['views_count', 'default', 'value' => 0], + + [['create_at', 'updated_at'], 'safe'], + + [['valid_from', 'valid_until'], 'safe'], + ]; + } + + /** + * @inheritdoc + */ + public function attributeLabels() + { + return [ + 'slug' => BannerModule::t('Slug'), + 'views_count' => BannerModule::t('Views count'), + 'published' => BannerModule::t('Published'), + 'created_at' => BannerModule::t('Created at'), + 'updated_at' => BannerModule::t('Updated at'), + 'valid_from' => BannerModule::t('Valid from'), + 'valid_until' => BannerModule::t('Valid until'), + ]; + } + + /** + * @inheritdoc + */ + public function transactions() + { + return [ + self::SCENARIO_DEFAULT => self::OP_ALL, + ]; + } + + /** + * @inheritdoc + */ + public function getTranslations() + { + return $this->hasMany(BannerTranslation::class, ['banner_id' => 'id']); + } +} diff --git a/src/backend/models/entities/BannerTranslation.php b/src/backend/models/entities/BannerTranslation.php new file mode 100644 index 0000000..74f0180 --- /dev/null +++ b/src/backend/models/entities/BannerTranslation.php @@ -0,0 +1,95 @@ + + * @since 1.0 + */ +class BannerTranslation extends CommonBannerTranslation +{ + /** + * @var \yii\web\UploadedFile + */ + public $imageFile; + + + /** + * @inheritdoc + */ + public function formName() + { + return parent::formName() . '[' . $this->language . ']'; + } + + /** + * Returns internal form name. + * + * @return string + */ + public static function internalFormName() + { + $reflector = new \ReflectionClass(self::class); + return $reflector->getShortName(); + } + + /** + * @inheritdoc + */ + public function rules() + { + return [ + ['banner_id', 'safe'], + + ['language', 'safe'], + + ['content', 'string'], + + ['hint', 'string', 'max' => 255], + + ['file_name', 'string', 'max' => 255], + + ['imageFile', 'file', 'extensions' => 'png, jpg, gif, svg'], + ]; + } + + /** + * @inheritdoc + */ + public function attributeLabels() + { + $labels = [ + 'content' => BannerModule::t('Content'), + 'hint' => BannerModule::t('Hint'), + 'alt' => BannerModule::t('Alt'), + 'imageFile' => BannerModule::t('Banner image'), + ]; + + foreach ($labels as $key => $label) { + $labels[$key] = $this->addLabelPostfix($label); + } + + return $labels; + } + + /** + * Adds prefix to label. + * + * @param string $label + * @return string + */ + protected function addLabelPostfix($label) + { + return $label . ' [' . $this->language . ']'; + } +} diff --git a/src/backend/services/BannerService.php b/src/backend/services/BannerService.php new file mode 100644 index 0000000..1470534 --- /dev/null +++ b/src/backend/services/BannerService.php @@ -0,0 +1,207 @@ + + * @since 1.0 + */ +class BannerService extends Object implements BannerServiceInterface +{ + /** + * @var string|array|Connection + */ + private $_db = 'db'; + /** + * @var FileManager + */ + private $_fileManager; + /** + * @var Banner + */ + private $_model; + + + /** + * @inheritdoc + * @param FileManager $fileManager + */ + public function __construct(FileManager $fileManager, $config = []) + { + $this->_fileManager = $fileManager; + parent::__construct($config); + } + + /** + * @param string|array|Connection $db + */ + public function setDb($db) + { + $this->_db = $db; + } + + /** + * @inheritdoc + */ + public function init() + { + $this->_db = Instance::ensure($this->_db, Connection::class); + } + + /** + * @return \yii\data\ActiveDataProvider + */ + public function getDataProvider() + { + return new ActiveDataProvider([ + 'db' => $this->_db, + 'query' => Banner::find()->with('translations'), + ]); + } + + /** + * @param int $id + * @return Banner + * @throws NotFoundHttpException + */ + private function findModel($id) + { + if ($model = Banner::findOne($id)) { + return $model; + } + throw new NotFoundHttpException(); + } + + /** + * Returns primary model object. + * + * @param null|int $id + * @return Banner + * @throws NotFoundHttpException + */ + public function getModel($id = null) + { + if ($id == null) { + $model = new Banner(); + $model->loadDefaultValues(); + $this->_model = $model; + } else { + $this->_model = $this->findModel($id); + } + + return $this->_model; + } + + /** + * Save uploaded file to file system. + * + * @param BannerTranslation $model + * @return string + * @throws FileUploadException + */ + private function saveUploadedFile($model) + { + $uploadedFile = UploadedFile::getInstance($model, 'imageFile'); + if ($uploadedFile === null) { + return $model->file_name; + } + + $fileName = $this->_fileManager->generateFileName($uploadedFile->extension); + if ($uploadedFile->saveAs($this->_fileManager->getImageSrc($fileName))) { + if (!$model->getIsNewRecord()) { + $this->_fileManager->deleteFile($model->file_name); + } + return $fileName; + } + + throw new FileUploadException('Error code #' . $uploadedFile->error); + } + + /** + * Save data to database. + * + * @param array $data + * @return bool + */ + protected function save(array $data) + { + if (!$this->_model->load($data)) { + Yii::trace('Cannot load data to primary model', 'yii2-banner'); + } else { + try { + foreach ($data[BannerTranslation::internalFormName()] as $language => $dataSet) { + $model = $this->_model->getTranslation($language); + $model->file_name = $this->saveUploadedFile($model); + foreach ($dataSet as $attribute => $translation) { + $model->$attribute = $translation; + } + } + return $this->_model->save(); + } catch (\Exception $ex) { + Yii::trace($ex, 'yii2-banner'); + } + } + + return false; + } + + /** + * Creates banner. + * + * @param array $data + * @return bool + */ + public function create(array $data) + { + return $this->save($data); + } + + /** + * Updates banner. + * + * @param array $data + * @return bool + */ + public function update(array $data) + { + return (bool)$this->save($data); + } + + /** + * Removes banner. + * + * @param int $id + * @return bool + * @throws NotFoundHttpException + */ + public function delete($id) + { + $model = $this->findModel($id); + foreach ($model->translations as $translation) { + if (!$this->_fileManager->deleteFile($translation->file_name)) { + Yii::trace('Cannot delete "' . $translation->file_name . '" file', 'yii2-banner'); + } + } + return $model->delete(); + } +} diff --git a/src/backend/services/BannerServiceInterface.php b/src/backend/services/BannerServiceInterface.php new file mode 100644 index 0000000..9a16561 --- /dev/null +++ b/src/backend/services/BannerServiceInterface.php @@ -0,0 +1,56 @@ + + * @since 1.0 + */ +interface BannerServiceInterface +{ + /** + * Returns data provider. + * + * @return \yii\data\ActiveDataProvider + */ + public function getDataProvider(); + + /** + * Returns model instance. + * + * @param null|int $id + * @return \yii\db\ActiveRecord + */ + public function getModel($id = null); + + /** + * Creates record. + * + * @param array $data + * @return bool + */ + public function create(array $data); + + /** + * Updates record. + * + * @param array $data + * @return bool + */ + public function update(array $data); + + /** + * Removes record. + * + * @param int $id + * @return bool + */ + public function delete($id); +} diff --git a/src/backend/views/default/create.php b/src/backend/views/default/create.php new file mode 100644 index 0000000..88c5868 --- /dev/null +++ b/src/backend/views/default/create.php @@ -0,0 +1,50 @@ + + * @since 1.0 + */ + +\yii\bootstrap\BootstrapAsset::register($this); +?> +
+
+
+

+
+
+
+
+ ['enctype' => 'multipart/form-data']]) ?> + field($model, 'slug') ?> + + getTranslation($language) ?> + field($translation, 'content')->textarea() ?> + field($translation, 'hint') ?> + field($translation, 'imageFile')->fileInput() ?> + field($translation, 'alt') ?> + + field($model, 'published')->checkbox() ?> + 'btn btn-success'] + ) ?> + +
+
+
diff --git a/src/backend/views/default/index.php b/src/backend/views/default/index.php new file mode 100644 index 0000000..46131b7 --- /dev/null +++ b/src/backend/views/default/index.php @@ -0,0 +1,52 @@ + + * @since 1.0 + */ + +\yii\bootstrap\BootstrapAsset::register($this); +?> +
+
+
+

+
+
+
+
+ 'btn btn-success']) ?> +
+
+
+
+ $dataProvider, + 'columns' => [ + ['class' => SerialColumn::class], + 'slug', + 'hint', + 'published:boolean', + 'created_at:datetime', + ['class' => ActionColumn::class], + ], + ]) ?> +
+
+
diff --git a/src/backend/views/default/update.php b/src/backend/views/default/update.php new file mode 100644 index 0000000..8d58614 --- /dev/null +++ b/src/backend/views/default/update.php @@ -0,0 +1,56 @@ + + * @since 1.0 + */ + +\yii\bootstrap\BootstrapAsset::register($this); +?> +
+
+
+

+ $model->slug, + ]) ?> +

+
+
+
+
+ ['enctype' => 'multipart/form-data']]) ?> + field($model, 'slug') ?> + + getTranslation($language) ?> + field($translation, 'content')->textarea() ?> + field($translation, 'hint') ?> + + field($translation, 'imageFile')->fileInput() ?> + field($translation, 'alt') ?> + + field($model, 'published')->checkbox() ?> + 'btn btn-success'] + ) ?> + +
+
+
diff --git a/src/backend/views/default/view.php b/src/backend/views/default/view.php new file mode 100644 index 0000000..f699935 --- /dev/null +++ b/src/backend/views/default/view.php @@ -0,0 +1,77 @@ + + * @since 1.0 + */ +?> +
+
+
+

+ $model->slug, + ]) ?> +

+
+ hint ?> +
+
+
+
+
+ $model->id], + ['class' => 'btn btn-warning'] + ) ?> + $model->id], + ['class' => 'btn btn-danger'] + ) ?> +
+
+
+
+ $model, + 'attributes' => [ + 'slug', + 'content', + [ + 'attribute' => 'file_name', + 'label' => BannerModule::t('Banner image'), + 'format' => 'html', + 'value' => function (Banner $model) { + return Html::img(ImageHelper::getUrl($model->file_name), ['width' => 300]); + } + ], + 'alt', + 'views_count', + 'valid_from:datetime', + 'valid_until:datetime', + 'published:boolean', + 'created_at:datetime', + 'updated_at:datetime', + ], + ]) ?> +
+
+
diff --git a/src/common/components/FileManager.php b/src/common/components/FileManager.php new file mode 100644 index 0000000..ad8d071 --- /dev/null +++ b/src/common/components/FileManager.php @@ -0,0 +1,102 @@ + + * @since 1.0 + */ +class FileManager extends Object implements FileManagerInterface +{ + /** + * Path to catalog where you store uploaded files. + * + * @var string + */ + protected $filesRoot = '@webroot/uploads/banners'; + /** + * URL of uploaded files catalog. + * + * @var string + */ + protected $filesBaseUrl = '@web/uploads/banners'; + + + /** + * @param $filesRoot + */ + public function setFilesRoot($filesRoot) + { + $this->filesRoot =$filesRoot; + } + + /** + * @param $filesBaseUrl + */ + public function setFilesBaseUrl($filesBaseUrl) + { + $this->filesBaseUrl = $filesBaseUrl; + } + + /** + * @inheritdoc + */ + public function init() + { + $filesRoot = Yii::getAlias($this->filesRoot); + if (!file_exists($filesRoot)) { + FileHelper::createDirectory($filesRoot); + } + } + + /** + * @inheritdoc + */ + public function generateFileName($extension) + { + $fileName = ''; + while (true) { + $fileName = uniqid('', true) . '.' . $extension; + if (!file_exists($this->getImageSrc($fileName))) { + break; + } + } + return $fileName; + } + + /** + * @inheritdoc + */ + public function getImageSrc($fileName) + { + return Yii::getAlias($this->filesRoot . '/' . $fileName); + } + + /** + * @inheritdoc + */ + public function getImageUrl($fileName) + { + return Yii::getAlias($this->filesBaseUrl . '/' . $fileName); + } + + /** + * @inheritdoc + */ + public function deleteFile($fileName) + { + $file = $this->getImageSrc($fileName); + return file_exists($file) ? unlink($file) : false; + } +} diff --git a/src/common/components/FileManagerInterface.php b/src/common/components/FileManagerInterface.php new file mode 100644 index 0000000..dc12881 --- /dev/null +++ b/src/common/components/FileManagerInterface.php @@ -0,0 +1,49 @@ + + * @since 1.0 + */ +interface FileManagerInterface +{ + /** + * Generates filename. + * + * @param string $extension File extension. + * @return string + */ + public function generateFilename($extension); + + /** + * Returns source of image. + * + * @param string $fileName + * @return string + */ + public function getImageSrc($fileName); + + /** + * Returns URL to image. + * + * @param string $fileName + * @return string + */ + public function getImageUrl($fileName); + + /** + * Delete file from file system. + * + * @param string $fileName + * @return bool + */ + public function deleteFile($fileName); +} diff --git a/src/common/models/entities/Banner.php b/src/common/models/entities/Banner.php new file mode 100644 index 0000000..84cd042 --- /dev/null +++ b/src/common/models/entities/Banner.php @@ -0,0 +1,80 @@ + + * @since 1.0 + */ +class Banner extends ActiveRecord +{ + /** + * @inheritdoc + */ + public static function tableName() + { + return '{{%banner}}'; + } + + /** + * @inheritdoc + */ + public function behaviors() + { + return [ + 'translateable' => [ + 'class' => TranslateableBehavior::class, + 'translationAttributes' => $this->getTranslationAttributes(), + ], + ]; + } + + /** + * Returns list of translation attributes. + * + * @return array + */ + public function getTranslationAttributes() + { + return [ + 'content', + 'hint', + 'alt', + 'file_name', + ]; + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getTranslations() + { + return $this->hasMany(BannerTranslation::class, ['banner_id' => 'id']); + } +} diff --git a/src/common/models/entities/BannerTranslation.php b/src/common/models/entities/BannerTranslation.php new file mode 100644 index 0000000..ebc4c65 --- /dev/null +++ b/src/common/models/entities/BannerTranslation.php @@ -0,0 +1,45 @@ + + * @since 1.0 + */ +class BannerTranslation extends ActiveRecord +{ + /** + * @inheritdoc + */ + public static function tableName() + { + return '{{%banner_translation}}'; + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBanner() + { + return $this->hasOne(Banner::class, ['id' => 'banner_id']); + } +} diff --git a/src/frontend/widgets/Banner.php b/src/frontend/widgets/Banner.php new file mode 100644 index 0000000..db58db4 --- /dev/null +++ b/src/frontend/widgets/Banner.php @@ -0,0 +1,102 @@ + + * @since 1.0 + */ +class Banner extends Widget +{ + /** + * @var string + */ + protected $slug; + /** + * @var bool If set `true` - views counter will be updated. + */ + protected $countViews = true; + /** + * @var BannerEntity + */ + protected $model; + + + /** + * @param string $slug + */ + public function setSlug($slug) + { + $this->slug = $slug; + } + + /** + * @param bool $countViews + */ + public function setCountViews($countViews) + { + $this->countViews = $countViews; + } + + /** + * @inheritdoc + * @throws InvalidConfigException + */ + public function init() + { + if (empty($this->slug)) { + throw new InvalidConfigException('You should set a slug'); + } + + $this->model = BannerEntity::find() + ->where([ + 'slug' => $this->slug, + 'published' => true, + ]) + ->with(['translations']) + ->one(); + + parent::init(); + } + + /** + * @inheritdoc + * @return string|null + */ + public function run() + { + if (empty($this->model)) { + return null; + } + + $this->incrementCounter(); + return $this->render('banner', [ + 'model' => $this->model, + ]); + } + + /** + * Increment views counter for banner. + */ + protected function incrementCounter() + { + if ($this->countViews) { + BannerEntity::updateAllCounters( + ['views_count' => 1], + 'slug = :slug', + [':slug' => $this->slug] + ); + } + } +} diff --git a/src/frontend/widgets/views/banner.php b/src/frontend/widgets/views/banner.php new file mode 100644 index 0000000..b98e32b --- /dev/null +++ b/src/frontend/widgets/views/banner.php @@ -0,0 +1,25 @@ + + * @since 1.0 + */ +?> +
+ <?= $model->alt ?> +content)): ?> +

content ?>

+ +
diff --git a/src/migrations/m171024_132212_create_banner_entities.php b/src/migrations/m171024_132212_create_banner_entities.php new file mode 100644 index 0000000..a1f84f2 --- /dev/null +++ b/src/migrations/m171024_132212_create_banner_entities.php @@ -0,0 +1,116 @@ + + * @since 1.0 + */ +class m171024_132212_create_banner_entities extends Migration +{ + /** + * @var string + */ + public $primaryTableName = '{{%banner}}'; + /** + * @var string + */ + public $translationTableName = '{{%banner_translation}}'; + + + /** + * @inheritdoc + */ + public function safeUp() + { + $tableOptions = null; + if ($this->db->getDriverName() === 'mysql') { + /* @link http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci */ + $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; + } + + // tables + $this->createTable( + $this->primaryTableName, + [ + 'id' => $this->primaryKey(), + + 'slug' => $this->string()->notNull()->unique(), + 'published' => $this->boolean()->notNull()->defaultValue(true), + 'views_count' => $this->integer()->unsigned()->notNull()->defaultValue(0), + + 'created_at' => $this->integer()->unsigned()->notNull()->defaultValue(0), + 'updated_at' => $this->integer()->unsigned()->notNull()->defaultValue(0), + + 'valid_from' => $this->dateTime()->null(), + 'valid_until' => $this->dateTime()->null(), + ], + $tableOptions + ); + $this->createTable( + $this->translationTableName, + [ + 'id' => $this->primaryKey(), + 'banner_id' => $this->integer()->unsigned()->notNull(), + + 'language' => $this->string(16)->notNull(), + 'content' => $this->text()->null(), + 'hint' => $this->string()->null(), + + 'file_name' => $this->string()->notNull(), + 'alt' => $this->string()->null(), + ], + $tableOptions + ); + + // foreign keys + $this->addForeignKey( + 'fk-banner_translation-banner_id-banner-id', + $this->translationTableName, + 'banner_id', + 'banner', + 'id', + 'CASCADE', + 'CASCADE' + ); + + // indexes + $this->createIndex( + 'idx-banner-slug', + $this->primaryTableName, + 'slug', + true + ); + $this->createIndex( + 'idx-banner_translation-banner_id', + $this->translationTableName, + 'banner_id' + ); + } + + /** + * @inheritdoc + */ + public function safeDown() + { + // foreign keys + $this->dropForeignKey('fk-banner_translation-banner_id-banner-id', $this->translationTableName); + // indexes + + $this->dropIndex('idx-banner_translation-banner_id', $this->translationTableName); + $this->dropIndex('idx-banner-slug', $this->primaryTableName); + + // tables + $this->dropTable($this->translationTableName); + $this->dropTable($this->primaryTableName); + } +} diff --git a/tests/_config/app.php b/tests/_config/app.php index 00adc7d..6550910 100755 --- a/tests/_config/app.php +++ b/tests/_config/app.php @@ -8,4 +8,14 @@ 'runtimePath' => Yii::getAlias('@tests/_output'), 'bootstrap' => [], + + 'components' => [ + 'db' => [ + 'class' => \yii\db\Connection::class, + 'dsn' => 'sqlite:' . Yii::getAlias('@tests/_output/test.db'), + 'username' => '', + 'password' => '', + 'charset' => 'utf8', + ], + ], ]; \ No newline at end of file diff --git a/tests/_data/.gitkeep b/tests/_data/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/_data/dump.sql b/tests/_data/dump.sql new file mode 100644 index 0000000..0b6b789 --- /dev/null +++ b/tests/_data/dump.sql @@ -0,0 +1,24 @@ +PRAGMA foreign_keys = off; +BEGIN TRANSACTION; + +-- Table: banner +DROP TABLE IF EXISTS banner; + +CREATE TABLE banner( + id INTEGER PRIMARY KEY AUTOINCREMENT, + slug STRING NOT NULL UNIQUE +-- published BOOLEAN NOT NULL DEFAULT VALUE true, +-- views_count INTEGER NOT NULL DEFAULT VALUE 0 +); + +-- Table: banner_translation +DROP TABLE IF EXISTS banner_translation; + +CREATE TABLE banner_translation( + id INTEGER PRIMARY KEY AUTOINCREMENT, + banner_id INTEGER NOT NULL, + language STRING NOT NULL +); + +COMMIT TRANSACTION; +PRAGMA foreign_keys = on; \ No newline at end of file diff --git a/tests/unit.suite.yml b/tests/unit.suite.yml index 58f63d5..1807607 100644 --- a/tests/unit.suite.yml +++ b/tests/unit.suite.yml @@ -3,4 +3,5 @@ bootstrap: false modules: enabled: - Asserts - - Yii2 \ No newline at end of file + - Yii2 + - Db \ No newline at end of file diff --git a/tests/unit/TestCase.php b/tests/unit/TestCase.php index 4689b5a..d62c1ff 100644 --- a/tests/unit/TestCase.php +++ b/tests/unit/TestCase.php @@ -5,13 +5,13 @@ * @license BSD 3-Clause License */ -namespace vintage\tinify\tests\unit; +namespace ymaker\banner\tests\unit; /** * Base test case class. * * @author Vladimir Kuprienko - * @since 2.0 + * @since 1.0 */ class TestCase extends \Codeception\Test\Unit {