Commit 54f2fc2b2473369a0968b7563de461af658f6514
0 parents
first commit
Showing
165 changed files
with
7720 additions
and
0 deletions
Show diff stats
1 | +++ a/.gitignore | ||
1 | +# yii console commands | ||
2 | +/yii | ||
3 | +/yii_test | ||
4 | +/yii_test.bat | ||
5 | + | ||
6 | +# phpstorm project files | ||
7 | +.idea | ||
8 | + | ||
9 | +# netbeans project files | ||
10 | +nbproject | ||
11 | + | ||
12 | +# zend studio for eclipse project files | ||
13 | +.buildpath | ||
14 | +.project | ||
15 | +.settings | ||
16 | + | ||
17 | +# windows thumbnail cache | ||
18 | +Thumbs.db | ||
19 | + | ||
20 | +# composer vendor dir | ||
21 | +/vendor | ||
22 | + | ||
23 | +# composer itself is not needed | ||
24 | +composer.phar | ||
25 | + | ||
26 | +# Mac DS_Store Files | ||
27 | +.DS_Store | ||
28 | + | ||
29 | +# phpunit itself is not needed | ||
30 | +phpunit.phar | ||
31 | +# local phpunit config | ||
32 | +/phpunit.xml | ||
33 | + | ||
34 | +# vagrant runtime | ||
35 | +/.vagrant |
1 | +++ a/LICENSE.md | ||
1 | +The Yii framework is free software. It is released under the terms of | ||
2 | +the following BSD License. | ||
3 | + | ||
4 | +Copyright © 2008 by Yii Software LLC (http://www.yiisoft.com) | ||
5 | +All rights reserved. | ||
6 | + | ||
7 | +Redistribution and use in source and binary forms, with or without | ||
8 | +modification, are permitted provided that the following conditions | ||
9 | +are met: | ||
10 | + | ||
11 | + * Redistributions of source code must retain the above copyright | ||
12 | + notice, this list of conditions and the following disclaimer. | ||
13 | + * Redistributions in binary form must reproduce the above copyright | ||
14 | + notice, this list of conditions and the following disclaimer in | ||
15 | + the documentation and/or other materials provided with the | ||
16 | + distribution. | ||
17 | + * Neither the name of Yii Software LLC nor the names of its | ||
18 | + contributors may be used to endorse or promote products derived | ||
19 | + from this software without specific prior written permission. | ||
20 | + | ||
21 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
22 | +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
23 | +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
24 | +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
25 | +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
26 | +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
27 | +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
28 | +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
29 | +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
30 | +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
31 | +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
32 | +POSSIBILITY OF SUCH DAMAGE. |
1 | +++ a/README.md | ||
1 | +<p align="center"> | ||
2 | + <a href="https://github.com/yiisoft" target="_blank"> | ||
3 | + <img src="https://avatars0.githubusercontent.com/u/993323" height="100px"> | ||
4 | + </a> | ||
5 | + <h1 align="center">Yii 2 Advanced Project Template</h1> | ||
6 | + <br> | ||
7 | +</p> | ||
8 | + | ||
9 | +Yii 2 Advanced Project Template is a skeleton [Yii 2](http://www.yiiframework.com/) application best for | ||
10 | +developing complex Web applications with multiple tiers. | ||
11 | + | ||
12 | +The template includes three tiers: front end, back end, and console, each of which | ||
13 | +is a separate Yii application. | ||
14 | + | ||
15 | +The template is designed to work in a team development environment. It supports | ||
16 | +deploying the application in different environments. | ||
17 | + | ||
18 | +Documentation is at [docs/guide/README.md](docs/guide/README.md). | ||
19 | + | ||
20 | +[](https://packagist.org/packages/yiisoft/yii2-app-advanced) | ||
21 | +[](https://packagist.org/packages/yiisoft/yii2-app-advanced) | ||
22 | +[](https://travis-ci.org/yiisoft/yii2-app-advanced) | ||
23 | + | ||
24 | +DIRECTORY STRUCTURE | ||
25 | +------------------- | ||
26 | + | ||
27 | +``` | ||
28 | +common | ||
29 | + config/ contains shared configurations | ||
30 | + mail/ contains view files for e-mails | ||
31 | + models/ contains model classes used in both backend and frontend | ||
32 | + tests/ contains tests for common classes | ||
33 | +console | ||
34 | + config/ contains console configurations | ||
35 | + controllers/ contains console controllers (commands) | ||
36 | + migrations/ contains database migrations | ||
37 | + models/ contains console-specific model classes | ||
38 | + runtime/ contains files generated during runtime | ||
39 | +backend | ||
40 | + assets/ contains application assets such as JavaScript and CSS | ||
41 | + config/ contains backend configurations | ||
42 | + controllers/ contains Web controller classes | ||
43 | + models/ contains backend-specific model classes | ||
44 | + runtime/ contains files generated during runtime | ||
45 | + tests/ contains tests for backend application | ||
46 | + views/ contains view files for the Web application | ||
47 | + web/ contains the entry script and Web resources | ||
48 | +frontend | ||
49 | + assets/ contains application assets such as JavaScript and CSS | ||
50 | + config/ contains frontend configurations | ||
51 | + controllers/ contains Web controller classes | ||
52 | + models/ contains frontend-specific model classes | ||
53 | + runtime/ contains files generated during runtime | ||
54 | + tests/ contains tests for frontend application | ||
55 | + views/ contains view files for the Web application | ||
56 | + web/ contains the entry script and Web resources | ||
57 | + widgets/ contains frontend widgets | ||
58 | +vendor/ contains dependent 3rd-party packages | ||
59 | +environments/ contains environment-based overrides | ||
60 | +``` |
1 | +++ a/Vagrantfile | ||
1 | +require 'yaml' | ||
2 | +require 'fileutils' | ||
3 | + | ||
4 | +required_plugins = %w( vagrant-hostmanager vagrant-vbguest ) | ||
5 | +required_plugins.each do |plugin| | ||
6 | + exec "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin | ||
7 | +end | ||
8 | + | ||
9 | +domains = { | ||
10 | + frontend: 'y2aa-frontend.test', | ||
11 | + backend: 'y2aa-backend.test' | ||
12 | +} | ||
13 | + | ||
14 | +config = { | ||
15 | + local: './vagrant/config/vagrant-local.yml', | ||
16 | + example: './vagrant/config/vagrant-local.example.yml' | ||
17 | +} | ||
18 | + | ||
19 | +# copy config from example if local config not exists | ||
20 | +FileUtils.cp config[:example], config[:local] unless File.exist?(config[:local]) | ||
21 | +# read config | ||
22 | +options = YAML.load_file config[:local] | ||
23 | + | ||
24 | +# check github token | ||
25 | +if options['github_token'].nil? || options['github_token'].to_s.length != 40 | ||
26 | + puts "You must place REAL GitHub token into configuration:\n/yii2-app-advanced/vagrant/config/vagrant-local.yml" | ||
27 | + exit | ||
28 | +end | ||
29 | + | ||
30 | +# vagrant configurate | ||
31 | +Vagrant.configure(2) do |config| | ||
32 | + # select the box | ||
33 | + config.vm.box = 'bento/ubuntu-16.04' | ||
34 | + | ||
35 | + # should we ask about box updates? | ||
36 | + config.vm.box_check_update = options['box_check_update'] | ||
37 | + | ||
38 | + config.vm.provider 'virtualbox' do |vb| | ||
39 | + # machine cpus count | ||
40 | + vb.cpus = options['cpus'] | ||
41 | + # machine memory size | ||
42 | + vb.memory = options['memory'] | ||
43 | + # machine name (for VirtualBox UI) | ||
44 | + vb.name = options['machine_name'] | ||
45 | + end | ||
46 | + | ||
47 | + # machine name (for vagrant console) | ||
48 | + config.vm.define options['machine_name'] | ||
49 | + | ||
50 | + # machine name (for guest machine console) | ||
51 | + config.vm.hostname = options['machine_name'] | ||
52 | + | ||
53 | + # network settings | ||
54 | + config.vm.network 'private_network', ip: options['ip'] | ||
55 | + | ||
56 | + # sync: folder 'yii2-app-advanced' (host machine) -> folder '/app' (guest machine) | ||
57 | + config.vm.synced_folder './', '/app', owner: 'vagrant', group: 'vagrant' | ||
58 | + | ||
59 | + # disable folder '/vagrant' (guest machine) | ||
60 | + config.vm.synced_folder '.', '/vagrant', disabled: true | ||
61 | + | ||
62 | + # hosts settings (host machine) | ||
63 | + config.vm.provision :hostmanager | ||
64 | + config.hostmanager.enabled = true | ||
65 | + config.hostmanager.manage_host = true | ||
66 | + config.hostmanager.ignore_private_ip = false | ||
67 | + config.hostmanager.include_offline = true | ||
68 | + config.hostmanager.aliases = domains.values | ||
69 | + | ||
70 | + # provisioners | ||
71 | + config.vm.provision 'shell', path: './vagrant/provision/once-as-root.sh', args: [options['timezone']] | ||
72 | + config.vm.provision 'shell', path: './vagrant/provision/once-as-vagrant.sh', args: [options['github_token']], privileged: false | ||
73 | + config.vm.provision 'shell', path: './vagrant/provision/always-as-root.sh', run: 'always' | ||
74 | + | ||
75 | + # post-install message (vagrant console) | ||
76 | + config.vm.post_up_message = "Frontend URL: http://#{domains[:frontend]}\nBackend URL: http://#{domains[:backend]}" | ||
77 | +end |
1 | +++ a/backend/assets/AppAsset.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\assets; | ||
4 | + | ||
5 | +use yii\web\AssetBundle; | ||
6 | + | ||
7 | +/** | ||
8 | + * Main backend application asset bundle. | ||
9 | + */ | ||
10 | +class AppAsset extends AssetBundle | ||
11 | +{ | ||
12 | + public $basePath = '@webroot'; | ||
13 | + public $baseUrl = '@web'; | ||
14 | + public $css = [ | ||
15 | + 'css/site.css', | ||
16 | + ]; | ||
17 | + public $js = [ | ||
18 | + ]; | ||
19 | + public $depends = [ | ||
20 | + 'yii\web\YiiAsset', | ||
21 | + 'yii\bootstrap\BootstrapAsset', | ||
22 | + ]; | ||
23 | +} |
1 | +++ a/backend/codeception.yml | ||
1 | +namespace: backend\tests | ||
2 | +actor_suffix: Tester | ||
3 | +paths: | ||
4 | + tests: tests | ||
5 | + output: tests/_output | ||
6 | + data: tests/_data | ||
7 | + support: tests/_support | ||
8 | +settings: | ||
9 | + bootstrap: _bootstrap.php | ||
10 | + colors: true | ||
11 | + memory_limit: 1024M | ||
12 | +modules: | ||
13 | + config: | ||
14 | + Yii2: | ||
15 | + configFile: 'config/test-local.php' |
1 | +++ a/backend/config/main.php | ||
1 | +<?php | ||
2 | + $params = array_merge( | ||
3 | + require __DIR__ . '/../../common/config/params.php', | ||
4 | + require __DIR__ . '/../../common/config/params-local.php', | ||
5 | + require __DIR__ . '/params.php', | ||
6 | + require __DIR__ . '/params-local.php' | ||
7 | + ); | ||
8 | + | ||
9 | + return [ | ||
10 | + 'id' => 'app-backend', | ||
11 | + 'homeUrl' => '/rest', | ||
12 | + 'basePath' => dirname(__DIR__), | ||
13 | + 'controllerNamespace' => 'backend\controllers', | ||
14 | + 'bootstrap' => [ 'log' ], | ||
15 | + 'modules' => [], | ||
16 | + 'components' => [ | ||
17 | + 'request' => [ | ||
18 | + 'baseUrl' => '/rest', | ||
19 | + 'csrfParam' => '_csrf-backend', | ||
20 | + ], | ||
21 | + 'user' => [ | ||
22 | + 'identityClass' => 'common\models\User', | ||
23 | + 'enableAutoLogin' => true, | ||
24 | + 'identityCookie' => [ | ||
25 | + 'name' => '_identity-backend', | ||
26 | + 'httpOnly' => true, | ||
27 | + ], | ||
28 | + ], | ||
29 | + 'session' => [ | ||
30 | + // this is the name of the session cookie used for login on the backend | ||
31 | + 'name' => 'advanced-backend', | ||
32 | + ], | ||
33 | + 'log' => [ | ||
34 | + 'traceLevel' => YII_DEBUG ? 3 : 0, | ||
35 | + 'targets' => [ | ||
36 | + [ | ||
37 | + 'class' => 'yii\log\FileTarget', | ||
38 | + 'levels' => [ | ||
39 | + 'error', | ||
40 | + 'warning', | ||
41 | + ], | ||
42 | + ], | ||
43 | + ], | ||
44 | + ], | ||
45 | + 'errorHandler' => [ | ||
46 | + 'errorAction' => 'site/error', | ||
47 | + ], | ||
48 | + 'urlManager' => [ | ||
49 | + 'enablePrettyUrl' => true, | ||
50 | + 'enableStrictParsing' => true, | ||
51 | + 'showScriptName' => false, | ||
52 | + 'rules' => [ | ||
53 | + [ 'class' => 'yii\rest\UrlRule', | ||
54 | + 'controller' => 'call', | ||
55 | + ], | ||
56 | + ], | ||
57 | + ], | ||
58 | + ], | ||
59 | + 'params' => $params, | ||
60 | + ]; |
1 | +++ a/backend/controllers/CallController.php | ||
1 | +<?php | ||
2 | + | ||
3 | + namespace backend\controllers; | ||
4 | + | ||
5 | + use yii\rest\ActiveController; | ||
6 | + | ||
7 | + class CallController extends ActiveController | ||
8 | + { | ||
9 | + public $modelClass = 'common\models\Call'; | ||
10 | + } | ||
0 | \ No newline at end of file | 11 | \ No newline at end of file |
1 | +++ a/backend/controllers/SiteController.php | ||
1 | +<?php | ||
2 | +namespace backend\controllers; | ||
3 | + | ||
4 | +use Yii; | ||
5 | +use yii\web\Controller; | ||
6 | +use yii\filters\VerbFilter; | ||
7 | +use yii\filters\AccessControl; | ||
8 | +use common\models\LoginForm; | ||
9 | + | ||
10 | +/** | ||
11 | + * Site controller | ||
12 | + */ | ||
13 | +class SiteController extends Controller | ||
14 | +{ | ||
15 | + /** | ||
16 | + * {@inheritdoc} | ||
17 | + */ | ||
18 | + public function behaviors() | ||
19 | + { | ||
20 | + return [ | ||
21 | + 'access' => [ | ||
22 | + 'class' => AccessControl::className(), | ||
23 | + 'rules' => [ | ||
24 | + [ | ||
25 | + 'actions' => ['login', 'error'], | ||
26 | + 'allow' => true, | ||
27 | + ], | ||
28 | + [ | ||
29 | + 'actions' => ['logout', 'index'], | ||
30 | + 'allow' => true, | ||
31 | + 'roles' => ['@'], | ||
32 | + ], | ||
33 | + ], | ||
34 | + ], | ||
35 | + 'verbs' => [ | ||
36 | + 'class' => VerbFilter::className(), | ||
37 | + 'actions' => [ | ||
38 | + 'logout' => ['post'], | ||
39 | + ], | ||
40 | + ], | ||
41 | + ]; | ||
42 | + } | ||
43 | + | ||
44 | + /** | ||
45 | + * {@inheritdoc} | ||
46 | + */ | ||
47 | + public function actions() | ||
48 | + { | ||
49 | + return [ | ||
50 | + 'error' => [ | ||
51 | + 'class' => 'yii\web\ErrorAction', | ||
52 | + ], | ||
53 | + ]; | ||
54 | + } | ||
55 | + | ||
56 | + /** | ||
57 | + * Displays homepage. | ||
58 | + * | ||
59 | + * @return string | ||
60 | + */ | ||
61 | + public function actionIndex() | ||
62 | + { | ||
63 | + return $this->render('index'); | ||
64 | + } | ||
65 | + | ||
66 | + /** | ||
67 | + * Login action. | ||
68 | + * | ||
69 | + * @return string | ||
70 | + */ | ||
71 | + public function actionLogin() | ||
72 | + { | ||
73 | + if (!Yii::$app->user->isGuest) { | ||
74 | + return $this->goHome(); | ||
75 | + } | ||
76 | + | ||
77 | + $model = new LoginForm(); | ||
78 | + if ($model->load(Yii::$app->request->post()) && $model->login()) { | ||
79 | + return $this->goBack(); | ||
80 | + } else { | ||
81 | + $model->password = ''; | ||
82 | + | ||
83 | + return $this->render('login', [ | ||
84 | + 'model' => $model, | ||
85 | + ]); | ||
86 | + } | ||
87 | + } | ||
88 | + | ||
89 | + /** | ||
90 | + * Logout action. | ||
91 | + * | ||
92 | + * @return string | ||
93 | + */ | ||
94 | + public function actionLogout() | ||
95 | + { | ||
96 | + Yii::$app->user->logout(); | ||
97 | + | ||
98 | + return $this->goHome(); | ||
99 | + } | ||
100 | +} |
1 | +++ a/backend/tests/_bootstrap.php | ||
1 | +<?php | ||
2 | +defined('YII_DEBUG') or define('YII_DEBUG', true); | ||
3 | +defined('YII_ENV') or define('YII_ENV', 'test'); | ||
4 | +defined('YII_APP_BASE_PATH') or define('YII_APP_BASE_PATH', __DIR__.'/../../'); | ||
5 | + | ||
6 | +require_once YII_APP_BASE_PATH . '/vendor/autoload.php'; | ||
7 | +require_once YII_APP_BASE_PATH . '/vendor/yiisoft/yii2/Yii.php'; | ||
8 | +require_once YII_APP_BASE_PATH . '/common/config/bootstrap.php'; | ||
9 | +require_once __DIR__ . '/../config/bootstrap.php'; |
1 | +++ a/backend/tests/_data/.gitignore |
1 | +++ a/backend/tests/_data/login_data.php | ||
1 | +<?php | ||
2 | +return [ | ||
3 | + [ | ||
4 | + 'username' => 'erau', | ||
5 | + 'auth_key' => 'tUu1qHcde0diwUol3xeI-18MuHkkprQI', | ||
6 | + // password_0 | ||
7 | + 'password_hash' => '$2y$13$nJ1WDlBaGcbCdbNC5.5l4.sgy.OMEKCqtDQOdQ2OWpgiKRWYyzzne', | ||
8 | + 'password_reset_token' => 'RkD_Jw0_8HEedzLk7MM-ZKEFfYR7VbMr_1392559490', | ||
9 | + 'created_at' => '1392559490', | ||
10 | + 'updated_at' => '1392559490', | ||
11 | + 'email' => 'sfriesen@jenkins.info', | ||
12 | + ], | ||
13 | +]; |
1 | +++ a/backend/tests/_support/FunctionalTester.php | ||
1 | +<?php | ||
2 | +namespace backend\tests; | ||
3 | + | ||
4 | +/** | ||
5 | + * Inherited Methods | ||
6 | + * @method void wantToTest($text) | ||
7 | + * @method void wantTo($text) | ||
8 | + * @method void execute($callable) | ||
9 | + * @method void expectTo($prediction) | ||
10 | + * @method void expect($prediction) | ||
11 | + * @method void amGoingTo($argumentation) | ||
12 | + * @method void am($role) | ||
13 | + * @method void lookForwardTo($achieveValue) | ||
14 | + * @method void comment($description) | ||
15 | + * @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL) | ||
16 | + * | ||
17 | + * @SuppressWarnings(PHPMD) | ||
18 | + */ | ||
19 | +class FunctionalTester extends \Codeception\Actor | ||
20 | +{ | ||
21 | + use _generated\FunctionalTesterActions; | ||
22 | + /** | ||
23 | + * Define custom actions here | ||
24 | + */ | ||
25 | +} |
1 | +++ a/backend/tests/_support/UnitTester.php | ||
1 | +<?php | ||
2 | +namespace backend\tests; | ||
3 | + | ||
4 | +/** | ||
5 | + * Inherited Methods | ||
6 | + * @method void wantToTest($text) | ||
7 | + * @method void wantTo($text) | ||
8 | + * @method void execute($callable) | ||
9 | + * @method void expectTo($prediction) | ||
10 | + * @method void expect($prediction) | ||
11 | + * @method void amGoingTo($argumentation) | ||
12 | + * @method void am($role) | ||
13 | + * @method void lookForwardTo($achieveValue) | ||
14 | + * @method void comment($description) | ||
15 | + * @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL) | ||
16 | + * | ||
17 | + * @SuppressWarnings(PHPMD) | ||
18 | + */ | ||
19 | +class UnitTester extends \Codeception\Actor | ||
20 | +{ | ||
21 | + use _generated\UnitTesterActions; | ||
22 | + /** | ||
23 | + * Define custom actions here | ||
24 | + */ | ||
25 | +} |
1 | +++ a/backend/tests/functional/LoginCest.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\tests\functional; | ||
4 | + | ||
5 | +use backend\tests\FunctionalTester; | ||
6 | +use common\fixtures\UserFixture; | ||
7 | + | ||
8 | +/** | ||
9 | + * Class LoginCest | ||
10 | + */ | ||
11 | +class LoginCest | ||
12 | +{ | ||
13 | + /** | ||
14 | + * Load fixtures before db transaction begin | ||
15 | + * Called in _before() | ||
16 | + * @see \Codeception\Module\Yii2::_before() | ||
17 | + * @see \Codeception\Module\Yii2::loadFixtures() | ||
18 | + * @return array | ||
19 | + */ | ||
20 | + public function _fixtures() | ||
21 | + { | ||
22 | + return [ | ||
23 | + 'user' => [ | ||
24 | + 'class' => UserFixture::className(), | ||
25 | + 'dataFile' => codecept_data_dir() . 'login_data.php' | ||
26 | + ] | ||
27 | + ]; | ||
28 | + } | ||
29 | + | ||
30 | + /** | ||
31 | + * @param FunctionalTester $I | ||
32 | + */ | ||
33 | + public function loginUser(FunctionalTester $I) | ||
34 | + { | ||
35 | + $I->amOnPage('/site/login'); | ||
36 | + $I->fillField('Username', 'erau'); | ||
37 | + $I->fillField('Password', 'password_0'); | ||
38 | + $I->click('login-button'); | ||
39 | + | ||
40 | + $I->see('Logout (erau)', 'form button[type=submit]'); | ||
41 | + $I->dontSeeLink('Login'); | ||
42 | + $I->dontSeeLink('Signup'); | ||
43 | + } | ||
44 | +} |
1 | +++ a/backend/tests/functional/_bootstrap.php | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * Here you can initialize variables via \Codeception\Util\Fixtures class | ||
4 | + * to store data in global array and use it in Cests. | ||
5 | + * | ||
6 | + * ```php | ||
7 | + * // Here _bootstrap.php | ||
8 | + * \Codeception\Util\Fixtures::add('user1', ['name' => 'davert']); | ||
9 | + * ``` | ||
10 | + * | ||
11 | + * In Cests | ||
12 | + * | ||
13 | + * ```php | ||
14 | + * \Codeception\Util\Fixtures::get('user1'); | ||
15 | + * ``` | ||
16 | + */ | ||
0 | \ No newline at end of file | 17 | \ No newline at end of file |
1 | +++ a/backend/tests/unit/_bootstrap.php | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * Here you can initialize variables via \Codeception\Util\Fixtures class | ||
4 | + * to store data in global array and use it in Tests. | ||
5 | + * | ||
6 | + * ```php | ||
7 | + * // Here _bootstrap.php | ||
8 | + * \Codeception\Util\Fixtures::add('user1', ['name' => 'davert']); | ||
9 | + * ``` | ||
10 | + * | ||
11 | + * In Tests | ||
12 | + * | ||
13 | + * ```php | ||
14 | + * \Codeception\Util\Fixtures::get('user1'); | ||
15 | + * ``` | ||
16 | + */ |
1 | +++ a/backend/views/layouts/main.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this \yii\web\View */ | ||
4 | +/* @var $content string */ | ||
5 | + | ||
6 | +use backend\assets\AppAsset; | ||
7 | +use yii\helpers\Html; | ||
8 | +use yii\bootstrap\Nav; | ||
9 | +use yii\bootstrap\NavBar; | ||
10 | +use yii\widgets\Breadcrumbs; | ||
11 | +use common\widgets\Alert; | ||
12 | + | ||
13 | +AppAsset::register($this); | ||
14 | +?> | ||
15 | +<?php $this->beginPage() ?> | ||
16 | +<!DOCTYPE html> | ||
17 | +<html lang="<?= Yii::$app->language ?>"> | ||
18 | +<head> | ||
19 | + <meta charset="<?= Yii::$app->charset ?>"> | ||
20 | + <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
21 | + <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
22 | + <?= Html::csrfMetaTags() ?> | ||
23 | + <title><?= Html::encode($this->title) ?></title> | ||
24 | + <?php $this->head() ?> | ||
25 | +</head> | ||
26 | +<body> | ||
27 | +<?php $this->beginBody() ?> | ||
28 | + | ||
29 | +<div class="wrap"> | ||
30 | + <?php | ||
31 | + NavBar::begin([ | ||
32 | + 'brandLabel' => Yii::$app->name, | ||
33 | + 'brandUrl' => Yii::$app->homeUrl, | ||
34 | + 'options' => [ | ||
35 | + 'class' => 'navbar-inverse navbar-fixed-top', | ||
36 | + ], | ||
37 | + ]); | ||
38 | + $menuItems = [ | ||
39 | + ['label' => 'Home', 'url' => ['/site/index']], | ||
40 | + ]; | ||
41 | + if (Yii::$app->user->isGuest) { | ||
42 | + $menuItems[] = ['label' => 'Login', 'url' => ['/site/login']]; | ||
43 | + } else { | ||
44 | + $menuItems[] = '<li>' | ||
45 | + . Html::beginForm(['/site/logout'], 'post') | ||
46 | + . Html::submitButton( | ||
47 | + 'Logout (' . Yii::$app->user->identity->username . ')', | ||
48 | + ['class' => 'btn btn-link logout'] | ||
49 | + ) | ||
50 | + . Html::endForm() | ||
51 | + . '</li>'; | ||
52 | + } | ||
53 | + echo Nav::widget([ | ||
54 | + 'options' => ['class' => 'navbar-nav navbar-right'], | ||
55 | + 'items' => $menuItems, | ||
56 | + ]); | ||
57 | + NavBar::end(); | ||
58 | + ?> | ||
59 | + | ||
60 | + <div class="container"> | ||
61 | + <?= Breadcrumbs::widget([ | ||
62 | + 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], | ||
63 | + ]) ?> | ||
64 | + <?= Alert::widget() ?> | ||
65 | + <?= $content ?> | ||
66 | + </div> | ||
67 | +</div> | ||
68 | + | ||
69 | +<footer class="footer"> | ||
70 | + <div class="container"> | ||
71 | + <p class="pull-left">© <?= Html::encode(Yii::$app->name) ?> <?= date('Y') ?></p> | ||
72 | + | ||
73 | + <p class="pull-right"><?= Yii::powered() ?></p> | ||
74 | + </div> | ||
75 | +</footer> | ||
76 | + | ||
77 | +<?php $this->endBody() ?> | ||
78 | +</body> | ||
79 | +</html> | ||
80 | +<?php $this->endPage() ?> |
1 | +++ a/backend/views/site/error.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this yii\web\View */ | ||
4 | +/* @var $name string */ | ||
5 | +/* @var $message string */ | ||
6 | +/* @var $exception Exception */ | ||
7 | + | ||
8 | +use yii\helpers\Html; | ||
9 | + | ||
10 | +$this->title = $name; | ||
11 | +?> | ||
12 | +<div class="site-error"> | ||
13 | + | ||
14 | + <h1><?= Html::encode($this->title) ?></h1> | ||
15 | + | ||
16 | + <div class="alert alert-danger"> | ||
17 | + <?= nl2br(Html::encode($message)) ?> | ||
18 | + </div> | ||
19 | + | ||
20 | + <p> | ||
21 | + The above error occurred while the Web server was processing your request. | ||
22 | + </p> | ||
23 | + <p> | ||
24 | + Please contact us if you think this is a server error. Thank you. | ||
25 | + </p> | ||
26 | + | ||
27 | +</div> |
1 | +++ a/backend/views/site/index.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this yii\web\View */ | ||
4 | + | ||
5 | +$this->title = 'My Yii Application'; | ||
6 | +?> | ||
7 | +<div class="site-index"> | ||
8 | + | ||
9 | + <div class="jumbotron"> | ||
10 | + <h1>Congratulations!</h1> | ||
11 | + | ||
12 | + <p class="lead">You have successfully created your Yii-powered application.</p> | ||
13 | + | ||
14 | + <p><a class="btn btn-lg btn-success" href="http://www.yiiframework.com">Get started with Yii</a></p> | ||
15 | + </div> | ||
16 | + | ||
17 | + <div class="body-content"> | ||
18 | + | ||
19 | + <div class="row"> | ||
20 | + <div class="col-lg-4"> | ||
21 | + <h2>Heading</h2> | ||
22 | + | ||
23 | + <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et | ||
24 | + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip | ||
25 | + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu | ||
26 | + fugiat nulla pariatur.</p> | ||
27 | + | ||
28 | + <p><a class="btn btn-default" href="http://www.yiiframework.com/doc/">Yii Documentation »</a></p> | ||
29 | + </div> | ||
30 | + <div class="col-lg-4"> | ||
31 | + <h2>Heading</h2> | ||
32 | + | ||
33 | + <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et | ||
34 | + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip | ||
35 | + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu | ||
36 | + fugiat nulla pariatur.</p> | ||
37 | + | ||
38 | + <p><a class="btn btn-default" href="http://www.yiiframework.com/forum/">Yii Forum »</a></p> | ||
39 | + </div> | ||
40 | + <div class="col-lg-4"> | ||
41 | + <h2>Heading</h2> | ||
42 | + | ||
43 | + <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et | ||
44 | + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip | ||
45 | + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu | ||
46 | + fugiat nulla pariatur.</p> | ||
47 | + | ||
48 | + <p><a class="btn btn-default" href="http://www.yiiframework.com/extensions/">Yii Extensions »</a></p> | ||
49 | + </div> | ||
50 | + </div> | ||
51 | + | ||
52 | + </div> | ||
53 | +</div> |
1 | +++ a/backend/views/site/login.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this yii\web\View */ | ||
4 | +/* @var $form yii\bootstrap\ActiveForm */ | ||
5 | +/* @var $model \common\models\LoginForm */ | ||
6 | + | ||
7 | +use yii\helpers\Html; | ||
8 | +use yii\bootstrap\ActiveForm; | ||
9 | + | ||
10 | +$this->title = 'Login'; | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="site-login"> | ||
14 | + <h1><?= Html::encode($this->title) ?></h1> | ||
15 | + | ||
16 | + <p>Please fill out the following fields to login:</p> | ||
17 | + | ||
18 | + <div class="row"> | ||
19 | + <div class="col-lg-5"> | ||
20 | + <?php $form = ActiveForm::begin(['id' => 'login-form']); ?> | ||
21 | + | ||
22 | + <?= $form->field($model, 'username')->textInput(['autofocus' => true]) ?> | ||
23 | + | ||
24 | + <?= $form->field($model, 'password')->passwordInput() ?> | ||
25 | + | ||
26 | + <?= $form->field($model, 'rememberMe')->checkbox() ?> | ||
27 | + | ||
28 | + <div class="form-group"> | ||
29 | + <?= Html::submitButton('Login', ['class' => 'btn btn-primary', 'name' => 'login-button']) ?> | ||
30 | + </div> | ||
31 | + | ||
32 | + <?php ActiveForm::end(); ?> | ||
33 | + </div> | ||
34 | + </div> | ||
35 | +</div> |
1 | +++ a/backend/web/css/site.css | ||
1 | +html, | ||
2 | +body { | ||
3 | + height: 100%; | ||
4 | +} | ||
5 | + | ||
6 | +.wrap { | ||
7 | + min-height: 100%; | ||
8 | + height: auto; | ||
9 | + margin: 0 auto -60px; | ||
10 | + padding: 0 0 60px; | ||
11 | +} | ||
12 | + | ||
13 | +.wrap > .container { | ||
14 | + padding: 70px 15px 20px; | ||
15 | +} | ||
16 | + | ||
17 | +.footer { | ||
18 | + height: 60px; | ||
19 | + background-color: #f5f5f5; | ||
20 | + border-top: 1px solid #ddd; | ||
21 | + padding-top: 20px; | ||
22 | +} | ||
23 | + | ||
24 | +.jumbotron { | ||
25 | + text-align: center; | ||
26 | + background-color: transparent; | ||
27 | +} | ||
28 | + | ||
29 | +.jumbotron .btn { | ||
30 | + font-size: 21px; | ||
31 | + padding: 14px 24px; | ||
32 | +} | ||
33 | + | ||
34 | +.not-set { | ||
35 | + color: #c55; | ||
36 | + font-style: italic; | ||
37 | +} | ||
38 | + | ||
39 | +/* add sorting icons to gridview sort links */ | ||
40 | +a.asc:after, a.desc:after { | ||
41 | + position: relative; | ||
42 | + top: 1px; | ||
43 | + display: inline-block; | ||
44 | + font-family: 'Glyphicons Halflings'; | ||
45 | + font-style: normal; | ||
46 | + font-weight: normal; | ||
47 | + line-height: 1; | ||
48 | + padding-left: 5px; | ||
49 | +} | ||
50 | + | ||
51 | +a.asc:after { | ||
52 | + content: /*"\e113"*/ "\e151"; | ||
53 | +} | ||
54 | + | ||
55 | +a.desc:after { | ||
56 | + content: /*"\e114"*/ "\e152"; | ||
57 | +} | ||
58 | + | ||
59 | +.sort-numerical a.asc:after { | ||
60 | + content: "\e153"; | ||
61 | +} | ||
62 | + | ||
63 | +.sort-numerical a.desc:after { | ||
64 | + content: "\e154"; | ||
65 | +} | ||
66 | + | ||
67 | +.sort-ordinal a.asc:after { | ||
68 | + content: "\e155"; | ||
69 | +} | ||
70 | + | ||
71 | +.sort-ordinal a.desc:after { | ||
72 | + content: "\e156"; | ||
73 | +} | ||
74 | + | ||
75 | +.grid-view td { | ||
76 | + white-space: nowrap; | ||
77 | +} | ||
78 | + | ||
79 | +.grid-view .filters input, | ||
80 | +.grid-view .filters select { | ||
81 | + min-width: 50px; | ||
82 | +} | ||
83 | + | ||
84 | +.hint-block { | ||
85 | + display: block; | ||
86 | + margin-top: 5px; | ||
87 | + color: #999; | ||
88 | +} | ||
89 | + | ||
90 | +.error-summary { | ||
91 | + color: #a94442; | ||
92 | + background: #fdf7f7; | ||
93 | + border-left: 3px solid #eed3d7; | ||
94 | + padding: 10px 20px; | ||
95 | + margin: 0 0 15px 0; | ||
96 | +} | ||
97 | + | ||
98 | +/* align the logout "link" (button in form) of the navbar */ | ||
99 | +.nav li > form > button.logout { | ||
100 | + padding: 15px; | ||
101 | + border: none; | ||
102 | +} | ||
103 | + | ||
104 | +@media(max-width:767px) { | ||
105 | + .nav li > form > button.logout { | ||
106 | + display:block; | ||
107 | + text-align: left; | ||
108 | + width: 100%; | ||
109 | + padding: 10px 15px; | ||
110 | + } | ||
111 | +} | ||
112 | + | ||
113 | +.nav > li > form > button.logout:focus, | ||
114 | +.nav > li > form > button.logout:hover { | ||
115 | + text-decoration: none; | ||
116 | +} | ||
117 | + | ||
118 | +.nav > li > form > button.logout:focus { | ||
119 | + outline: none; | ||
120 | +} |
No preview for this file type
1 | +++ a/common/codeception.yml | ||
1 | +namespace: common\tests | ||
2 | +actor_suffix: Tester | ||
3 | +paths: | ||
4 | + tests: tests | ||
5 | + output: tests/_output | ||
6 | + data: tests/_data | ||
7 | + support: tests/_support | ||
8 | +settings: | ||
9 | + bootstrap: _bootstrap.php | ||
10 | + colors: true | ||
11 | + memory_limit: 1024M | ||
12 | +modules: | ||
13 | + config: | ||
14 | + Yii2: | ||
15 | + configFile: 'config/test-local.php' |
1 | +++ a/common/config/bootstrap.php | ||
1 | +<?php | ||
2 | +Yii::setAlias('@common', dirname(__DIR__)); | ||
3 | +Yii::setAlias('@frontend', dirname(dirname(__DIR__)) . '/frontend'); | ||
4 | +Yii::setAlias('@backend', dirname(dirname(__DIR__)) . '/backend'); | ||
5 | +Yii::setAlias('@console', dirname(dirname(__DIR__)) . '/console'); |
1 | +++ a/common/config/main.php | ||
1 | +<?php | ||
2 | +return [ | ||
3 | + 'aliases' => [ | ||
4 | + '@bower' => '@vendor/bower-asset', | ||
5 | + '@npm' => '@vendor/npm-asset', | ||
6 | + ], | ||
7 | + 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', | ||
8 | + 'components' => [ | ||
9 | + 'cache' => [ | ||
10 | + 'class' => 'yii\caching\FileCache', | ||
11 | + ], | ||
12 | + ], | ||
13 | +]; |
1 | +++ a/common/config/test.php | ||
1 | +<?php | ||
2 | +return [ | ||
3 | + 'id' => 'app-common-tests', | ||
4 | + 'basePath' => dirname(__DIR__), | ||
5 | + 'components' => [ | ||
6 | + 'user' => [ | ||
7 | + 'class' => 'yii\web\User', | ||
8 | + 'identityClass' => 'common\models\User', | ||
9 | + ], | ||
10 | + 'request' => [ | ||
11 | + 'cookieValidationKey' => 'test', | ||
12 | + ], | ||
13 | + ], | ||
14 | +]; |
1 | +++ a/common/mail/layouts/html.php | ||
1 | +<?php | ||
2 | +use yii\helpers\Html; | ||
3 | + | ||
4 | +/* @var $this \yii\web\View view component instance */ | ||
5 | +/* @var $message \yii\mail\MessageInterface the message being composed */ | ||
6 | +/* @var $content string main view render result */ | ||
7 | +?> | ||
8 | +<?php $this->beginPage() ?> | ||
9 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
10 | +<html xmlns="http://www.w3.org/1999/xhtml"> | ||
11 | +<head> | ||
12 | + <meta http-equiv="Content-Type" content="text/html; charset=<?= Yii::$app->charset ?>" /> | ||
13 | + <title><?= Html::encode($this->title) ?></title> | ||
14 | + <?php $this->head() ?> | ||
15 | +</head> | ||
16 | +<body> | ||
17 | + <?php $this->beginBody() ?> | ||
18 | + <?= $content ?> | ||
19 | + <?php $this->endBody() ?> | ||
20 | +</body> | ||
21 | +</html> | ||
22 | +<?php $this->endPage() ?> |
1 | +++ a/common/mail/layouts/text.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | + | ||
5 | +/** @var \yii\web\View $this view component instance */ | ||
6 | +/** @var \yii\mail\MessageInterface $message the message being composed */ | ||
7 | +/** @var string $content main view render result */ | ||
8 | +?> | ||
9 | + | ||
10 | +<?php $this->beginPage() ?> | ||
11 | +<?php $this->beginBody() ?> | ||
12 | +<?= $content ?> | ||
13 | +<?php $this->endBody() ?> | ||
14 | +<?php $this->endPage() ?> |
1 | +++ a/common/mail/passwordResetToken-html.php | ||
1 | +<?php | ||
2 | +use yii\helpers\Html; | ||
3 | + | ||
4 | +/* @var $this yii\web\View */ | ||
5 | +/* @var $user common\models\User */ | ||
6 | + | ||
7 | +$resetLink = Yii::$app->urlManager->createAbsoluteUrl(['site/reset-password', 'token' => $user->password_reset_token]); | ||
8 | +?> | ||
9 | +<div class="password-reset"> | ||
10 | + <p>Hello <?= Html::encode($user->username) ?>,</p> | ||
11 | + | ||
12 | + <p>Follow the link below to reset your password:</p> | ||
13 | + | ||
14 | + <p><?= Html::a(Html::encode($resetLink), $resetLink) ?></p> | ||
15 | +</div> |
1 | +++ a/common/mail/passwordResetToken-text.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this yii\web\View */ | ||
4 | +/* @var $user common\models\User */ | ||
5 | + | ||
6 | +$resetLink = Yii::$app->urlManager->createAbsoluteUrl(['site/reset-password', 'token' => $user->password_reset_token]); | ||
7 | +?> | ||
8 | +Hello <?= $user->username ?>, | ||
9 | + | ||
10 | +Follow the link below to reset your password: | ||
11 | + | ||
12 | +<?= $resetLink ?> |
1 | +++ a/common/models/Call.php | ||
1 | +<?php | ||
2 | + | ||
3 | + namespace common\models; | ||
4 | + | ||
5 | + use yii\db\ActiveRecord; | ||
6 | + | ||
7 | + /** | ||
8 | + * This is the model class for table "call". | ||
9 | + * | ||
10 | + * @property int $id | ||
11 | + * @property string $company | ||
12 | + * @property string $calldate | ||
13 | + * @property string $callerid | ||
14 | + * @property string $line | ||
15 | + * @property string $operator | ||
16 | + * @property string $status | ||
17 | + * @property string $queue | ||
18 | + * @property int $duration | ||
19 | + * @property int $billsec | ||
20 | + * @property string $record | ||
21 | + */ | ||
22 | + class Call extends ActiveRecord | ||
23 | + { | ||
24 | + /** | ||
25 | + * @inheritdoc | ||
26 | + */ | ||
27 | + public static function tableName() | ||
28 | + { | ||
29 | + return 'call'; | ||
30 | + } | ||
31 | + | ||
32 | + /** | ||
33 | + * @inheritdoc | ||
34 | + */ | ||
35 | + public function rules() | ||
36 | + { | ||
37 | + return [ | ||
38 | + [ | ||
39 | + [ | ||
40 | + 'company', | ||
41 | + 'calldate', | ||
42 | + 'callerid', | ||
43 | + 'status', | ||
44 | + 'duration', | ||
45 | + 'billsec', | ||
46 | + ], | ||
47 | + 'required', | ||
48 | + ], | ||
49 | + [ | ||
50 | + [ 'calldate' ], | ||
51 | + 'safe', | ||
52 | + ], | ||
53 | + [ | ||
54 | + [ | ||
55 | + 'duration', | ||
56 | + 'billsec', | ||
57 | + ], | ||
58 | + 'default', | ||
59 | + 'value' => null, | ||
60 | + ], | ||
61 | + [ | ||
62 | + [ | ||
63 | + 'duration', | ||
64 | + 'billsec', | ||
65 | + ], | ||
66 | + 'integer', | ||
67 | + ], | ||
68 | + [ | ||
69 | + [ | ||
70 | + 'company', | ||
71 | + 'callerid', | ||
72 | + 'line', | ||
73 | + 'operator', | ||
74 | + 'status', | ||
75 | + 'queue', | ||
76 | + 'record', | ||
77 | + ], | ||
78 | + 'string', | ||
79 | + 'max' => 255, | ||
80 | + ], | ||
81 | + ]; | ||
82 | + } | ||
83 | + | ||
84 | + /** | ||
85 | + * @inheritdoc | ||
86 | + */ | ||
87 | + public function attributeLabels() | ||
88 | + { | ||
89 | + return [ | ||
90 | + 'id' => 'ID', | ||
91 | + 'company' => 'Company', | ||
92 | + 'calldate' => 'Calldate', | ||
93 | + 'callerid' => 'Callerid', | ||
94 | + 'line' => 'Line', | ||
95 | + 'operator' => 'Operator', | ||
96 | + 'status' => 'Status', | ||
97 | + 'queue' => 'Queue', | ||
98 | + 'duration' => 'Duration', | ||
99 | + 'billsec' => 'Billsec', | ||
100 | + 'record' => 'Record', | ||
101 | + ]; | ||
102 | + } | ||
103 | + } |
1 | +++ a/common/models/LoginForm.php | ||
1 | +<?php | ||
2 | +namespace common\models; | ||
3 | + | ||
4 | +use Yii; | ||
5 | +use yii\base\Model; | ||
6 | + | ||
7 | +/** | ||
8 | + * Login form | ||
9 | + */ | ||
10 | +class LoginForm extends Model | ||
11 | +{ | ||
12 | + public $username; | ||
13 | + public $password; | ||
14 | + public $rememberMe = true; | ||
15 | + | ||
16 | + private $_user; | ||
17 | + | ||
18 | + | ||
19 | + /** | ||
20 | + * {@inheritdoc} | ||
21 | + */ | ||
22 | + public function rules() | ||
23 | + { | ||
24 | + return [ | ||
25 | + // username and password are both required | ||
26 | + [['username', 'password'], 'required'], | ||
27 | + // rememberMe must be a boolean value | ||
28 | + ['rememberMe', 'boolean'], | ||
29 | + // password is validated by validatePassword() | ||
30 | + ['password', 'validatePassword'], | ||
31 | + ]; | ||
32 | + } | ||
33 | + | ||
34 | + /** | ||
35 | + * Validates the password. | ||
36 | + * This method serves as the inline validation for password. | ||
37 | + * | ||
38 | + * @param string $attribute the attribute currently being validated | ||
39 | + * @param array $params the additional name-value pairs given in the rule | ||
40 | + */ | ||
41 | + public function validatePassword($attribute, $params) | ||
42 | + { | ||
43 | + if (!$this->hasErrors()) { | ||
44 | + $user = $this->getUser(); | ||
45 | + if (!$user || !$user->validatePassword($this->password)) { | ||
46 | + $this->addError($attribute, 'Incorrect username or password.'); | ||
47 | + } | ||
48 | + } | ||
49 | + } | ||
50 | + | ||
51 | + /** | ||
52 | + * Logs in a user using the provided username and password. | ||
53 | + * | ||
54 | + * @return bool whether the user is logged in successfully | ||
55 | + */ | ||
56 | + public function login() | ||
57 | + { | ||
58 | + if ($this->validate()) { | ||
59 | + return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0); | ||
60 | + } | ||
61 | + | ||
62 | + return false; | ||
63 | + } | ||
64 | + | ||
65 | + /** | ||
66 | + * Finds user by [[username]] | ||
67 | + * | ||
68 | + * @return User|null | ||
69 | + */ | ||
70 | + protected function getUser() | ||
71 | + { | ||
72 | + if ($this->_user === null) { | ||
73 | + $this->_user = User::findByUsername($this->username); | ||
74 | + } | ||
75 | + | ||
76 | + return $this->_user; | ||
77 | + } | ||
78 | +} |
1 | +++ a/common/models/User.php | ||
1 | +<?php | ||
2 | +namespace common\models; | ||
3 | + | ||
4 | +use Yii; | ||
5 | +use yii\base\NotSupportedException; | ||
6 | +use yii\behaviors\TimestampBehavior; | ||
7 | +use yii\db\ActiveRecord; | ||
8 | +use yii\web\IdentityInterface; | ||
9 | + | ||
10 | +/** | ||
11 | + * User model | ||
12 | + * | ||
13 | + * @property integer $id | ||
14 | + * @property string $username | ||
15 | + * @property string $password_hash | ||
16 | + * @property string $password_reset_token | ||
17 | + * @property string $email | ||
18 | + * @property string $auth_key | ||
19 | + * @property integer $status | ||
20 | + * @property integer $created_at | ||
21 | + * @property integer $updated_at | ||
22 | + * @property string $password write-only password | ||
23 | + */ | ||
24 | +class User extends ActiveRecord implements IdentityInterface | ||
25 | +{ | ||
26 | + const STATUS_DELETED = 0; | ||
27 | + const STATUS_ACTIVE = 10; | ||
28 | + | ||
29 | + | ||
30 | + /** | ||
31 | + * {@inheritdoc} | ||
32 | + */ | ||
33 | + public static function tableName() | ||
34 | + { | ||
35 | + return '{{%user}}'; | ||
36 | + } | ||
37 | + | ||
38 | + /** | ||
39 | + * {@inheritdoc} | ||
40 | + */ | ||
41 | + public function behaviors() | ||
42 | + { | ||
43 | + return [ | ||
44 | + TimestampBehavior::className(), | ||
45 | + ]; | ||
46 | + } | ||
47 | + | ||
48 | + /** | ||
49 | + * {@inheritdoc} | ||
50 | + */ | ||
51 | + public function rules() | ||
52 | + { | ||
53 | + return [ | ||
54 | + ['status', 'default', 'value' => self::STATUS_ACTIVE], | ||
55 | + ['status', 'in', 'range' => [self::STATUS_ACTIVE, self::STATUS_DELETED]], | ||
56 | + ]; | ||
57 | + } | ||
58 | + | ||
59 | + /** | ||
60 | + * {@inheritdoc} | ||
61 | + */ | ||
62 | + public static function findIdentity($id) | ||
63 | + { | ||
64 | + return static::findOne(['id' => $id, 'status' => self::STATUS_ACTIVE]); | ||
65 | + } | ||
66 | + | ||
67 | + /** | ||
68 | + * {@inheritdoc} | ||
69 | + */ | ||
70 | + public static function findIdentityByAccessToken($token, $type = null) | ||
71 | + { | ||
72 | + throw new NotSupportedException('"findIdentityByAccessToken" is not implemented.'); | ||
73 | + } | ||
74 | + | ||
75 | + /** | ||
76 | + * Finds user by username | ||
77 | + * | ||
78 | + * @param string $username | ||
79 | + * @return static|null | ||
80 | + */ | ||
81 | + public static function findByUsername($username) | ||
82 | + { | ||
83 | + return static::findOne(['username' => $username, 'status' => self::STATUS_ACTIVE]); | ||
84 | + } | ||
85 | + | ||
86 | + /** | ||
87 | + * Finds user by password reset token | ||
88 | + * | ||
89 | + * @param string $token password reset token | ||
90 | + * @return static|null | ||
91 | + */ | ||
92 | + public static function findByPasswordResetToken($token) | ||
93 | + { | ||
94 | + if (!static::isPasswordResetTokenValid($token)) { | ||
95 | + return null; | ||
96 | + } | ||
97 | + | ||
98 | + return static::findOne([ | ||
99 | + 'password_reset_token' => $token, | ||
100 | + 'status' => self::STATUS_ACTIVE, | ||
101 | + ]); | ||
102 | + } | ||
103 | + | ||
104 | + /** | ||
105 | + * Finds out if password reset token is valid | ||
106 | + * | ||
107 | + * @param string $token password reset token | ||
108 | + * @return bool | ||
109 | + */ | ||
110 | + public static function isPasswordResetTokenValid($token) | ||
111 | + { | ||
112 | + if (empty($token)) { | ||
113 | + return false; | ||
114 | + } | ||
115 | + | ||
116 | + $timestamp = (int) substr($token, strrpos($token, '_') + 1); | ||
117 | + $expire = Yii::$app->params['user.passwordResetTokenExpire']; | ||
118 | + return $timestamp + $expire >= time(); | ||
119 | + } | ||
120 | + | ||
121 | + /** | ||
122 | + * {@inheritdoc} | ||
123 | + */ | ||
124 | + public function getId() | ||
125 | + { | ||
126 | + return $this->getPrimaryKey(); | ||
127 | + } | ||
128 | + | ||
129 | + /** | ||
130 | + * {@inheritdoc} | ||
131 | + */ | ||
132 | + public function getAuthKey() | ||
133 | + { | ||
134 | + return $this->auth_key; | ||
135 | + } | ||
136 | + | ||
137 | + /** | ||
138 | + * {@inheritdoc} | ||
139 | + */ | ||
140 | + public function validateAuthKey($authKey) | ||
141 | + { | ||
142 | + return $this->getAuthKey() === $authKey; | ||
143 | + } | ||
144 | + | ||
145 | + /** | ||
146 | + * Validates password | ||
147 | + * | ||
148 | + * @param string $password password to validate | ||
149 | + * @return bool if password provided is valid for current user | ||
150 | + */ | ||
151 | + public function validatePassword($password) | ||
152 | + { | ||
153 | + return Yii::$app->security->validatePassword($password, $this->password_hash); | ||
154 | + } | ||
155 | + | ||
156 | + /** | ||
157 | + * Generates password hash from password and sets it to the model | ||
158 | + * | ||
159 | + * @param string $password | ||
160 | + */ | ||
161 | + public function setPassword($password) | ||
162 | + { | ||
163 | + $this->password_hash = Yii::$app->security->generatePasswordHash($password); | ||
164 | + } | ||
165 | + | ||
166 | + /** | ||
167 | + * Generates "remember me" authentication key | ||
168 | + */ | ||
169 | + public function generateAuthKey() | ||
170 | + { | ||
171 | + $this->auth_key = Yii::$app->security->generateRandomString(); | ||
172 | + } | ||
173 | + | ||
174 | + /** | ||
175 | + * Generates new password reset token | ||
176 | + */ | ||
177 | + public function generatePasswordResetToken() | ||
178 | + { | ||
179 | + $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time(); | ||
180 | + } | ||
181 | + | ||
182 | + /** | ||
183 | + * Removes password reset token | ||
184 | + */ | ||
185 | + public function removePasswordResetToken() | ||
186 | + { | ||
187 | + $this->password_reset_token = null; | ||
188 | + } | ||
189 | +} |
1 | +++ a/common/tests/_bootstrap.php | ||
1 | +<?php | ||
2 | +defined('YII_DEBUG') or define('YII_DEBUG', true); | ||
3 | +defined('YII_ENV') or define('YII_ENV', 'test'); | ||
4 | +defined('YII_APP_BASE_PATH') or define('YII_APP_BASE_PATH', __DIR__.'/../../'); | ||
5 | + | ||
6 | +require_once __DIR__ . '/../../vendor/autoload.php'; | ||
7 | +require_once __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php'; | ||
8 | +require __DIR__ . '/../config/bootstrap.php'; | ||
9 | + |
1 | +++ a/common/tests/_data/user.php | ||
1 | +<?php | ||
2 | + | ||
3 | +return [ | ||
4 | + [ | ||
5 | + 'username' => 'bayer.hudson', | ||
6 | + 'auth_key' => 'HP187Mvq7Mmm3CTU80dLkGmni_FUH_lR', | ||
7 | + //password_0 | ||
8 | + 'password_hash' => '$2y$13$EjaPFBnZOQsHdGuHI.xvhuDp1fHpo8hKRSk6yshqa9c5EG8s3C3lO', | ||
9 | + 'password_reset_token' => 'ExzkCOaYc1L8IOBs4wdTGGbgNiG3Wz1I_1402312317', | ||
10 | + 'created_at' => '1402312317', | ||
11 | + 'updated_at' => '1402312317', | ||
12 | + 'email' => 'nicole.paucek@schultz.info', | ||
13 | + ], | ||
14 | +]; |
1 | +++ a/common/tests/_support/UnitTester.php | ||
1 | +<?php | ||
2 | +namespace common\tests; | ||
3 | + | ||
4 | +/** | ||
5 | + * Inherited Methods | ||
6 | + * @method void wantToTest($text) | ||
7 | + * @method void wantTo($text) | ||
8 | + * @method void execute($callable) | ||
9 | + * @method void expectTo($prediction) | ||
10 | + * @method void expect($prediction) | ||
11 | + * @method void amGoingTo($argumentation) | ||
12 | + * @method void am($role) | ||
13 | + * @method void lookForwardTo($achieveValue) | ||
14 | + * @method void comment($description) | ||
15 | + * @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL) | ||
16 | + * | ||
17 | + * @SuppressWarnings(PHPMD) | ||
18 | + */ | ||
19 | +class UnitTester extends \Codeception\Actor | ||
20 | +{ | ||
21 | + use _generated\UnitTesterActions; | ||
22 | + /** | ||
23 | + * Define custom actions here | ||
24 | + */ | ||
25 | +} |
1 | +++ a/common/tests/unit/models/LoginFormTest.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace common\tests\unit\models; | ||
4 | + | ||
5 | +use Yii; | ||
6 | +use common\models\LoginForm; | ||
7 | +use common\fixtures\UserFixture; | ||
8 | + | ||
9 | +/** | ||
10 | + * Login form test | ||
11 | + */ | ||
12 | +class LoginFormTest extends \Codeception\Test\Unit | ||
13 | +{ | ||
14 | + /** | ||
15 | + * @var \common\tests\UnitTester | ||
16 | + */ | ||
17 | + protected $tester; | ||
18 | + | ||
19 | + | ||
20 | + /** | ||
21 | + * @return array | ||
22 | + */ | ||
23 | + public function _fixtures() | ||
24 | + { | ||
25 | + return [ | ||
26 | + 'user' => [ | ||
27 | + 'class' => UserFixture::className(), | ||
28 | + 'dataFile' => codecept_data_dir() . 'user.php' | ||
29 | + ] | ||
30 | + ]; | ||
31 | + } | ||
32 | + | ||
33 | + public function testLoginNoUser() | ||
34 | + { | ||
35 | + $model = new LoginForm([ | ||
36 | + 'username' => 'not_existing_username', | ||
37 | + 'password' => 'not_existing_password', | ||
38 | + ]); | ||
39 | + | ||
40 | + expect('model should not login user', $model->login())->false(); | ||
41 | + expect('user should not be logged in', Yii::$app->user->isGuest)->true(); | ||
42 | + } | ||
43 | + | ||
44 | + public function testLoginWrongPassword() | ||
45 | + { | ||
46 | + $model = new LoginForm([ | ||
47 | + 'username' => 'bayer.hudson', | ||
48 | + 'password' => 'wrong_password', | ||
49 | + ]); | ||
50 | + | ||
51 | + expect('model should not login user', $model->login())->false(); | ||
52 | + expect('error message should be set', $model->errors)->hasKey('password'); | ||
53 | + expect('user should not be logged in', Yii::$app->user->isGuest)->true(); | ||
54 | + } | ||
55 | + | ||
56 | + public function testLoginCorrect() | ||
57 | + { | ||
58 | + $model = new LoginForm([ | ||
59 | + 'username' => 'bayer.hudson', | ||
60 | + 'password' => 'password_0', | ||
61 | + ]); | ||
62 | + | ||
63 | + expect('model should login user', $model->login())->true(); | ||
64 | + expect('error message should not be set', $model->errors)->hasntKey('password'); | ||
65 | + expect('user should be logged in', Yii::$app->user->isGuest)->false(); | ||
66 | + } | ||
67 | +} |
1 | +++ a/common/widgets/Alert.php | ||
1 | +<?php | ||
2 | +namespace common\widgets; | ||
3 | + | ||
4 | +use Yii; | ||
5 | + | ||
6 | +/** | ||
7 | + * Alert widget renders a message from session flash. All flash messages are displayed | ||
8 | + * in the sequence they were assigned using setFlash. You can set message as following: | ||
9 | + * | ||
10 | + * ```php | ||
11 | + * Yii::$app->session->setFlash('error', 'This is the message'); | ||
12 | + * Yii::$app->session->setFlash('success', 'This is the message'); | ||
13 | + * Yii::$app->session->setFlash('info', 'This is the message'); | ||
14 | + * ``` | ||
15 | + * | ||
16 | + * Multiple messages could be set as follows: | ||
17 | + * | ||
18 | + * ```php | ||
19 | + * Yii::$app->session->setFlash('error', ['Error 1', 'Error 2']); | ||
20 | + * ``` | ||
21 | + * | ||
22 | + * @author Kartik Visweswaran <kartikv2@gmail.com> | ||
23 | + * @author Alexander Makarov <sam@rmcreative.ru> | ||
24 | + */ | ||
25 | +class Alert extends \yii\bootstrap\Widget | ||
26 | +{ | ||
27 | + /** | ||
28 | + * @var array the alert types configuration for the flash messages. | ||
29 | + * This array is setup as $key => $value, where: | ||
30 | + * - key: the name of the session flash variable | ||
31 | + * - value: the bootstrap alert type (i.e. danger, success, info, warning) | ||
32 | + */ | ||
33 | + public $alertTypes = [ | ||
34 | + 'error' => 'alert-danger', | ||
35 | + 'danger' => 'alert-danger', | ||
36 | + 'success' => 'alert-success', | ||
37 | + 'info' => 'alert-info', | ||
38 | + 'warning' => 'alert-warning' | ||
39 | + ]; | ||
40 | + /** | ||
41 | + * @var array the options for rendering the close button tag. | ||
42 | + * Array will be passed to [[\yii\bootstrap\Alert::closeButton]]. | ||
43 | + */ | ||
44 | + public $closeButton = []; | ||
45 | + | ||
46 | + | ||
47 | + /** | ||
48 | + * {@inheritdoc} | ||
49 | + */ | ||
50 | + public function run() | ||
51 | + { | ||
52 | + $session = Yii::$app->session; | ||
53 | + $flashes = $session->getAllFlashes(); | ||
54 | + $appendClass = isset($this->options['class']) ? ' ' . $this->options['class'] : ''; | ||
55 | + | ||
56 | + foreach ($flashes as $type => $flash) { | ||
57 | + if (!isset($this->alertTypes[$type])) { | ||
58 | + continue; | ||
59 | + } | ||
60 | + | ||
61 | + foreach ((array) $flash as $i => $message) { | ||
62 | + echo \yii\bootstrap\Alert::widget([ | ||
63 | + 'body' => $message, | ||
64 | + 'closeButton' => $this->closeButton, | ||
65 | + 'options' => array_merge($this->options, [ | ||
66 | + 'id' => $this->getId() . '-' . $type . '-' . $i, | ||
67 | + 'class' => $this->alertTypes[$type] . $appendClass, | ||
68 | + ]), | ||
69 | + ]); | ||
70 | + } | ||
71 | + | ||
72 | + $session->removeFlash($type); | ||
73 | + } | ||
74 | + } | ||
75 | +} |
1 | +++ a/composer.json | ||
1 | +{ | ||
2 | + "name": "yiisoft/yii2-app-advanced", | ||
3 | + "description": "Yii 2 Advanced Project Template", | ||
4 | + "keywords": ["yii2", "framework", "advanced", "project template"], | ||
5 | + "homepage": "http://www.yiiframework.com/", | ||
6 | + "type": "project", | ||
7 | + "license": "BSD-3-Clause", | ||
8 | + "support": { | ||
9 | + "issues": "https://github.com/yiisoft/yii2/issues?state=open", | ||
10 | + "forum": "http://www.yiiframework.com/forum/", | ||
11 | + "wiki": "http://www.yiiframework.com/wiki/", | ||
12 | + "irc": "irc://irc.freenode.net/yii", | ||
13 | + "source": "https://github.com/yiisoft/yii2" | ||
14 | + }, | ||
15 | + "minimum-stability": "stable", | ||
16 | + "require": { | ||
17 | + "php": ">=5.4.0", | ||
18 | + "yiisoft/yii2": "~2.0.6", | ||
19 | + "yiisoft/yii2-bootstrap": "~2.0.0", | ||
20 | + "yiisoft/yii2-swiftmailer": "~2.0.0 || ~2.1.0" | ||
21 | + }, | ||
22 | + "require-dev": { | ||
23 | + "yiisoft/yii2-debug": "~2.0.0", | ||
24 | + "yiisoft/yii2-gii": "~2.0.0", | ||
25 | + "yiisoft/yii2-faker": "~2.0.0", | ||
26 | + "codeception/base": "^2.2.3", | ||
27 | + "codeception/verify": "~0.3.1" | ||
28 | + }, | ||
29 | + "config": { | ||
30 | + "process-timeout": 1800, | ||
31 | + "fxp-asset": { | ||
32 | + "enabled": false | ||
33 | + } | ||
34 | + }, | ||
35 | + "repositories": [ | ||
36 | + { | ||
37 | + "type": "composer", | ||
38 | + "url": "https://asset-packagist.org" | ||
39 | + } | ||
40 | + ] | ||
41 | +} |
1 | +++ a/composer.lock | ||
1 | +{ | ||
2 | + "_readme": [ | ||
3 | + "This file locks the dependencies of your project to a known state", | ||
4 | + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", | ||
5 | + "This file is @generated automatically" | ||
6 | + ], | ||
7 | + "content-hash": "630d5f1d19e73b0163f900453171fba5", | ||
8 | + "packages": [ | ||
9 | + { | ||
10 | + "name": "bower-asset/bootstrap", | ||
11 | + "version": "v3.3.7", | ||
12 | + "source": { | ||
13 | + "type": "git", | ||
14 | + "url": "https://github.com/twbs/bootstrap.git", | ||
15 | + "reference": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" | ||
16 | + }, | ||
17 | + "dist": { | ||
18 | + "type": "zip", | ||
19 | + "url": "https://api.github.com/repos/twbs/bootstrap/zipball/0b9c4a4007c44201dce9a6cc1a38407005c26c86", | ||
20 | + "reference": "0b9c4a4007c44201dce9a6cc1a38407005c26c86", | ||
21 | + "shasum": null | ||
22 | + }, | ||
23 | + "require": { | ||
24 | + "bower-asset/jquery": ">=1.9.1,<4.0" | ||
25 | + }, | ||
26 | + "type": "bower-asset", | ||
27 | + "license": [ | ||
28 | + "MIT" | ||
29 | + ] | ||
30 | + }, | ||
31 | + { | ||
32 | + "name": "bower-asset/inputmask", | ||
33 | + "version": "3.3.11", | ||
34 | + "source": { | ||
35 | + "type": "git", | ||
36 | + "url": "https://github.com/RobinHerbots/Inputmask.git", | ||
37 | + "reference": "5e670ad62f50c738388d4dcec78d2888505ad77b" | ||
38 | + }, | ||
39 | + "dist": { | ||
40 | + "type": "zip", | ||
41 | + "url": "https://api.github.com/repos/RobinHerbots/Inputmask/zipball/5e670ad62f50c738388d4dcec78d2888505ad77b", | ||
42 | + "reference": "5e670ad62f50c738388d4dcec78d2888505ad77b", | ||
43 | + "shasum": null | ||
44 | + }, | ||
45 | + "require": { | ||
46 | + "bower-asset/jquery": ">=1.7" | ||
47 | + }, | ||
48 | + "type": "bower-asset", | ||
49 | + "license": [ | ||
50 | + "http://opensource.org/licenses/mit-license.php" | ||
51 | + ] | ||
52 | + }, | ||
53 | + { | ||
54 | + "name": "bower-asset/jquery", | ||
55 | + "version": "3.2.1", | ||
56 | + "source": { | ||
57 | + "type": "git", | ||
58 | + "url": "https://github.com/jquery/jquery-dist.git", | ||
59 | + "reference": "77d2a51d0520d2ee44173afdf4e40a9201f5964e" | ||
60 | + }, | ||
61 | + "dist": { | ||
62 | + "type": "zip", | ||
63 | + "url": "https://api.github.com/repos/jquery/jquery-dist/zipball/77d2a51d0520d2ee44173afdf4e40a9201f5964e", | ||
64 | + "reference": "77d2a51d0520d2ee44173afdf4e40a9201f5964e", | ||
65 | + "shasum": null | ||
66 | + }, | ||
67 | + "type": "bower-asset", | ||
68 | + "license": [ | ||
69 | + "MIT" | ||
70 | + ] | ||
71 | + }, | ||
72 | + { | ||
73 | + "name": "bower-asset/punycode", | ||
74 | + "version": "v1.3.2", | ||
75 | + "source": { | ||
76 | + "type": "git", | ||
77 | + "url": "https://github.com/bestiejs/punycode.js.git", | ||
78 | + "reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3" | ||
79 | + }, | ||
80 | + "dist": { | ||
81 | + "type": "zip", | ||
82 | + "url": "https://api.github.com/repos/bestiejs/punycode.js/zipball/38c8d3131a82567bfef18da09f7f4db68c84f8a3", | ||
83 | + "reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3", | ||
84 | + "shasum": null | ||
85 | + }, | ||
86 | + "type": "bower-asset" | ||
87 | + }, | ||
88 | + { | ||
89 | + "name": "bower-asset/yii2-pjax", | ||
90 | + "version": "2.0.7.1", | ||
91 | + "source": { | ||
92 | + "type": "git", | ||
93 | + "url": "git@github.com:yiisoft/jquery-pjax.git", | ||
94 | + "reference": "aef7b953107264f00234902a3880eb50dafc48be" | ||
95 | + }, | ||
96 | + "dist": { | ||
97 | + "type": "zip", | ||
98 | + "url": "https://api.github.com/repos/yiisoft/jquery-pjax/zipball/aef7b953107264f00234902a3880eb50dafc48be", | ||
99 | + "reference": "aef7b953107264f00234902a3880eb50dafc48be", | ||
100 | + "shasum": null | ||
101 | + }, | ||
102 | + "require": { | ||
103 | + "bower-asset/jquery": ">=1.8" | ||
104 | + }, | ||
105 | + "type": "bower-asset", | ||
106 | + "license": [ | ||
107 | + "MIT" | ||
108 | + ] | ||
109 | + }, | ||
110 | + { | ||
111 | + "name": "cebe/markdown", | ||
112 | + "version": "1.1.2", | ||
113 | + "source": { | ||
114 | + "type": "git", | ||
115 | + "url": "https://github.com/cebe/markdown.git", | ||
116 | + "reference": "25b28bae8a6f185b5030673af77b32e1163d5c6e" | ||
117 | + }, | ||
118 | + "dist": { | ||
119 | + "type": "zip", | ||
120 | + "url": "https://api.github.com/repos/cebe/markdown/zipball/25b28bae8a6f185b5030673af77b32e1163d5c6e", | ||
121 | + "reference": "25b28bae8a6f185b5030673af77b32e1163d5c6e", | ||
122 | + "shasum": "" | ||
123 | + }, | ||
124 | + "require": { | ||
125 | + "lib-pcre": "*", | ||
126 | + "php": ">=5.4.0" | ||
127 | + }, | ||
128 | + "require-dev": { | ||
129 | + "cebe/indent": "*", | ||
130 | + "facebook/xhprof": "*@dev", | ||
131 | + "phpunit/phpunit": "4.1.*" | ||
132 | + }, | ||
133 | + "bin": [ | ||
134 | + "bin/markdown" | ||
135 | + ], | ||
136 | + "type": "library", | ||
137 | + "extra": { | ||
138 | + "branch-alias": { | ||
139 | + "dev-master": "1.1.x-dev" | ||
140 | + } | ||
141 | + }, | ||
142 | + "autoload": { | ||
143 | + "psr-4": { | ||
144 | + "cebe\\markdown\\": "" | ||
145 | + } | ||
146 | + }, | ||
147 | + "notification-url": "https://packagist.org/downloads/", | ||
148 | + "license": [ | ||
149 | + "MIT" | ||
150 | + ], | ||
151 | + "authors": [ | ||
152 | + { | ||
153 | + "name": "Carsten Brandt", | ||
154 | + "email": "mail@cebe.cc", | ||
155 | + "homepage": "http://cebe.cc/", | ||
156 | + "role": "Creator" | ||
157 | + } | ||
158 | + ], | ||
159 | + "description": "A super fast, highly extensible markdown parser for PHP", | ||
160 | + "homepage": "https://github.com/cebe/markdown#readme", | ||
161 | + "keywords": [ | ||
162 | + "extensible", | ||
163 | + "fast", | ||
164 | + "gfm", | ||
165 | + "markdown", | ||
166 | + "markdown-extra" | ||
167 | + ], | ||
168 | + "time": "2017-07-16T21:13:23+00:00" | ||
169 | + }, | ||
170 | + { | ||
171 | + "name": "doctrine/lexer", | ||
172 | + "version": "v1.0.1", | ||
173 | + "source": { | ||
174 | + "type": "git", | ||
175 | + "url": "https://github.com/doctrine/lexer.git", | ||
176 | + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" | ||
177 | + }, | ||
178 | + "dist": { | ||
179 | + "type": "zip", | ||
180 | + "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", | ||
181 | + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", | ||
182 | + "shasum": "" | ||
183 | + }, | ||
184 | + "require": { | ||
185 | + "php": ">=5.3.2" | ||
186 | + }, | ||
187 | + "type": "library", | ||
188 | + "extra": { | ||
189 | + "branch-alias": { | ||
190 | + "dev-master": "1.0.x-dev" | ||
191 | + } | ||
192 | + }, | ||
193 | + "autoload": { | ||
194 | + "psr-0": { | ||
195 | + "Doctrine\\Common\\Lexer\\": "lib/" | ||
196 | + } | ||
197 | + }, | ||
198 | + "notification-url": "https://packagist.org/downloads/", | ||
199 | + "license": [ | ||
200 | + "MIT" | ||
201 | + ], | ||
202 | + "authors": [ | ||
203 | + { | ||
204 | + "name": "Roman Borschel", | ||
205 | + "email": "roman@code-factory.org" | ||
206 | + }, | ||
207 | + { | ||
208 | + "name": "Guilherme Blanco", | ||
209 | + "email": "guilhermeblanco@gmail.com" | ||
210 | + }, | ||
211 | + { | ||
212 | + "name": "Johannes Schmitt", | ||
213 | + "email": "schmittjoh@gmail.com" | ||
214 | + } | ||
215 | + ], | ||
216 | + "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", | ||
217 | + "homepage": "http://www.doctrine-project.org", | ||
218 | + "keywords": [ | ||
219 | + "lexer", | ||
220 | + "parser" | ||
221 | + ], | ||
222 | + "time": "2014-09-09T13:34:57+00:00" | ||
223 | + }, | ||
224 | + { | ||
225 | + "name": "egulias/email-validator", | ||
226 | + "version": "2.1.3", | ||
227 | + "source": { | ||
228 | + "type": "git", | ||
229 | + "url": "https://github.com/egulias/EmailValidator.git", | ||
230 | + "reference": "1bec00a10039b823cc94eef4eddd47dcd3b2ca04" | ||
231 | + }, | ||
232 | + "dist": { | ||
233 | + "type": "zip", | ||
234 | + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/1bec00a10039b823cc94eef4eddd47dcd3b2ca04", | ||
235 | + "reference": "1bec00a10039b823cc94eef4eddd47dcd3b2ca04", | ||
236 | + "shasum": "" | ||
237 | + }, | ||
238 | + "require": { | ||
239 | + "doctrine/lexer": "^1.0.1", | ||
240 | + "php": ">= 5.5" | ||
241 | + }, | ||
242 | + "require-dev": { | ||
243 | + "dominicsayers/isemail": "dev-master", | ||
244 | + "phpunit/phpunit": "^4.8.35", | ||
245 | + "satooshi/php-coveralls": "^1.0.1" | ||
246 | + }, | ||
247 | + "suggest": { | ||
248 | + "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" | ||
249 | + }, | ||
250 | + "type": "library", | ||
251 | + "extra": { | ||
252 | + "branch-alias": { | ||
253 | + "dev-master": "2.0.x-dev" | ||
254 | + } | ||
255 | + }, | ||
256 | + "autoload": { | ||
257 | + "psr-4": { | ||
258 | + "Egulias\\EmailValidator\\": "EmailValidator" | ||
259 | + } | ||
260 | + }, | ||
261 | + "notification-url": "https://packagist.org/downloads/", | ||
262 | + "license": [ | ||
263 | + "MIT" | ||
264 | + ], | ||
265 | + "authors": [ | ||
266 | + { | ||
267 | + "name": "Eduardo Gulias Davis" | ||
268 | + } | ||
269 | + ], | ||
270 | + "description": "A library for validating emails against several RFCs", | ||
271 | + "homepage": "https://github.com/egulias/EmailValidator", | ||
272 | + "keywords": [ | ||
273 | + "email", | ||
274 | + "emailvalidation", | ||
275 | + "emailvalidator", | ||
276 | + "validation", | ||
277 | + "validator" | ||
278 | + ], | ||
279 | + "time": "2017-11-15T23:40:40+00:00" | ||
280 | + }, | ||
281 | + { | ||
282 | + "name": "ezyang/htmlpurifier", | ||
283 | + "version": "v4.9.3", | ||
284 | + "source": { | ||
285 | + "type": "git", | ||
286 | + "url": "https://github.com/ezyang/htmlpurifier.git", | ||
287 | + "reference": "95e1bae3182efc0f3422896a3236e991049dac69" | ||
288 | + }, | ||
289 | + "dist": { | ||
290 | + "type": "zip", | ||
291 | + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/95e1bae3182efc0f3422896a3236e991049dac69", | ||
292 | + "reference": "95e1bae3182efc0f3422896a3236e991049dac69", | ||
293 | + "shasum": "" | ||
294 | + }, | ||
295 | + "require": { | ||
296 | + "php": ">=5.2" | ||
297 | + }, | ||
298 | + "require-dev": { | ||
299 | + "simpletest/simpletest": "^1.1" | ||
300 | + }, | ||
301 | + "type": "library", | ||
302 | + "autoload": { | ||
303 | + "psr-0": { | ||
304 | + "HTMLPurifier": "library/" | ||
305 | + }, | ||
306 | + "files": [ | ||
307 | + "library/HTMLPurifier.composer.php" | ||
308 | + ] | ||
309 | + }, | ||
310 | + "notification-url": "https://packagist.org/downloads/", | ||
311 | + "license": [ | ||
312 | + "LGPL" | ||
313 | + ], | ||
314 | + "authors": [ | ||
315 | + { | ||
316 | + "name": "Edward Z. Yang", | ||
317 | + "email": "admin@htmlpurifier.org", | ||
318 | + "homepage": "http://ezyang.com" | ||
319 | + } | ||
320 | + ], | ||
321 | + "description": "Standards compliant HTML filter written in PHP", | ||
322 | + "homepage": "http://htmlpurifier.org/", | ||
323 | + "keywords": [ | ||
324 | + "html" | ||
325 | + ], | ||
326 | + "time": "2017-06-03T02:28:16+00:00" | ||
327 | + }, | ||
328 | + { | ||
329 | + "name": "swiftmailer/swiftmailer", | ||
330 | + "version": "v6.0.2", | ||
331 | + "source": { | ||
332 | + "type": "git", | ||
333 | + "url": "https://github.com/swiftmailer/swiftmailer.git", | ||
334 | + "reference": "412333372fb6c8ffb65496a2bbd7321af75733fc" | ||
335 | + }, | ||
336 | + "dist": { | ||
337 | + "type": "zip", | ||
338 | + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/412333372fb6c8ffb65496a2bbd7321af75733fc", | ||
339 | + "reference": "412333372fb6c8ffb65496a2bbd7321af75733fc", | ||
340 | + "shasum": "" | ||
341 | + }, | ||
342 | + "require": { | ||
343 | + "egulias/email-validator": "~2.0", | ||
344 | + "php": ">=7.0.0" | ||
345 | + }, | ||
346 | + "require-dev": { | ||
347 | + "mockery/mockery": "~0.9.1", | ||
348 | + "symfony/phpunit-bridge": "~3.3@dev" | ||
349 | + }, | ||
350 | + "type": "library", | ||
351 | + "extra": { | ||
352 | + "branch-alias": { | ||
353 | + "dev-master": "6.0-dev" | ||
354 | + } | ||
355 | + }, | ||
356 | + "autoload": { | ||
357 | + "files": [ | ||
358 | + "lib/swift_required.php" | ||
359 | + ] | ||
360 | + }, | ||
361 | + "notification-url": "https://packagist.org/downloads/", | ||
362 | + "license": [ | ||
363 | + "MIT" | ||
364 | + ], | ||
365 | + "authors": [ | ||
366 | + { | ||
367 | + "name": "Chris Corbyn" | ||
368 | + }, | ||
369 | + { | ||
370 | + "name": "Fabien Potencier", | ||
371 | + "email": "fabien@symfony.com" | ||
372 | + } | ||
373 | + ], | ||
374 | + "description": "Swiftmailer, free feature-rich PHP mailer", | ||
375 | + "homepage": "http://swiftmailer.symfony.com", | ||
376 | + "keywords": [ | ||
377 | + "email", | ||
378 | + "mail", | ||
379 | + "mailer" | ||
380 | + ], | ||
381 | + "time": "2017-09-30T22:39:41+00:00" | ||
382 | + }, | ||
383 | + { | ||
384 | + "name": "yiisoft/yii2", | ||
385 | + "version": "2.0.14", | ||
386 | + "source": { | ||
387 | + "type": "git", | ||
388 | + "url": "https://github.com/yiisoft/yii2-framework.git", | ||
389 | + "reference": "1c9cf916b1394681c7d043e79e1522c33e5bc6c1" | ||
390 | + }, | ||
391 | + "dist": { | ||
392 | + "type": "zip", | ||
393 | + "url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/1c9cf916b1394681c7d043e79e1522c33e5bc6c1", | ||
394 | + "reference": "1c9cf916b1394681c7d043e79e1522c33e5bc6c1", | ||
395 | + "shasum": "" | ||
396 | + }, | ||
397 | + "require": { | ||
398 | + "bower-asset/inputmask": "~3.2.2 | ~3.3.5", | ||
399 | + "bower-asset/jquery": "3.2.*@stable | 3.1.*@stable | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable", | ||
400 | + "bower-asset/punycode": "1.3.*", | ||
401 | + "bower-asset/yii2-pjax": "~2.0.1", | ||
402 | + "cebe/markdown": "~1.0.0 | ~1.1.0", | ||
403 | + "ext-ctype": "*", | ||
404 | + "ext-mbstring": "*", | ||
405 | + "ezyang/htmlpurifier": "~4.6", | ||
406 | + "lib-pcre": "*", | ||
407 | + "php": ">=5.4.0", | ||
408 | + "yiisoft/yii2-composer": "~2.0.4" | ||
409 | + }, | ||
410 | + "bin": [ | ||
411 | + "yii" | ||
412 | + ], | ||
413 | + "type": "library", | ||
414 | + "extra": { | ||
415 | + "branch-alias": { | ||
416 | + "dev-master": "2.0.x-dev" | ||
417 | + } | ||
418 | + }, | ||
419 | + "autoload": { | ||
420 | + "psr-4": { | ||
421 | + "yii\\": "" | ||
422 | + } | ||
423 | + }, | ||
424 | + "notification-url": "https://packagist.org/downloads/", | ||
425 | + "license": [ | ||
426 | + "BSD-3-Clause" | ||
427 | + ], | ||
428 | + "authors": [ | ||
429 | + { | ||
430 | + "name": "Qiang Xue", | ||
431 | + "email": "qiang.xue@gmail.com", | ||
432 | + "homepage": "http://www.yiiframework.com/", | ||
433 | + "role": "Founder and project lead" | ||
434 | + }, | ||
435 | + { | ||
436 | + "name": "Alexander Makarov", | ||
437 | + "email": "sam@rmcreative.ru", | ||
438 | + "homepage": "http://rmcreative.ru/", | ||
439 | + "role": "Core framework development" | ||
440 | + }, | ||
441 | + { | ||
442 | + "name": "Maurizio Domba", | ||
443 | + "homepage": "http://mdomba.info/", | ||
444 | + "role": "Core framework development" | ||
445 | + }, | ||
446 | + { | ||
447 | + "name": "Carsten Brandt", | ||
448 | + "email": "mail@cebe.cc", | ||
449 | + "homepage": "http://cebe.cc/", | ||
450 | + "role": "Core framework development" | ||
451 | + }, | ||
452 | + { | ||
453 | + "name": "Timur Ruziev", | ||
454 | + "email": "resurtm@gmail.com", | ||
455 | + "homepage": "http://resurtm.com/", | ||
456 | + "role": "Core framework development" | ||
457 | + }, | ||
458 | + { | ||
459 | + "name": "Paul Klimov", | ||
460 | + "email": "klimov.paul@gmail.com", | ||
461 | + "role": "Core framework development" | ||
462 | + }, | ||
463 | + { | ||
464 | + "name": "Dmitry Naumenko", | ||
465 | + "email": "d.naumenko.a@gmail.com", | ||
466 | + "role": "Core framework development" | ||
467 | + }, | ||
468 | + { | ||
469 | + "name": "Boudewijn Vahrmeijer", | ||
470 | + "email": "info@dynasource.eu", | ||
471 | + "homepage": "http://dynasource.eu", | ||
472 | + "role": "Core framework development" | ||
473 | + } | ||
474 | + ], | ||
475 | + "description": "Yii PHP Framework Version 2", | ||
476 | + "homepage": "http://www.yiiframework.com/", | ||
477 | + "keywords": [ | ||
478 | + "framework", | ||
479 | + "yii2" | ||
480 | + ], | ||
481 | + "time": "2018-02-18T22:52:12+00:00" | ||
482 | + }, | ||
483 | + { | ||
484 | + "name": "yiisoft/yii2-bootstrap", | ||
485 | + "version": "2.0.8", | ||
486 | + "source": { | ||
487 | + "type": "git", | ||
488 | + "url": "https://github.com/yiisoft/yii2-bootstrap.git", | ||
489 | + "reference": "3f49c47924bb9fa5363c3fc7b073d954168cf438" | ||
490 | + }, | ||
491 | + "dist": { | ||
492 | + "type": "zip", | ||
493 | + "url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/3f49c47924bb9fa5363c3fc7b073d954168cf438", | ||
494 | + "reference": "3f49c47924bb9fa5363c3fc7b073d954168cf438", | ||
495 | + "shasum": "" | ||
496 | + }, | ||
497 | + "require": { | ||
498 | + "bower-asset/bootstrap": "3.3.* | 3.2.* | 3.1.*", | ||
499 | + "yiisoft/yii2": "~2.0.6" | ||
500 | + }, | ||
501 | + "type": "yii2-extension", | ||
502 | + "extra": { | ||
503 | + "branch-alias": { | ||
504 | + "dev-master": "2.0.x-dev" | ||
505 | + } | ||
506 | + }, | ||
507 | + "autoload": { | ||
508 | + "psr-4": { | ||
509 | + "yii\\bootstrap\\": "src" | ||
510 | + } | ||
511 | + }, | ||
512 | + "notification-url": "https://packagist.org/downloads/", | ||
513 | + "license": [ | ||
514 | + "BSD-3-Clause" | ||
515 | + ], | ||
516 | + "authors": [ | ||
517 | + { | ||
518 | + "name": "Paul Klimov", | ||
519 | + "email": "klimov.paul@gmail.com" | ||
520 | + }, | ||
521 | + { | ||
522 | + "name": "Alexander Makarov", | ||
523 | + "email": "sam@rmcreative.ru", | ||
524 | + "homepage": "http://rmcreative.ru/" | ||
525 | + }, | ||
526 | + { | ||
527 | + "name": "Antonio Ramirez", | ||
528 | + "email": "amigo.cobos@gmail.com" | ||
529 | + }, | ||
530 | + { | ||
531 | + "name": "Qiang Xue", | ||
532 | + "email": "qiang.xue@gmail.com", | ||
533 | + "homepage": "http://www.yiiframework.com/" | ||
534 | + } | ||
535 | + ], | ||
536 | + "description": "The Twitter Bootstrap extension for the Yii framework", | ||
537 | + "keywords": [ | ||
538 | + "bootstrap", | ||
539 | + "yii2" | ||
540 | + ], | ||
541 | + "time": "2018-02-16T10:41:52+00:00" | ||
542 | + }, | ||
543 | + { | ||
544 | + "name": "yiisoft/yii2-composer", | ||
545 | + "version": "2.0.5", | ||
546 | + "source": { | ||
547 | + "type": "git", | ||
548 | + "url": "https://github.com/yiisoft/yii2-composer.git", | ||
549 | + "reference": "3f4923c2bde6caf3f5b88cc22fdd5770f52f8df2" | ||
550 | + }, | ||
551 | + "dist": { | ||
552 | + "type": "zip", | ||
553 | + "url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/3f4923c2bde6caf3f5b88cc22fdd5770f52f8df2", | ||
554 | + "reference": "3f4923c2bde6caf3f5b88cc22fdd5770f52f8df2", | ||
555 | + "shasum": "" | ||
556 | + }, | ||
557 | + "require": { | ||
558 | + "composer-plugin-api": "^1.0" | ||
559 | + }, | ||
560 | + "require-dev": { | ||
561 | + "composer/composer": "^1.0" | ||
562 | + }, | ||
563 | + "type": "composer-plugin", | ||
564 | + "extra": { | ||
565 | + "class": "yii\\composer\\Plugin", | ||
566 | + "branch-alias": { | ||
567 | + "dev-master": "2.0.x-dev" | ||
568 | + } | ||
569 | + }, | ||
570 | + "autoload": { | ||
571 | + "psr-4": { | ||
572 | + "yii\\composer\\": "" | ||
573 | + } | ||
574 | + }, | ||
575 | + "notification-url": "https://packagist.org/downloads/", | ||
576 | + "license": [ | ||
577 | + "BSD-3-Clause" | ||
578 | + ], | ||
579 | + "authors": [ | ||
580 | + { | ||
581 | + "name": "Qiang Xue", | ||
582 | + "email": "qiang.xue@gmail.com" | ||
583 | + } | ||
584 | + ], | ||
585 | + "description": "The composer plugin for Yii extension installer", | ||
586 | + "keywords": [ | ||
587 | + "composer", | ||
588 | + "extension installer", | ||
589 | + "yii2" | ||
590 | + ], | ||
591 | + "time": "2016-12-20T13:26:02+00:00" | ||
592 | + }, | ||
593 | + { | ||
594 | + "name": "yiisoft/yii2-swiftmailer", | ||
595 | + "version": "2.1.0", | ||
596 | + "source": { | ||
597 | + "type": "git", | ||
598 | + "url": "https://github.com/yiisoft/yii2-swiftmailer.git", | ||
599 | + "reference": "563570c9aa19ca47c1b22e3032983229378e9274" | ||
600 | + }, | ||
601 | + "dist": { | ||
602 | + "type": "zip", | ||
603 | + "url": "https://api.github.com/repos/yiisoft/yii2-swiftmailer/zipball/563570c9aa19ca47c1b22e3032983229378e9274", | ||
604 | + "reference": "563570c9aa19ca47c1b22e3032983229378e9274", | ||
605 | + "shasum": "" | ||
606 | + }, | ||
607 | + "require": { | ||
608 | + "swiftmailer/swiftmailer": "~6.0", | ||
609 | + "yiisoft/yii2": "~2.0.4" | ||
610 | + }, | ||
611 | + "type": "yii2-extension", | ||
612 | + "extra": { | ||
613 | + "branch-alias": { | ||
614 | + "dev-master": "2.0.x-dev" | ||
615 | + } | ||
616 | + }, | ||
617 | + "autoload": { | ||
618 | + "psr-4": { | ||
619 | + "yii\\swiftmailer\\": "" | ||
620 | + } | ||
621 | + }, | ||
622 | + "notification-url": "https://packagist.org/downloads/", | ||
623 | + "license": [ | ||
624 | + "BSD-3-Clause" | ||
625 | + ], | ||
626 | + "authors": [ | ||
627 | + { | ||
628 | + "name": "Paul Klimov", | ||
629 | + "email": "klimov.paul@gmail.com" | ||
630 | + } | ||
631 | + ], | ||
632 | + "description": "The SwiftMailer integration for the Yii framework", | ||
633 | + "keywords": [ | ||
634 | + "email", | ||
635 | + "mail", | ||
636 | + "mailer", | ||
637 | + "swift", | ||
638 | + "swiftmailer", | ||
639 | + "yii2" | ||
640 | + ], | ||
641 | + "time": "2017-08-04T10:48:17+00:00" | ||
642 | + } | ||
643 | + ], | ||
644 | + "packages-dev": [ | ||
645 | + { | ||
646 | + "name": "behat/gherkin", | ||
647 | + "version": "v4.4.5", | ||
648 | + "source": { | ||
649 | + "type": "git", | ||
650 | + "url": "https://github.com/Behat/Gherkin.git", | ||
651 | + "reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74" | ||
652 | + }, | ||
653 | + "dist": { | ||
654 | + "type": "zip", | ||
655 | + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/5c14cff4f955b17d20d088dec1bde61c0539ec74", | ||
656 | + "reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74", | ||
657 | + "shasum": "" | ||
658 | + }, | ||
659 | + "require": { | ||
660 | + "php": ">=5.3.1" | ||
661 | + }, | ||
662 | + "require-dev": { | ||
663 | + "phpunit/phpunit": "~4.5|~5", | ||
664 | + "symfony/phpunit-bridge": "~2.7|~3", | ||
665 | + "symfony/yaml": "~2.3|~3" | ||
666 | + }, | ||
667 | + "suggest": { | ||
668 | + "symfony/yaml": "If you want to parse features, represented in YAML files" | ||
669 | + }, | ||
670 | + "type": "library", | ||
671 | + "extra": { | ||
672 | + "branch-alias": { | ||
673 | + "dev-master": "4.4-dev" | ||
674 | + } | ||
675 | + }, | ||
676 | + "autoload": { | ||
677 | + "psr-0": { | ||
678 | + "Behat\\Gherkin": "src/" | ||
679 | + } | ||
680 | + }, | ||
681 | + "notification-url": "https://packagist.org/downloads/", | ||
682 | + "license": [ | ||
683 | + "MIT" | ||
684 | + ], | ||
685 | + "authors": [ | ||
686 | + { | ||
687 | + "name": "Konstantin Kudryashov", | ||
688 | + "email": "ever.zet@gmail.com", | ||
689 | + "homepage": "http://everzet.com" | ||
690 | + } | ||
691 | + ], | ||
692 | + "description": "Gherkin DSL parser for PHP 5.3", | ||
693 | + "homepage": "http://behat.org/", | ||
694 | + "keywords": [ | ||
695 | + "BDD", | ||
696 | + "Behat", | ||
697 | + "Cucumber", | ||
698 | + "DSL", | ||
699 | + "gherkin", | ||
700 | + "parser" | ||
701 | + ], | ||
702 | + "time": "2016-10-30T11:50:56+00:00" | ||
703 | + }, | ||
704 | + { | ||
705 | + "name": "bower-asset/typeahead.js", | ||
706 | + "version": "v0.11.1", | ||
707 | + "source": { | ||
708 | + "type": "git", | ||
709 | + "url": "git@github.com:twitter/typeahead.js.git", | ||
710 | + "reference": "588440f66559714280628a4f9799f0c4eb880a4a" | ||
711 | + }, | ||
712 | + "dist": { | ||
713 | + "type": "zip", | ||
714 | + "url": "https://api.github.com/repos/twitter/typeahead.js/zipball/588440f66559714280628a4f9799f0c4eb880a4a", | ||
715 | + "reference": "588440f66559714280628a4f9799f0c4eb880a4a", | ||
716 | + "shasum": null | ||
717 | + }, | ||
718 | + "require": { | ||
719 | + "bower-asset/jquery": ">=1.7" | ||
720 | + }, | ||
721 | + "type": "bower-asset" | ||
722 | + }, | ||
723 | + { | ||
724 | + "name": "codeception/base", | ||
725 | + "version": "2.3.8", | ||
726 | + "source": { | ||
727 | + "type": "git", | ||
728 | + "url": "https://github.com/Codeception/base.git", | ||
729 | + "reference": "68419205ec25c8657f7a795e7310ab8993b4a1d6" | ||
730 | + }, | ||
731 | + "dist": { | ||
732 | + "type": "zip", | ||
733 | + "url": "https://api.github.com/repos/Codeception/base/zipball/68419205ec25c8657f7a795e7310ab8993b4a1d6", | ||
734 | + "reference": "68419205ec25c8657f7a795e7310ab8993b4a1d6", | ||
735 | + "shasum": "" | ||
736 | + }, | ||
737 | + "require": { | ||
738 | + "behat/gherkin": "~4.4.0", | ||
739 | + "codeception/stub": "^1.0", | ||
740 | + "ext-json": "*", | ||
741 | + "ext-mbstring": "*", | ||
742 | + "guzzlehttp/psr7": "~1.0", | ||
743 | + "php": ">=5.4.0 <8.0", | ||
744 | + "phpunit/php-code-coverage": ">=2.2.4 <6.0", | ||
745 | + "phpunit/phpunit": ">=4.8.28 <5.0.0 || >=5.6.3 <7.0", | ||
746 | + "sebastian/comparator": ">1.1 <3.0", | ||
747 | + "sebastian/diff": ">=1.4 <3.0", | ||
748 | + "symfony/browser-kit": ">=2.7 <5.0", | ||
749 | + "symfony/console": ">=2.7 <5.0", | ||
750 | + "symfony/css-selector": ">=2.7 <5.0", | ||
751 | + "symfony/dom-crawler": ">=2.7 <5.0", | ||
752 | + "symfony/event-dispatcher": ">=2.7 <5.0", | ||
753 | + "symfony/finder": ">=2.7 <5.0", | ||
754 | + "symfony/yaml": ">=2.7 <5.0" | ||
755 | + }, | ||
756 | + "require-dev": { | ||
757 | + "codeception/specify": "~0.3", | ||
758 | + "facebook/graph-sdk": "~5.3", | ||
759 | + "flow/jsonpath": "~0.2", | ||
760 | + "monolog/monolog": "~1.8", | ||
761 | + "pda/pheanstalk": "~3.0", | ||
762 | + "php-amqplib/php-amqplib": "~2.4", | ||
763 | + "predis/predis": "^1.0", | ||
764 | + "squizlabs/php_codesniffer": "~2.0", | ||
765 | + "symfony/process": ">=2.7 <5.0", | ||
766 | + "vlucas/phpdotenv": "^2.4.0" | ||
767 | + }, | ||
768 | + "suggest": { | ||
769 | + "aws/aws-sdk-php": "For using AWS Auth in REST module and Queue module", | ||
770 | + "codeception/phpbuiltinserver": "Start and stop PHP built-in web server for your tests", | ||
771 | + "codeception/specify": "BDD-style code blocks", | ||
772 | + "codeception/verify": "BDD-style assertions", | ||
773 | + "flow/jsonpath": "For using JSONPath in REST module", | ||
774 | + "league/factory-muffin": "For DataFactory module", | ||
775 | + "league/factory-muffin-faker": "For Faker support in DataFactory module", | ||
776 | + "phpseclib/phpseclib": "for SFTP option in FTP Module", | ||
777 | + "stecman/symfony-console-completion": "For BASH autocompletion", | ||
778 | + "symfony/phpunit-bridge": "For phpunit-bridge support" | ||
779 | + }, | ||
780 | + "bin": [ | ||
781 | + "codecept" | ||
782 | + ], | ||
783 | + "type": "library", | ||
784 | + "extra": { | ||
785 | + "branch-alias": [] | ||
786 | + }, | ||
787 | + "autoload": { | ||
788 | + "psr-4": { | ||
789 | + "Codeception\\": "src\\Codeception", | ||
790 | + "Codeception\\Extension\\": "ext" | ||
791 | + } | ||
792 | + }, | ||
793 | + "notification-url": "https://packagist.org/downloads/", | ||
794 | + "license": [ | ||
795 | + "MIT" | ||
796 | + ], | ||
797 | + "authors": [ | ||
798 | + { | ||
799 | + "name": "Michael Bodnarchuk", | ||
800 | + "email": "davert@mail.ua", | ||
801 | + "homepage": "http://codegyre.com" | ||
802 | + } | ||
803 | + ], | ||
804 | + "description": "BDD-style testing framework", | ||
805 | + "homepage": "http://codeception.com/", | ||
806 | + "keywords": [ | ||
807 | + "BDD", | ||
808 | + "TDD", | ||
809 | + "acceptance testing", | ||
810 | + "functional testing", | ||
811 | + "unit testing" | ||
812 | + ], | ||
813 | + "time": "2018-01-27T23:25:01+00:00" | ||
814 | + }, | ||
815 | + { | ||
816 | + "name": "codeception/stub", | ||
817 | + "version": "1.0.2", | ||
818 | + "source": { | ||
819 | + "type": "git", | ||
820 | + "url": "https://github.com/Codeception/Stub.git", | ||
821 | + "reference": "95fb7a36b81890dd2e5163e7ab31310df6f1bb99" | ||
822 | + }, | ||
823 | + "dist": { | ||
824 | + "type": "zip", | ||
825 | + "url": "https://api.github.com/repos/Codeception/Stub/zipball/95fb7a36b81890dd2e5163e7ab31310df6f1bb99", | ||
826 | + "reference": "95fb7a36b81890dd2e5163e7ab31310df6f1bb99", | ||
827 | + "shasum": "" | ||
828 | + }, | ||
829 | + "require": { | ||
830 | + "phpunit/phpunit-mock-objects": ">2.3 <7.0" | ||
831 | + }, | ||
832 | + "require-dev": { | ||
833 | + "phpunit/phpunit": ">=4.8 <8.0" | ||
834 | + }, | ||
835 | + "type": "library", | ||
836 | + "autoload": { | ||
837 | + "psr-4": { | ||
838 | + "Codeception\\": "src/" | ||
839 | + } | ||
840 | + }, | ||
841 | + "notification-url": "https://packagist.org/downloads/", | ||
842 | + "license": [ | ||
843 | + "MIT" | ||
844 | + ], | ||
845 | + "description": "Flexible Stub wrapper for PHPUnit's Mock Builder", | ||
846 | + "time": "2018-02-18T13:56:56+00:00" | ||
847 | + }, | ||
848 | + { | ||
849 | + "name": "codeception/verify", | ||
850 | + "version": "0.3.3", | ||
851 | + "source": { | ||
852 | + "type": "git", | ||
853 | + "url": "https://github.com/Codeception/Verify.git", | ||
854 | + "reference": "5d649dda453cd814dadc4bb053060cd2c6bb4b4c" | ||
855 | + }, | ||
856 | + "dist": { | ||
857 | + "type": "zip", | ||
858 | + "url": "https://api.github.com/repos/Codeception/Verify/zipball/5d649dda453cd814dadc4bb053060cd2c6bb4b4c", | ||
859 | + "reference": "5d649dda453cd814dadc4bb053060cd2c6bb4b4c", | ||
860 | + "shasum": "" | ||
861 | + }, | ||
862 | + "require-dev": { | ||
863 | + "phpunit/phpunit": "~4.0" | ||
864 | + }, | ||
865 | + "type": "library", | ||
866 | + "autoload": { | ||
867 | + "files": [ | ||
868 | + "src/Codeception/function.php" | ||
869 | + ] | ||
870 | + }, | ||
871 | + "notification-url": "https://packagist.org/downloads/", | ||
872 | + "license": [ | ||
873 | + "MIT" | ||
874 | + ], | ||
875 | + "authors": [ | ||
876 | + { | ||
877 | + "name": "Michael Bodnarchuk", | ||
878 | + "email": "davert.php@mailican.com" | ||
879 | + } | ||
880 | + ], | ||
881 | + "description": "BDD assertion library for PHPUnit", | ||
882 | + "time": "2017-01-09T10:58:51+00:00" | ||
883 | + }, | ||
884 | + { | ||
885 | + "name": "doctrine/instantiator", | ||
886 | + "version": "1.1.0", | ||
887 | + "source": { | ||
888 | + "type": "git", | ||
889 | + "url": "https://github.com/doctrine/instantiator.git", | ||
890 | + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" | ||
891 | + }, | ||
892 | + "dist": { | ||
893 | + "type": "zip", | ||
894 | + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", | ||
895 | + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", | ||
896 | + "shasum": "" | ||
897 | + }, | ||
898 | + "require": { | ||
899 | + "php": "^7.1" | ||
900 | + }, | ||
901 | + "require-dev": { | ||
902 | + "athletic/athletic": "~0.1.8", | ||
903 | + "ext-pdo": "*", | ||
904 | + "ext-phar": "*", | ||
905 | + "phpunit/phpunit": "^6.2.3", | ||
906 | + "squizlabs/php_codesniffer": "^3.0.2" | ||
907 | + }, | ||
908 | + "type": "library", | ||
909 | + "extra": { | ||
910 | + "branch-alias": { | ||
911 | + "dev-master": "1.2.x-dev" | ||
912 | + } | ||
913 | + }, | ||
914 | + "autoload": { | ||
915 | + "psr-4": { | ||
916 | + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" | ||
917 | + } | ||
918 | + }, | ||
919 | + "notification-url": "https://packagist.org/downloads/", | ||
920 | + "license": [ | ||
921 | + "MIT" | ||
922 | + ], | ||
923 | + "authors": [ | ||
924 | + { | ||
925 | + "name": "Marco Pivetta", | ||
926 | + "email": "ocramius@gmail.com", | ||
927 | + "homepage": "http://ocramius.github.com/" | ||
928 | + } | ||
929 | + ], | ||
930 | + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", | ||
931 | + "homepage": "https://github.com/doctrine/instantiator", | ||
932 | + "keywords": [ | ||
933 | + "constructor", | ||
934 | + "instantiate" | ||
935 | + ], | ||
936 | + "time": "2017-07-22T11:58:36+00:00" | ||
937 | + }, | ||
938 | + { | ||
939 | + "name": "fzaninotto/faker", | ||
940 | + "version": "v1.7.1", | ||
941 | + "source": { | ||
942 | + "type": "git", | ||
943 | + "url": "https://github.com/fzaninotto/Faker.git", | ||
944 | + "reference": "d3ed4cc37051c1ca52d22d76b437d14809fc7e0d" | ||
945 | + }, | ||
946 | + "dist": { | ||
947 | + "type": "zip", | ||
948 | + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/d3ed4cc37051c1ca52d22d76b437d14809fc7e0d", | ||
949 | + "reference": "d3ed4cc37051c1ca52d22d76b437d14809fc7e0d", | ||
950 | + "shasum": "" | ||
951 | + }, | ||
952 | + "require": { | ||
953 | + "php": "^5.3.3 || ^7.0" | ||
954 | + }, | ||
955 | + "require-dev": { | ||
956 | + "ext-intl": "*", | ||
957 | + "phpunit/phpunit": "^4.0 || ^5.0", | ||
958 | + "squizlabs/php_codesniffer": "^1.5" | ||
959 | + }, | ||
960 | + "type": "library", | ||
961 | + "extra": { | ||
962 | + "branch-alias": { | ||
963 | + "dev-master": "1.8-dev" | ||
964 | + } | ||
965 | + }, | ||
966 | + "autoload": { | ||
967 | + "psr-4": { | ||
968 | + "Faker\\": "src/Faker/" | ||
969 | + } | ||
970 | + }, | ||
971 | + "notification-url": "https://packagist.org/downloads/", | ||
972 | + "license": [ | ||
973 | + "MIT" | ||
974 | + ], | ||
975 | + "authors": [ | ||
976 | + { | ||
977 | + "name": "François Zaninotto" | ||
978 | + } | ||
979 | + ], | ||
980 | + "description": "Faker is a PHP library that generates fake data for you.", | ||
981 | + "keywords": [ | ||
982 | + "data", | ||
983 | + "faker", | ||
984 | + "fixtures" | ||
985 | + ], | ||
986 | + "time": "2017-08-15T16:48:10+00:00" | ||
987 | + }, | ||
988 | + { | ||
989 | + "name": "guzzlehttp/psr7", | ||
990 | + "version": "1.4.2", | ||
991 | + "source": { | ||
992 | + "type": "git", | ||
993 | + "url": "https://github.com/guzzle/psr7.git", | ||
994 | + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" | ||
995 | + }, | ||
996 | + "dist": { | ||
997 | + "type": "zip", | ||
998 | + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", | ||
999 | + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", | ||
1000 | + "shasum": "" | ||
1001 | + }, | ||
1002 | + "require": { | ||
1003 | + "php": ">=5.4.0", | ||
1004 | + "psr/http-message": "~1.0" | ||
1005 | + }, | ||
1006 | + "provide": { | ||
1007 | + "psr/http-message-implementation": "1.0" | ||
1008 | + }, | ||
1009 | + "require-dev": { | ||
1010 | + "phpunit/phpunit": "~4.0" | ||
1011 | + }, | ||
1012 | + "type": "library", | ||
1013 | + "extra": { | ||
1014 | + "branch-alias": { | ||
1015 | + "dev-master": "1.4-dev" | ||
1016 | + } | ||
1017 | + }, | ||
1018 | + "autoload": { | ||
1019 | + "psr-4": { | ||
1020 | + "GuzzleHttp\\Psr7\\": "src/" | ||
1021 | + }, | ||
1022 | + "files": [ | ||
1023 | + "src/functions_include.php" | ||
1024 | + ] | ||
1025 | + }, | ||
1026 | + "notification-url": "https://packagist.org/downloads/", | ||
1027 | + "license": [ | ||
1028 | + "MIT" | ||
1029 | + ], | ||
1030 | + "authors": [ | ||
1031 | + { | ||
1032 | + "name": "Michael Dowling", | ||
1033 | + "email": "mtdowling@gmail.com", | ||
1034 | + "homepage": "https://github.com/mtdowling" | ||
1035 | + }, | ||
1036 | + { | ||
1037 | + "name": "Tobias Schultze", | ||
1038 | + "homepage": "https://github.com/Tobion" | ||
1039 | + } | ||
1040 | + ], | ||
1041 | + "description": "PSR-7 message implementation that also provides common utility methods", | ||
1042 | + "keywords": [ | ||
1043 | + "http", | ||
1044 | + "message", | ||
1045 | + "request", | ||
1046 | + "response", | ||
1047 | + "stream", | ||
1048 | + "uri", | ||
1049 | + "url" | ||
1050 | + ], | ||
1051 | + "time": "2017-03-20T17:10:46+00:00" | ||
1052 | + }, | ||
1053 | + { | ||
1054 | + "name": "myclabs/deep-copy", | ||
1055 | + "version": "1.7.0", | ||
1056 | + "source": { | ||
1057 | + "type": "git", | ||
1058 | + "url": "https://github.com/myclabs/DeepCopy.git", | ||
1059 | + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" | ||
1060 | + }, | ||
1061 | + "dist": { | ||
1062 | + "type": "zip", | ||
1063 | + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", | ||
1064 | + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", | ||
1065 | + "shasum": "" | ||
1066 | + }, | ||
1067 | + "require": { | ||
1068 | + "php": "^5.6 || ^7.0" | ||
1069 | + }, | ||
1070 | + "require-dev": { | ||
1071 | + "doctrine/collections": "^1.0", | ||
1072 | + "doctrine/common": "^2.6", | ||
1073 | + "phpunit/phpunit": "^4.1" | ||
1074 | + }, | ||
1075 | + "type": "library", | ||
1076 | + "autoload": { | ||
1077 | + "psr-4": { | ||
1078 | + "DeepCopy\\": "src/DeepCopy/" | ||
1079 | + }, | ||
1080 | + "files": [ | ||
1081 | + "src/DeepCopy/deep_copy.php" | ||
1082 | + ] | ||
1083 | + }, | ||
1084 | + "notification-url": "https://packagist.org/downloads/", | ||
1085 | + "license": [ | ||
1086 | + "MIT" | ||
1087 | + ], | ||
1088 | + "description": "Create deep copies (clones) of your objects", | ||
1089 | + "keywords": [ | ||
1090 | + "clone", | ||
1091 | + "copy", | ||
1092 | + "duplicate", | ||
1093 | + "object", | ||
1094 | + "object graph" | ||
1095 | + ], | ||
1096 | + "time": "2017-10-19T19:58:43+00:00" | ||
1097 | + }, | ||
1098 | + { | ||
1099 | + "name": "phar-io/manifest", | ||
1100 | + "version": "1.0.1", | ||
1101 | + "source": { | ||
1102 | + "type": "git", | ||
1103 | + "url": "https://github.com/phar-io/manifest.git", | ||
1104 | + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" | ||
1105 | + }, | ||
1106 | + "dist": { | ||
1107 | + "type": "zip", | ||
1108 | + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", | ||
1109 | + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", | ||
1110 | + "shasum": "" | ||
1111 | + }, | ||
1112 | + "require": { | ||
1113 | + "ext-dom": "*", | ||
1114 | + "ext-phar": "*", | ||
1115 | + "phar-io/version": "^1.0.1", | ||
1116 | + "php": "^5.6 || ^7.0" | ||
1117 | + }, | ||
1118 | + "type": "library", | ||
1119 | + "extra": { | ||
1120 | + "branch-alias": { | ||
1121 | + "dev-master": "1.0.x-dev" | ||
1122 | + } | ||
1123 | + }, | ||
1124 | + "autoload": { | ||
1125 | + "classmap": [ | ||
1126 | + "src/" | ||
1127 | + ] | ||
1128 | + }, | ||
1129 | + "notification-url": "https://packagist.org/downloads/", | ||
1130 | + "license": [ | ||
1131 | + "BSD-3-Clause" | ||
1132 | + ], | ||
1133 | + "authors": [ | ||
1134 | + { | ||
1135 | + "name": "Arne Blankerts", | ||
1136 | + "email": "arne@blankerts.de", | ||
1137 | + "role": "Developer" | ||
1138 | + }, | ||
1139 | + { | ||
1140 | + "name": "Sebastian Heuer", | ||
1141 | + "email": "sebastian@phpeople.de", | ||
1142 | + "role": "Developer" | ||
1143 | + }, | ||
1144 | + { | ||
1145 | + "name": "Sebastian Bergmann", | ||
1146 | + "email": "sebastian@phpunit.de", | ||
1147 | + "role": "Developer" | ||
1148 | + } | ||
1149 | + ], | ||
1150 | + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", | ||
1151 | + "time": "2017-03-05T18:14:27+00:00" | ||
1152 | + }, | ||
1153 | + { | ||
1154 | + "name": "phar-io/version", | ||
1155 | + "version": "1.0.1", | ||
1156 | + "source": { | ||
1157 | + "type": "git", | ||
1158 | + "url": "https://github.com/phar-io/version.git", | ||
1159 | + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" | ||
1160 | + }, | ||
1161 | + "dist": { | ||
1162 | + "type": "zip", | ||
1163 | + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", | ||
1164 | + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", | ||
1165 | + "shasum": "" | ||
1166 | + }, | ||
1167 | + "require": { | ||
1168 | + "php": "^5.6 || ^7.0" | ||
1169 | + }, | ||
1170 | + "type": "library", | ||
1171 | + "autoload": { | ||
1172 | + "classmap": [ | ||
1173 | + "src/" | ||
1174 | + ] | ||
1175 | + }, | ||
1176 | + "notification-url": "https://packagist.org/downloads/", | ||
1177 | + "license": [ | ||
1178 | + "BSD-3-Clause" | ||
1179 | + ], | ||
1180 | + "authors": [ | ||
1181 | + { | ||
1182 | + "name": "Arne Blankerts", | ||
1183 | + "email": "arne@blankerts.de", | ||
1184 | + "role": "Developer" | ||
1185 | + }, | ||
1186 | + { | ||
1187 | + "name": "Sebastian Heuer", | ||
1188 | + "email": "sebastian@phpeople.de", | ||
1189 | + "role": "Developer" | ||
1190 | + }, | ||
1191 | + { | ||
1192 | + "name": "Sebastian Bergmann", | ||
1193 | + "email": "sebastian@phpunit.de", | ||
1194 | + "role": "Developer" | ||
1195 | + } | ||
1196 | + ], | ||
1197 | + "description": "Library for handling version information and constraints", | ||
1198 | + "time": "2017-03-05T17:38:23+00:00" | ||
1199 | + }, | ||
1200 | + { | ||
1201 | + "name": "phpdocumentor/reflection-common", | ||
1202 | + "version": "1.0.1", | ||
1203 | + "source": { | ||
1204 | + "type": "git", | ||
1205 | + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", | ||
1206 | + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" | ||
1207 | + }, | ||
1208 | + "dist": { | ||
1209 | + "type": "zip", | ||
1210 | + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", | ||
1211 | + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", | ||
1212 | + "shasum": "" | ||
1213 | + }, | ||
1214 | + "require": { | ||
1215 | + "php": ">=5.5" | ||
1216 | + }, | ||
1217 | + "require-dev": { | ||
1218 | + "phpunit/phpunit": "^4.6" | ||
1219 | + }, | ||
1220 | + "type": "library", | ||
1221 | + "extra": { | ||
1222 | + "branch-alias": { | ||
1223 | + "dev-master": "1.0.x-dev" | ||
1224 | + } | ||
1225 | + }, | ||
1226 | + "autoload": { | ||
1227 | + "psr-4": { | ||
1228 | + "phpDocumentor\\Reflection\\": [ | ||
1229 | + "src" | ||
1230 | + ] | ||
1231 | + } | ||
1232 | + }, | ||
1233 | + "notification-url": "https://packagist.org/downloads/", | ||
1234 | + "license": [ | ||
1235 | + "MIT" | ||
1236 | + ], | ||
1237 | + "authors": [ | ||
1238 | + { | ||
1239 | + "name": "Jaap van Otterdijk", | ||
1240 | + "email": "opensource@ijaap.nl" | ||
1241 | + } | ||
1242 | + ], | ||
1243 | + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", | ||
1244 | + "homepage": "http://www.phpdoc.org", | ||
1245 | + "keywords": [ | ||
1246 | + "FQSEN", | ||
1247 | + "phpDocumentor", | ||
1248 | + "phpdoc", | ||
1249 | + "reflection", | ||
1250 | + "static analysis" | ||
1251 | + ], | ||
1252 | + "time": "2017-09-11T18:02:19+00:00" | ||
1253 | + }, | ||
1254 | + { | ||
1255 | + "name": "phpdocumentor/reflection-docblock", | ||
1256 | + "version": "4.3.0", | ||
1257 | + "source": { | ||
1258 | + "type": "git", | ||
1259 | + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", | ||
1260 | + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" | ||
1261 | + }, | ||
1262 | + "dist": { | ||
1263 | + "type": "zip", | ||
1264 | + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", | ||
1265 | + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", | ||
1266 | + "shasum": "" | ||
1267 | + }, | ||
1268 | + "require": { | ||
1269 | + "php": "^7.0", | ||
1270 | + "phpdocumentor/reflection-common": "^1.0.0", | ||
1271 | + "phpdocumentor/type-resolver": "^0.4.0", | ||
1272 | + "webmozart/assert": "^1.0" | ||
1273 | + }, | ||
1274 | + "require-dev": { | ||
1275 | + "doctrine/instantiator": "~1.0.5", | ||
1276 | + "mockery/mockery": "^1.0", | ||
1277 | + "phpunit/phpunit": "^6.4" | ||
1278 | + }, | ||
1279 | + "type": "library", | ||
1280 | + "extra": { | ||
1281 | + "branch-alias": { | ||
1282 | + "dev-master": "4.x-dev" | ||
1283 | + } | ||
1284 | + }, | ||
1285 | + "autoload": { | ||
1286 | + "psr-4": { | ||
1287 | + "phpDocumentor\\Reflection\\": [ | ||
1288 | + "src/" | ||
1289 | + ] | ||
1290 | + } | ||
1291 | + }, | ||
1292 | + "notification-url": "https://packagist.org/downloads/", | ||
1293 | + "license": [ | ||
1294 | + "MIT" | ||
1295 | + ], | ||
1296 | + "authors": [ | ||
1297 | + { | ||
1298 | + "name": "Mike van Riel", | ||
1299 | + "email": "me@mikevanriel.com" | ||
1300 | + } | ||
1301 | + ], | ||
1302 | + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", | ||
1303 | + "time": "2017-11-30T07:14:17+00:00" | ||
1304 | + }, | ||
1305 | + { | ||
1306 | + "name": "phpdocumentor/type-resolver", | ||
1307 | + "version": "0.4.0", | ||
1308 | + "source": { | ||
1309 | + "type": "git", | ||
1310 | + "url": "https://github.com/phpDocumentor/TypeResolver.git", | ||
1311 | + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" | ||
1312 | + }, | ||
1313 | + "dist": { | ||
1314 | + "type": "zip", | ||
1315 | + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", | ||
1316 | + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", | ||
1317 | + "shasum": "" | ||
1318 | + }, | ||
1319 | + "require": { | ||
1320 | + "php": "^5.5 || ^7.0", | ||
1321 | + "phpdocumentor/reflection-common": "^1.0" | ||
1322 | + }, | ||
1323 | + "require-dev": { | ||
1324 | + "mockery/mockery": "^0.9.4", | ||
1325 | + "phpunit/phpunit": "^5.2||^4.8.24" | ||
1326 | + }, | ||
1327 | + "type": "library", | ||
1328 | + "extra": { | ||
1329 | + "branch-alias": { | ||
1330 | + "dev-master": "1.0.x-dev" | ||
1331 | + } | ||
1332 | + }, | ||
1333 | + "autoload": { | ||
1334 | + "psr-4": { | ||
1335 | + "phpDocumentor\\Reflection\\": [ | ||
1336 | + "src/" | ||
1337 | + ] | ||
1338 | + } | ||
1339 | + }, | ||
1340 | + "notification-url": "https://packagist.org/downloads/", | ||
1341 | + "license": [ | ||
1342 | + "MIT" | ||
1343 | + ], | ||
1344 | + "authors": [ | ||
1345 | + { | ||
1346 | + "name": "Mike van Riel", | ||
1347 | + "email": "me@mikevanriel.com" | ||
1348 | + } | ||
1349 | + ], | ||
1350 | + "time": "2017-07-14T14:27:02+00:00" | ||
1351 | + }, | ||
1352 | + { | ||
1353 | + "name": "phpspec/php-diff", | ||
1354 | + "version": "v1.1.0", | ||
1355 | + "source": { | ||
1356 | + "type": "git", | ||
1357 | + "url": "https://github.com/phpspec/php-diff.git", | ||
1358 | + "reference": "0464787bfa7cd13576c5a1e318709768798bec6a" | ||
1359 | + }, | ||
1360 | + "dist": { | ||
1361 | + "type": "zip", | ||
1362 | + "url": "https://api.github.com/repos/phpspec/php-diff/zipball/0464787bfa7cd13576c5a1e318709768798bec6a", | ||
1363 | + "reference": "0464787bfa7cd13576c5a1e318709768798bec6a", | ||
1364 | + "shasum": "" | ||
1365 | + }, | ||
1366 | + "type": "library", | ||
1367 | + "extra": { | ||
1368 | + "branch-alias": { | ||
1369 | + "dev-master": "1.0.x-dev" | ||
1370 | + } | ||
1371 | + }, | ||
1372 | + "autoload": { | ||
1373 | + "psr-0": { | ||
1374 | + "Diff": "lib/" | ||
1375 | + } | ||
1376 | + }, | ||
1377 | + "notification-url": "https://packagist.org/downloads/", | ||
1378 | + "license": [ | ||
1379 | + "BSD-3-Clause" | ||
1380 | + ], | ||
1381 | + "authors": [ | ||
1382 | + { | ||
1383 | + "name": "Chris Boulton", | ||
1384 | + "homepage": "http://github.com/chrisboulton" | ||
1385 | + } | ||
1386 | + ], | ||
1387 | + "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).", | ||
1388 | + "time": "2016-04-07T12:29:16+00:00" | ||
1389 | + }, | ||
1390 | + { | ||
1391 | + "name": "phpspec/prophecy", | ||
1392 | + "version": "1.7.5", | ||
1393 | + "source": { | ||
1394 | + "type": "git", | ||
1395 | + "url": "https://github.com/phpspec/prophecy.git", | ||
1396 | + "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401" | ||
1397 | + }, | ||
1398 | + "dist": { | ||
1399 | + "type": "zip", | ||
1400 | + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401", | ||
1401 | + "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401", | ||
1402 | + "shasum": "" | ||
1403 | + }, | ||
1404 | + "require": { | ||
1405 | + "doctrine/instantiator": "^1.0.2", | ||
1406 | + "php": "^5.3|^7.0", | ||
1407 | + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", | ||
1408 | + "sebastian/comparator": "^1.1|^2.0", | ||
1409 | + "sebastian/recursion-context": "^1.0|^2.0|^3.0" | ||
1410 | + }, | ||
1411 | + "require-dev": { | ||
1412 | + "phpspec/phpspec": "^2.5|^3.2", | ||
1413 | + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" | ||
1414 | + }, | ||
1415 | + "type": "library", | ||
1416 | + "extra": { | ||
1417 | + "branch-alias": { | ||
1418 | + "dev-master": "1.7.x-dev" | ||
1419 | + } | ||
1420 | + }, | ||
1421 | + "autoload": { | ||
1422 | + "psr-0": { | ||
1423 | + "Prophecy\\": "src/" | ||
1424 | + } | ||
1425 | + }, | ||
1426 | + "notification-url": "https://packagist.org/downloads/", | ||
1427 | + "license": [ | ||
1428 | + "MIT" | ||
1429 | + ], | ||
1430 | + "authors": [ | ||
1431 | + { | ||
1432 | + "name": "Konstantin Kudryashov", | ||
1433 | + "email": "ever.zet@gmail.com", | ||
1434 | + "homepage": "http://everzet.com" | ||
1435 | + }, | ||
1436 | + { | ||
1437 | + "name": "Marcello Duarte", | ||
1438 | + "email": "marcello.duarte@gmail.com" | ||
1439 | + } | ||
1440 | + ], | ||
1441 | + "description": "Highly opinionated mocking framework for PHP 5.3+", | ||
1442 | + "homepage": "https://github.com/phpspec/prophecy", | ||
1443 | + "keywords": [ | ||
1444 | + "Double", | ||
1445 | + "Dummy", | ||
1446 | + "fake", | ||
1447 | + "mock", | ||
1448 | + "spy", | ||
1449 | + "stub" | ||
1450 | + ], | ||
1451 | + "time": "2018-02-19T10:16:54+00:00" | ||
1452 | + }, | ||
1453 | + { | ||
1454 | + "name": "phpunit/php-code-coverage", | ||
1455 | + "version": "5.3.0", | ||
1456 | + "source": { | ||
1457 | + "type": "git", | ||
1458 | + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", | ||
1459 | + "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1" | ||
1460 | + }, | ||
1461 | + "dist": { | ||
1462 | + "type": "zip", | ||
1463 | + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/661f34d0bd3f1a7225ef491a70a020ad23a057a1", | ||
1464 | + "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1", | ||
1465 | + "shasum": "" | ||
1466 | + }, | ||
1467 | + "require": { | ||
1468 | + "ext-dom": "*", | ||
1469 | + "ext-xmlwriter": "*", | ||
1470 | + "php": "^7.0", | ||
1471 | + "phpunit/php-file-iterator": "^1.4.2", | ||
1472 | + "phpunit/php-text-template": "^1.2.1", | ||
1473 | + "phpunit/php-token-stream": "^2.0.1", | ||
1474 | + "sebastian/code-unit-reverse-lookup": "^1.0.1", | ||
1475 | + "sebastian/environment": "^3.0", | ||
1476 | + "sebastian/version": "^2.0.1", | ||
1477 | + "theseer/tokenizer": "^1.1" | ||
1478 | + }, | ||
1479 | + "require-dev": { | ||
1480 | + "phpunit/phpunit": "^6.0" | ||
1481 | + }, | ||
1482 | + "suggest": { | ||
1483 | + "ext-xdebug": "^2.5.5" | ||
1484 | + }, | ||
1485 | + "type": "library", | ||
1486 | + "extra": { | ||
1487 | + "branch-alias": { | ||
1488 | + "dev-master": "5.3.x-dev" | ||
1489 | + } | ||
1490 | + }, | ||
1491 | + "autoload": { | ||
1492 | + "classmap": [ | ||
1493 | + "src/" | ||
1494 | + ] | ||
1495 | + }, | ||
1496 | + "notification-url": "https://packagist.org/downloads/", | ||
1497 | + "license": [ | ||
1498 | + "BSD-3-Clause" | ||
1499 | + ], | ||
1500 | + "authors": [ | ||
1501 | + { | ||
1502 | + "name": "Sebastian Bergmann", | ||
1503 | + "email": "sebastian@phpunit.de", | ||
1504 | + "role": "lead" | ||
1505 | + } | ||
1506 | + ], | ||
1507 | + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", | ||
1508 | + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", | ||
1509 | + "keywords": [ | ||
1510 | + "coverage", | ||
1511 | + "testing", | ||
1512 | + "xunit" | ||
1513 | + ], | ||
1514 | + "time": "2017-12-06T09:29:45+00:00" | ||
1515 | + }, | ||
1516 | + { | ||
1517 | + "name": "phpunit/php-file-iterator", | ||
1518 | + "version": "1.4.5", | ||
1519 | + "source": { | ||
1520 | + "type": "git", | ||
1521 | + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", | ||
1522 | + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" | ||
1523 | + }, | ||
1524 | + "dist": { | ||
1525 | + "type": "zip", | ||
1526 | + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", | ||
1527 | + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", | ||
1528 | + "shasum": "" | ||
1529 | + }, | ||
1530 | + "require": { | ||
1531 | + "php": ">=5.3.3" | ||
1532 | + }, | ||
1533 | + "type": "library", | ||
1534 | + "extra": { | ||
1535 | + "branch-alias": { | ||
1536 | + "dev-master": "1.4.x-dev" | ||
1537 | + } | ||
1538 | + }, | ||
1539 | + "autoload": { | ||
1540 | + "classmap": [ | ||
1541 | + "src/" | ||
1542 | + ] | ||
1543 | + }, | ||
1544 | + "notification-url": "https://packagist.org/downloads/", | ||
1545 | + "license": [ | ||
1546 | + "BSD-3-Clause" | ||
1547 | + ], | ||
1548 | + "authors": [ | ||
1549 | + { | ||
1550 | + "name": "Sebastian Bergmann", | ||
1551 | + "email": "sb@sebastian-bergmann.de", | ||
1552 | + "role": "lead" | ||
1553 | + } | ||
1554 | + ], | ||
1555 | + "description": "FilterIterator implementation that filters files based on a list of suffixes.", | ||
1556 | + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", | ||
1557 | + "keywords": [ | ||
1558 | + "filesystem", | ||
1559 | + "iterator" | ||
1560 | + ], | ||
1561 | + "time": "2017-11-27T13:52:08+00:00" | ||
1562 | + }, | ||
1563 | + { | ||
1564 | + "name": "phpunit/php-text-template", | ||
1565 | + "version": "1.2.1", | ||
1566 | + "source": { | ||
1567 | + "type": "git", | ||
1568 | + "url": "https://github.com/sebastianbergmann/php-text-template.git", | ||
1569 | + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" | ||
1570 | + }, | ||
1571 | + "dist": { | ||
1572 | + "type": "zip", | ||
1573 | + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", | ||
1574 | + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", | ||
1575 | + "shasum": "" | ||
1576 | + }, | ||
1577 | + "require": { | ||
1578 | + "php": ">=5.3.3" | ||
1579 | + }, | ||
1580 | + "type": "library", | ||
1581 | + "autoload": { | ||
1582 | + "classmap": [ | ||
1583 | + "src/" | ||
1584 | + ] | ||
1585 | + }, | ||
1586 | + "notification-url": "https://packagist.org/downloads/", | ||
1587 | + "license": [ | ||
1588 | + "BSD-3-Clause" | ||
1589 | + ], | ||
1590 | + "authors": [ | ||
1591 | + { | ||
1592 | + "name": "Sebastian Bergmann", | ||
1593 | + "email": "sebastian@phpunit.de", | ||
1594 | + "role": "lead" | ||
1595 | + } | ||
1596 | + ], | ||
1597 | + "description": "Simple template engine.", | ||
1598 | + "homepage": "https://github.com/sebastianbergmann/php-text-template/", | ||
1599 | + "keywords": [ | ||
1600 | + "template" | ||
1601 | + ], | ||
1602 | + "time": "2015-06-21T13:50:34+00:00" | ||
1603 | + }, | ||
1604 | + { | ||
1605 | + "name": "phpunit/php-timer", | ||
1606 | + "version": "1.0.9", | ||
1607 | + "source": { | ||
1608 | + "type": "git", | ||
1609 | + "url": "https://github.com/sebastianbergmann/php-timer.git", | ||
1610 | + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" | ||
1611 | + }, | ||
1612 | + "dist": { | ||
1613 | + "type": "zip", | ||
1614 | + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", | ||
1615 | + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", | ||
1616 | + "shasum": "" | ||
1617 | + }, | ||
1618 | + "require": { | ||
1619 | + "php": "^5.3.3 || ^7.0" | ||
1620 | + }, | ||
1621 | + "require-dev": { | ||
1622 | + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" | ||
1623 | + }, | ||
1624 | + "type": "library", | ||
1625 | + "extra": { | ||
1626 | + "branch-alias": { | ||
1627 | + "dev-master": "1.0-dev" | ||
1628 | + } | ||
1629 | + }, | ||
1630 | + "autoload": { | ||
1631 | + "classmap": [ | ||
1632 | + "src/" | ||
1633 | + ] | ||
1634 | + }, | ||
1635 | + "notification-url": "https://packagist.org/downloads/", | ||
1636 | + "license": [ | ||
1637 | + "BSD-3-Clause" | ||
1638 | + ], | ||
1639 | + "authors": [ | ||
1640 | + { | ||
1641 | + "name": "Sebastian Bergmann", | ||
1642 | + "email": "sb@sebastian-bergmann.de", | ||
1643 | + "role": "lead" | ||
1644 | + } | ||
1645 | + ], | ||
1646 | + "description": "Utility class for timing", | ||
1647 | + "homepage": "https://github.com/sebastianbergmann/php-timer/", | ||
1648 | + "keywords": [ | ||
1649 | + "timer" | ||
1650 | + ], | ||
1651 | + "time": "2017-02-26T11:10:40+00:00" | ||
1652 | + }, | ||
1653 | + { | ||
1654 | + "name": "phpunit/php-token-stream", | ||
1655 | + "version": "2.0.2", | ||
1656 | + "source": { | ||
1657 | + "type": "git", | ||
1658 | + "url": "https://github.com/sebastianbergmann/php-token-stream.git", | ||
1659 | + "reference": "791198a2c6254db10131eecfe8c06670700904db" | ||
1660 | + }, | ||
1661 | + "dist": { | ||
1662 | + "type": "zip", | ||
1663 | + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", | ||
1664 | + "reference": "791198a2c6254db10131eecfe8c06670700904db", | ||
1665 | + "shasum": "" | ||
1666 | + }, | ||
1667 | + "require": { | ||
1668 | + "ext-tokenizer": "*", | ||
1669 | + "php": "^7.0" | ||
1670 | + }, | ||
1671 | + "require-dev": { | ||
1672 | + "phpunit/phpunit": "^6.2.4" | ||
1673 | + }, | ||
1674 | + "type": "library", | ||
1675 | + "extra": { | ||
1676 | + "branch-alias": { | ||
1677 | + "dev-master": "2.0-dev" | ||
1678 | + } | ||
1679 | + }, | ||
1680 | + "autoload": { | ||
1681 | + "classmap": [ | ||
1682 | + "src/" | ||
1683 | + ] | ||
1684 | + }, | ||
1685 | + "notification-url": "https://packagist.org/downloads/", | ||
1686 | + "license": [ | ||
1687 | + "BSD-3-Clause" | ||
1688 | + ], | ||
1689 | + "authors": [ | ||
1690 | + { | ||
1691 | + "name": "Sebastian Bergmann", | ||
1692 | + "email": "sebastian@phpunit.de" | ||
1693 | + } | ||
1694 | + ], | ||
1695 | + "description": "Wrapper around PHP's tokenizer extension.", | ||
1696 | + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", | ||
1697 | + "keywords": [ | ||
1698 | + "tokenizer" | ||
1699 | + ], | ||
1700 | + "time": "2017-11-27T05:48:46+00:00" | ||
1701 | + }, | ||
1702 | + { | ||
1703 | + "name": "phpunit/phpunit", | ||
1704 | + "version": "6.5.6", | ||
1705 | + "source": { | ||
1706 | + "type": "git", | ||
1707 | + "url": "https://github.com/sebastianbergmann/phpunit.git", | ||
1708 | + "reference": "3330ef26ade05359d006041316ed0fa9e8e3cefe" | ||
1709 | + }, | ||
1710 | + "dist": { | ||
1711 | + "type": "zip", | ||
1712 | + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3330ef26ade05359d006041316ed0fa9e8e3cefe", | ||
1713 | + "reference": "3330ef26ade05359d006041316ed0fa9e8e3cefe", | ||
1714 | + "shasum": "" | ||
1715 | + }, | ||
1716 | + "require": { | ||
1717 | + "ext-dom": "*", | ||
1718 | + "ext-json": "*", | ||
1719 | + "ext-libxml": "*", | ||
1720 | + "ext-mbstring": "*", | ||
1721 | + "ext-xml": "*", | ||
1722 | + "myclabs/deep-copy": "^1.6.1", | ||
1723 | + "phar-io/manifest": "^1.0.1", | ||
1724 | + "phar-io/version": "^1.0", | ||
1725 | + "php": "^7.0", | ||
1726 | + "phpspec/prophecy": "^1.7", | ||
1727 | + "phpunit/php-code-coverage": "^5.3", | ||
1728 | + "phpunit/php-file-iterator": "^1.4.3", | ||
1729 | + "phpunit/php-text-template": "^1.2.1", | ||
1730 | + "phpunit/php-timer": "^1.0.9", | ||
1731 | + "phpunit/phpunit-mock-objects": "^5.0.5", | ||
1732 | + "sebastian/comparator": "^2.1", | ||
1733 | + "sebastian/diff": "^2.0", | ||
1734 | + "sebastian/environment": "^3.1", | ||
1735 | + "sebastian/exporter": "^3.1", | ||
1736 | + "sebastian/global-state": "^2.0", | ||
1737 | + "sebastian/object-enumerator": "^3.0.3", | ||
1738 | + "sebastian/resource-operations": "^1.0", | ||
1739 | + "sebastian/version": "^2.0.1" | ||
1740 | + }, | ||
1741 | + "conflict": { | ||
1742 | + "phpdocumentor/reflection-docblock": "3.0.2", | ||
1743 | + "phpunit/dbunit": "<3.0" | ||
1744 | + }, | ||
1745 | + "require-dev": { | ||
1746 | + "ext-pdo": "*" | ||
1747 | + }, | ||
1748 | + "suggest": { | ||
1749 | + "ext-xdebug": "*", | ||
1750 | + "phpunit/php-invoker": "^1.1" | ||
1751 | + }, | ||
1752 | + "bin": [ | ||
1753 | + "phpunit" | ||
1754 | + ], | ||
1755 | + "type": "library", | ||
1756 | + "extra": { | ||
1757 | + "branch-alias": { | ||
1758 | + "dev-master": "6.5.x-dev" | ||
1759 | + } | ||
1760 | + }, | ||
1761 | + "autoload": { | ||
1762 | + "classmap": [ | ||
1763 | + "src/" | ||
1764 | + ] | ||
1765 | + }, | ||
1766 | + "notification-url": "https://packagist.org/downloads/", | ||
1767 | + "license": [ | ||
1768 | + "BSD-3-Clause" | ||
1769 | + ], | ||
1770 | + "authors": [ | ||
1771 | + { | ||
1772 | + "name": "Sebastian Bergmann", | ||
1773 | + "email": "sebastian@phpunit.de", | ||
1774 | + "role": "lead" | ||
1775 | + } | ||
1776 | + ], | ||
1777 | + "description": "The PHP Unit Testing framework.", | ||
1778 | + "homepage": "https://phpunit.de/", | ||
1779 | + "keywords": [ | ||
1780 | + "phpunit", | ||
1781 | + "testing", | ||
1782 | + "xunit" | ||
1783 | + ], | ||
1784 | + "time": "2018-02-01T05:57:37+00:00" | ||
1785 | + }, | ||
1786 | + { | ||
1787 | + "name": "phpunit/phpunit-mock-objects", | ||
1788 | + "version": "5.0.6", | ||
1789 | + "source": { | ||
1790 | + "type": "git", | ||
1791 | + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", | ||
1792 | + "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf" | ||
1793 | + }, | ||
1794 | + "dist": { | ||
1795 | + "type": "zip", | ||
1796 | + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/33fd41a76e746b8fa96d00b49a23dadfa8334cdf", | ||
1797 | + "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf", | ||
1798 | + "shasum": "" | ||
1799 | + }, | ||
1800 | + "require": { | ||
1801 | + "doctrine/instantiator": "^1.0.5", | ||
1802 | + "php": "^7.0", | ||
1803 | + "phpunit/php-text-template": "^1.2.1", | ||
1804 | + "sebastian/exporter": "^3.1" | ||
1805 | + }, | ||
1806 | + "conflict": { | ||
1807 | + "phpunit/phpunit": "<6.0" | ||
1808 | + }, | ||
1809 | + "require-dev": { | ||
1810 | + "phpunit/phpunit": "^6.5" | ||
1811 | + }, | ||
1812 | + "suggest": { | ||
1813 | + "ext-soap": "*" | ||
1814 | + }, | ||
1815 | + "type": "library", | ||
1816 | + "extra": { | ||
1817 | + "branch-alias": { | ||
1818 | + "dev-master": "5.0.x-dev" | ||
1819 | + } | ||
1820 | + }, | ||
1821 | + "autoload": { | ||
1822 | + "classmap": [ | ||
1823 | + "src/" | ||
1824 | + ] | ||
1825 | + }, | ||
1826 | + "notification-url": "https://packagist.org/downloads/", | ||
1827 | + "license": [ | ||
1828 | + "BSD-3-Clause" | ||
1829 | + ], | ||
1830 | + "authors": [ | ||
1831 | + { | ||
1832 | + "name": "Sebastian Bergmann", | ||
1833 | + "email": "sebastian@phpunit.de", | ||
1834 | + "role": "lead" | ||
1835 | + } | ||
1836 | + ], | ||
1837 | + "description": "Mock Object library for PHPUnit", | ||
1838 | + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", | ||
1839 | + "keywords": [ | ||
1840 | + "mock", | ||
1841 | + "xunit" | ||
1842 | + ], | ||
1843 | + "time": "2018-01-06T05:45:45+00:00" | ||
1844 | + }, | ||
1845 | + { | ||
1846 | + "name": "psr/http-message", | ||
1847 | + "version": "1.0.1", | ||
1848 | + "source": { | ||
1849 | + "type": "git", | ||
1850 | + "url": "https://github.com/php-fig/http-message.git", | ||
1851 | + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" | ||
1852 | + }, | ||
1853 | + "dist": { | ||
1854 | + "type": "zip", | ||
1855 | + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", | ||
1856 | + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", | ||
1857 | + "shasum": "" | ||
1858 | + }, | ||
1859 | + "require": { | ||
1860 | + "php": ">=5.3.0" | ||
1861 | + }, | ||
1862 | + "type": "library", | ||
1863 | + "extra": { | ||
1864 | + "branch-alias": { | ||
1865 | + "dev-master": "1.0.x-dev" | ||
1866 | + } | ||
1867 | + }, | ||
1868 | + "autoload": { | ||
1869 | + "psr-4": { | ||
1870 | + "Psr\\Http\\Message\\": "src/" | ||
1871 | + } | ||
1872 | + }, | ||
1873 | + "notification-url": "https://packagist.org/downloads/", | ||
1874 | + "license": [ | ||
1875 | + "MIT" | ||
1876 | + ], | ||
1877 | + "authors": [ | ||
1878 | + { | ||
1879 | + "name": "PHP-FIG", | ||
1880 | + "homepage": "http://www.php-fig.org/" | ||
1881 | + } | ||
1882 | + ], | ||
1883 | + "description": "Common interface for HTTP messages", | ||
1884 | + "homepage": "https://github.com/php-fig/http-message", | ||
1885 | + "keywords": [ | ||
1886 | + "http", | ||
1887 | + "http-message", | ||
1888 | + "psr", | ||
1889 | + "psr-7", | ||
1890 | + "request", | ||
1891 | + "response" | ||
1892 | + ], | ||
1893 | + "time": "2016-08-06T14:39:51+00:00" | ||
1894 | + }, | ||
1895 | + { | ||
1896 | + "name": "sebastian/code-unit-reverse-lookup", | ||
1897 | + "version": "1.0.1", | ||
1898 | + "source": { | ||
1899 | + "type": "git", | ||
1900 | + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", | ||
1901 | + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" | ||
1902 | + }, | ||
1903 | + "dist": { | ||
1904 | + "type": "zip", | ||
1905 | + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", | ||
1906 | + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", | ||
1907 | + "shasum": "" | ||
1908 | + }, | ||
1909 | + "require": { | ||
1910 | + "php": "^5.6 || ^7.0" | ||
1911 | + }, | ||
1912 | + "require-dev": { | ||
1913 | + "phpunit/phpunit": "^5.7 || ^6.0" | ||
1914 | + }, | ||
1915 | + "type": "library", | ||
1916 | + "extra": { | ||
1917 | + "branch-alias": { | ||
1918 | + "dev-master": "1.0.x-dev" | ||
1919 | + } | ||
1920 | + }, | ||
1921 | + "autoload": { | ||
1922 | + "classmap": [ | ||
1923 | + "src/" | ||
1924 | + ] | ||
1925 | + }, | ||
1926 | + "notification-url": "https://packagist.org/downloads/", | ||
1927 | + "license": [ | ||
1928 | + "BSD-3-Clause" | ||
1929 | + ], | ||
1930 | + "authors": [ | ||
1931 | + { | ||
1932 | + "name": "Sebastian Bergmann", | ||
1933 | + "email": "sebastian@phpunit.de" | ||
1934 | + } | ||
1935 | + ], | ||
1936 | + "description": "Looks up which function or method a line of code belongs to", | ||
1937 | + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", | ||
1938 | + "time": "2017-03-04T06:30:41+00:00" | ||
1939 | + }, | ||
1940 | + { | ||
1941 | + "name": "sebastian/comparator", | ||
1942 | + "version": "2.1.3", | ||
1943 | + "source": { | ||
1944 | + "type": "git", | ||
1945 | + "url": "https://github.com/sebastianbergmann/comparator.git", | ||
1946 | + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" | ||
1947 | + }, | ||
1948 | + "dist": { | ||
1949 | + "type": "zip", | ||
1950 | + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", | ||
1951 | + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", | ||
1952 | + "shasum": "" | ||
1953 | + }, | ||
1954 | + "require": { | ||
1955 | + "php": "^7.0", | ||
1956 | + "sebastian/diff": "^2.0 || ^3.0", | ||
1957 | + "sebastian/exporter": "^3.1" | ||
1958 | + }, | ||
1959 | + "require-dev": { | ||
1960 | + "phpunit/phpunit": "^6.4" | ||
1961 | + }, | ||
1962 | + "type": "library", | ||
1963 | + "extra": { | ||
1964 | + "branch-alias": { | ||
1965 | + "dev-master": "2.1.x-dev" | ||
1966 | + } | ||
1967 | + }, | ||
1968 | + "autoload": { | ||
1969 | + "classmap": [ | ||
1970 | + "src/" | ||
1971 | + ] | ||
1972 | + }, | ||
1973 | + "notification-url": "https://packagist.org/downloads/", | ||
1974 | + "license": [ | ||
1975 | + "BSD-3-Clause" | ||
1976 | + ], | ||
1977 | + "authors": [ | ||
1978 | + { | ||
1979 | + "name": "Jeff Welch", | ||
1980 | + "email": "whatthejeff@gmail.com" | ||
1981 | + }, | ||
1982 | + { | ||
1983 | + "name": "Volker Dusch", | ||
1984 | + "email": "github@wallbash.com" | ||
1985 | + }, | ||
1986 | + { | ||
1987 | + "name": "Bernhard Schussek", | ||
1988 | + "email": "bschussek@2bepublished.at" | ||
1989 | + }, | ||
1990 | + { | ||
1991 | + "name": "Sebastian Bergmann", | ||
1992 | + "email": "sebastian@phpunit.de" | ||
1993 | + } | ||
1994 | + ], | ||
1995 | + "description": "Provides the functionality to compare PHP values for equality", | ||
1996 | + "homepage": "https://github.com/sebastianbergmann/comparator", | ||
1997 | + "keywords": [ | ||
1998 | + "comparator", | ||
1999 | + "compare", | ||
2000 | + "equality" | ||
2001 | + ], | ||
2002 | + "time": "2018-02-01T13:46:46+00:00" | ||
2003 | + }, | ||
2004 | + { | ||
2005 | + "name": "sebastian/diff", | ||
2006 | + "version": "2.0.1", | ||
2007 | + "source": { | ||
2008 | + "type": "git", | ||
2009 | + "url": "https://github.com/sebastianbergmann/diff.git", | ||
2010 | + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" | ||
2011 | + }, | ||
2012 | + "dist": { | ||
2013 | + "type": "zip", | ||
2014 | + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", | ||
2015 | + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", | ||
2016 | + "shasum": "" | ||
2017 | + }, | ||
2018 | + "require": { | ||
2019 | + "php": "^7.0" | ||
2020 | + }, | ||
2021 | + "require-dev": { | ||
2022 | + "phpunit/phpunit": "^6.2" | ||
2023 | + }, | ||
2024 | + "type": "library", | ||
2025 | + "extra": { | ||
2026 | + "branch-alias": { | ||
2027 | + "dev-master": "2.0-dev" | ||
2028 | + } | ||
2029 | + }, | ||
2030 | + "autoload": { | ||
2031 | + "classmap": [ | ||
2032 | + "src/" | ||
2033 | + ] | ||
2034 | + }, | ||
2035 | + "notification-url": "https://packagist.org/downloads/", | ||
2036 | + "license": [ | ||
2037 | + "BSD-3-Clause" | ||
2038 | + ], | ||
2039 | + "authors": [ | ||
2040 | + { | ||
2041 | + "name": "Kore Nordmann", | ||
2042 | + "email": "mail@kore-nordmann.de" | ||
2043 | + }, | ||
2044 | + { | ||
2045 | + "name": "Sebastian Bergmann", | ||
2046 | + "email": "sebastian@phpunit.de" | ||
2047 | + } | ||
2048 | + ], | ||
2049 | + "description": "Diff implementation", | ||
2050 | + "homepage": "https://github.com/sebastianbergmann/diff", | ||
2051 | + "keywords": [ | ||
2052 | + "diff" | ||
2053 | + ], | ||
2054 | + "time": "2017-08-03T08:09:46+00:00" | ||
2055 | + }, | ||
2056 | + { | ||
2057 | + "name": "sebastian/environment", | ||
2058 | + "version": "3.1.0", | ||
2059 | + "source": { | ||
2060 | + "type": "git", | ||
2061 | + "url": "https://github.com/sebastianbergmann/environment.git", | ||
2062 | + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" | ||
2063 | + }, | ||
2064 | + "dist": { | ||
2065 | + "type": "zip", | ||
2066 | + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", | ||
2067 | + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", | ||
2068 | + "shasum": "" | ||
2069 | + }, | ||
2070 | + "require": { | ||
2071 | + "php": "^7.0" | ||
2072 | + }, | ||
2073 | + "require-dev": { | ||
2074 | + "phpunit/phpunit": "^6.1" | ||
2075 | + }, | ||
2076 | + "type": "library", | ||
2077 | + "extra": { | ||
2078 | + "branch-alias": { | ||
2079 | + "dev-master": "3.1.x-dev" | ||
2080 | + } | ||
2081 | + }, | ||
2082 | + "autoload": { | ||
2083 | + "classmap": [ | ||
2084 | + "src/" | ||
2085 | + ] | ||
2086 | + }, | ||
2087 | + "notification-url": "https://packagist.org/downloads/", | ||
2088 | + "license": [ | ||
2089 | + "BSD-3-Clause" | ||
2090 | + ], | ||
2091 | + "authors": [ | ||
2092 | + { | ||
2093 | + "name": "Sebastian Bergmann", | ||
2094 | + "email": "sebastian@phpunit.de" | ||
2095 | + } | ||
2096 | + ], | ||
2097 | + "description": "Provides functionality to handle HHVM/PHP environments", | ||
2098 | + "homepage": "http://www.github.com/sebastianbergmann/environment", | ||
2099 | + "keywords": [ | ||
2100 | + "Xdebug", | ||
2101 | + "environment", | ||
2102 | + "hhvm" | ||
2103 | + ], | ||
2104 | + "time": "2017-07-01T08:51:00+00:00" | ||
2105 | + }, | ||
2106 | + { | ||
2107 | + "name": "sebastian/exporter", | ||
2108 | + "version": "3.1.0", | ||
2109 | + "source": { | ||
2110 | + "type": "git", | ||
2111 | + "url": "https://github.com/sebastianbergmann/exporter.git", | ||
2112 | + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" | ||
2113 | + }, | ||
2114 | + "dist": { | ||
2115 | + "type": "zip", | ||
2116 | + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", | ||
2117 | + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", | ||
2118 | + "shasum": "" | ||
2119 | + }, | ||
2120 | + "require": { | ||
2121 | + "php": "^7.0", | ||
2122 | + "sebastian/recursion-context": "^3.0" | ||
2123 | + }, | ||
2124 | + "require-dev": { | ||
2125 | + "ext-mbstring": "*", | ||
2126 | + "phpunit/phpunit": "^6.0" | ||
2127 | + }, | ||
2128 | + "type": "library", | ||
2129 | + "extra": { | ||
2130 | + "branch-alias": { | ||
2131 | + "dev-master": "3.1.x-dev" | ||
2132 | + } | ||
2133 | + }, | ||
2134 | + "autoload": { | ||
2135 | + "classmap": [ | ||
2136 | + "src/" | ||
2137 | + ] | ||
2138 | + }, | ||
2139 | + "notification-url": "https://packagist.org/downloads/", | ||
2140 | + "license": [ | ||
2141 | + "BSD-3-Clause" | ||
2142 | + ], | ||
2143 | + "authors": [ | ||
2144 | + { | ||
2145 | + "name": "Jeff Welch", | ||
2146 | + "email": "whatthejeff@gmail.com" | ||
2147 | + }, | ||
2148 | + { | ||
2149 | + "name": "Volker Dusch", | ||
2150 | + "email": "github@wallbash.com" | ||
2151 | + }, | ||
2152 | + { | ||
2153 | + "name": "Bernhard Schussek", | ||
2154 | + "email": "bschussek@2bepublished.at" | ||
2155 | + }, | ||
2156 | + { | ||
2157 | + "name": "Sebastian Bergmann", | ||
2158 | + "email": "sebastian@phpunit.de" | ||
2159 | + }, | ||
2160 | + { | ||
2161 | + "name": "Adam Harvey", | ||
2162 | + "email": "aharvey@php.net" | ||
2163 | + } | ||
2164 | + ], | ||
2165 | + "description": "Provides the functionality to export PHP variables for visualization", | ||
2166 | + "homepage": "http://www.github.com/sebastianbergmann/exporter", | ||
2167 | + "keywords": [ | ||
2168 | + "export", | ||
2169 | + "exporter" | ||
2170 | + ], | ||
2171 | + "time": "2017-04-03T13:19:02+00:00" | ||
2172 | + }, | ||
2173 | + { | ||
2174 | + "name": "sebastian/global-state", | ||
2175 | + "version": "2.0.0", | ||
2176 | + "source": { | ||
2177 | + "type": "git", | ||
2178 | + "url": "https://github.com/sebastianbergmann/global-state.git", | ||
2179 | + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" | ||
2180 | + }, | ||
2181 | + "dist": { | ||
2182 | + "type": "zip", | ||
2183 | + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", | ||
2184 | + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", | ||
2185 | + "shasum": "" | ||
2186 | + }, | ||
2187 | + "require": { | ||
2188 | + "php": "^7.0" | ||
2189 | + }, | ||
2190 | + "require-dev": { | ||
2191 | + "phpunit/phpunit": "^6.0" | ||
2192 | + }, | ||
2193 | + "suggest": { | ||
2194 | + "ext-uopz": "*" | ||
2195 | + }, | ||
2196 | + "type": "library", | ||
2197 | + "extra": { | ||
2198 | + "branch-alias": { | ||
2199 | + "dev-master": "2.0-dev" | ||
2200 | + } | ||
2201 | + }, | ||
2202 | + "autoload": { | ||
2203 | + "classmap": [ | ||
2204 | + "src/" | ||
2205 | + ] | ||
2206 | + }, | ||
2207 | + "notification-url": "https://packagist.org/downloads/", | ||
2208 | + "license": [ | ||
2209 | + "BSD-3-Clause" | ||
2210 | + ], | ||
2211 | + "authors": [ | ||
2212 | + { | ||
2213 | + "name": "Sebastian Bergmann", | ||
2214 | + "email": "sebastian@phpunit.de" | ||
2215 | + } | ||
2216 | + ], | ||
2217 | + "description": "Snapshotting of global state", | ||
2218 | + "homepage": "http://www.github.com/sebastianbergmann/global-state", | ||
2219 | + "keywords": [ | ||
2220 | + "global state" | ||
2221 | + ], | ||
2222 | + "time": "2017-04-27T15:39:26+00:00" | ||
2223 | + }, | ||
2224 | + { | ||
2225 | + "name": "sebastian/object-enumerator", | ||
2226 | + "version": "3.0.3", | ||
2227 | + "source": { | ||
2228 | + "type": "git", | ||
2229 | + "url": "https://github.com/sebastianbergmann/object-enumerator.git", | ||
2230 | + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" | ||
2231 | + }, | ||
2232 | + "dist": { | ||
2233 | + "type": "zip", | ||
2234 | + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", | ||
2235 | + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", | ||
2236 | + "shasum": "" | ||
2237 | + }, | ||
2238 | + "require": { | ||
2239 | + "php": "^7.0", | ||
2240 | + "sebastian/object-reflector": "^1.1.1", | ||
2241 | + "sebastian/recursion-context": "^3.0" | ||
2242 | + }, | ||
2243 | + "require-dev": { | ||
2244 | + "phpunit/phpunit": "^6.0" | ||
2245 | + }, | ||
2246 | + "type": "library", | ||
2247 | + "extra": { | ||
2248 | + "branch-alias": { | ||
2249 | + "dev-master": "3.0.x-dev" | ||
2250 | + } | ||
2251 | + }, | ||
2252 | + "autoload": { | ||
2253 | + "classmap": [ | ||
2254 | + "src/" | ||
2255 | + ] | ||
2256 | + }, | ||
2257 | + "notification-url": "https://packagist.org/downloads/", | ||
2258 | + "license": [ | ||
2259 | + "BSD-3-Clause" | ||
2260 | + ], | ||
2261 | + "authors": [ | ||
2262 | + { | ||
2263 | + "name": "Sebastian Bergmann", | ||
2264 | + "email": "sebastian@phpunit.de" | ||
2265 | + } | ||
2266 | + ], | ||
2267 | + "description": "Traverses array structures and object graphs to enumerate all referenced objects", | ||
2268 | + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", | ||
2269 | + "time": "2017-08-03T12:35:26+00:00" | ||
2270 | + }, | ||
2271 | + { | ||
2272 | + "name": "sebastian/object-reflector", | ||
2273 | + "version": "1.1.1", | ||
2274 | + "source": { | ||
2275 | + "type": "git", | ||
2276 | + "url": "https://github.com/sebastianbergmann/object-reflector.git", | ||
2277 | + "reference": "773f97c67f28de00d397be301821b06708fca0be" | ||
2278 | + }, | ||
2279 | + "dist": { | ||
2280 | + "type": "zip", | ||
2281 | + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", | ||
2282 | + "reference": "773f97c67f28de00d397be301821b06708fca0be", | ||
2283 | + "shasum": "" | ||
2284 | + }, | ||
2285 | + "require": { | ||
2286 | + "php": "^7.0" | ||
2287 | + }, | ||
2288 | + "require-dev": { | ||
2289 | + "phpunit/phpunit": "^6.0" | ||
2290 | + }, | ||
2291 | + "type": "library", | ||
2292 | + "extra": { | ||
2293 | + "branch-alias": { | ||
2294 | + "dev-master": "1.1-dev" | ||
2295 | + } | ||
2296 | + }, | ||
2297 | + "autoload": { | ||
2298 | + "classmap": [ | ||
2299 | + "src/" | ||
2300 | + ] | ||
2301 | + }, | ||
2302 | + "notification-url": "https://packagist.org/downloads/", | ||
2303 | + "license": [ | ||
2304 | + "BSD-3-Clause" | ||
2305 | + ], | ||
2306 | + "authors": [ | ||
2307 | + { | ||
2308 | + "name": "Sebastian Bergmann", | ||
2309 | + "email": "sebastian@phpunit.de" | ||
2310 | + } | ||
2311 | + ], | ||
2312 | + "description": "Allows reflection of object attributes, including inherited and non-public ones", | ||
2313 | + "homepage": "https://github.com/sebastianbergmann/object-reflector/", | ||
2314 | + "time": "2017-03-29T09:07:27+00:00" | ||
2315 | + }, | ||
2316 | + { | ||
2317 | + "name": "sebastian/recursion-context", | ||
2318 | + "version": "3.0.0", | ||
2319 | + "source": { | ||
2320 | + "type": "git", | ||
2321 | + "url": "https://github.com/sebastianbergmann/recursion-context.git", | ||
2322 | + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" | ||
2323 | + }, | ||
2324 | + "dist": { | ||
2325 | + "type": "zip", | ||
2326 | + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", | ||
2327 | + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", | ||
2328 | + "shasum": "" | ||
2329 | + }, | ||
2330 | + "require": { | ||
2331 | + "php": "^7.0" | ||
2332 | + }, | ||
2333 | + "require-dev": { | ||
2334 | + "phpunit/phpunit": "^6.0" | ||
2335 | + }, | ||
2336 | + "type": "library", | ||
2337 | + "extra": { | ||
2338 | + "branch-alias": { | ||
2339 | + "dev-master": "3.0.x-dev" | ||
2340 | + } | ||
2341 | + }, | ||
2342 | + "autoload": { | ||
2343 | + "classmap": [ | ||
2344 | + "src/" | ||
2345 | + ] | ||
2346 | + }, | ||
2347 | + "notification-url": "https://packagist.org/downloads/", | ||
2348 | + "license": [ | ||
2349 | + "BSD-3-Clause" | ||
2350 | + ], | ||
2351 | + "authors": [ | ||
2352 | + { | ||
2353 | + "name": "Jeff Welch", | ||
2354 | + "email": "whatthejeff@gmail.com" | ||
2355 | + }, | ||
2356 | + { | ||
2357 | + "name": "Sebastian Bergmann", | ||
2358 | + "email": "sebastian@phpunit.de" | ||
2359 | + }, | ||
2360 | + { | ||
2361 | + "name": "Adam Harvey", | ||
2362 | + "email": "aharvey@php.net" | ||
2363 | + } | ||
2364 | + ], | ||
2365 | + "description": "Provides functionality to recursively process PHP variables", | ||
2366 | + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", | ||
2367 | + "time": "2017-03-03T06:23:57+00:00" | ||
2368 | + }, | ||
2369 | + { | ||
2370 | + "name": "sebastian/resource-operations", | ||
2371 | + "version": "1.0.0", | ||
2372 | + "source": { | ||
2373 | + "type": "git", | ||
2374 | + "url": "https://github.com/sebastianbergmann/resource-operations.git", | ||
2375 | + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" | ||
2376 | + }, | ||
2377 | + "dist": { | ||
2378 | + "type": "zip", | ||
2379 | + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", | ||
2380 | + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", | ||
2381 | + "shasum": "" | ||
2382 | + }, | ||
2383 | + "require": { | ||
2384 | + "php": ">=5.6.0" | ||
2385 | + }, | ||
2386 | + "type": "library", | ||
2387 | + "extra": { | ||
2388 | + "branch-alias": { | ||
2389 | + "dev-master": "1.0.x-dev" | ||
2390 | + } | ||
2391 | + }, | ||
2392 | + "autoload": { | ||
2393 | + "classmap": [ | ||
2394 | + "src/" | ||
2395 | + ] | ||
2396 | + }, | ||
2397 | + "notification-url": "https://packagist.org/downloads/", | ||
2398 | + "license": [ | ||
2399 | + "BSD-3-Clause" | ||
2400 | + ], | ||
2401 | + "authors": [ | ||
2402 | + { | ||
2403 | + "name": "Sebastian Bergmann", | ||
2404 | + "email": "sebastian@phpunit.de" | ||
2405 | + } | ||
2406 | + ], | ||
2407 | + "description": "Provides a list of PHP built-in functions that operate on resources", | ||
2408 | + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", | ||
2409 | + "time": "2015-07-28T20:34:47+00:00" | ||
2410 | + }, | ||
2411 | + { | ||
2412 | + "name": "sebastian/version", | ||
2413 | + "version": "2.0.1", | ||
2414 | + "source": { | ||
2415 | + "type": "git", | ||
2416 | + "url": "https://github.com/sebastianbergmann/version.git", | ||
2417 | + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" | ||
2418 | + }, | ||
2419 | + "dist": { | ||
2420 | + "type": "zip", | ||
2421 | + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", | ||
2422 | + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", | ||
2423 | + "shasum": "" | ||
2424 | + }, | ||
2425 | + "require": { | ||
2426 | + "php": ">=5.6" | ||
2427 | + }, | ||
2428 | + "type": "library", | ||
2429 | + "extra": { | ||
2430 | + "branch-alias": { | ||
2431 | + "dev-master": "2.0.x-dev" | ||
2432 | + } | ||
2433 | + }, | ||
2434 | + "autoload": { | ||
2435 | + "classmap": [ | ||
2436 | + "src/" | ||
2437 | + ] | ||
2438 | + }, | ||
2439 | + "notification-url": "https://packagist.org/downloads/", | ||
2440 | + "license": [ | ||
2441 | + "BSD-3-Clause" | ||
2442 | + ], | ||
2443 | + "authors": [ | ||
2444 | + { | ||
2445 | + "name": "Sebastian Bergmann", | ||
2446 | + "email": "sebastian@phpunit.de", | ||
2447 | + "role": "lead" | ||
2448 | + } | ||
2449 | + ], | ||
2450 | + "description": "Library that helps with managing the version number of Git-hosted PHP projects", | ||
2451 | + "homepage": "https://github.com/sebastianbergmann/version", | ||
2452 | + "time": "2016-10-03T07:35:21+00:00" | ||
2453 | + }, | ||
2454 | + { | ||
2455 | + "name": "symfony/browser-kit", | ||
2456 | + "version": "v4.0.4", | ||
2457 | + "source": { | ||
2458 | + "type": "git", | ||
2459 | + "url": "https://github.com/symfony/browser-kit.git", | ||
2460 | + "reference": "fee0fcd501304b1c3190f6293f650cceb738a353" | ||
2461 | + }, | ||
2462 | + "dist": { | ||
2463 | + "type": "zip", | ||
2464 | + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/fee0fcd501304b1c3190f6293f650cceb738a353", | ||
2465 | + "reference": "fee0fcd501304b1c3190f6293f650cceb738a353", | ||
2466 | + "shasum": "" | ||
2467 | + }, | ||
2468 | + "require": { | ||
2469 | + "php": "^7.1.3", | ||
2470 | + "symfony/dom-crawler": "~3.4|~4.0" | ||
2471 | + }, | ||
2472 | + "require-dev": { | ||
2473 | + "symfony/css-selector": "~3.4|~4.0", | ||
2474 | + "symfony/process": "~3.4|~4.0" | ||
2475 | + }, | ||
2476 | + "suggest": { | ||
2477 | + "symfony/process": "" | ||
2478 | + }, | ||
2479 | + "type": "library", | ||
2480 | + "extra": { | ||
2481 | + "branch-alias": { | ||
2482 | + "dev-master": "4.0-dev" | ||
2483 | + } | ||
2484 | + }, | ||
2485 | + "autoload": { | ||
2486 | + "psr-4": { | ||
2487 | + "Symfony\\Component\\BrowserKit\\": "" | ||
2488 | + }, | ||
2489 | + "exclude-from-classmap": [ | ||
2490 | + "/Tests/" | ||
2491 | + ] | ||
2492 | + }, | ||
2493 | + "notification-url": "https://packagist.org/downloads/", | ||
2494 | + "license": [ | ||
2495 | + "MIT" | ||
2496 | + ], | ||
2497 | + "authors": [ | ||
2498 | + { | ||
2499 | + "name": "Fabien Potencier", | ||
2500 | + "email": "fabien@symfony.com" | ||
2501 | + }, | ||
2502 | + { | ||
2503 | + "name": "Symfony Community", | ||
2504 | + "homepage": "https://symfony.com/contributors" | ||
2505 | + } | ||
2506 | + ], | ||
2507 | + "description": "Symfony BrowserKit Component", | ||
2508 | + "homepage": "https://symfony.com", | ||
2509 | + "time": "2018-01-03T07:38:00+00:00" | ||
2510 | + }, | ||
2511 | + { | ||
2512 | + "name": "symfony/console", | ||
2513 | + "version": "v4.0.4", | ||
2514 | + "source": { | ||
2515 | + "type": "git", | ||
2516 | + "url": "https://github.com/symfony/console.git", | ||
2517 | + "reference": "36d5b41e7d4e1ccf0370f6babe966c08ef0a1488" | ||
2518 | + }, | ||
2519 | + "dist": { | ||
2520 | + "type": "zip", | ||
2521 | + "url": "https://api.github.com/repos/symfony/console/zipball/36d5b41e7d4e1ccf0370f6babe966c08ef0a1488", | ||
2522 | + "reference": "36d5b41e7d4e1ccf0370f6babe966c08ef0a1488", | ||
2523 | + "shasum": "" | ||
2524 | + }, | ||
2525 | + "require": { | ||
2526 | + "php": "^7.1.3", | ||
2527 | + "symfony/polyfill-mbstring": "~1.0" | ||
2528 | + }, | ||
2529 | + "conflict": { | ||
2530 | + "symfony/dependency-injection": "<3.4", | ||
2531 | + "symfony/process": "<3.3" | ||
2532 | + }, | ||
2533 | + "require-dev": { | ||
2534 | + "psr/log": "~1.0", | ||
2535 | + "symfony/config": "~3.4|~4.0", | ||
2536 | + "symfony/dependency-injection": "~3.4|~4.0", | ||
2537 | + "symfony/event-dispatcher": "~3.4|~4.0", | ||
2538 | + "symfony/lock": "~3.4|~4.0", | ||
2539 | + "symfony/process": "~3.4|~4.0" | ||
2540 | + }, | ||
2541 | + "suggest": { | ||
2542 | + "psr/log": "For using the console logger", | ||
2543 | + "symfony/event-dispatcher": "", | ||
2544 | + "symfony/lock": "", | ||
2545 | + "symfony/process": "" | ||
2546 | + }, | ||
2547 | + "type": "library", | ||
2548 | + "extra": { | ||
2549 | + "branch-alias": { | ||
2550 | + "dev-master": "4.0-dev" | ||
2551 | + } | ||
2552 | + }, | ||
2553 | + "autoload": { | ||
2554 | + "psr-4": { | ||
2555 | + "Symfony\\Component\\Console\\": "" | ||
2556 | + }, | ||
2557 | + "exclude-from-classmap": [ | ||
2558 | + "/Tests/" | ||
2559 | + ] | ||
2560 | + }, | ||
2561 | + "notification-url": "https://packagist.org/downloads/", | ||
2562 | + "license": [ | ||
2563 | + "MIT" | ||
2564 | + ], | ||
2565 | + "authors": [ | ||
2566 | + { | ||
2567 | + "name": "Fabien Potencier", | ||
2568 | + "email": "fabien@symfony.com" | ||
2569 | + }, | ||
2570 | + { | ||
2571 | + "name": "Symfony Community", | ||
2572 | + "homepage": "https://symfony.com/contributors" | ||
2573 | + } | ||
2574 | + ], | ||
2575 | + "description": "Symfony Console Component", | ||
2576 | + "homepage": "https://symfony.com", | ||
2577 | + "time": "2018-01-29T09:06:29+00:00" | ||
2578 | + }, | ||
2579 | + { | ||
2580 | + "name": "symfony/css-selector", | ||
2581 | + "version": "v4.0.4", | ||
2582 | + "source": { | ||
2583 | + "type": "git", | ||
2584 | + "url": "https://github.com/symfony/css-selector.git", | ||
2585 | + "reference": "f97600434e3141ef3cbb9ea42cf500fba88022b7" | ||
2586 | + }, | ||
2587 | + "dist": { | ||
2588 | + "type": "zip", | ||
2589 | + "url": "https://api.github.com/repos/symfony/css-selector/zipball/f97600434e3141ef3cbb9ea42cf500fba88022b7", | ||
2590 | + "reference": "f97600434e3141ef3cbb9ea42cf500fba88022b7", | ||
2591 | + "shasum": "" | ||
2592 | + }, | ||
2593 | + "require": { | ||
2594 | + "php": "^7.1.3" | ||
2595 | + }, | ||
2596 | + "type": "library", | ||
2597 | + "extra": { | ||
2598 | + "branch-alias": { | ||
2599 | + "dev-master": "4.0-dev" | ||
2600 | + } | ||
2601 | + }, | ||
2602 | + "autoload": { | ||
2603 | + "psr-4": { | ||
2604 | + "Symfony\\Component\\CssSelector\\": "" | ||
2605 | + }, | ||
2606 | + "exclude-from-classmap": [ | ||
2607 | + "/Tests/" | ||
2608 | + ] | ||
2609 | + }, | ||
2610 | + "notification-url": "https://packagist.org/downloads/", | ||
2611 | + "license": [ | ||
2612 | + "MIT" | ||
2613 | + ], | ||
2614 | + "authors": [ | ||
2615 | + { | ||
2616 | + "name": "Jean-François Simon", | ||
2617 | + "email": "jeanfrancois.simon@sensiolabs.com" | ||
2618 | + }, | ||
2619 | + { | ||
2620 | + "name": "Fabien Potencier", | ||
2621 | + "email": "fabien@symfony.com" | ||
2622 | + }, | ||
2623 | + { | ||
2624 | + "name": "Symfony Community", | ||
2625 | + "homepage": "https://symfony.com/contributors" | ||
2626 | + } | ||
2627 | + ], | ||
2628 | + "description": "Symfony CssSelector Component", | ||
2629 | + "homepage": "https://symfony.com", | ||
2630 | + "time": "2018-01-03T07:38:00+00:00" | ||
2631 | + }, | ||
2632 | + { | ||
2633 | + "name": "symfony/dom-crawler", | ||
2634 | + "version": "v4.0.4", | ||
2635 | + "source": { | ||
2636 | + "type": "git", | ||
2637 | + "url": "https://github.com/symfony/dom-crawler.git", | ||
2638 | + "reference": "39b785e1cf28e9f21bb601a5d62c4992a8e8a290" | ||
2639 | + }, | ||
2640 | + "dist": { | ||
2641 | + "type": "zip", | ||
2642 | + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/39b785e1cf28e9f21bb601a5d62c4992a8e8a290", | ||
2643 | + "reference": "39b785e1cf28e9f21bb601a5d62c4992a8e8a290", | ||
2644 | + "shasum": "" | ||
2645 | + }, | ||
2646 | + "require": { | ||
2647 | + "php": "^7.1.3", | ||
2648 | + "symfony/polyfill-mbstring": "~1.0" | ||
2649 | + }, | ||
2650 | + "require-dev": { | ||
2651 | + "symfony/css-selector": "~3.4|~4.0" | ||
2652 | + }, | ||
2653 | + "suggest": { | ||
2654 | + "symfony/css-selector": "" | ||
2655 | + }, | ||
2656 | + "type": "library", | ||
2657 | + "extra": { | ||
2658 | + "branch-alias": { | ||
2659 | + "dev-master": "4.0-dev" | ||
2660 | + } | ||
2661 | + }, | ||
2662 | + "autoload": { | ||
2663 | + "psr-4": { | ||
2664 | + "Symfony\\Component\\DomCrawler\\": "" | ||
2665 | + }, | ||
2666 | + "exclude-from-classmap": [ | ||
2667 | + "/Tests/" | ||
2668 | + ] | ||
2669 | + }, | ||
2670 | + "notification-url": "https://packagist.org/downloads/", | ||
2671 | + "license": [ | ||
2672 | + "MIT" | ||
2673 | + ], | ||
2674 | + "authors": [ | ||
2675 | + { | ||
2676 | + "name": "Fabien Potencier", | ||
2677 | + "email": "fabien@symfony.com" | ||
2678 | + }, | ||
2679 | + { | ||
2680 | + "name": "Symfony Community", | ||
2681 | + "homepage": "https://symfony.com/contributors" | ||
2682 | + } | ||
2683 | + ], | ||
2684 | + "description": "Symfony DomCrawler Component", | ||
2685 | + "homepage": "https://symfony.com", | ||
2686 | + "time": "2018-01-03T07:38:00+00:00" | ||
2687 | + }, | ||
2688 | + { | ||
2689 | + "name": "symfony/event-dispatcher", | ||
2690 | + "version": "v4.0.4", | ||
2691 | + "source": { | ||
2692 | + "type": "git", | ||
2693 | + "url": "https://github.com/symfony/event-dispatcher.git", | ||
2694 | + "reference": "74d33aac36208c4d6757807d9f598f0133a3a4eb" | ||
2695 | + }, | ||
2696 | + "dist": { | ||
2697 | + "type": "zip", | ||
2698 | + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/74d33aac36208c4d6757807d9f598f0133a3a4eb", | ||
2699 | + "reference": "74d33aac36208c4d6757807d9f598f0133a3a4eb", | ||
2700 | + "shasum": "" | ||
2701 | + }, | ||
2702 | + "require": { | ||
2703 | + "php": "^7.1.3" | ||
2704 | + }, | ||
2705 | + "conflict": { | ||
2706 | + "symfony/dependency-injection": "<3.4" | ||
2707 | + }, | ||
2708 | + "require-dev": { | ||
2709 | + "psr/log": "~1.0", | ||
2710 | + "symfony/config": "~3.4|~4.0", | ||
2711 | + "symfony/dependency-injection": "~3.4|~4.0", | ||
2712 | + "symfony/expression-language": "~3.4|~4.0", | ||
2713 | + "symfony/stopwatch": "~3.4|~4.0" | ||
2714 | + }, | ||
2715 | + "suggest": { | ||
2716 | + "symfony/dependency-injection": "", | ||
2717 | + "symfony/http-kernel": "" | ||
2718 | + }, | ||
2719 | + "type": "library", | ||
2720 | + "extra": { | ||
2721 | + "branch-alias": { | ||
2722 | + "dev-master": "4.0-dev" | ||
2723 | + } | ||
2724 | + }, | ||
2725 | + "autoload": { | ||
2726 | + "psr-4": { | ||
2727 | + "Symfony\\Component\\EventDispatcher\\": "" | ||
2728 | + }, | ||
2729 | + "exclude-from-classmap": [ | ||
2730 | + "/Tests/" | ||
2731 | + ] | ||
2732 | + }, | ||
2733 | + "notification-url": "https://packagist.org/downloads/", | ||
2734 | + "license": [ | ||
2735 | + "MIT" | ||
2736 | + ], | ||
2737 | + "authors": [ | ||
2738 | + { | ||
2739 | + "name": "Fabien Potencier", | ||
2740 | + "email": "fabien@symfony.com" | ||
2741 | + }, | ||
2742 | + { | ||
2743 | + "name": "Symfony Community", | ||
2744 | + "homepage": "https://symfony.com/contributors" | ||
2745 | + } | ||
2746 | + ], | ||
2747 | + "description": "Symfony EventDispatcher Component", | ||
2748 | + "homepage": "https://symfony.com", | ||
2749 | + "time": "2018-01-03T07:38:00+00:00" | ||
2750 | + }, | ||
2751 | + { | ||
2752 | + "name": "symfony/finder", | ||
2753 | + "version": "v4.0.4", | ||
2754 | + "source": { | ||
2755 | + "type": "git", | ||
2756 | + "url": "https://github.com/symfony/finder.git", | ||
2757 | + "reference": "8b08180f2b7ccb41062366b9ad91fbc4f1af8601" | ||
2758 | + }, | ||
2759 | + "dist": { | ||
2760 | + "type": "zip", | ||
2761 | + "url": "https://api.github.com/repos/symfony/finder/zipball/8b08180f2b7ccb41062366b9ad91fbc4f1af8601", | ||
2762 | + "reference": "8b08180f2b7ccb41062366b9ad91fbc4f1af8601", | ||
2763 | + "shasum": "" | ||
2764 | + }, | ||
2765 | + "require": { | ||
2766 | + "php": "^7.1.3" | ||
2767 | + }, | ||
2768 | + "type": "library", | ||
2769 | + "extra": { | ||
2770 | + "branch-alias": { | ||
2771 | + "dev-master": "4.0-dev" | ||
2772 | + } | ||
2773 | + }, | ||
2774 | + "autoload": { | ||
2775 | + "psr-4": { | ||
2776 | + "Symfony\\Component\\Finder\\": "" | ||
2777 | + }, | ||
2778 | + "exclude-from-classmap": [ | ||
2779 | + "/Tests/" | ||
2780 | + ] | ||
2781 | + }, | ||
2782 | + "notification-url": "https://packagist.org/downloads/", | ||
2783 | + "license": [ | ||
2784 | + "MIT" | ||
2785 | + ], | ||
2786 | + "authors": [ | ||
2787 | + { | ||
2788 | + "name": "Fabien Potencier", | ||
2789 | + "email": "fabien@symfony.com" | ||
2790 | + }, | ||
2791 | + { | ||
2792 | + "name": "Symfony Community", | ||
2793 | + "homepage": "https://symfony.com/contributors" | ||
2794 | + } | ||
2795 | + ], | ||
2796 | + "description": "Symfony Finder Component", | ||
2797 | + "homepage": "https://symfony.com", | ||
2798 | + "time": "2018-01-03T07:38:00+00:00" | ||
2799 | + }, | ||
2800 | + { | ||
2801 | + "name": "symfony/polyfill-mbstring", | ||
2802 | + "version": "v1.7.0", | ||
2803 | + "source": { | ||
2804 | + "type": "git", | ||
2805 | + "url": "https://github.com/symfony/polyfill-mbstring.git", | ||
2806 | + "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" | ||
2807 | + }, | ||
2808 | + "dist": { | ||
2809 | + "type": "zip", | ||
2810 | + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", | ||
2811 | + "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", | ||
2812 | + "shasum": "" | ||
2813 | + }, | ||
2814 | + "require": { | ||
2815 | + "php": ">=5.3.3" | ||
2816 | + }, | ||
2817 | + "suggest": { | ||
2818 | + "ext-mbstring": "For best performance" | ||
2819 | + }, | ||
2820 | + "type": "library", | ||
2821 | + "extra": { | ||
2822 | + "branch-alias": { | ||
2823 | + "dev-master": "1.7-dev" | ||
2824 | + } | ||
2825 | + }, | ||
2826 | + "autoload": { | ||
2827 | + "psr-4": { | ||
2828 | + "Symfony\\Polyfill\\Mbstring\\": "" | ||
2829 | + }, | ||
2830 | + "files": [ | ||
2831 | + "bootstrap.php" | ||
2832 | + ] | ||
2833 | + }, | ||
2834 | + "notification-url": "https://packagist.org/downloads/", | ||
2835 | + "license": [ | ||
2836 | + "MIT" | ||
2837 | + ], | ||
2838 | + "authors": [ | ||
2839 | + { | ||
2840 | + "name": "Nicolas Grekas", | ||
2841 | + "email": "p@tchwork.com" | ||
2842 | + }, | ||
2843 | + { | ||
2844 | + "name": "Symfony Community", | ||
2845 | + "homepage": "https://symfony.com/contributors" | ||
2846 | + } | ||
2847 | + ], | ||
2848 | + "description": "Symfony polyfill for the Mbstring extension", | ||
2849 | + "homepage": "https://symfony.com", | ||
2850 | + "keywords": [ | ||
2851 | + "compatibility", | ||
2852 | + "mbstring", | ||
2853 | + "polyfill", | ||
2854 | + "portable", | ||
2855 | + "shim" | ||
2856 | + ], | ||
2857 | + "time": "2018-01-30T19:27:44+00:00" | ||
2858 | + }, | ||
2859 | + { | ||
2860 | + "name": "symfony/yaml", | ||
2861 | + "version": "v4.0.4", | ||
2862 | + "source": { | ||
2863 | + "type": "git", | ||
2864 | + "url": "https://github.com/symfony/yaml.git", | ||
2865 | + "reference": "ffc60bda1d4a00ec0b32eeabf39dc017bf480028" | ||
2866 | + }, | ||
2867 | + "dist": { | ||
2868 | + "type": "zip", | ||
2869 | + "url": "https://api.github.com/repos/symfony/yaml/zipball/ffc60bda1d4a00ec0b32eeabf39dc017bf480028", | ||
2870 | + "reference": "ffc60bda1d4a00ec0b32eeabf39dc017bf480028", | ||
2871 | + "shasum": "" | ||
2872 | + }, | ||
2873 | + "require": { | ||
2874 | + "php": "^7.1.3" | ||
2875 | + }, | ||
2876 | + "conflict": { | ||
2877 | + "symfony/console": "<3.4" | ||
2878 | + }, | ||
2879 | + "require-dev": { | ||
2880 | + "symfony/console": "~3.4|~4.0" | ||
2881 | + }, | ||
2882 | + "suggest": { | ||
2883 | + "symfony/console": "For validating YAML files using the lint command" | ||
2884 | + }, | ||
2885 | + "type": "library", | ||
2886 | + "extra": { | ||
2887 | + "branch-alias": { | ||
2888 | + "dev-master": "4.0-dev" | ||
2889 | + } | ||
2890 | + }, | ||
2891 | + "autoload": { | ||
2892 | + "psr-4": { | ||
2893 | + "Symfony\\Component\\Yaml\\": "" | ||
2894 | + }, | ||
2895 | + "exclude-from-classmap": [ | ||
2896 | + "/Tests/" | ||
2897 | + ] | ||
2898 | + }, | ||
2899 | + "notification-url": "https://packagist.org/downloads/", | ||
2900 | + "license": [ | ||
2901 | + "MIT" | ||
2902 | + ], | ||
2903 | + "authors": [ | ||
2904 | + { | ||
2905 | + "name": "Fabien Potencier", | ||
2906 | + "email": "fabien@symfony.com" | ||
2907 | + }, | ||
2908 | + { | ||
2909 | + "name": "Symfony Community", | ||
2910 | + "homepage": "https://symfony.com/contributors" | ||
2911 | + } | ||
2912 | + ], | ||
2913 | + "description": "Symfony Yaml Component", | ||
2914 | + "homepage": "https://symfony.com", | ||
2915 | + "time": "2018-01-21T19:06:11+00:00" | ||
2916 | + }, | ||
2917 | + { | ||
2918 | + "name": "theseer/tokenizer", | ||
2919 | + "version": "1.1.0", | ||
2920 | + "source": { | ||
2921 | + "type": "git", | ||
2922 | + "url": "https://github.com/theseer/tokenizer.git", | ||
2923 | + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" | ||
2924 | + }, | ||
2925 | + "dist": { | ||
2926 | + "type": "zip", | ||
2927 | + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", | ||
2928 | + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", | ||
2929 | + "shasum": "" | ||
2930 | + }, | ||
2931 | + "require": { | ||
2932 | + "ext-dom": "*", | ||
2933 | + "ext-tokenizer": "*", | ||
2934 | + "ext-xmlwriter": "*", | ||
2935 | + "php": "^7.0" | ||
2936 | + }, | ||
2937 | + "type": "library", | ||
2938 | + "autoload": { | ||
2939 | + "classmap": [ | ||
2940 | + "src/" | ||
2941 | + ] | ||
2942 | + }, | ||
2943 | + "notification-url": "https://packagist.org/downloads/", | ||
2944 | + "license": [ | ||
2945 | + "BSD-3-Clause" | ||
2946 | + ], | ||
2947 | + "authors": [ | ||
2948 | + { | ||
2949 | + "name": "Arne Blankerts", | ||
2950 | + "email": "arne@blankerts.de", | ||
2951 | + "role": "Developer" | ||
2952 | + } | ||
2953 | + ], | ||
2954 | + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", | ||
2955 | + "time": "2017-04-07T12:08:54+00:00" | ||
2956 | + }, | ||
2957 | + { | ||
2958 | + "name": "webmozart/assert", | ||
2959 | + "version": "1.3.0", | ||
2960 | + "source": { | ||
2961 | + "type": "git", | ||
2962 | + "url": "https://github.com/webmozart/assert.git", | ||
2963 | + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" | ||
2964 | + }, | ||
2965 | + "dist": { | ||
2966 | + "type": "zip", | ||
2967 | + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", | ||
2968 | + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", | ||
2969 | + "shasum": "" | ||
2970 | + }, | ||
2971 | + "require": { | ||
2972 | + "php": "^5.3.3 || ^7.0" | ||
2973 | + }, | ||
2974 | + "require-dev": { | ||
2975 | + "phpunit/phpunit": "^4.6", | ||
2976 | + "sebastian/version": "^1.0.1" | ||
2977 | + }, | ||
2978 | + "type": "library", | ||
2979 | + "extra": { | ||
2980 | + "branch-alias": { | ||
2981 | + "dev-master": "1.3-dev" | ||
2982 | + } | ||
2983 | + }, | ||
2984 | + "autoload": { | ||
2985 | + "psr-4": { | ||
2986 | + "Webmozart\\Assert\\": "src/" | ||
2987 | + } | ||
2988 | + }, | ||
2989 | + "notification-url": "https://packagist.org/downloads/", | ||
2990 | + "license": [ | ||
2991 | + "MIT" | ||
2992 | + ], | ||
2993 | + "authors": [ | ||
2994 | + { | ||
2995 | + "name": "Bernhard Schussek", | ||
2996 | + "email": "bschussek@gmail.com" | ||
2997 | + } | ||
2998 | + ], | ||
2999 | + "description": "Assertions to validate method input/output with nice error messages.", | ||
3000 | + "keywords": [ | ||
3001 | + "assert", | ||
3002 | + "check", | ||
3003 | + "validate" | ||
3004 | + ], | ||
3005 | + "time": "2018-01-29T19:49:41+00:00" | ||
3006 | + }, | ||
3007 | + { | ||
3008 | + "name": "yiisoft/yii2-debug", | ||
3009 | + "version": "2.0.13", | ||
3010 | + "source": { | ||
3011 | + "type": "git", | ||
3012 | + "url": "https://github.com/yiisoft/yii2-debug.git", | ||
3013 | + "reference": "b37f414959c2fafefb332020b42037cd17c1cb7f" | ||
3014 | + }, | ||
3015 | + "dist": { | ||
3016 | + "type": "zip", | ||
3017 | + "url": "https://api.github.com/repos/yiisoft/yii2-debug/zipball/b37f414959c2fafefb332020b42037cd17c1cb7f", | ||
3018 | + "reference": "b37f414959c2fafefb332020b42037cd17c1cb7f", | ||
3019 | + "shasum": "" | ||
3020 | + }, | ||
3021 | + "require": { | ||
3022 | + "yiisoft/yii2": "~2.0.13", | ||
3023 | + "yiisoft/yii2-bootstrap": "~2.0.0" | ||
3024 | + }, | ||
3025 | + "type": "yii2-extension", | ||
3026 | + "extra": { | ||
3027 | + "branch-alias": { | ||
3028 | + "dev-master": "2.0.x-dev" | ||
3029 | + } | ||
3030 | + }, | ||
3031 | + "autoload": { | ||
3032 | + "psr-4": { | ||
3033 | + "yii\\debug\\": "" | ||
3034 | + } | ||
3035 | + }, | ||
3036 | + "notification-url": "https://packagist.org/downloads/", | ||
3037 | + "license": [ | ||
3038 | + "BSD-3-Clause" | ||
3039 | + ], | ||
3040 | + "authors": [ | ||
3041 | + { | ||
3042 | + "name": "Qiang Xue", | ||
3043 | + "email": "qiang.xue@gmail.com" | ||
3044 | + } | ||
3045 | + ], | ||
3046 | + "description": "The debugger extension for the Yii framework", | ||
3047 | + "keywords": [ | ||
3048 | + "debug", | ||
3049 | + "debugger", | ||
3050 | + "yii2" | ||
3051 | + ], | ||
3052 | + "time": "2017-12-05T07:36:23+00:00" | ||
3053 | + }, | ||
3054 | + { | ||
3055 | + "name": "yiisoft/yii2-faker", | ||
3056 | + "version": "2.0.4", | ||
3057 | + "source": { | ||
3058 | + "type": "git", | ||
3059 | + "url": "https://github.com/yiisoft/yii2-faker.git", | ||
3060 | + "reference": "3df62b1dcb272a8413f9c6e532c9d73f325ccde1" | ||
3061 | + }, | ||
3062 | + "dist": { | ||
3063 | + "type": "zip", | ||
3064 | + "url": "https://api.github.com/repos/yiisoft/yii2-faker/zipball/3df62b1dcb272a8413f9c6e532c9d73f325ccde1", | ||
3065 | + "reference": "3df62b1dcb272a8413f9c6e532c9d73f325ccde1", | ||
3066 | + "shasum": "" | ||
3067 | + }, | ||
3068 | + "require": { | ||
3069 | + "fzaninotto/faker": "~1.4", | ||
3070 | + "yiisoft/yii2": "~2.0.0" | ||
3071 | + }, | ||
3072 | + "type": "yii2-extension", | ||
3073 | + "extra": { | ||
3074 | + "branch-alias": { | ||
3075 | + "dev-master": "2.0.x-dev" | ||
3076 | + } | ||
3077 | + }, | ||
3078 | + "autoload": { | ||
3079 | + "psr-4": { | ||
3080 | + "yii\\faker\\": "" | ||
3081 | + } | ||
3082 | + }, | ||
3083 | + "notification-url": "https://packagist.org/downloads/", | ||
3084 | + "license": [ | ||
3085 | + "BSD-3-Clause" | ||
3086 | + ], | ||
3087 | + "authors": [ | ||
3088 | + { | ||
3089 | + "name": "Mark Jebri", | ||
3090 | + "email": "mark.github@yandex.ru" | ||
3091 | + } | ||
3092 | + ], | ||
3093 | + "description": "Fixture generator. The Faker integration for the Yii framework.", | ||
3094 | + "keywords": [ | ||
3095 | + "Fixture", | ||
3096 | + "faker", | ||
3097 | + "yii2" | ||
3098 | + ], | ||
3099 | + "time": "2018-02-19T20:27:10+00:00" | ||
3100 | + }, | ||
3101 | + { | ||
3102 | + "name": "yiisoft/yii2-gii", | ||
3103 | + "version": "2.0.6", | ||
3104 | + "source": { | ||
3105 | + "type": "git", | ||
3106 | + "url": "https://github.com/yiisoft/yii2-gii.git", | ||
3107 | + "reference": "db41f647d9b73702ceb6864fdfce827a72b5ce42" | ||
3108 | + }, | ||
3109 | + "dist": { | ||
3110 | + "type": "zip", | ||
3111 | + "url": "https://api.github.com/repos/yiisoft/yii2-gii/zipball/db41f647d9b73702ceb6864fdfce827a72b5ce42", | ||
3112 | + "reference": "db41f647d9b73702ceb6864fdfce827a72b5ce42", | ||
3113 | + "shasum": "" | ||
3114 | + }, | ||
3115 | + "require": { | ||
3116 | + "bower-asset/typeahead.js": "0.10.* | ~0.11.0", | ||
3117 | + "phpspec/php-diff": ">=1.0.2", | ||
3118 | + "yiisoft/yii2": "~2.0.13", | ||
3119 | + "yiisoft/yii2-bootstrap": "~2.0.0" | ||
3120 | + }, | ||
3121 | + "type": "yii2-extension", | ||
3122 | + "extra": { | ||
3123 | + "branch-alias": { | ||
3124 | + "dev-master": "2.0.x-dev" | ||
3125 | + }, | ||
3126 | + "asset-installer-paths": { | ||
3127 | + "npm-asset-library": "vendor/npm", | ||
3128 | + "bower-asset-library": "vendor/bower" | ||
3129 | + } | ||
3130 | + }, | ||
3131 | + "autoload": { | ||
3132 | + "psr-4": { | ||
3133 | + "yii\\gii\\": "" | ||
3134 | + } | ||
3135 | + }, | ||
3136 | + "notification-url": "https://packagist.org/downloads/", | ||
3137 | + "license": [ | ||
3138 | + "BSD-3-Clause" | ||
3139 | + ], | ||
3140 | + "authors": [ | ||
3141 | + { | ||
3142 | + "name": "Qiang Xue", | ||
3143 | + "email": "qiang.xue@gmail.com" | ||
3144 | + } | ||
3145 | + ], | ||
3146 | + "description": "The Gii extension for the Yii framework", | ||
3147 | + "keywords": [ | ||
3148 | + "code generator", | ||
3149 | + "gii", | ||
3150 | + "yii2" | ||
3151 | + ], | ||
3152 | + "time": "2017-12-22T23:53:06+00:00" | ||
3153 | + } | ||
3154 | + ], | ||
3155 | + "aliases": [], | ||
3156 | + "minimum-stability": "stable", | ||
3157 | + "stability-flags": [], | ||
3158 | + "prefer-stable": false, | ||
3159 | + "prefer-lowest": false, | ||
3160 | + "platform": { | ||
3161 | + "php": ">=5.4.0" | ||
3162 | + }, | ||
3163 | + "platform-dev": [] | ||
3164 | +} |
1 | +++ a/console/config/main.php | ||
1 | +<?php | ||
2 | +$params = array_merge( | ||
3 | + require __DIR__ . '/../../common/config/params.php', | ||
4 | + require __DIR__ . '/../../common/config/params-local.php', | ||
5 | + require __DIR__ . '/params.php', | ||
6 | + require __DIR__ . '/params-local.php' | ||
7 | +); | ||
8 | + | ||
9 | +return [ | ||
10 | + 'id' => 'app-console', | ||
11 | + 'basePath' => dirname(__DIR__), | ||
12 | + 'bootstrap' => ['log'], | ||
13 | + 'controllerNamespace' => 'console\controllers', | ||
14 | + 'aliases' => [ | ||
15 | + '@bower' => '@vendor/bower-asset', | ||
16 | + '@npm' => '@vendor/npm-asset', | ||
17 | + ], | ||
18 | + 'controllerMap' => [ | ||
19 | + 'fixture' => [ | ||
20 | + 'class' => 'yii\console\controllers\FixtureController', | ||
21 | + 'namespace' => 'common\fixtures', | ||
22 | + ], | ||
23 | + ], | ||
24 | + 'components' => [ | ||
25 | + 'log' => [ | ||
26 | + 'targets' => [ | ||
27 | + [ | ||
28 | + 'class' => 'yii\log\FileTarget', | ||
29 | + 'levels' => ['error', 'warning'], | ||
30 | + ], | ||
31 | + ], | ||
32 | + ], | ||
33 | + ], | ||
34 | + 'params' => $params, | ||
35 | +]; |
1 | +++ a/console/controllers/.gitkeep |
1 | +++ a/console/migrations/m130524_201442_init.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\db\Migration; | ||
4 | + | ||
5 | +class m130524_201442_init extends Migration | ||
6 | +{ | ||
7 | + public function up() | ||
8 | + { | ||
9 | + $tableOptions = null; | ||
10 | + if ($this->db->driverName === 'mysql') { | ||
11 | + // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci | ||
12 | + $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; | ||
13 | + } | ||
14 | + | ||
15 | + $this->createTable('{{%user}}', [ | ||
16 | + 'id' => $this->primaryKey(), | ||
17 | + 'username' => $this->string()->notNull()->unique(), | ||
18 | + 'auth_key' => $this->string(32)->notNull(), | ||
19 | + 'password_hash' => $this->string()->notNull(), | ||
20 | + 'password_reset_token' => $this->string()->unique(), | ||
21 | + 'email' => $this->string()->notNull()->unique(), | ||
22 | + | ||
23 | + 'status' => $this->smallInteger()->notNull()->defaultValue(10), | ||
24 | + 'created_at' => $this->integer()->notNull(), | ||
25 | + 'updated_at' => $this->integer()->notNull(), | ||
26 | + ], $tableOptions); | ||
27 | + } | ||
28 | + | ||
29 | + public function down() | ||
30 | + { | ||
31 | + $this->dropTable('{{%user}}'); | ||
32 | + } | ||
33 | +} |
console/migrations/m180220_172009_create_call_table.php
0 → 100644
1 | +++ a/console/migrations/m180220_172009_create_call_table.php | ||
1 | +<?php | ||
2 | + | ||
3 | + use yii\db\Migration; | ||
4 | + | ||
5 | + /** | ||
6 | + * Class m180203_131720_call_table | ||
7 | + */ | ||
8 | + class m180220_172009_create_call_table extends Migration | ||
9 | + { | ||
10 | + /** | ||
11 | + * @inheritdoc | ||
12 | + */ | ||
13 | + public function safeUp() | ||
14 | + { | ||
15 | + $this->createTable( | ||
16 | + 'call', | ||
17 | + [ | ||
18 | + 'id' => $this->primaryKey(), | ||
19 | + 'company' => $this->string() | ||
20 | + ->notNull(), | ||
21 | + 'calldate' => 'timestamp NOT NULL', | ||
22 | + 'callerid' => $this->string() | ||
23 | + ->notNull(), | ||
24 | + 'line' => $this->string(), | ||
25 | + 'operator' => $this->string(), | ||
26 | + 'status' => $this->string() | ||
27 | + ->notNull(), | ||
28 | + 'queue' => $this->string(), | ||
29 | + 'duration' => $this->integer() | ||
30 | + ->notNull(), | ||
31 | + 'billsec' => $this->integer() | ||
32 | + ->notNull(), | ||
33 | + 'record' => $this->string(), | ||
34 | + ] | ||
35 | + ); | ||
36 | + } | ||
37 | + | ||
38 | + /** | ||
39 | + * @inheritdoc | ||
40 | + */ | ||
41 | + public function safeDown() | ||
42 | + { | ||
43 | + $this->dropTable('call'); | ||
44 | + } | ||
45 | + } |
1 | +++ a/environments/dev/backend/config/main-local.php | ||
1 | +<?php | ||
2 | + | ||
3 | +$config = [ | ||
4 | + 'components' => [ | ||
5 | + 'request' => [ | ||
6 | + // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation | ||
7 | + 'cookieValidationKey' => '', | ||
8 | + ], | ||
9 | + ], | ||
10 | +]; | ||
11 | + | ||
12 | +if (!YII_ENV_TEST) { | ||
13 | + // configuration adjustments for 'dev' environment | ||
14 | + $config['bootstrap'][] = 'debug'; | ||
15 | + $config['modules']['debug'] = [ | ||
16 | + 'class' => 'yii\debug\Module', | ||
17 | + ]; | ||
18 | + | ||
19 | + $config['bootstrap'][] = 'gii'; | ||
20 | + $config['modules']['gii'] = [ | ||
21 | + 'class' => 'yii\gii\Module', | ||
22 | + ]; | ||
23 | +} | ||
24 | + | ||
25 | +return $config; |
1 | +++ a/environments/dev/backend/web/index-test.php | ||
1 | +<?php | ||
2 | + | ||
3 | +// NOTE: Make sure this file is not accessible when deployed to production | ||
4 | +if (!in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'])) { | ||
5 | + die('You are not allowed to access this file.'); | ||
6 | +} | ||
7 | + | ||
8 | +defined('YII_DEBUG') or define('YII_DEBUG', true); | ||
9 | +defined('YII_ENV') or define('YII_ENV', 'test'); | ||
10 | + | ||
11 | +require __DIR__ . '/../../vendor/autoload.php'; | ||
12 | +require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php'; | ||
13 | +require __DIR__ . '/../../common/config/bootstrap.php'; | ||
14 | +require __DIR__ . '/../config/bootstrap.php'; | ||
15 | + | ||
16 | +$config = require __DIR__ . '/../config/test-local.php'; | ||
17 | + | ||
18 | +(new yii\web\Application($config))->run(); |
1 | +++ a/environments/dev/backend/web/index.php | ||
1 | +<?php | ||
2 | +defined('YII_DEBUG') or define('YII_DEBUG', true); | ||
3 | +defined('YII_ENV') or define('YII_ENV', 'dev'); | ||
4 | + | ||
5 | +require __DIR__ . '/../../vendor/autoload.php'; | ||
6 | +require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php'; | ||
7 | +require __DIR__ . '/../../common/config/bootstrap.php'; | ||
8 | +require __DIR__ . '/../config/bootstrap.php'; | ||
9 | + | ||
10 | +$config = yii\helpers\ArrayHelper::merge( | ||
11 | + require __DIR__ . '/../../common/config/main.php', | ||
12 | + require __DIR__ . '/../../common/config/main-local.php', | ||
13 | + require __DIR__ . '/../config/main.php', | ||
14 | + require __DIR__ . '/../config/main-local.php' | ||
15 | +); | ||
16 | + | ||
17 | +(new yii\web\Application($config))->run(); |
1 | +++ a/environments/dev/common/config/main-local.php | ||
1 | +<?php | ||
2 | +return [ | ||
3 | + 'components' => [ | ||
4 | + 'db' => [ | ||
5 | + 'class' => 'yii\db\Connection', | ||
6 | + 'dsn' => 'mysql:host=localhost;dbname=yii2advanced', | ||
7 | + 'username' => 'root', | ||
8 | + 'password' => '', | ||
9 | + 'charset' => 'utf8', | ||
10 | + ], | ||
11 | + 'mailer' => [ | ||
12 | + 'class' => 'yii\swiftmailer\Mailer', | ||
13 | + 'viewPath' => '@common/mail', | ||
14 | + // send all mails to a file by default. You have to set | ||
15 | + // 'useFileTransport' to false and configure a transport | ||
16 | + // for the mailer to send real emails. | ||
17 | + 'useFileTransport' => true, | ||
18 | + ], | ||
19 | + ], | ||
20 | +]; |
1 | +++ a/environments/dev/common/config/test-local.php | ||
1 | +<?php | ||
2 | +return yii\helpers\ArrayHelper::merge( | ||
3 | + require __DIR__ . '/main.php', | ||
4 | + require __DIR__ . '/main-local.php', | ||
5 | + require __DIR__ . '/test.php', | ||
6 | + [ | ||
7 | + 'components' => [ | ||
8 | + 'db' => [ | ||
9 | + 'dsn' => 'mysql:host=localhost;dbname=yii2advanced_test', | ||
10 | + ] | ||
11 | + ], | ||
12 | + ] | ||
13 | +); |
1 | +++ a/environments/dev/frontend/config/main-local.php | ||
1 | +<?php | ||
2 | + | ||
3 | +$config = [ | ||
4 | + 'components' => [ | ||
5 | + 'request' => [ | ||
6 | + // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation | ||
7 | + 'cookieValidationKey' => '', | ||
8 | + ], | ||
9 | + ], | ||
10 | +]; | ||
11 | + | ||
12 | +if (!YII_ENV_TEST) { | ||
13 | + // configuration adjustments for 'dev' environment | ||
14 | + $config['bootstrap'][] = 'debug'; | ||
15 | + $config['modules']['debug'] = [ | ||
16 | + 'class' => 'yii\debug\Module', | ||
17 | + ]; | ||
18 | + | ||
19 | + $config['bootstrap'][] = 'gii'; | ||
20 | + $config['modules']['gii'] = [ | ||
21 | + 'class' => 'yii\gii\Module', | ||
22 | + ]; | ||
23 | +} | ||
24 | + | ||
25 | +return $config; |
1 | +++ a/environments/dev/frontend/web/index-test.php | ||
1 | +<?php | ||
2 | + | ||
3 | +// NOTE: Make sure this file is not accessible when deployed to production | ||
4 | +if (!in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'])) { | ||
5 | + die('You are not allowed to access this file.'); | ||
6 | +} | ||
7 | + | ||
8 | +defined('YII_DEBUG') or define('YII_DEBUG', true); | ||
9 | +defined('YII_ENV') or define('YII_ENV', 'test'); | ||
10 | + | ||
11 | +require __DIR__ . '/../../vendor/autoload.php'; | ||
12 | +require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php'; | ||
13 | +require __DIR__ . '/../../common/config/bootstrap.php'; | ||
14 | +require __DIR__ . '/../config/bootstrap.php'; | ||
15 | + | ||
16 | +$config = require __DIR__ . '/../config/test-local.php'; | ||
17 | + | ||
18 | +(new yii\web\Application($config))->run(); |
1 | +++ a/environments/dev/frontend/web/index.php | ||
1 | +<?php | ||
2 | +defined('YII_DEBUG') or define('YII_DEBUG', true); | ||
3 | +defined('YII_ENV') or define('YII_ENV', 'dev'); | ||
4 | + | ||
5 | +require __DIR__ . '/../../vendor/autoload.php'; | ||
6 | +require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php'; | ||
7 | +require __DIR__ . '/../../common/config/bootstrap.php'; | ||
8 | +require __DIR__ . '/../config/bootstrap.php'; | ||
9 | + | ||
10 | +$config = yii\helpers\ArrayHelper::merge( | ||
11 | + require __DIR__ . '/../../common/config/main.php', | ||
12 | + require __DIR__ . '/../../common/config/main-local.php', | ||
13 | + require __DIR__ . '/../config/main.php', | ||
14 | + require __DIR__ . '/../config/main-local.php' | ||
15 | +); | ||
16 | + | ||
17 | +(new yii\web\Application($config))->run(); |
1 | +++ a/environments/dev/yii | ||
1 | +#!/usr/bin/env php | ||
2 | +<?php | ||
3 | +/** | ||
4 | + * Yii console bootstrap file. | ||
5 | + */ | ||
6 | + | ||
7 | +defined('YII_DEBUG') or define('YII_DEBUG', true); | ||
8 | +defined('YII_ENV') or define('YII_ENV', 'dev'); | ||
9 | + | ||
10 | +require __DIR__ . '/vendor/autoload.php'; | ||
11 | +require __DIR__ . '/vendor/yiisoft/yii2/Yii.php'; | ||
12 | +require __DIR__ . '/common/config/bootstrap.php'; | ||
13 | +require __DIR__ . '/console/config/bootstrap.php'; | ||
14 | + | ||
15 | +$config = yii\helpers\ArrayHelper::merge( | ||
16 | + require __DIR__ . '/common/config/main.php', | ||
17 | + require __DIR__ . '/common/config/main-local.php', | ||
18 | + require __DIR__ . '/console/config/main.php', | ||
19 | + require __DIR__ . '/console/config/main-local.php' | ||
20 | +); | ||
21 | + | ||
22 | +$application = new yii\console\Application($config); | ||
23 | +$exitCode = $application->run(); | ||
24 | +exit($exitCode); |
1 | +++ a/environments/dev/yii_test | ||
1 | +#!/usr/bin/env php | ||
2 | +<?php | ||
3 | +/** | ||
4 | + * Yii console bootstrap file. | ||
5 | + */ | ||
6 | + | ||
7 | +defined('YII_DEBUG') or define('YII_DEBUG', true); | ||
8 | +defined('YII_ENV') or define('YII_ENV', 'test'); | ||
9 | + | ||
10 | +require __DIR__ . '/vendor/autoload.php'; | ||
11 | +require __DIR__ . '/vendor/yiisoft/yii2/Yii.php'; | ||
12 | +require __DIR__ . '/common/config/bootstrap.php'; | ||
13 | +require __DIR__ . '/console/config/bootstrap.php'; | ||
14 | + | ||
15 | +$config = yii\helpers\ArrayHelper::merge( | ||
16 | + require __DIR__ . '/common/config/test-local.php', | ||
17 | + require __DIR__ . '/console/config/main.php', | ||
18 | + require __DIR__ . '/console/config/main-local.php' | ||
19 | +); | ||
20 | + | ||
21 | +$application = new yii\console\Application($config); | ||
22 | +$exitCode = $application->run(); | ||
23 | +exit($exitCode); |
1 | +++ a/environments/dev/yii_test.bat | ||
1 | +@echo off | ||
2 | + | ||
3 | +rem ------------------------------------------------------------- | ||
4 | +rem Yii command line bootstrap script for Windows. | ||
5 | +rem ------------------------------------------------------------- | ||
6 | + | ||
7 | +@setlocal | ||
8 | + | ||
9 | +set YII_PATH=%~dp0 | ||
10 | + | ||
11 | +if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe | ||
12 | + | ||
13 | +"%PHP_COMMAND%" "%YII_PATH%yii_test" %* | ||
14 | + | ||
15 | +@endlocal |
1 | +++ a/environments/index.php | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * The manifest of files that are local to specific environment. | ||
4 | + * This file returns a list of environments that the application | ||
5 | + * may be installed under. The returned data must be in the following | ||
6 | + * format: | ||
7 | + * | ||
8 | + * ```php | ||
9 | + * return [ | ||
10 | + * 'environment name' => [ | ||
11 | + * 'path' => 'directory storing the local files', | ||
12 | + * 'skipFiles' => [ | ||
13 | + * // list of files that should only copied once and skipped if they already exist | ||
14 | + * ], | ||
15 | + * 'setWritable' => [ | ||
16 | + * // list of directories that should be set writable | ||
17 | + * ], | ||
18 | + * 'setExecutable' => [ | ||
19 | + * // list of files that should be set executable | ||
20 | + * ], | ||
21 | + * 'setCookieValidationKey' => [ | ||
22 | + * // list of config files that need to be inserted with automatically generated cookie validation keys | ||
23 | + * ], | ||
24 | + * 'createSymlink' => [ | ||
25 | + * // list of symlinks to be created. Keys are symlinks, and values are the targets. | ||
26 | + * ], | ||
27 | + * ], | ||
28 | + * ]; | ||
29 | + * ``` | ||
30 | + */ | ||
31 | +return [ | ||
32 | + 'Development' => [ | ||
33 | + 'path' => 'dev', | ||
34 | + 'setWritable' => [ | ||
35 | + 'backend/runtime', | ||
36 | + 'backend/web/assets', | ||
37 | + 'frontend/runtime', | ||
38 | + 'frontend/web/assets', | ||
39 | + ], | ||
40 | + 'setExecutable' => [ | ||
41 | + 'yii', | ||
42 | + 'yii_test', | ||
43 | + ], | ||
44 | + 'setCookieValidationKey' => [ | ||
45 | + 'backend/config/main-local.php', | ||
46 | + 'frontend/config/main-local.php', | ||
47 | + ], | ||
48 | + ], | ||
49 | + 'Production' => [ | ||
50 | + 'path' => 'prod', | ||
51 | + 'setWritable' => [ | ||
52 | + 'backend/runtime', | ||
53 | + 'backend/web/assets', | ||
54 | + 'frontend/runtime', | ||
55 | + 'frontend/web/assets', | ||
56 | + ], | ||
57 | + 'setExecutable' => [ | ||
58 | + 'yii', | ||
59 | + ], | ||
60 | + 'setCookieValidationKey' => [ | ||
61 | + 'backend/config/main-local.php', | ||
62 | + 'frontend/config/main-local.php', | ||
63 | + ], | ||
64 | + ], | ||
65 | +]; |
1 | +++ a/environments/prod/backend/web/index.php | ||
1 | +<?php | ||
2 | +defined('YII_DEBUG') or define('YII_DEBUG', false); | ||
3 | +defined('YII_ENV') or define('YII_ENV', 'prod'); | ||
4 | + | ||
5 | +require __DIR__ . '/../../vendor/autoload.php'; | ||
6 | +require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php'; | ||
7 | +require __DIR__ . '/../../common/config/bootstrap.php'; | ||
8 | +require __DIR__ . '/../config/bootstrap.php'; | ||
9 | + | ||
10 | +$config = yii\helpers\ArrayHelper::merge( | ||
11 | + require __DIR__ . '/../../common/config/main.php', | ||
12 | + require __DIR__ . '/../../common/config/main-local.php', | ||
13 | + require __DIR__ . '/../config/main.php', | ||
14 | + require __DIR__ . '/../config/main-local.php' | ||
15 | +); | ||
16 | + | ||
17 | +(new yii\web\Application($config))->run(); |
1 | +++ a/environments/prod/common/config/main-local.php | ||
1 | +<?php | ||
2 | +return [ | ||
3 | + 'components' => [ | ||
4 | + 'db' => [ | ||
5 | + 'class' => 'yii\db\Connection', | ||
6 | + 'dsn' => 'mysql:host=localhost;dbname=yii2advanced', | ||
7 | + 'username' => 'root', | ||
8 | + 'password' => '', | ||
9 | + 'charset' => 'utf8', | ||
10 | + ], | ||
11 | + 'mailer' => [ | ||
12 | + 'class' => 'yii\swiftmailer\Mailer', | ||
13 | + 'viewPath' => '@common/mail', | ||
14 | + ], | ||
15 | + ], | ||
16 | +]; |
1 | +++ a/environments/prod/frontend/web/index.php | ||
1 | +<?php | ||
2 | +defined('YII_DEBUG') or define('YII_DEBUG', false); | ||
3 | +defined('YII_ENV') or define('YII_ENV', 'prod'); | ||
4 | + | ||
5 | +require __DIR__ . '/../../vendor/autoload.php'; | ||
6 | +require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php'; | ||
7 | +require __DIR__ . '/../../common/config/bootstrap.php'; | ||
8 | +require __DIR__ . '/../config/bootstrap.php'; | ||
9 | + | ||
10 | +$config = yii\helpers\ArrayHelper::merge( | ||
11 | + require __DIR__ . '/../../common/config/main.php', | ||
12 | + require __DIR__ . '/../../common/config/main-local.php', | ||
13 | + require __DIR__ . '/../config/main.php', | ||
14 | + require __DIR__ . '/../config/main-local.php' | ||
15 | +); | ||
16 | + | ||
17 | +(new yii\web\Application($config))->run(); |
1 | +++ a/environments/prod/yii | ||
1 | +#!/usr/bin/env php | ||
2 | +<?php | ||
3 | +/** | ||
4 | + * Yii console bootstrap file. | ||
5 | + */ | ||
6 | + | ||
7 | +defined('YII_DEBUG') or define('YII_DEBUG', false); | ||
8 | +defined('YII_ENV') or define('YII_ENV', 'prod'); | ||
9 | + | ||
10 | +require __DIR__ . '/vendor/autoload.php'; | ||
11 | +require __DIR__ . '/vendor/yiisoft/yii2/Yii.php'; | ||
12 | +require __DIR__ . '/common/config/bootstrap.php'; | ||
13 | +require __DIR__ . '/console/config/bootstrap.php'; | ||
14 | + | ||
15 | +$config = yii\helpers\ArrayHelper::merge( | ||
16 | + require __DIR__ . '/common/config/main.php', | ||
17 | + require __DIR__ . '/common/config/main-local.php', | ||
18 | + require __DIR__ . '/console/config/main.php', | ||
19 | + require __DIR__ . '/console/config/main-local.php' | ||
20 | +); | ||
21 | + | ||
22 | +$application = new yii\console\Application($config); | ||
23 | +$exitCode = $application->run(); | ||
24 | +exit($exitCode); |
1 | +++ a/frontend/assets/AppAsset.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace frontend\assets; | ||
4 | + | ||
5 | +use yii\web\AssetBundle; | ||
6 | + | ||
7 | +/** | ||
8 | + * Main frontend application asset bundle. | ||
9 | + */ | ||
10 | +class AppAsset extends AssetBundle | ||
11 | +{ | ||
12 | + public $basePath = '@webroot'; | ||
13 | + public $baseUrl = '@web'; | ||
14 | + public $css = [ | ||
15 | + 'css/site.css', | ||
16 | + ]; | ||
17 | + public $js = [ | ||
18 | + ]; | ||
19 | + public $depends = [ | ||
20 | + 'yii\web\YiiAsset', | ||
21 | + 'yii\bootstrap\BootstrapAsset', | ||
22 | + ]; | ||
23 | +} |
1 | +++ a/frontend/codeception.yml | ||
1 | +namespace: frontend\tests | ||
2 | +actor_suffix: Tester | ||
3 | +paths: | ||
4 | + tests: tests | ||
5 | + output: tests/_output | ||
6 | + data: tests/_data | ||
7 | + support: tests/_support | ||
8 | +settings: | ||
9 | + bootstrap: _bootstrap.php | ||
10 | + colors: true | ||
11 | + memory_limit: 1024M | ||
12 | +modules: | ||
13 | + config: | ||
14 | + Yii2: | ||
15 | + configFile: 'config/test-local.php' |
1 | +++ a/frontend/config/main.php | ||
1 | +<?php | ||
2 | + $params = array_merge( | ||
3 | + require __DIR__ . '/../../common/config/params.php', | ||
4 | + require __DIR__ . '/../../common/config/params-local.php', | ||
5 | + require __DIR__ . '/params.php', | ||
6 | + require __DIR__ . '/params-local.php' | ||
7 | + ); | ||
8 | + | ||
9 | + return [ | ||
10 | + 'id' => 'app-frontend', | ||
11 | + 'basePath' => dirname(__DIR__), | ||
12 | + 'bootstrap' => [ 'log' ], | ||
13 | + 'controllerNamespace' => 'frontend\controllers', | ||
14 | + 'components' => [ | ||
15 | + 'request' => [ | ||
16 | + 'csrfParam' => '_csrf-frontend', | ||
17 | + 'baseUrl' => '', | ||
18 | + ], | ||
19 | + 'user' => [ | ||
20 | + 'identityClass' => 'common\models\User', | ||
21 | + 'enableAutoLogin' => true, | ||
22 | + 'identityCookie' => [ | ||
23 | + 'name' => '_identity-frontend', | ||
24 | + 'httpOnly' => true, | ||
25 | + ], | ||
26 | + ], | ||
27 | + 'session' => [ | ||
28 | + // this is the name of the session cookie used for login on the frontend | ||
29 | + 'name' => 'advanced-frontend', | ||
30 | + ], | ||
31 | + 'log' => [ | ||
32 | + 'traceLevel' => YII_DEBUG ? 3 : 0, | ||
33 | + 'targets' => [ | ||
34 | + [ | ||
35 | + 'class' => 'yii\log\FileTarget', | ||
36 | + 'levels' => [ | ||
37 | + 'error', | ||
38 | + 'warning', | ||
39 | + ], | ||
40 | + ], | ||
41 | + ], | ||
42 | + ], | ||
43 | + 'errorHandler' => [ | ||
44 | + 'errorAction' => 'site/error', | ||
45 | + ], | ||
46 | + 'urlManager' => [ | ||
47 | + 'enablePrettyUrl' => true, | ||
48 | + 'showScriptName' => false, | ||
49 | + ], | ||
50 | + ], | ||
51 | + 'params' => $params, | ||
52 | + ]; |
1 | +++ a/frontend/controllers/SiteController.php | ||
1 | +<?php | ||
2 | +namespace frontend\controllers; | ||
3 | + | ||
4 | +use Yii; | ||
5 | +use yii\base\InvalidParamException; | ||
6 | +use yii\web\BadRequestHttpException; | ||
7 | +use yii\web\Controller; | ||
8 | +use yii\filters\VerbFilter; | ||
9 | +use yii\filters\AccessControl; | ||
10 | +use common\models\LoginForm; | ||
11 | +use frontend\models\PasswordResetRequestForm; | ||
12 | +use frontend\models\ResetPasswordForm; | ||
13 | +use frontend\models\SignupForm; | ||
14 | +use frontend\models\ContactForm; | ||
15 | + | ||
16 | +/** | ||
17 | + * Site controller | ||
18 | + */ | ||
19 | +class SiteController extends Controller | ||
20 | +{ | ||
21 | + /** | ||
22 | + * {@inheritdoc} | ||
23 | + */ | ||
24 | + public function behaviors() | ||
25 | + { | ||
26 | + return [ | ||
27 | + 'access' => [ | ||
28 | + 'class' => AccessControl::className(), | ||
29 | + 'only' => ['logout', 'signup'], | ||
30 | + 'rules' => [ | ||
31 | + [ | ||
32 | + 'actions' => ['signup'], | ||
33 | + 'allow' => true, | ||
34 | + 'roles' => ['?'], | ||
35 | + ], | ||
36 | + [ | ||
37 | + 'actions' => ['logout'], | ||
38 | + 'allow' => true, | ||
39 | + 'roles' => ['@'], | ||
40 | + ], | ||
41 | + ], | ||
42 | + ], | ||
43 | + 'verbs' => [ | ||
44 | + 'class' => VerbFilter::className(), | ||
45 | + 'actions' => [ | ||
46 | + 'logout' => ['post'], | ||
47 | + ], | ||
48 | + ], | ||
49 | + ]; | ||
50 | + } | ||
51 | + | ||
52 | + /** | ||
53 | + * {@inheritdoc} | ||
54 | + */ | ||
55 | + public function actions() | ||
56 | + { | ||
57 | + return [ | ||
58 | + 'error' => [ | ||
59 | + 'class' => 'yii\web\ErrorAction', | ||
60 | + ], | ||
61 | + 'captcha' => [ | ||
62 | + 'class' => 'yii\captcha\CaptchaAction', | ||
63 | + 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null, | ||
64 | + ], | ||
65 | + ]; | ||
66 | + } | ||
67 | + | ||
68 | + /** | ||
69 | + * Displays homepage. | ||
70 | + * | ||
71 | + * @return mixed | ||
72 | + */ | ||
73 | + public function actionIndex() | ||
74 | + { | ||
75 | + return $this->render('index'); | ||
76 | + } | ||
77 | + | ||
78 | + /** | ||
79 | + * Logs in a user. | ||
80 | + * | ||
81 | + * @return mixed | ||
82 | + */ | ||
83 | + public function actionLogin() | ||
84 | + { | ||
85 | + if (!Yii::$app->user->isGuest) { | ||
86 | + return $this->goHome(); | ||
87 | + } | ||
88 | + | ||
89 | + $model = new LoginForm(); | ||
90 | + if ($model->load(Yii::$app->request->post()) && $model->login()) { | ||
91 | + return $this->goBack(); | ||
92 | + } else { | ||
93 | + $model->password = ''; | ||
94 | + | ||
95 | + return $this->render('login', [ | ||
96 | + 'model' => $model, | ||
97 | + ]); | ||
98 | + } | ||
99 | + } | ||
100 | + | ||
101 | + /** | ||
102 | + * Logs out the current user. | ||
103 | + * | ||
104 | + * @return mixed | ||
105 | + */ | ||
106 | + public function actionLogout() | ||
107 | + { | ||
108 | + Yii::$app->user->logout(); | ||
109 | + | ||
110 | + return $this->goHome(); | ||
111 | + } | ||
112 | + | ||
113 | + /** | ||
114 | + * Displays contact page. | ||
115 | + * | ||
116 | + * @return mixed | ||
117 | + */ | ||
118 | + public function actionContact() | ||
119 | + { | ||
120 | + $model = new ContactForm(); | ||
121 | + if ($model->load(Yii::$app->request->post()) && $model->validate()) { | ||
122 | + if ($model->sendEmail(Yii::$app->params['adminEmail'])) { | ||
123 | + Yii::$app->session->setFlash('success', 'Thank you for contacting us. We will respond to you as soon as possible.'); | ||
124 | + } else { | ||
125 | + Yii::$app->session->setFlash('error', 'There was an error sending your message.'); | ||
126 | + } | ||
127 | + | ||
128 | + return $this->refresh(); | ||
129 | + } else { | ||
130 | + return $this->render('contact', [ | ||
131 | + 'model' => $model, | ||
132 | + ]); | ||
133 | + } | ||
134 | + } | ||
135 | + | ||
136 | + /** | ||
137 | + * Displays about page. | ||
138 | + * | ||
139 | + * @return mixed | ||
140 | + */ | ||
141 | + public function actionAbout() | ||
142 | + { | ||
143 | + return $this->render('about'); | ||
144 | + } | ||
145 | + | ||
146 | + /** | ||
147 | + * Signs user up. | ||
148 | + * | ||
149 | + * @return mixed | ||
150 | + */ | ||
151 | + public function actionSignup() | ||
152 | + { | ||
153 | + $model = new SignupForm(); | ||
154 | + if ($model->load(Yii::$app->request->post())) { | ||
155 | + if ($user = $model->signup()) { | ||
156 | + if (Yii::$app->getUser()->login($user)) { | ||
157 | + return $this->goHome(); | ||
158 | + } | ||
159 | + } | ||
160 | + } | ||
161 | + | ||
162 | + return $this->render('signup', [ | ||
163 | + 'model' => $model, | ||
164 | + ]); | ||
165 | + } | ||
166 | + | ||
167 | + /** | ||
168 | + * Requests password reset. | ||
169 | + * | ||
170 | + * @return mixed | ||
171 | + */ | ||
172 | + public function actionRequestPasswordReset() | ||
173 | + { | ||
174 | + $model = new PasswordResetRequestForm(); | ||
175 | + if ($model->load(Yii::$app->request->post()) && $model->validate()) { | ||
176 | + if ($model->sendEmail()) { | ||
177 | + Yii::$app->session->setFlash('success', 'Check your email for further instructions.'); | ||
178 | + | ||
179 | + return $this->goHome(); | ||
180 | + } else { | ||
181 | + Yii::$app->session->setFlash('error', 'Sorry, we are unable to reset password for the provided email address.'); | ||
182 | + } | ||
183 | + } | ||
184 | + | ||
185 | + return $this->render('requestPasswordResetToken', [ | ||
186 | + 'model' => $model, | ||
187 | + ]); | ||
188 | + } | ||
189 | + | ||
190 | + /** | ||
191 | + * Resets password. | ||
192 | + * | ||
193 | + * @param string $token | ||
194 | + * @return mixed | ||
195 | + * @throws BadRequestHttpException | ||
196 | + */ | ||
197 | + public function actionResetPassword($token) | ||
198 | + { | ||
199 | + try { | ||
200 | + $model = new ResetPasswordForm($token); | ||
201 | + } catch (InvalidParamException $e) { | ||
202 | + throw new BadRequestHttpException($e->getMessage()); | ||
203 | + } | ||
204 | + | ||
205 | + if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->resetPassword()) { | ||
206 | + Yii::$app->session->setFlash('success', 'New password saved.'); | ||
207 | + | ||
208 | + return $this->goHome(); | ||
209 | + } | ||
210 | + | ||
211 | + return $this->render('resetPassword', [ | ||
212 | + 'model' => $model, | ||
213 | + ]); | ||
214 | + } | ||
215 | +} |
1 | +++ a/frontend/models/ContactForm.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace frontend\models; | ||
4 | + | ||
5 | +use Yii; | ||
6 | +use yii\base\Model; | ||
7 | + | ||
8 | +/** | ||
9 | + * ContactForm is the model behind the contact form. | ||
10 | + */ | ||
11 | +class ContactForm extends Model | ||
12 | +{ | ||
13 | + public $name; | ||
14 | + public $email; | ||
15 | + public $subject; | ||
16 | + public $body; | ||
17 | + public $verifyCode; | ||
18 | + | ||
19 | + | ||
20 | + /** | ||
21 | + * {@inheritdoc} | ||
22 | + */ | ||
23 | + public function rules() | ||
24 | + { | ||
25 | + return [ | ||
26 | + // name, email, subject and body are required | ||
27 | + [['name', 'email', 'subject', 'body'], 'required'], | ||
28 | + // email has to be a valid email address | ||
29 | + ['email', 'email'], | ||
30 | + // verifyCode needs to be entered correctly | ||
31 | + ['verifyCode', 'captcha'], | ||
32 | + ]; | ||
33 | + } | ||
34 | + | ||
35 | + /** | ||
36 | + * {@inheritdoc} | ||
37 | + */ | ||
38 | + public function attributeLabels() | ||
39 | + { | ||
40 | + return [ | ||
41 | + 'verifyCode' => 'Verification Code', | ||
42 | + ]; | ||
43 | + } | ||
44 | + | ||
45 | + /** | ||
46 | + * Sends an email to the specified email address using the information collected by this model. | ||
47 | + * | ||
48 | + * @param string $email the target email address | ||
49 | + * @return bool whether the email was sent | ||
50 | + */ | ||
51 | + public function sendEmail($email) | ||
52 | + { | ||
53 | + return Yii::$app->mailer->compose() | ||
54 | + ->setTo($email) | ||
55 | + ->setFrom([$this->email => $this->name]) | ||
56 | + ->setSubject($this->subject) | ||
57 | + ->setTextBody($this->body) | ||
58 | + ->send(); | ||
59 | + } | ||
60 | +} |
1 | +++ a/frontend/models/PasswordResetRequestForm.php | ||
1 | +<?php | ||
2 | +namespace frontend\models; | ||
3 | + | ||
4 | +use Yii; | ||
5 | +use yii\base\Model; | ||
6 | +use common\models\User; | ||
7 | + | ||
8 | +/** | ||
9 | + * Password reset request form | ||
10 | + */ | ||
11 | +class PasswordResetRequestForm extends Model | ||
12 | +{ | ||
13 | + public $email; | ||
14 | + | ||
15 | + | ||
16 | + /** | ||
17 | + * {@inheritdoc} | ||
18 | + */ | ||
19 | + public function rules() | ||
20 | + { | ||
21 | + return [ | ||
22 | + ['email', 'trim'], | ||
23 | + ['email', 'required'], | ||
24 | + ['email', 'email'], | ||
25 | + ['email', 'exist', | ||
26 | + 'targetClass' => '\common\models\User', | ||
27 | + 'filter' => ['status' => User::STATUS_ACTIVE], | ||
28 | + 'message' => 'There is no user with this email address.' | ||
29 | + ], | ||
30 | + ]; | ||
31 | + } | ||
32 | + | ||
33 | + /** | ||
34 | + * Sends an email with a link, for resetting the password. | ||
35 | + * | ||
36 | + * @return bool whether the email was send | ||
37 | + */ | ||
38 | + public function sendEmail() | ||
39 | + { | ||
40 | + /* @var $user User */ | ||
41 | + $user = User::findOne([ | ||
42 | + 'status' => User::STATUS_ACTIVE, | ||
43 | + 'email' => $this->email, | ||
44 | + ]); | ||
45 | + | ||
46 | + if (!$user) { | ||
47 | + return false; | ||
48 | + } | ||
49 | + | ||
50 | + if (!User::isPasswordResetTokenValid($user->password_reset_token)) { | ||
51 | + $user->generatePasswordResetToken(); | ||
52 | + if (!$user->save()) { | ||
53 | + return false; | ||
54 | + } | ||
55 | + } | ||
56 | + | ||
57 | + return Yii::$app | ||
58 | + ->mailer | ||
59 | + ->compose( | ||
60 | + ['html' => 'passwordResetToken-html', 'text' => 'passwordResetToken-text'], | ||
61 | + ['user' => $user] | ||
62 | + ) | ||
63 | + ->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name . ' robot']) | ||
64 | + ->setTo($this->email) | ||
65 | + ->setSubject('Password reset for ' . Yii::$app->name) | ||
66 | + ->send(); | ||
67 | + } | ||
68 | +} |
1 | +++ a/frontend/models/ResetPasswordForm.php | ||
1 | +<?php | ||
2 | +namespace frontend\models; | ||
3 | + | ||
4 | +use yii\base\Model; | ||
5 | +use yii\base\InvalidParamException; | ||
6 | +use common\models\User; | ||
7 | + | ||
8 | +/** | ||
9 | + * Password reset form | ||
10 | + */ | ||
11 | +class ResetPasswordForm extends Model | ||
12 | +{ | ||
13 | + public $password; | ||
14 | + | ||
15 | + /** | ||
16 | + * @var \common\models\User | ||
17 | + */ | ||
18 | + private $_user; | ||
19 | + | ||
20 | + | ||
21 | + /** | ||
22 | + * Creates a form model given a token. | ||
23 | + * | ||
24 | + * @param string $token | ||
25 | + * @param array $config name-value pairs that will be used to initialize the object properties | ||
26 | + * @throws \yii\base\InvalidParamException if token is empty or not valid | ||
27 | + */ | ||
28 | + public function __construct($token, $config = []) | ||
29 | + { | ||
30 | + if (empty($token) || !is_string($token)) { | ||
31 | + throw new InvalidParamException('Password reset token cannot be blank.'); | ||
32 | + } | ||
33 | + $this->_user = User::findByPasswordResetToken($token); | ||
34 | + if (!$this->_user) { | ||
35 | + throw new InvalidParamException('Wrong password reset token.'); | ||
36 | + } | ||
37 | + parent::__construct($config); | ||
38 | + } | ||
39 | + | ||
40 | + /** | ||
41 | + * {@inheritdoc} | ||
42 | + */ | ||
43 | + public function rules() | ||
44 | + { | ||
45 | + return [ | ||
46 | + ['password', 'required'], | ||
47 | + ['password', 'string', 'min' => 6], | ||
48 | + ]; | ||
49 | + } | ||
50 | + | ||
51 | + /** | ||
52 | + * Resets password. | ||
53 | + * | ||
54 | + * @return bool if password was reset. | ||
55 | + */ | ||
56 | + public function resetPassword() | ||
57 | + { | ||
58 | + $user = $this->_user; | ||
59 | + $user->setPassword($this->password); | ||
60 | + $user->removePasswordResetToken(); | ||
61 | + | ||
62 | + return $user->save(false); | ||
63 | + } | ||
64 | +} |
1 | +++ a/frontend/models/SignupForm.php | ||
1 | +<?php | ||
2 | +namespace frontend\models; | ||
3 | + | ||
4 | +use yii\base\Model; | ||
5 | +use common\models\User; | ||
6 | + | ||
7 | +/** | ||
8 | + * Signup form | ||
9 | + */ | ||
10 | +class SignupForm extends Model | ||
11 | +{ | ||
12 | + public $username; | ||
13 | + public $email; | ||
14 | + public $password; | ||
15 | + | ||
16 | + | ||
17 | + /** | ||
18 | + * {@inheritdoc} | ||
19 | + */ | ||
20 | + public function rules() | ||
21 | + { | ||
22 | + return [ | ||
23 | + ['username', 'trim'], | ||
24 | + ['username', 'required'], | ||
25 | + ['username', 'unique', 'targetClass' => '\common\models\User', 'message' => 'This username has already been taken.'], | ||
26 | + ['username', 'string', 'min' => 2, 'max' => 255], | ||
27 | + | ||
28 | + ['email', 'trim'], | ||
29 | + ['email', 'required'], | ||
30 | + ['email', 'email'], | ||
31 | + ['email', 'string', 'max' => 255], | ||
32 | + ['email', 'unique', 'targetClass' => '\common\models\User', 'message' => 'This email address has already been taken.'], | ||
33 | + | ||
34 | + ['password', 'required'], | ||
35 | + ['password', 'string', 'min' => 6], | ||
36 | + ]; | ||
37 | + } | ||
38 | + | ||
39 | + /** | ||
40 | + * Signs user up. | ||
41 | + * | ||
42 | + * @return User|null the saved model or null if saving fails | ||
43 | + */ | ||
44 | + public function signup() | ||
45 | + { | ||
46 | + if (!$this->validate()) { | ||
47 | + return null; | ||
48 | + } | ||
49 | + | ||
50 | + $user = new User(); | ||
51 | + $user->username = $this->username; | ||
52 | + $user->email = $this->email; | ||
53 | + $user->setPassword($this->password); | ||
54 | + $user->generateAuthKey(); | ||
55 | + | ||
56 | + return $user->save() ? $user : null; | ||
57 | + } | ||
58 | +} |
1 | +++ a/frontend/tests/_bootstrap.php | ||
1 | +<?php | ||
2 | +defined('YII_DEBUG') or define('YII_DEBUG', true); | ||
3 | +defined('YII_ENV') or define('YII_ENV', 'test'); | ||
4 | +defined('YII_APP_BASE_PATH') or define('YII_APP_BASE_PATH', __DIR__.'/../../'); | ||
5 | + | ||
6 | +require_once YII_APP_BASE_PATH . '/vendor/autoload.php'; | ||
7 | +require_once YII_APP_BASE_PATH . '/vendor/yiisoft/yii2/Yii.php'; | ||
8 | +require_once YII_APP_BASE_PATH . '/common/config/bootstrap.php'; | ||
9 | +require_once __DIR__ . '/../config/bootstrap.php'; |
1 | +++ a/frontend/tests/_data/login_data.php | ||
1 | +<?php | ||
2 | +return [ | ||
3 | + [ | ||
4 | + 'username' => 'erau', | ||
5 | + 'auth_key' => 'tUu1qHcde0diwUol3xeI-18MuHkkprQI', | ||
6 | + // password_0 | ||
7 | + 'password_hash' => '$2y$13$nJ1WDlBaGcbCdbNC5.5l4.sgy.OMEKCqtDQOdQ2OWpgiKRWYyzzne', | ||
8 | + 'password_reset_token' => 'RkD_Jw0_8HEedzLk7MM-ZKEFfYR7VbMr_1392559490', | ||
9 | + 'created_at' => '1392559490', | ||
10 | + 'updated_at' => '1392559490', | ||
11 | + 'email' => 'sfriesen@jenkins.info', | ||
12 | + ], | ||
13 | +]; |
1 | +++ a/frontend/tests/_data/user.php | ||
1 | +<?php | ||
2 | + | ||
3 | +return [ | ||
4 | + [ | ||
5 | + 'username' => 'okirlin', | ||
6 | + 'auth_key' => 'iwTNae9t34OmnK6l4vT4IeaTk-YWI2Rv', | ||
7 | + 'password_hash' => '$2y$13$CXT0Rkle1EMJ/c1l5bylL.EylfmQ39O5JlHJVFpNn618OUS1HwaIi', | ||
8 | + 'password_reset_token' => 't5GU9NwpuGYSfb7FEZMAxqtuz2PkEvv_' . time(), | ||
9 | + 'created_at' => '1391885313', | ||
10 | + 'updated_at' => '1391885313', | ||
11 | + 'email' => 'brady.renner@rutherford.com', | ||
12 | + ], | ||
13 | + [ | ||
14 | + 'username' => 'troy.becker', | ||
15 | + 'auth_key' => 'EdKfXrx88weFMV0vIxuTMWKgfK2tS3Lp', | ||
16 | + 'password_hash' => '$2y$13$g5nv41Px7VBqhS3hVsVN2.MKfgT3jFdkXEsMC4rQJLfaMa7VaJqL2', | ||
17 | + 'password_reset_token' => '4BSNyiZNAuxjs5Mty990c47sVrgllIi_' . time(), | ||
18 | + 'created_at' => '1391885313', | ||
19 | + 'updated_at' => '1391885313', | ||
20 | + 'email' => 'nicolas.dianna@hotmail.com', | ||
21 | + 'status' => '0', | ||
22 | + ], | ||
23 | +]; |
1 | +++ a/frontend/tests/_support/FunctionalTester.php | ||
1 | +<?php | ||
2 | +namespace frontend\tests; | ||
3 | + | ||
4 | +/** | ||
5 | + * Inherited Methods | ||
6 | + * @method void wantToTest($text) | ||
7 | + * @method void wantTo($text) | ||
8 | + * @method void execute($callable) | ||
9 | + * @method void expectTo($prediction) | ||
10 | + * @method void expect($prediction) | ||
11 | + * @method void amGoingTo($argumentation) | ||
12 | + * @method void am($role) | ||
13 | + * @method void lookForwardTo($achieveValue) | ||
14 | + * @method void comment($description) | ||
15 | + * @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL) | ||
16 | + * | ||
17 | + * @SuppressWarnings(PHPMD) | ||
18 | + */ | ||
19 | +class FunctionalTester extends \Codeception\Actor | ||
20 | +{ | ||
21 | + use _generated\FunctionalTesterActions; | ||
22 | + | ||
23 | + | ||
24 | + public function seeValidationError($message) | ||
25 | + { | ||
26 | + $this->see($message, '.help-block'); | ||
27 | + } | ||
28 | + | ||
29 | + public function dontSeeValidationError($message) | ||
30 | + { | ||
31 | + $this->dontSee($message, '.help-block'); | ||
32 | + } | ||
33 | +} |
1 | +++ a/frontend/tests/_support/UnitTester.php | ||
1 | +<?php | ||
2 | +namespace frontend\tests; | ||
3 | + | ||
4 | +/** | ||
5 | + * Inherited Methods | ||
6 | + * @method void wantToTest($text) | ||
7 | + * @method void wantTo($text) | ||
8 | + * @method void execute($callable) | ||
9 | + * @method void expectTo($prediction) | ||
10 | + * @method void expect($prediction) | ||
11 | + * @method void amGoingTo($argumentation) | ||
12 | + * @method void am($role) | ||
13 | + * @method void lookForwardTo($achieveValue) | ||
14 | + * @method void comment($description) | ||
15 | + * @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL) | ||
16 | + * | ||
17 | + * @SuppressWarnings(PHPMD) | ||
18 | + */ | ||
19 | +class UnitTester extends \Codeception\Actor | ||
20 | +{ | ||
21 | + use _generated\UnitTesterActions; | ||
22 | + /** | ||
23 | + * Define custom actions here | ||
24 | + */ | ||
25 | +} |
1 | +++ a/frontend/tests/acceptance/HomeCest.php | ||
1 | +<?php | ||
2 | +namespace frontend\tests\acceptance; | ||
3 | + | ||
4 | +use frontend\tests\AcceptanceTester; | ||
5 | +use yii\helpers\Url; | ||
6 | + | ||
7 | +class HomeCest | ||
8 | +{ | ||
9 | + public function checkHome(AcceptanceTester $I) | ||
10 | + { | ||
11 | + $I->amOnPage(Url::toRoute('/site/index')); | ||
12 | + $I->see('My Application'); | ||
13 | + | ||
14 | + $I->seeLink('About'); | ||
15 | + $I->click('About'); | ||
16 | + $I->wait(2); // wait for page to be opened | ||
17 | + | ||
18 | + $I->see('This is the About page.'); | ||
19 | + } | ||
20 | +} |
1 | +++ a/frontend/tests/acceptance/_bootstrap.php | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * Here you can initialize variables via \Codeception\Util\Fixtures class | ||
4 | + * to store data in global array and use it in Cepts. | ||
5 | + * | ||
6 | + * ```php | ||
7 | + * // Here _bootstrap.php | ||
8 | + * \Codeception\Util\Fixtures::add('user1', ['name' => 'davert']); | ||
9 | + * ``` | ||
10 | + * | ||
11 | + * In Cept | ||
12 | + * | ||
13 | + * ```php | ||
14 | + * \Codeception\Util\Fixtures::get('user1'); | ||
15 | + * ``` | ||
16 | + */ | ||
0 | \ No newline at end of file | 17 | \ No newline at end of file |
1 | +++ a/frontend/tests/functional/AboutCest.php | ||
1 | +<?php | ||
2 | +namespace frontend\tests\functional; | ||
3 | + | ||
4 | +use frontend\tests\FunctionalTester; | ||
5 | + | ||
6 | +class AboutCest | ||
7 | +{ | ||
8 | + public function checkAbout(FunctionalTester $I) | ||
9 | + { | ||
10 | + $I->amOnRoute('site/about'); | ||
11 | + $I->see('About', 'h1'); | ||
12 | + } | ||
13 | +} |
1 | +++ a/frontend/tests/functional/ContactCest.php | ||
1 | +<?php | ||
2 | +namespace frontend\tests\functional; | ||
3 | + | ||
4 | +use frontend\tests\FunctionalTester; | ||
5 | + | ||
6 | +/* @var $scenario \Codeception\Scenario */ | ||
7 | + | ||
8 | +class ContactCest | ||
9 | +{ | ||
10 | + public function _before(FunctionalTester $I) | ||
11 | + { | ||
12 | + $I->amOnPage(['site/contact']); | ||
13 | + } | ||
14 | + | ||
15 | + public function checkContact(FunctionalTester $I) | ||
16 | + { | ||
17 | + $I->see('Contact', 'h1'); | ||
18 | + } | ||
19 | + | ||
20 | + public function checkContactSubmitNoData(FunctionalTester $I) | ||
21 | + { | ||
22 | + $I->submitForm('#contact-form', []); | ||
23 | + $I->see('Contact', 'h1'); | ||
24 | + $I->seeValidationError('Name cannot be blank'); | ||
25 | + $I->seeValidationError('Email cannot be blank'); | ||
26 | + $I->seeValidationError('Subject cannot be blank'); | ||
27 | + $I->seeValidationError('Body cannot be blank'); | ||
28 | + $I->seeValidationError('The verification code is incorrect'); | ||
29 | + } | ||
30 | + | ||
31 | + public function checkContactSubmitNotCorrectEmail(FunctionalTester $I) | ||
32 | + { | ||
33 | + $I->submitForm('#contact-form', [ | ||
34 | + 'ContactForm[name]' => 'tester', | ||
35 | + 'ContactForm[email]' => 'tester.email', | ||
36 | + 'ContactForm[subject]' => 'test subject', | ||
37 | + 'ContactForm[body]' => 'test content', | ||
38 | + 'ContactForm[verifyCode]' => 'testme', | ||
39 | + ]); | ||
40 | + $I->seeValidationError('Email is not a valid email address.'); | ||
41 | + $I->dontSeeValidationError('Name cannot be blank'); | ||
42 | + $I->dontSeeValidationError('Subject cannot be blank'); | ||
43 | + $I->dontSeeValidationError('Body cannot be blank'); | ||
44 | + $I->dontSeeValidationError('The verification code is incorrect'); | ||
45 | + } | ||
46 | + | ||
47 | + public function checkContactSubmitCorrectData(FunctionalTester $I) | ||
48 | + { | ||
49 | + $I->submitForm('#contact-form', [ | ||
50 | + 'ContactForm[name]' => 'tester', | ||
51 | + 'ContactForm[email]' => 'tester@example.com', | ||
52 | + 'ContactForm[subject]' => 'test subject', | ||
53 | + 'ContactForm[body]' => 'test content', | ||
54 | + 'ContactForm[verifyCode]' => 'testme', | ||
55 | + ]); | ||
56 | + $I->seeEmailIsSent(); | ||
57 | + $I->see('Thank you for contacting us. We will respond to you as soon as possible.'); | ||
58 | + } | ||
59 | +} |
1 | +++ a/frontend/tests/functional/HomeCest.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace frontend\tests\functional; | ||
4 | + | ||
5 | +use frontend\tests\FunctionalTester; | ||
6 | + | ||
7 | +class HomeCest | ||
8 | +{ | ||
9 | + public function checkOpen(FunctionalTester $I) | ||
10 | + { | ||
11 | + $I->amOnPage(\Yii::$app->homeUrl); | ||
12 | + $I->see('My Application'); | ||
13 | + $I->seeLink('About'); | ||
14 | + $I->click('About'); | ||
15 | + $I->see('This is the About page.'); | ||
16 | + } | ||
17 | +} | ||
0 | \ No newline at end of file | 18 | \ No newline at end of file |
1 | +++ a/frontend/tests/functional/LoginCest.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace frontend\tests\functional; | ||
4 | + | ||
5 | +use frontend\tests\FunctionalTester; | ||
6 | +use common\fixtures\UserFixture; | ||
7 | + | ||
8 | +class LoginCest | ||
9 | +{ | ||
10 | + /** | ||
11 | + * Load fixtures before db transaction begin | ||
12 | + * Called in _before() | ||
13 | + * @see \Codeception\Module\Yii2::_before() | ||
14 | + * @see \Codeception\Module\Yii2::loadFixtures() | ||
15 | + * @return array | ||
16 | + */ | ||
17 | + public function _fixtures() | ||
18 | + { | ||
19 | + return [ | ||
20 | + 'user' => [ | ||
21 | + 'class' => UserFixture::className(), | ||
22 | + 'dataFile' => codecept_data_dir() . 'login_data.php' | ||
23 | + ] | ||
24 | + ]; | ||
25 | + } | ||
26 | + | ||
27 | + public function _before(FunctionalTester $I) | ||
28 | + { | ||
29 | + $I->amOnRoute('site/login'); | ||
30 | + } | ||
31 | + | ||
32 | + protected function formParams($login, $password) | ||
33 | + { | ||
34 | + return [ | ||
35 | + 'LoginForm[username]' => $login, | ||
36 | + 'LoginForm[password]' => $password, | ||
37 | + ]; | ||
38 | + } | ||
39 | + | ||
40 | + public function checkEmpty(FunctionalTester $I) | ||
41 | + { | ||
42 | + $I->submitForm('#login-form', $this->formParams('', '')); | ||
43 | + $I->seeValidationError('Username cannot be blank.'); | ||
44 | + $I->seeValidationError('Password cannot be blank.'); | ||
45 | + } | ||
46 | + | ||
47 | + public function checkWrongPassword(FunctionalTester $I) | ||
48 | + { | ||
49 | + $I->submitForm('#login-form', $this->formParams('admin', 'wrong')); | ||
50 | + $I->seeValidationError('Incorrect username or password.'); | ||
51 | + } | ||
52 | + | ||
53 | + public function checkValidLogin(FunctionalTester $I) | ||
54 | + { | ||
55 | + $I->submitForm('#login-form', $this->formParams('erau', 'password_0')); | ||
56 | + $I->see('Logout (erau)', 'form button[type=submit]'); | ||
57 | + $I->dontSeeLink('Login'); | ||
58 | + $I->dontSeeLink('Signup'); | ||
59 | + } | ||
60 | +} |
1 | +++ a/frontend/tests/functional/SignupCest.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace frontend\tests\functional; | ||
4 | + | ||
5 | +use frontend\tests\FunctionalTester; | ||
6 | + | ||
7 | +class SignupCest | ||
8 | +{ | ||
9 | + protected $formId = '#form-signup'; | ||
10 | + | ||
11 | + | ||
12 | + public function _before(FunctionalTester $I) | ||
13 | + { | ||
14 | + $I->amOnRoute('site/signup'); | ||
15 | + } | ||
16 | + | ||
17 | + public function signupWithEmptyFields(FunctionalTester $I) | ||
18 | + { | ||
19 | + $I->see('Signup', 'h1'); | ||
20 | + $I->see('Please fill out the following fields to signup:'); | ||
21 | + $I->submitForm($this->formId, []); | ||
22 | + $I->seeValidationError('Username cannot be blank.'); | ||
23 | + $I->seeValidationError('Email cannot be blank.'); | ||
24 | + $I->seeValidationError('Password cannot be blank.'); | ||
25 | + | ||
26 | + } | ||
27 | + | ||
28 | + public function signupWithWrongEmail(FunctionalTester $I) | ||
29 | + { | ||
30 | + $I->submitForm( | ||
31 | + $this->formId, [ | ||
32 | + 'SignupForm[username]' => 'tester', | ||
33 | + 'SignupForm[email]' => 'ttttt', | ||
34 | + 'SignupForm[password]' => 'tester_password', | ||
35 | + ] | ||
36 | + ); | ||
37 | + $I->dontSee('Username cannot be blank.', '.help-block'); | ||
38 | + $I->dontSee('Password cannot be blank.', '.help-block'); | ||
39 | + $I->see('Email is not a valid email address.', '.help-block'); | ||
40 | + } | ||
41 | + | ||
42 | + public function signupSuccessfully(FunctionalTester $I) | ||
43 | + { | ||
44 | + $I->submitForm($this->formId, [ | ||
45 | + 'SignupForm[username]' => 'tester', | ||
46 | + 'SignupForm[email]' => 'tester.email@example.com', | ||
47 | + 'SignupForm[password]' => 'tester_password', | ||
48 | + ]); | ||
49 | + | ||
50 | + $I->seeRecord('common\models\User', [ | ||
51 | + 'username' => 'tester', | ||
52 | + 'email' => 'tester.email@example.com', | ||
53 | + ]); | ||
54 | + | ||
55 | + $I->see('Logout (tester)', 'form button[type=submit]'); | ||
56 | + } | ||
57 | +} |
1 | +++ a/frontend/tests/functional/_bootstrap.php | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * Here you can initialize variables via \Codeception\Util\Fixtures class | ||
4 | + * to store data in global array and use it in Cests. | ||
5 | + * | ||
6 | + * ```php | ||
7 | + * // Here _bootstrap.php | ||
8 | + * \Codeception\Util\Fixtures::add('user1', ['name' => 'davert']); | ||
9 | + * ``` | ||
10 | + * | ||
11 | + * In Cests | ||
12 | + * | ||
13 | + * ```php | ||
14 | + * \Codeception\Util\Fixtures::get('user1'); | ||
15 | + * ``` | ||
16 | + */ | ||
0 | \ No newline at end of file | 17 | \ No newline at end of file |
1 | +++ a/frontend/tests/unit/_bootstrap.php | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * Here you can initialize variables via \Codeception\Util\Fixtures class | ||
4 | + * to store data in global array and use it in Tests. | ||
5 | + * | ||
6 | + * ```php | ||
7 | + * // Here _bootstrap.php | ||
8 | + * \Codeception\Util\Fixtures::add('user1', ['name' => 'davert']); | ||
9 | + * ``` | ||
10 | + * | ||
11 | + * In Tests | ||
12 | + * | ||
13 | + * ```php | ||
14 | + * \Codeception\Util\Fixtures::get('user1'); | ||
15 | + * ``` | ||
16 | + */ |
1 | +++ a/frontend/tests/unit/models/ContactFormTest.php | ||
1 | +<?php | ||
2 | +namespace frontend\tests\unit\models; | ||
3 | + | ||
4 | +use Yii; | ||
5 | +use frontend\models\ContactForm; | ||
6 | + | ||
7 | +class ContactFormTest extends \Codeception\Test\Unit | ||
8 | +{ | ||
9 | + public function testSendEmail() | ||
10 | + { | ||
11 | + $model = new ContactForm(); | ||
12 | + | ||
13 | + $model->attributes = [ | ||
14 | + 'name' => 'Tester', | ||
15 | + 'email' => 'tester@example.com', | ||
16 | + 'subject' => 'very important letter subject', | ||
17 | + 'body' => 'body of current message', | ||
18 | + ]; | ||
19 | + | ||
20 | + expect_that($model->sendEmail('admin@example.com')); | ||
21 | + | ||
22 | + // using Yii2 module actions to check email was sent | ||
23 | + $this->tester->seeEmailIsSent(); | ||
24 | + | ||
25 | + $emailMessage = $this->tester->grabLastSentEmail(); | ||
26 | + expect('valid email is sent', $emailMessage)->isInstanceOf('yii\mail\MessageInterface'); | ||
27 | + expect($emailMessage->getTo())->hasKey('admin@example.com'); | ||
28 | + expect($emailMessage->getFrom())->hasKey('tester@example.com'); | ||
29 | + expect($emailMessage->getSubject())->equals('very important letter subject'); | ||
30 | + expect($emailMessage->toString())->contains('body of current message'); | ||
31 | + } | ||
32 | +} |
frontend/tests/unit/models/PasswordResetRequestFormTest.php
0 → 100644
1 | +++ a/frontend/tests/unit/models/PasswordResetRequestFormTest.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace frontend\tests\unit\models; | ||
4 | + | ||
5 | +use Yii; | ||
6 | +use frontend\models\PasswordResetRequestForm; | ||
7 | +use common\fixtures\UserFixture as UserFixture; | ||
8 | +use common\models\User; | ||
9 | + | ||
10 | +class PasswordResetRequestFormTest extends \Codeception\Test\Unit | ||
11 | +{ | ||
12 | + /** | ||
13 | + * @var \frontend\tests\UnitTester | ||
14 | + */ | ||
15 | + protected $tester; | ||
16 | + | ||
17 | + | ||
18 | + public function _before() | ||
19 | + { | ||
20 | + $this->tester->haveFixtures([ | ||
21 | + 'user' => [ | ||
22 | + 'class' => UserFixture::className(), | ||
23 | + 'dataFile' => codecept_data_dir() . 'user.php' | ||
24 | + ] | ||
25 | + ]); | ||
26 | + } | ||
27 | + | ||
28 | + public function testSendMessageWithWrongEmailAddress() | ||
29 | + { | ||
30 | + $model = new PasswordResetRequestForm(); | ||
31 | + $model->email = 'not-existing-email@example.com'; | ||
32 | + expect_not($model->sendEmail()); | ||
33 | + } | ||
34 | + | ||
35 | + public function testNotSendEmailsToInactiveUser() | ||
36 | + { | ||
37 | + $user = $this->tester->grabFixture('user', 1); | ||
38 | + $model = new PasswordResetRequestForm(); | ||
39 | + $model->email = $user['email']; | ||
40 | + expect_not($model->sendEmail()); | ||
41 | + } | ||
42 | + | ||
43 | + public function testSendEmailSuccessfully() | ||
44 | + { | ||
45 | + $userFixture = $this->tester->grabFixture('user', 0); | ||
46 | + | ||
47 | + $model = new PasswordResetRequestForm(); | ||
48 | + $model->email = $userFixture['email']; | ||
49 | + $user = User::findOne(['password_reset_token' => $userFixture['password_reset_token']]); | ||
50 | + | ||
51 | + expect_that($model->sendEmail()); | ||
52 | + expect_that($user->password_reset_token); | ||
53 | + | ||
54 | + $emailMessage = $this->tester->grabLastSentEmail(); | ||
55 | + expect('valid email is sent', $emailMessage)->isInstanceOf('yii\mail\MessageInterface'); | ||
56 | + expect($emailMessage->getTo())->hasKey($model->email); | ||
57 | + expect($emailMessage->getFrom())->hasKey(Yii::$app->params['supportEmail']); | ||
58 | + } | ||
59 | +} |
frontend/tests/unit/models/ResetPasswordFormTest.php
0 → 100644
1 | +++ a/frontend/tests/unit/models/ResetPasswordFormTest.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace frontend\tests\unit\models; | ||
4 | + | ||
5 | +use common\fixtures\UserFixture; | ||
6 | +use frontend\models\ResetPasswordForm; | ||
7 | + | ||
8 | +class ResetPasswordFormTest extends \Codeception\Test\Unit | ||
9 | +{ | ||
10 | + /** | ||
11 | + * @var \frontend\tests\UnitTester | ||
12 | + */ | ||
13 | + protected $tester; | ||
14 | + | ||
15 | + | ||
16 | + public function _before() | ||
17 | + { | ||
18 | + $this->tester->haveFixtures([ | ||
19 | + 'user' => [ | ||
20 | + 'class' => UserFixture::className(), | ||
21 | + 'dataFile' => codecept_data_dir() . 'user.php' | ||
22 | + ], | ||
23 | + ]); | ||
24 | + } | ||
25 | + | ||
26 | + public function testResetWrongToken() | ||
27 | + { | ||
28 | + $this->tester->expectException('yii\base\InvalidParamException', function() { | ||
29 | + new ResetPasswordForm(''); | ||
30 | + }); | ||
31 | + | ||
32 | + $this->tester->expectException('yii\base\InvalidParamException', function() { | ||
33 | + new ResetPasswordForm('notexistingtoken_1391882543'); | ||
34 | + }); | ||
35 | + } | ||
36 | + | ||
37 | + public function testResetCorrectToken() | ||
38 | + { | ||
39 | + $user = $this->tester->grabFixture('user', 0); | ||
40 | + $form = new ResetPasswordForm($user['password_reset_token']); | ||
41 | + expect_that($form->resetPassword()); | ||
42 | + } | ||
43 | + | ||
44 | +} |
1 | +++ a/frontend/tests/unit/models/SignupFormTest.php | ||
1 | +<?php | ||
2 | +namespace frontend\tests\unit\models; | ||
3 | + | ||
4 | +use common\fixtures\UserFixture; | ||
5 | +use frontend\models\SignupForm; | ||
6 | + | ||
7 | +class SignupFormTest extends \Codeception\Test\Unit | ||
8 | +{ | ||
9 | + /** | ||
10 | + * @var \frontend\tests\UnitTester | ||
11 | + */ | ||
12 | + protected $tester; | ||
13 | + | ||
14 | + | ||
15 | + public function _before() | ||
16 | + { | ||
17 | + $this->tester->haveFixtures([ | ||
18 | + 'user' => [ | ||
19 | + 'class' => UserFixture::className(), | ||
20 | + 'dataFile' => codecept_data_dir() . 'user.php' | ||
21 | + ] | ||
22 | + ]); | ||
23 | + } | ||
24 | + | ||
25 | + public function testCorrectSignup() | ||
26 | + { | ||
27 | + $model = new SignupForm([ | ||
28 | + 'username' => 'some_username', | ||
29 | + 'email' => 'some_email@example.com', | ||
30 | + 'password' => 'some_password', | ||
31 | + ]); | ||
32 | + | ||
33 | + $user = $model->signup(); | ||
34 | + | ||
35 | + expect($user)->isInstanceOf('common\models\User'); | ||
36 | + | ||
37 | + expect($user->username)->equals('some_username'); | ||
38 | + expect($user->email)->equals('some_email@example.com'); | ||
39 | + expect($user->validatePassword('some_password'))->true(); | ||
40 | + } | ||
41 | + | ||
42 | + public function testNotCorrectSignup() | ||
43 | + { | ||
44 | + $model = new SignupForm([ | ||
45 | + 'username' => 'troy.becker', | ||
46 | + 'email' => 'nicolas.dianna@hotmail.com', | ||
47 | + 'password' => 'some_password', | ||
48 | + ]); | ||
49 | + | ||
50 | + expect_not($model->signup()); | ||
51 | + expect_that($model->getErrors('username')); | ||
52 | + expect_that($model->getErrors('email')); | ||
53 | + | ||
54 | + expect($model->getFirstError('username')) | ||
55 | + ->equals('This username has already been taken.'); | ||
56 | + expect($model->getFirstError('email')) | ||
57 | + ->equals('This email address has already been taken.'); | ||
58 | + } | ||
59 | +} |
1 | +++ a/frontend/views/layouts/main.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this \yii\web\View */ | ||
4 | +/* @var $content string */ | ||
5 | + | ||
6 | +use yii\helpers\Html; | ||
7 | +use yii\bootstrap\Nav; | ||
8 | +use yii\bootstrap\NavBar; | ||
9 | +use yii\widgets\Breadcrumbs; | ||
10 | +use frontend\assets\AppAsset; | ||
11 | +use common\widgets\Alert; | ||
12 | + | ||
13 | +AppAsset::register($this); | ||
14 | +?> | ||
15 | +<?php $this->beginPage() ?> | ||
16 | +<!DOCTYPE html> | ||
17 | +<html lang="<?= Yii::$app->language ?>"> | ||
18 | +<head> | ||
19 | + <meta charset="<?= Yii::$app->charset ?>"> | ||
20 | + <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
21 | + <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
22 | + <?= Html::csrfMetaTags() ?> | ||
23 | + <title><?= Html::encode($this->title) ?></title> | ||
24 | + <?php $this->head() ?> | ||
25 | +</head> | ||
26 | +<body> | ||
27 | +<?php $this->beginBody() ?> | ||
28 | + | ||
29 | +<div class="wrap"> | ||
30 | + <?php | ||
31 | + NavBar::begin([ | ||
32 | + 'brandLabel' => Yii::$app->name, | ||
33 | + 'brandUrl' => Yii::$app->homeUrl, | ||
34 | + 'options' => [ | ||
35 | + 'class' => 'navbar-inverse navbar-fixed-top', | ||
36 | + ], | ||
37 | + ]); | ||
38 | + $menuItems = [ | ||
39 | + ['label' => 'Home', 'url' => ['/site/index']], | ||
40 | + ['label' => 'About', 'url' => ['/site/about']], | ||
41 | + ['label' => 'Contact', 'url' => ['/site/contact']], | ||
42 | + ]; | ||
43 | + if (Yii::$app->user->isGuest) { | ||
44 | + $menuItems[] = ['label' => 'Signup', 'url' => ['/site/signup']]; | ||
45 | + $menuItems[] = ['label' => 'Login', 'url' => ['/site/login']]; | ||
46 | + } else { | ||
47 | + $menuItems[] = '<li>' | ||
48 | + . Html::beginForm(['/site/logout'], 'post') | ||
49 | + . Html::submitButton( | ||
50 | + 'Logout (' . Yii::$app->user->identity->username . ')', | ||
51 | + ['class' => 'btn btn-link logout'] | ||
52 | + ) | ||
53 | + . Html::endForm() | ||
54 | + . '</li>'; | ||
55 | + } | ||
56 | + echo Nav::widget([ | ||
57 | + 'options' => ['class' => 'navbar-nav navbar-right'], | ||
58 | + 'items' => $menuItems, | ||
59 | + ]); | ||
60 | + NavBar::end(); | ||
61 | + ?> | ||
62 | + | ||
63 | + <div class="container"> | ||
64 | + <?= Breadcrumbs::widget([ | ||
65 | + 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], | ||
66 | + ]) ?> | ||
67 | + <?= Alert::widget() ?> | ||
68 | + <?= $content ?> | ||
69 | + </div> | ||
70 | +</div> | ||
71 | + | ||
72 | +<footer class="footer"> | ||
73 | + <div class="container"> | ||
74 | + <p class="pull-left">© <?= Html::encode(Yii::$app->name) ?> <?= date('Y') ?></p> | ||
75 | + | ||
76 | + <p class="pull-right"><?= Yii::powered() ?></p> | ||
77 | + </div> | ||
78 | +</footer> | ||
79 | + | ||
80 | +<?php $this->endBody() ?> | ||
81 | +</body> | ||
82 | +</html> | ||
83 | +<?php $this->endPage() ?> |
1 | +++ a/frontend/views/site/about.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this yii\web\View */ | ||
4 | + | ||
5 | +use yii\helpers\Html; | ||
6 | + | ||
7 | +$this->title = 'About'; | ||
8 | +$this->params['breadcrumbs'][] = $this->title; | ||
9 | +?> | ||
10 | +<div class="site-about"> | ||
11 | + <h1><?= Html::encode($this->title) ?></h1> | ||
12 | + | ||
13 | + <p>This is the About page. You may modify the following file to customize its content:</p> | ||
14 | + | ||
15 | + <code><?= __FILE__ ?></code> | ||
16 | +</div> |
1 | +++ a/frontend/views/site/contact.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this yii\web\View */ | ||
4 | +/* @var $form yii\bootstrap\ActiveForm */ | ||
5 | +/* @var $model \frontend\models\ContactForm */ | ||
6 | + | ||
7 | +use yii\helpers\Html; | ||
8 | +use yii\bootstrap\ActiveForm; | ||
9 | +use yii\captcha\Captcha; | ||
10 | + | ||
11 | +$this->title = 'Contact'; | ||
12 | +$this->params['breadcrumbs'][] = $this->title; | ||
13 | +?> | ||
14 | +<div class="site-contact"> | ||
15 | + <h1><?= Html::encode($this->title) ?></h1> | ||
16 | + | ||
17 | + <p> | ||
18 | + If you have business inquiries or other questions, please fill out the following form to contact us. Thank you. | ||
19 | + </p> | ||
20 | + | ||
21 | + <div class="row"> | ||
22 | + <div class="col-lg-5"> | ||
23 | + <?php $form = ActiveForm::begin(['id' => 'contact-form']); ?> | ||
24 | + | ||
25 | + <?= $form->field($model, 'name')->textInput(['autofocus' => true]) ?> | ||
26 | + | ||
27 | + <?= $form->field($model, 'email') ?> | ||
28 | + | ||
29 | + <?= $form->field($model, 'subject') ?> | ||
30 | + | ||
31 | + <?= $form->field($model, 'body')->textarea(['rows' => 6]) ?> | ||
32 | + | ||
33 | + <?= $form->field($model, 'verifyCode')->widget(Captcha::className(), [ | ||
34 | + 'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>', | ||
35 | + ]) ?> | ||
36 | + | ||
37 | + <div class="form-group"> | ||
38 | + <?= Html::submitButton('Submit', ['class' => 'btn btn-primary', 'name' => 'contact-button']) ?> | ||
39 | + </div> | ||
40 | + | ||
41 | + <?php ActiveForm::end(); ?> | ||
42 | + </div> | ||
43 | + </div> | ||
44 | + | ||
45 | +</div> |
1 | +++ a/frontend/views/site/error.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this yii\web\View */ | ||
4 | +/* @var $name string */ | ||
5 | +/* @var $message string */ | ||
6 | +/* @var $exception Exception */ | ||
7 | + | ||
8 | +use yii\helpers\Html; | ||
9 | + | ||
10 | +$this->title = $name; | ||
11 | +?> | ||
12 | +<div class="site-error"> | ||
13 | + | ||
14 | + <h1><?= Html::encode($this->title) ?></h1> | ||
15 | + | ||
16 | + <div class="alert alert-danger"> | ||
17 | + <?= nl2br(Html::encode($message)) ?> | ||
18 | + </div> | ||
19 | + | ||
20 | + <p> | ||
21 | + The above error occurred while the Web server was processing your request. | ||
22 | + </p> | ||
23 | + <p> | ||
24 | + Please contact us if you think this is a server error. Thank you. | ||
25 | + </p> | ||
26 | + | ||
27 | +</div> |
1 | +++ a/frontend/views/site/index.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this yii\web\View */ | ||
4 | + | ||
5 | +$this->title = 'My Yii Application'; | ||
6 | +?> | ||
7 | +<div class="site-index"> | ||
8 | + | ||
9 | + <div class="jumbotron"> | ||
10 | + <h1>Congratulations!</h1> | ||
11 | + | ||
12 | + <p class="lead">You have successfully created your Yii-powered application.</p> | ||
13 | + | ||
14 | + <p><a class="btn btn-lg btn-success" href="http://www.yiiframework.com">Get started with Yii</a></p> | ||
15 | + </div> | ||
16 | + | ||
17 | + <div class="body-content"> | ||
18 | + | ||
19 | + <div class="row"> | ||
20 | + <div class="col-lg-4"> | ||
21 | + <h2>Heading</h2> | ||
22 | + | ||
23 | + <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et | ||
24 | + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip | ||
25 | + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu | ||
26 | + fugiat nulla pariatur.</p> | ||
27 | + | ||
28 | + <p><a class="btn btn-default" href="http://www.yiiframework.com/doc/">Yii Documentation »</a></p> | ||
29 | + </div> | ||
30 | + <div class="col-lg-4"> | ||
31 | + <h2>Heading</h2> | ||
32 | + | ||
33 | + <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et | ||
34 | + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip | ||
35 | + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu | ||
36 | + fugiat nulla pariatur.</p> | ||
37 | + | ||
38 | + <p><a class="btn btn-default" href="http://www.yiiframework.com/forum/">Yii Forum »</a></p> | ||
39 | + </div> | ||
40 | + <div class="col-lg-4"> | ||
41 | + <h2>Heading</h2> | ||
42 | + | ||
43 | + <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et | ||
44 | + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip | ||
45 | + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu | ||
46 | + fugiat nulla pariatur.</p> | ||
47 | + | ||
48 | + <p><a class="btn btn-default" href="http://www.yiiframework.com/extensions/">Yii Extensions »</a></p> | ||
49 | + </div> | ||
50 | + </div> | ||
51 | + | ||
52 | + </div> | ||
53 | +</div> |
1 | +++ a/frontend/views/site/login.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this yii\web\View */ | ||
4 | +/* @var $form yii\bootstrap\ActiveForm */ | ||
5 | +/* @var $model \common\models\LoginForm */ | ||
6 | + | ||
7 | +use yii\helpers\Html; | ||
8 | +use yii\bootstrap\ActiveForm; | ||
9 | + | ||
10 | +$this->title = 'Login'; | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="site-login"> | ||
14 | + <h1><?= Html::encode($this->title) ?></h1> | ||
15 | + | ||
16 | + <p>Please fill out the following fields to login:</p> | ||
17 | + | ||
18 | + <div class="row"> | ||
19 | + <div class="col-lg-5"> | ||
20 | + <?php $form = ActiveForm::begin(['id' => 'login-form']); ?> | ||
21 | + | ||
22 | + <?= $form->field($model, 'username')->textInput(['autofocus' => true]) ?> | ||
23 | + | ||
24 | + <?= $form->field($model, 'password')->passwordInput() ?> | ||
25 | + | ||
26 | + <?= $form->field($model, 'rememberMe')->checkbox() ?> | ||
27 | + | ||
28 | + <div style="color:#999;margin:1em 0"> | ||
29 | + If you forgot your password you can <?= Html::a('reset it', ['site/request-password-reset']) ?>. | ||
30 | + </div> | ||
31 | + | ||
32 | + <div class="form-group"> | ||
33 | + <?= Html::submitButton('Login', ['class' => 'btn btn-primary', 'name' => 'login-button']) ?> | ||
34 | + </div> | ||
35 | + | ||
36 | + <?php ActiveForm::end(); ?> | ||
37 | + </div> | ||
38 | + </div> | ||
39 | +</div> |
1 | +++ a/frontend/views/site/requestPasswordResetToken.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this yii\web\View */ | ||
4 | +/* @var $form yii\bootstrap\ActiveForm */ | ||
5 | +/* @var $model \frontend\models\PasswordResetRequestForm */ | ||
6 | + | ||
7 | +use yii\helpers\Html; | ||
8 | +use yii\bootstrap\ActiveForm; | ||
9 | + | ||
10 | +$this->title = 'Request password reset'; | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="site-request-password-reset"> | ||
14 | + <h1><?= Html::encode($this->title) ?></h1> | ||
15 | + | ||
16 | + <p>Please fill out your email. A link to reset password will be sent there.</p> | ||
17 | + | ||
18 | + <div class="row"> | ||
19 | + <div class="col-lg-5"> | ||
20 | + <?php $form = ActiveForm::begin(['id' => 'request-password-reset-form']); ?> | ||
21 | + | ||
22 | + <?= $form->field($model, 'email')->textInput(['autofocus' => true]) ?> | ||
23 | + | ||
24 | + <div class="form-group"> | ||
25 | + <?= Html::submitButton('Send', ['class' => 'btn btn-primary']) ?> | ||
26 | + </div> | ||
27 | + | ||
28 | + <?php ActiveForm::end(); ?> | ||
29 | + </div> | ||
30 | + </div> | ||
31 | +</div> |
1 | +++ a/frontend/views/site/resetPassword.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this yii\web\View */ | ||
4 | +/* @var $form yii\bootstrap\ActiveForm */ | ||
5 | +/* @var $model \frontend\models\ResetPasswordForm */ | ||
6 | + | ||
7 | +use yii\helpers\Html; | ||
8 | +use yii\bootstrap\ActiveForm; | ||
9 | + | ||
10 | +$this->title = 'Reset password'; | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="site-reset-password"> | ||
14 | + <h1><?= Html::encode($this->title) ?></h1> | ||
15 | + | ||
16 | + <p>Please choose your new password:</p> | ||
17 | + | ||
18 | + <div class="row"> | ||
19 | + <div class="col-lg-5"> | ||
20 | + <?php $form = ActiveForm::begin(['id' => 'reset-password-form']); ?> | ||
21 | + | ||
22 | + <?= $form->field($model, 'password')->passwordInput(['autofocus' => true]) ?> | ||
23 | + | ||
24 | + <div class="form-group"> | ||
25 | + <?= Html::submitButton('Save', ['class' => 'btn btn-primary']) ?> | ||
26 | + </div> | ||
27 | + | ||
28 | + <?php ActiveForm::end(); ?> | ||
29 | + </div> | ||
30 | + </div> | ||
31 | +</div> |
1 | +++ a/frontend/views/site/signup.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this yii\web\View */ | ||
4 | +/* @var $form yii\bootstrap\ActiveForm */ | ||
5 | +/* @var $model \frontend\models\SignupForm */ | ||
6 | + | ||
7 | +use yii\helpers\Html; | ||
8 | +use yii\bootstrap\ActiveForm; | ||
9 | + | ||
10 | +$this->title = 'Signup'; | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="site-signup"> | ||
14 | + <h1><?= Html::encode($this->title) ?></h1> | ||
15 | + | ||
16 | + <p>Please fill out the following fields to signup:</p> | ||
17 | + | ||
18 | + <div class="row"> | ||
19 | + <div class="col-lg-5"> | ||
20 | + <?php $form = ActiveForm::begin(['id' => 'form-signup']); ?> | ||
21 | + | ||
22 | + <?= $form->field($model, 'username')->textInput(['autofocus' => true]) ?> | ||
23 | + | ||
24 | + <?= $form->field($model, 'email') ?> | ||
25 | + | ||
26 | + <?= $form->field($model, 'password')->passwordInput() ?> | ||
27 | + | ||
28 | + <div class="form-group"> | ||
29 | + <?= Html::submitButton('Signup', ['class' => 'btn btn-primary', 'name' => 'signup-button']) ?> | ||
30 | + </div> | ||
31 | + | ||
32 | + <?php ActiveForm::end(); ?> | ||
33 | + </div> | ||
34 | + </div> | ||
35 | +</div> |
1 | +++ a/frontend/web/css/site.css | ||
1 | +html, | ||
2 | +body { | ||
3 | + height: 100%; | ||
4 | +} | ||
5 | + | ||
6 | +.wrap { | ||
7 | + min-height: 100%; | ||
8 | + height: auto; | ||
9 | + margin: 0 auto -60px; | ||
10 | + padding: 0 0 60px; | ||
11 | +} | ||
12 | + | ||
13 | +.wrap > .container { | ||
14 | + padding: 70px 15px 20px; | ||
15 | +} | ||
16 | + | ||
17 | +.footer { | ||
18 | + height: 60px; | ||
19 | + background-color: #f5f5f5; | ||
20 | + border-top: 1px solid #ddd; | ||
21 | + padding-top: 20px; | ||
22 | +} | ||
23 | + | ||
24 | +.jumbotron { | ||
25 | + text-align: center; | ||
26 | + background-color: transparent; | ||
27 | +} | ||
28 | + | ||
29 | +.jumbotron .btn { | ||
30 | + font-size: 21px; | ||
31 | + padding: 14px 24px; | ||
32 | +} | ||
33 | + | ||
34 | +.not-set { | ||
35 | + color: #c55; | ||
36 | + font-style: italic; | ||
37 | +} | ||
38 | + | ||
39 | +/* add sorting icons to gridview sort links */ | ||
40 | +a.asc:after, a.desc:after { | ||
41 | + position: relative; | ||
42 | + top: 1px; | ||
43 | + display: inline-block; | ||
44 | + font-family: 'Glyphicons Halflings'; | ||
45 | + font-style: normal; | ||
46 | + font-weight: normal; | ||
47 | + line-height: 1; | ||
48 | + padding-left: 5px; | ||
49 | +} | ||
50 | + | ||
51 | +a.asc:after { | ||
52 | + content: "\e151"; | ||
53 | +} | ||
54 | + | ||
55 | +a.desc:after { | ||
56 | + content: "\e152"; | ||
57 | +} | ||
58 | + | ||
59 | +.sort-numerical a.asc:after { | ||
60 | + content: "\e153"; | ||
61 | +} | ||
62 | + | ||
63 | +.sort-numerical a.desc:after { | ||
64 | + content: "\e154"; | ||
65 | +} | ||
66 | + | ||
67 | +.sort-ordinal a.asc:after { | ||
68 | + content: "\e155"; | ||
69 | +} | ||
70 | + | ||
71 | +.sort-ordinal a.desc:after { | ||
72 | + content: "\e156"; | ||
73 | +} | ||
74 | + | ||
75 | +.grid-view td { | ||
76 | + white-space: nowrap; | ||
77 | +} | ||
78 | + | ||
79 | +.grid-view .filters input, | ||
80 | +.grid-view .filters select { | ||
81 | + min-width: 50px; | ||
82 | +} | ||
83 | + | ||
84 | +.hint-block { | ||
85 | + display: block; | ||
86 | + margin-top: 5px; | ||
87 | + color: #999; | ||
88 | +} | ||
89 | + | ||
90 | +.error-summary { | ||
91 | + color: #a94442; | ||
92 | + background: #fdf7f7; | ||
93 | + border-left: 3px solid #eed3d7; | ||
94 | + padding: 10px 20px; | ||
95 | + margin: 0 0 15px 0; | ||
96 | +} | ||
97 | + | ||
98 | +/* align the logout "link" (button in form) of the navbar */ | ||
99 | +.nav li > form > button.logout { | ||
100 | + padding: 15px; | ||
101 | + border: none; | ||
102 | +} | ||
103 | + | ||
104 | +@media(max-width:767px) { | ||
105 | + .nav li > form > button.logout { | ||
106 | + display:block; | ||
107 | + text-align: left; | ||
108 | + width: 100%; | ||
109 | + padding: 10px 15px; | ||
110 | + } | ||
111 | +} | ||
112 | + | ||
113 | +.nav > li > form > button.logout:focus, | ||
114 | +.nav > li > form > button.logout:hover { | ||
115 | + text-decoration: none; | ||
116 | +} | ||
117 | + | ||
118 | +.nav > li > form > button.logout:focus { | ||
119 | + outline: none; | ||
120 | +} |
No preview for this file type
1 | +++ a/init | ||
1 | +#!/usr/bin/env php | ||
2 | +<?php | ||
3 | +/** | ||
4 | + * Yii Application Initialization Tool | ||
5 | + * | ||
6 | + * In order to run in non-interactive mode: | ||
7 | + * | ||
8 | + * init --env=Development --overwrite=n | ||
9 | + */ | ||
10 | + | ||
11 | +if (!extension_loaded('openssl')) { | ||
12 | + die('The OpenSSL PHP extension is required by Yii2.'); | ||
13 | +} | ||
14 | + | ||
15 | +$params = getParams(); | ||
16 | +$root = str_replace('\\', '/', __DIR__); | ||
17 | +$envs = require "$root/environments/index.php"; | ||
18 | +$envNames = array_keys($envs); | ||
19 | + | ||
20 | +echo "Yii Application Initialization Tool v1.0\n\n"; | ||
21 | + | ||
22 | +$envName = null; | ||
23 | +if (empty($params['env']) || $params['env'] === '1') { | ||
24 | + echo "Which environment do you want the application to be initialized in?\n\n"; | ||
25 | + foreach ($envNames as $i => $name) { | ||
26 | + echo " [$i] $name\n"; | ||
27 | + } | ||
28 | + echo "\n Your choice [0-" . (count($envs) - 1) . ', or "q" to quit] '; | ||
29 | + $answer = trim(fgets(STDIN)); | ||
30 | + | ||
31 | + if (!ctype_digit($answer) || !in_array($answer, range(0, count($envs) - 1))) { | ||
32 | + echo "\n Quit initialization.\n"; | ||
33 | + exit(0); | ||
34 | + } | ||
35 | + | ||
36 | + if (isset($envNames[$answer])) { | ||
37 | + $envName = $envNames[$answer]; | ||
38 | + } | ||
39 | +} else { | ||
40 | + $envName = $params['env']; | ||
41 | +} | ||
42 | + | ||
43 | +if (!in_array($envName, $envNames)) { | ||
44 | + $envsList = implode(', ', $envNames); | ||
45 | + echo "\n $envName is not a valid environment. Try one of the following: $envsList. \n"; | ||
46 | + exit(2); | ||
47 | +} | ||
48 | + | ||
49 | +$env = $envs[$envName]; | ||
50 | + | ||
51 | +if (empty($params['env'])) { | ||
52 | + echo "\n Initialize the application under '{$envNames[$answer]}' environment? [yes|no] "; | ||
53 | + $answer = trim(fgets(STDIN)); | ||
54 | + if (strncasecmp($answer, 'y', 1)) { | ||
55 | + echo "\n Quit initialization.\n"; | ||
56 | + exit(0); | ||
57 | + } | ||
58 | +} | ||
59 | + | ||
60 | +echo "\n Start initialization ...\n\n"; | ||
61 | +$files = getFileList("$root/environments/{$env['path']}"); | ||
62 | +if (isset($env['skipFiles'])) { | ||
63 | + $skipFiles = $env['skipFiles']; | ||
64 | + array_walk($skipFiles, function(&$value) use($env, $root) { $value = "$root/$value"; }); | ||
65 | + $files = array_diff($files, array_intersect_key($env['skipFiles'], array_filter($skipFiles, 'file_exists'))); | ||
66 | +} | ||
67 | +$all = false; | ||
68 | +foreach ($files as $file) { | ||
69 | + if (!copyFile($root, "environments/{$env['path']}/$file", $file, $all, $params)) { | ||
70 | + break; | ||
71 | + } | ||
72 | +} | ||
73 | + | ||
74 | +$callbacks = ['setCookieValidationKey', 'setWritable', 'setExecutable', 'createSymlink']; | ||
75 | +foreach ($callbacks as $callback) { | ||
76 | + if (!empty($env[$callback])) { | ||
77 | + $callback($root, $env[$callback]); | ||
78 | + } | ||
79 | +} | ||
80 | + | ||
81 | +echo "\n ... initialization completed.\n\n"; | ||
82 | + | ||
83 | +function getFileList($root, $basePath = '') | ||
84 | +{ | ||
85 | + $files = []; | ||
86 | + $handle = opendir($root); | ||
87 | + while (($path = readdir($handle)) !== false) { | ||
88 | + if ($path === '.git' || $path === '.svn' || $path === '.' || $path === '..') { | ||
89 | + continue; | ||
90 | + } | ||
91 | + $fullPath = "$root/$path"; | ||
92 | + $relativePath = $basePath === '' ? $path : "$basePath/$path"; | ||
93 | + if (is_dir($fullPath)) { | ||
94 | + $files = array_merge($files, getFileList($fullPath, $relativePath)); | ||
95 | + } else { | ||
96 | + $files[] = $relativePath; | ||
97 | + } | ||
98 | + } | ||
99 | + closedir($handle); | ||
100 | + return $files; | ||
101 | +} | ||
102 | + | ||
103 | +function copyFile($root, $source, $target, &$all, $params) | ||
104 | +{ | ||
105 | + if (!is_file($root . '/' . $source)) { | ||
106 | + echo " skip $target ($source not exist)\n"; | ||
107 | + return true; | ||
108 | + } | ||
109 | + if (is_file($root . '/' . $target)) { | ||
110 | + if (file_get_contents($root . '/' . $source) === file_get_contents($root . '/' . $target)) { | ||
111 | + echo " unchanged $target\n"; | ||
112 | + return true; | ||
113 | + } | ||
114 | + if ($all) { | ||
115 | + echo " overwrite $target\n"; | ||
116 | + } else { | ||
117 | + echo " exist $target\n"; | ||
118 | + echo " ...overwrite? [Yes|No|All|Quit] "; | ||
119 | + | ||
120 | + | ||
121 | + $answer = !empty($params['overwrite']) ? $params['overwrite'] : trim(fgets(STDIN)); | ||
122 | + if (!strncasecmp($answer, 'q', 1)) { | ||
123 | + return false; | ||
124 | + } else { | ||
125 | + if (!strncasecmp($answer, 'y', 1)) { | ||
126 | + echo " overwrite $target\n"; | ||
127 | + } else { | ||
128 | + if (!strncasecmp($answer, 'a', 1)) { | ||
129 | + echo " overwrite $target\n"; | ||
130 | + $all = true; | ||
131 | + } else { | ||
132 | + echo " skip $target\n"; | ||
133 | + return true; | ||
134 | + } | ||
135 | + } | ||
136 | + } | ||
137 | + } | ||
138 | + file_put_contents($root . '/' . $target, file_get_contents($root . '/' . $source)); | ||
139 | + return true; | ||
140 | + } | ||
141 | + echo " generate $target\n"; | ||
142 | + @mkdir(dirname($root . '/' . $target), 0777, true); | ||
143 | + file_put_contents($root . '/' . $target, file_get_contents($root . '/' . $source)); | ||
144 | + return true; | ||
145 | +} | ||
146 | + | ||
147 | +function getParams() | ||
148 | +{ | ||
149 | + $rawParams = []; | ||
150 | + if (isset($_SERVER['argv'])) { | ||
151 | + $rawParams = $_SERVER['argv']; | ||
152 | + array_shift($rawParams); | ||
153 | + } | ||
154 | + | ||
155 | + $params = []; | ||
156 | + foreach ($rawParams as $param) { | ||
157 | + if (preg_match('/^--(\w+)(=(.*))?$/', $param, $matches)) { | ||
158 | + $name = $matches[1]; | ||
159 | + $params[$name] = isset($matches[3]) ? $matches[3] : true; | ||
160 | + } else { | ||
161 | + $params[] = $param; | ||
162 | + } | ||
163 | + } | ||
164 | + return $params; | ||
165 | +} | ||
166 | + | ||
167 | +function setWritable($root, $paths) | ||
168 | +{ | ||
169 | + foreach ($paths as $writable) { | ||
170 | + if (is_dir("$root/$writable")) { | ||
171 | + if (@chmod("$root/$writable", 0777)) { | ||
172 | + echo " chmod 0777 $writable\n"; | ||
173 | + } else { | ||
174 | + printError("Operation chmod not permitted for directory $writable."); | ||
175 | + } | ||
176 | + } else { | ||
177 | + printError("Directory $writable does not exist."); | ||
178 | + } | ||
179 | + } | ||
180 | +} | ||
181 | + | ||
182 | +function setExecutable($root, $paths) | ||
183 | +{ | ||
184 | + foreach ($paths as $executable) { | ||
185 | + if (file_exists("$root/$executable")) { | ||
186 | + if (@chmod("$root/$executable", 0755)) { | ||
187 | + echo " chmod 0755 $executable\n"; | ||
188 | + } else { | ||
189 | + printError("Operation chmod not permitted for $executable."); | ||
190 | + } | ||
191 | + } else { | ||
192 | + printError("$executable does not exist."); | ||
193 | + } | ||
194 | + } | ||
195 | +} | ||
196 | + | ||
197 | +function setCookieValidationKey($root, $paths) | ||
198 | +{ | ||
199 | + foreach ($paths as $file) { | ||
200 | + echo " generate cookie validation key in $file\n"; | ||
201 | + $file = $root . '/' . $file; | ||
202 | + $length = 32; | ||
203 | + $bytes = openssl_random_pseudo_bytes($length); | ||
204 | + $key = strtr(substr(base64_encode($bytes), 0, $length), '+/=', '_-.'); | ||
205 | + $content = preg_replace('/(("|\')cookieValidationKey("|\')\s*=>\s*)(""|\'\')/', "\\1'$key'", file_get_contents($file)); | ||
206 | + file_put_contents($file, $content); | ||
207 | + } | ||
208 | +} | ||
209 | + | ||
210 | +function createSymlink($root, $links) | ||
211 | +{ | ||
212 | + foreach ($links as $link => $target) { | ||
213 | + //first removing folders to avoid errors if the folder already exists | ||
214 | + @rmdir($root . "/" . $link); | ||
215 | + //next removing existing symlink in order to update the target | ||
216 | + if (is_link($root . "/" . $link)) { | ||
217 | + @unlink($root . "/" . $link); | ||
218 | + } | ||
219 | + if (@symlink($root . "/" . $target, $root . "/" . $link)) { | ||
220 | + echo " symlink $root/$target $root/$link\n"; | ||
221 | + } else { | ||
222 | + printError("Cannot create symlink $root/$target $root/$link."); | ||
223 | + } | ||
224 | + } | ||
225 | +} | ||
226 | + | ||
227 | +/** | ||
228 | + * Prints error message. | ||
229 | + * @param string $message message | ||
230 | + */ | ||
231 | +function printError($message) | ||
232 | +{ | ||
233 | + echo "\n " . formatMessage("Error. $message", ['fg-red']) . " \n"; | ||
234 | +} | ||
235 | + | ||
236 | +/** | ||
237 | + * Returns true if the stream supports colorization. ANSI colors are disabled if not supported by the stream. | ||
238 | + * | ||
239 | + * - windows without ansicon | ||
240 | + * - not tty consoles | ||
241 | + * | ||
242 | + * @return boolean true if the stream supports ANSI colors, otherwise false. | ||
243 | + */ | ||
244 | +function ansiColorsSupported() | ||
245 | +{ | ||
246 | + return DIRECTORY_SEPARATOR === '\\' | ||
247 | + ? getenv('ANSICON') !== false || getenv('ConEmuANSI') === 'ON' | ||
248 | + : function_exists('posix_isatty') && @posix_isatty(STDOUT); | ||
249 | +} | ||
250 | + | ||
251 | +/** | ||
252 | + * Get ANSI code of style. | ||
253 | + * @param string $name style name | ||
254 | + * @return integer ANSI code of style. | ||
255 | + */ | ||
256 | +function getStyleCode($name) | ||
257 | +{ | ||
258 | + $styles = [ | ||
259 | + 'bold' => 1, | ||
260 | + 'fg-black' => 30, | ||
261 | + 'fg-red' => 31, | ||
262 | + 'fg-green' => 32, | ||
263 | + 'fg-yellow' => 33, | ||
264 | + 'fg-blue' => 34, | ||
265 | + 'fg-magenta' => 35, | ||
266 | + 'fg-cyan' => 36, | ||
267 | + 'fg-white' => 37, | ||
268 | + 'bg-black' => 40, | ||
269 | + 'bg-red' => 41, | ||
270 | + 'bg-green' => 42, | ||
271 | + 'bg-yellow' => 43, | ||
272 | + 'bg-blue' => 44, | ||
273 | + 'bg-magenta' => 45, | ||
274 | + 'bg-cyan' => 46, | ||
275 | + 'bg-white' => 47, | ||
276 | + ]; | ||
277 | + return $styles[$name]; | ||
278 | +} | ||
279 | + | ||
280 | +/** | ||
281 | + * Formats message using styles if STDOUT supports it. | ||
282 | + * @param string $message message | ||
283 | + * @param string[] $styles styles | ||
284 | + * @return string formatted message. | ||
285 | + */ | ||
286 | +function formatMessage($message, $styles) | ||
287 | +{ | ||
288 | + if (empty($styles) || !ansiColorsSupported()) { | ||
289 | + return $message; | ||
290 | + } | ||
291 | + | ||
292 | + return sprintf("\x1b[%sm", implode(';', array_map('getStyleCode', $styles))) . $message . "\x1b[0m"; | ||
293 | +} |
1 | +++ a/init.bat | ||
1 | +@echo off | ||
2 | + | ||
3 | +rem ------------------------------------------------------------- | ||
4 | +rem Yii command line init script for Windows. | ||
5 | +rem ------------------------------------------------------------- | ||
6 | + | ||
7 | +@setlocal | ||
8 | + | ||
9 | +set YII_PATH=%~dp0 | ||
10 | + | ||
11 | +if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe | ||
12 | + | ||
13 | +"%PHP_COMMAND%" "%YII_PATH%init" %* | ||
14 | + | ||
15 | +@endlocal |
1 | +++ a/requirements.php | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * Application requirement checker script. | ||
4 | + * | ||
5 | + * In order to run this script use the following console command: | ||
6 | + * php requirements.php | ||
7 | + * | ||
8 | + * In order to run this script from the web, you should copy it to the web root. | ||
9 | + * If you are using Linux you can create a hard link instead, using the following command: | ||
10 | + * ln ../requirements.php requirements.php | ||
11 | + */ | ||
12 | + | ||
13 | +// you may need to adjust this path to the correct Yii framework path | ||
14 | +$frameworkPath = dirname(__FILE__) . '/vendor/yiisoft/yii2'; | ||
15 | + | ||
16 | +if (!is_dir($frameworkPath)) { | ||
17 | + echo '<h1>Error</h1>'; | ||
18 | + echo '<p><strong>The path to yii framework seems to be incorrect.</strong></p>'; | ||
19 | + echo '<p>You need to install Yii framework via composer or adjust the framework path in file <abbr title="' . __FILE__ . '">' . basename(__FILE__) . '</abbr>.</p>'; | ||
20 | + echo '<p>Please refer to the <abbr title="' . dirname(__FILE__) . '/README.md">README</abbr> on how to install Yii.</p>'; | ||
21 | +} | ||
22 | + | ||
23 | +require_once $frameworkPath . '/requirements/YiiRequirementChecker.php'; | ||
24 | +$requirementsChecker = new YiiRequirementChecker(); | ||
25 | + | ||
26 | +$gdMemo = $imagickMemo = 'Either GD PHP extension with FreeType support or ImageMagick PHP extension with PNG support is required for image CAPTCHA.'; | ||
27 | +$gdOK = $imagickOK = false; | ||
28 | + | ||
29 | +if (extension_loaded('imagick')) { | ||
30 | + $imagick = new Imagick(); | ||
31 | + $imagickFormats = $imagick->queryFormats('PNG'); | ||
32 | + if (in_array('PNG', $imagickFormats)) { | ||
33 | + $imagickOK = true; | ||
34 | + } else { | ||
35 | + $imagickMemo = 'Imagick extension should be installed with PNG support in order to be used for image CAPTCHA.'; | ||
36 | + } | ||
37 | +} | ||
38 | + | ||
39 | +if (extension_loaded('gd')) { | ||
40 | + $gdInfo = gd_info(); | ||
41 | + if (!empty($gdInfo['FreeType Support'])) { | ||
42 | + $gdOK = true; | ||
43 | + } else { | ||
44 | + $gdMemo = 'GD extension should be installed with FreeType support in order to be used for image CAPTCHA.'; | ||
45 | + } | ||
46 | +} | ||
47 | + | ||
48 | +/** | ||
49 | + * Adjust requirements according to your application specifics. | ||
50 | + */ | ||
51 | +$requirements = array( | ||
52 | + // Database : | ||
53 | + array( | ||
54 | + 'name' => 'PDO extension', | ||
55 | + 'mandatory' => true, | ||
56 | + 'condition' => extension_loaded('pdo'), | ||
57 | + 'by' => 'All DB-related classes', | ||
58 | + ), | ||
59 | + array( | ||
60 | + 'name' => 'PDO SQLite extension', | ||
61 | + 'mandatory' => false, | ||
62 | + 'condition' => extension_loaded('pdo_sqlite'), | ||
63 | + 'by' => 'All DB-related classes', | ||
64 | + 'memo' => 'Required for SQLite database.', | ||
65 | + ), | ||
66 | + array( | ||
67 | + 'name' => 'PDO MySQL extension', | ||
68 | + 'mandatory' => false, | ||
69 | + 'condition' => extension_loaded('pdo_mysql'), | ||
70 | + 'by' => 'All DB-related classes', | ||
71 | + 'memo' => 'Required for MySQL database.', | ||
72 | + ), | ||
73 | + array( | ||
74 | + 'name' => 'PDO PostgreSQL extension', | ||
75 | + 'mandatory' => false, | ||
76 | + 'condition' => extension_loaded('pdo_pgsql'), | ||
77 | + 'by' => 'All DB-related classes', | ||
78 | + 'memo' => 'Required for PostgreSQL database.', | ||
79 | + ), | ||
80 | + // Cache : | ||
81 | + array( | ||
82 | + 'name' => 'Memcache extension', | ||
83 | + 'mandatory' => false, | ||
84 | + 'condition' => extension_loaded('memcache') || extension_loaded('memcached'), | ||
85 | + 'by' => '<a href="http://www.yiiframework.com/doc-2.0/yii-caching-memcache.html">MemCache</a>', | ||
86 | + 'memo' => extension_loaded('memcached') ? 'To use memcached set <a href="http://www.yiiframework.com/doc-2.0/yii-caching-memcache.html#$useMemcached-detail">MemCache::useMemcached</a> to <code>true</code>.' : '' | ||
87 | + ), | ||
88 | + array( | ||
89 | + 'name' => 'APC extension', | ||
90 | + 'mandatory' => false, | ||
91 | + 'condition' => extension_loaded('apc'), | ||
92 | + 'by' => '<a href="http://www.yiiframework.com/doc-2.0/yii-caching-apccache.html">ApcCache</a>', | ||
93 | + ), | ||
94 | + // CAPTCHA: | ||
95 | + array( | ||
96 | + 'name' => 'GD PHP extension with FreeType support', | ||
97 | + 'mandatory' => false, | ||
98 | + 'condition' => $gdOK, | ||
99 | + 'by' => '<a href="http://www.yiiframework.com/doc-2.0/yii-captcha-captcha.html">Captcha</a>', | ||
100 | + 'memo' => $gdMemo, | ||
101 | + ), | ||
102 | + array( | ||
103 | + 'name' => 'ImageMagick PHP extension with PNG support', | ||
104 | + 'mandatory' => false, | ||
105 | + 'condition' => $imagickOK, | ||
106 | + 'by' => '<a href="http://www.yiiframework.com/doc-2.0/yii-captcha-captcha.html">Captcha</a>', | ||
107 | + 'memo' => $imagickMemo, | ||
108 | + ), | ||
109 | + // PHP ini : | ||
110 | + 'phpExposePhp' => array( | ||
111 | + 'name' => 'Expose PHP', | ||
112 | + 'mandatory' => false, | ||
113 | + 'condition' => $requirementsChecker->checkPhpIniOff("expose_php"), | ||
114 | + 'by' => 'Security reasons', | ||
115 | + 'memo' => '"expose_php" should be disabled at php.ini', | ||
116 | + ), | ||
117 | + 'phpAllowUrlInclude' => array( | ||
118 | + 'name' => 'PHP allow url include', | ||
119 | + 'mandatory' => false, | ||
120 | + 'condition' => $requirementsChecker->checkPhpIniOff("allow_url_include"), | ||
121 | + 'by' => 'Security reasons', | ||
122 | + 'memo' => '"allow_url_include" should be disabled at php.ini', | ||
123 | + ), | ||
124 | + 'phpSmtp' => array( | ||
125 | + 'name' => 'PHP mail SMTP', | ||
126 | + 'mandatory' => false, | ||
127 | + 'condition' => strlen(ini_get('SMTP')) > 0, | ||
128 | + 'by' => 'Email sending', | ||
129 | + 'memo' => 'PHP mail SMTP server required', | ||
130 | + ), | ||
131 | +); | ||
132 | +$requirementsChecker->checkYii()->check($requirements)->render(); |
1 | +++ a/vagrant/config/vagrant-local.example.yml | ||
1 | +# Your personal GitHub token | ||
2 | +github_token: <your-personal-github-token> | ||
3 | +# Read more: https://github.com/blog/1509-personal-api-tokens | ||
4 | +# You can generate it here: https://github.com/settings/tokens | ||
5 | + | ||
6 | +# Guest OS timezone | ||
7 | +timezone: Europe/London | ||
8 | + | ||
9 | +# Are we need check box updates for every 'vagrant up'? | ||
10 | +box_check_update: false | ||
11 | + | ||
12 | +# Virtual machine name | ||
13 | +machine_name: y2aa | ||
14 | + | ||
15 | +# Virtual machine IP | ||
16 | +ip: 192.168.83.137 | ||
17 | + | ||
18 | +# Virtual machine CPU cores number | ||
19 | +cpus: 1 | ||
20 | + | ||
21 | +# Virtual machine RAM | ||
22 | +memory: 1024 |
1 | +++ a/vagrant/nginx/app.conf | ||
1 | +server { | ||
2 | + charset utf-8; | ||
3 | + client_max_body_size 128M; | ||
4 | + sendfile off; | ||
5 | + | ||
6 | + listen 80; ## listen for ipv4 | ||
7 | + #listen [::]:80 default_server ipv6only=on; ## listen for ipv6 | ||
8 | + | ||
9 | + server_name y2aa-frontend.test; | ||
10 | + root /app/frontend/web/; | ||
11 | + index index.php; | ||
12 | + | ||
13 | + access_log /app/vagrant/nginx/log/frontend-access.log; | ||
14 | + error_log /app/vagrant/nginx/log/frontend-error.log; | ||
15 | + | ||
16 | + location / { | ||
17 | + # Redirect everything that isn't a real file to index.php | ||
18 | + try_files $uri $uri/ /index.php$is_args$args; | ||
19 | + } | ||
20 | + | ||
21 | + # uncomment to avoid processing of calls to non-existing static files by Yii | ||
22 | + #location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { | ||
23 | + # try_files $uri =404; | ||
24 | + #} | ||
25 | + #error_page 404 /404.html; | ||
26 | + | ||
27 | + location ~ \.php$ { | ||
28 | + include fastcgi_params; | ||
29 | + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
30 | + #fastcgi_pass 127.0.0.1:9000; | ||
31 | + fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; | ||
32 | + try_files $uri =404; | ||
33 | + } | ||
34 | + | ||
35 | + location ~ /\.(ht|svn|git) { | ||
36 | + deny all; | ||
37 | + } | ||
38 | +} | ||
39 | + | ||
40 | +server { | ||
41 | + charset utf-8; | ||
42 | + client_max_body_size 128M; | ||
43 | + sendfile off; | ||
44 | + | ||
45 | + listen 80; ## listen for ipv4 | ||
46 | + #listen [::]:80 default_server ipv6only=on; ## listen for ipv6 | ||
47 | + | ||
48 | + server_name y2aa-backend.test; | ||
49 | + root /app/backend/web/; | ||
50 | + index index.php; | ||
51 | + | ||
52 | + access_log /app/vagrant/nginx/log/backend-access.log; | ||
53 | + error_log /app/vagrant/nginx/log/backend-error.log; | ||
54 | + | ||
55 | + location / { | ||
56 | + # Redirect everything that isn't a real file to index.php | ||
57 | + try_files $uri $uri/ /index.php$is_args$args; | ||
58 | + } | ||
59 | + | ||
60 | + # uncomment to avoid processing of calls to non-existing static files by Yii | ||
61 | + #location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { | ||
62 | + # try_files $uri =404; | ||
63 | + #} | ||
64 | + #error_page 404 /404.html; | ||
65 | + | ||
66 | + location ~ \.php$ { | ||
67 | + include fastcgi_params; | ||
68 | + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
69 | + #fastcgi_pass 127.0.0.1:9000; | ||
70 | + fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; | ||
71 | + try_files $uri =404; | ||
72 | + } | ||
73 | + | ||
74 | + location ~ /\.(ht|svn|git) { | ||
75 | + deny all; | ||
76 | + } | ||
77 | +} |
1 | +++ a/vagrant/provision/always-as-root.sh | ||
1 | +#!/usr/bin/env bash | ||
2 | + | ||
3 | +source /app/vagrant/provision/common.sh | ||
4 | + | ||
5 | +#== Provision script == | ||
6 | + | ||
7 | +info "Provision-script user: `whoami`" | ||
8 | + | ||
9 | +info "Restart web-stack" | ||
10 | +service php7.0-fpm restart | ||
11 | +service nginx restart | ||
12 | +service mysql restart | ||
0 | \ No newline at end of file | 13 | \ No newline at end of file |
1 | +++ a/vagrant/provision/once-as-root.sh | ||
1 | +#!/usr/bin/env bash | ||
2 | + | ||
3 | +source /app/vagrant/provision/common.sh | ||
4 | + | ||
5 | +#== Import script args == | ||
6 | + | ||
7 | +timezone=$(echo "$1") | ||
8 | + | ||
9 | +#== Provision script == | ||
10 | + | ||
11 | +info "Provision-script user: `whoami`" | ||
12 | + | ||
13 | +export DEBIAN_FRONTEND=noninteractive | ||
14 | + | ||
15 | +info "Configure timezone" | ||
16 | +timedatectl set-timezone ${timezone} --no-ask-password | ||
17 | + | ||
18 | +info "Prepare root password for MySQL" | ||
19 | +debconf-set-selections <<< "mysql-community-server mysql-community-server/root-pass password \"''\"" | ||
20 | +debconf-set-selections <<< "mysql-community-server mysql-community-server/re-root-pass password \"''\"" | ||
21 | +echo "Done!" | ||
22 | + | ||
23 | +info "Update OS software" | ||
24 | +apt-get update | ||
25 | +apt-get upgrade -y | ||
26 | + | ||
27 | +info "Install additional software" | ||
28 | +apt-get install -y php7.0-curl php7.0-cli php7.0-intl php7.0-mysqlnd php7.0-gd php7.0-fpm php7.0-mbstring php7.0-xml unzip nginx mysql-server-5.7 php.xdebug | ||
29 | + | ||
30 | +info "Configure MySQL" | ||
31 | +sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/mysql.conf.d/mysqld.cnf | ||
32 | +mysql -uroot <<< "CREATE USER 'root'@'%' IDENTIFIED BY ''" | ||
33 | +mysql -uroot <<< "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'" | ||
34 | +mysql -uroot <<< "DROP USER 'root'@'localhost'" | ||
35 | +mysql -uroot <<< "FLUSH PRIVILEGES" | ||
36 | +echo "Done!" | ||
37 | + | ||
38 | +info "Configure PHP-FPM" | ||
39 | +sed -i 's/user = www-data/user = vagrant/g' /etc/php/7.0/fpm/pool.d/www.conf | ||
40 | +sed -i 's/group = www-data/group = vagrant/g' /etc/php/7.0/fpm/pool.d/www.conf | ||
41 | +sed -i 's/owner = www-data/owner = vagrant/g' /etc/php/7.0/fpm/pool.d/www.conf | ||
42 | +cat << EOF > /etc/php/7.0/mods-available/xdebug.ini | ||
43 | +zend_extension=xdebug.so | ||
44 | +xdebug.remote_enable=1 | ||
45 | +xdebug.remote_connect_back=1 | ||
46 | +xdebug.remote_port=9000 | ||
47 | +xdebug.remote_autostart=1 | ||
48 | +EOF | ||
49 | +echo "Done!" | ||
50 | + | ||
51 | +info "Configure NGINX" | ||
52 | +sed -i 's/user www-data/user vagrant/g' /etc/nginx/nginx.conf | ||
53 | +echo "Done!" | ||
54 | + | ||
55 | +info "Enabling site configuration" | ||
56 | +ln -s /app/vagrant/nginx/app.conf /etc/nginx/sites-enabled/app.conf | ||
57 | +echo "Done!" | ||
58 | + | ||
59 | +info "Initailize databases for MySQL" | ||
60 | +mysql -uroot <<< "CREATE DATABASE yii2advanced" | ||
61 | +mysql -uroot <<< "CREATE DATABASE yii2advanced_test" | ||
62 | +echo "Done!" | ||
63 | + | ||
64 | +info "Install composer" | ||
65 | +curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | ||
0 | \ No newline at end of file | 66 | \ No newline at end of file |
1 | +++ a/vagrant/provision/once-as-vagrant.sh | ||
1 | +#!/usr/bin/env bash | ||
2 | + | ||
3 | +source /app/vagrant/provision/common.sh | ||
4 | + | ||
5 | +#== Import script args == | ||
6 | + | ||
7 | +github_token=$(echo "$1") | ||
8 | + | ||
9 | +#== Provision script == | ||
10 | + | ||
11 | +info "Provision-script user: `whoami`" | ||
12 | + | ||
13 | +info "Configure composer" | ||
14 | +composer config --global github-oauth.github.com ${github_token} | ||
15 | +echo "Done!" | ||
16 | + | ||
17 | +info "Install project dependencies" | ||
18 | +cd /app | ||
19 | +composer --no-progress --prefer-dist install | ||
20 | + | ||
21 | +info "Init project" | ||
22 | +./init --env=Development --overwrite=y | ||
23 | + | ||
24 | +info "Apply migrations" | ||
25 | +./yii migrate --interactive=0 | ||
26 | +./yii_test migrate --interactive=0 | ||
27 | + | ||
28 | +info "Create bash-alias 'app' for vagrant user" | ||
29 | +echo 'alias app="cd /app"' | tee /home/vagrant/.bash_aliases | ||
30 | + | ||
31 | +info "Enabling colorized prompt for guest console" | ||
32 | +sed -i "s/#force_color_prompt=yes/force_color_prompt=yes/" /home/vagrant/.bashrc |
1 | +++ a/yii.bat | ||
1 | +@echo off | ||
2 | + | ||
3 | +rem ------------------------------------------------------------- | ||
4 | +rem Yii command line bootstrap script for Windows. | ||
5 | +rem ------------------------------------------------------------- | ||
6 | + | ||
7 | +@setlocal | ||
8 | + | ||
9 | +set YII_PATH=%~dp0 | ||
10 | + | ||
11 | +if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe | ||
12 | + | ||
13 | +"%PHP_COMMAND%" "%YII_PATH%yii" %* | ||
14 | + | ||
15 | +@endlocal |