├── .bowerrc ├── .gitignore ├── LICENSE.md ├── README.md ├── Vagrantfile ├── assets └── AppAsset.php ├── codeception.yml ├── commands ├── HelloController.php └── JobsController.php ├── composer.json ├── composer.lock ├── config ├── console.php ├── db.php ├── params.php ├── swoole-jobs.php ├── test.php ├── test_db.php └── web.php ├── controllers └── SiteController.php ├── mail └── layouts │ └── html.php ├── models ├── ContactForm.php ├── LoginForm.php └── User.php ├── requirements.php ├── runtime └── .gitignore ├── swoole-jobs.php ├── tests ├── _bootstrap.php ├── _data │ └── .gitkeep ├── _output │ └── .gitignore ├── _support │ ├── AcceptanceTester.php │ ├── FunctionalTester.php │ └── UnitTester.php ├── acceptance.suite.yml.example ├── acceptance │ ├── AboutCest.php │ ├── ContactCest.php │ ├── HomeCest.php │ ├── LoginCest.php │ └── _bootstrap.php ├── bin │ ├── yii │ └── yii.bat ├── functional.suite.yml ├── functional │ ├── ContactFormCest.php │ ├── LoginFormCest.php │ └── _bootstrap.php ├── unit.suite.yml └── unit │ ├── _bootstrap.php │ └── models │ ├── ContactFormTest.php │ ├── LoginFormTest.php │ └── UserTest.php ├── vagrant ├── config │ ├── .gitignore │ └── vagrant-local-example.yml ├── nginx │ ├── app.conf │ └── log │ │ └── .gitignore └── provision │ ├── always-as-root.sh │ ├── once-as-root.sh │ └── once-as-vagrant.sh ├── views ├── layouts │ └── main.php └── site │ ├── about.php │ ├── contact.php │ ├── error.php │ ├── index.php │ └── login.php ├── web ├── assets │ └── .gitignore ├── css │ └── site.css ├── favicon.ico ├── index-test.php ├── index.php └── robots.txt ├── widgets └── Alert.php ├── yii └── yii.bat /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory" : "vendor/bower-asset" 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # phpstorm project files 2 | .idea 3 | 4 | # netbeans project files 5 | nbproject 6 | 7 | # zend studio for eclipse project files 8 | .buildpath 9 | .project 10 | .settings 11 | 12 | # windows thumbnail cache 13 | Thumbs.db 14 | 15 | # composer vendor dir 16 | /vendor 17 | 18 | # composer itself is not needed 19 | composer.phar 20 | 21 | # Mac DS_Store Files 22 | .DS_Store 23 | 24 | # phpunit itself is not needed 25 | phpunit.phar 26 | # local phpunit config 27 | /phpunit.xml 28 | 29 | tests/_output/* 30 | tests/_support/_generated 31 | 32 | #vagrant folder 33 | /.vagrant -------------------------------------------------------------------------------- /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. 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## swoole-jobs-yii2 2 | 3 | * 基于swoole-jobs的yii2 demo项目 4 | * 教大家如何整合yii2和swoole-jobs 5 | 6 | ## 文档 7 | 8 | * git clone https://github.com/kcloze/swoole-jobs-yii2.git 9 | * composer install -vvv --profile 10 | * 修改config/swoole-jobs.php配置 11 | 12 | ## 管理服务 13 | 14 | * php ./swoole-jobs.php start|stop|exit 15 | 16 | ## 增加测试任务到队列 17 | 18 | * php yii jobs/add 19 | 20 | ## 自己的yii2项目怎么改? 21 | * 修改自己项目composer.json,增加swoole-jobs包,并执行composer update 22 | ``` 23 | "require": { 24 | "php": ">=7.0", 25 | "kcloze/swoole-jobs": "*" 26 | } 27 | ``` 28 | * 复制该项目swoole-jobs文件到自己项目根目录 29 | * 复制该项目config/swoole-jobs.php到自己项目配置目录 30 | * 插入队列:参考commands/JobsController.php代码 31 | * 参考上面文档启动服务 32 | 33 | 34 | ## 更多信息 35 | * [swoole-jobs](https://github.com/kcloze/swoole-jobs) 36 | 37 | 38 | 39 | ## 联系 40 | 41 | qq群:141059677 42 | 43 | -------------------------------------------------------------------------------- /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 | app: 'yii2basic.dev' 11 | } 12 | 13 | config = { 14 | local: './vagrant/config/vagrant-local.yml', 15 | example: './vagrant/config/vagrant-local.example.yml' 16 | } 17 | 18 | # copy config from example if local config not exists 19 | FileUtils.cp config[:example], config[:local] unless File.exist?(config[:local]) 20 | # read config 21 | options = YAML.load_file config[:local] 22 | 23 | # check github token 24 | if options['github_token'].nil? || options['github_token'].to_s.length != 40 25 | puts "You must place REAL GitHub token into configuration:\n/yii2-app-basic/vagrant/config/vagrant-local.yml" 26 | exit 27 | end 28 | 29 | # vagrant configurate 30 | Vagrant.configure(2) do |config| 31 | # select the box 32 | config.vm.box = 'bento/ubuntu-16.04' 33 | 34 | # should we ask about box updates? 35 | config.vm.box_check_update = options['box_check_update'] 36 | 37 | config.vm.provider 'virtualbox' do |vb| 38 | # machine cpus count 39 | vb.cpus = options['cpus'] 40 | # machine memory size 41 | vb.memory = options['memory'] 42 | # machine name (for VirtualBox UI) 43 | vb.name = options['machine_name'] 44 | end 45 | 46 | # machine name (for vagrant console) 47 | config.vm.define options['machine_name'] 48 | 49 | # machine name (for guest machine console) 50 | config.vm.hostname = options['machine_name'] 51 | 52 | # network settings 53 | config.vm.network 'private_network', ip: options['ip'] 54 | 55 | # sync: folder 'yii2-app-advanced' (host machine) -> folder '/app' (guest machine) 56 | config.vm.synced_folder './', '/app', owner: 'vagrant', group: 'vagrant' 57 | 58 | # disable folder '/vagrant' (guest machine) 59 | config.vm.synced_folder '.', '/vagrant', disabled: true 60 | 61 | # hosts settings (host machine) 62 | config.vm.provision :hostmanager 63 | config.hostmanager.enabled = true 64 | config.hostmanager.manage_host = true 65 | config.hostmanager.ignore_private_ip = false 66 | config.hostmanager.include_offline = true 67 | config.hostmanager.aliases = domains.values 68 | 69 | # quick fix for failed guest additions installations 70 | # config.vbguest.auto_update = false 71 | 72 | # provisioners 73 | config.vm.provision 'shell', path: './vagrant/provision/once-as-root.sh', args: [options['timezone']] 74 | config.vm.provision 'shell', path: './vagrant/provision/once-as-vagrant.sh', args: [options['github_token']], privileged: false 75 | config.vm.provision 'shell', path: './vagrant/provision/always-as-root.sh', run: 'always' 76 | 77 | # post-install message (vagrant console) 78 | config.vm.post_up_message = "App URL: http://#{domains[:app]}" 79 | end 80 | -------------------------------------------------------------------------------- /assets/AppAsset.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 2.0 17 | */ 18 | class AppAsset extends AssetBundle 19 | { 20 | public $basePath = '@webroot'; 21 | public $baseUrl = '@web'; 22 | public $css = [ 23 | 'css/site.css', 24 | ]; 25 | public $js = [ 26 | ]; 27 | public $depends = [ 28 | 'yii\web\YiiAsset', 29 | 'yii\bootstrap\BootstrapAsset', 30 | ]; 31 | } 32 | -------------------------------------------------------------------------------- /codeception.yml: -------------------------------------------------------------------------------- 1 | actor: Tester 2 | paths: 3 | tests: tests 4 | log: tests/_output 5 | data: tests/_data 6 | helpers: tests/_support 7 | settings: 8 | bootstrap: _bootstrap.php 9 | memory_limit: 1024M 10 | colors: true 11 | modules: 12 | config: 13 | Yii2: 14 | configFile: 'config/test.php' 15 | cleanup: false 16 | 17 | # To enable code coverage: 18 | #coverage: 19 | # #c3_url: http://localhost:8080/index-test.php/ 20 | # enabled: true 21 | # #remote: true 22 | # #remote_config: '../codeception.yml' 23 | # whitelist: 24 | # include: 25 | # - models/* 26 | # - controllers/* 27 | # - commands/* 28 | # - mail/* 29 | # blacklist: 30 | # include: 31 | # - assets/* 32 | # - config/* 33 | # - runtime/* 34 | # - vendor/* 35 | # - views/* 36 | # - web/* 37 | # - tests/* 38 | -------------------------------------------------------------------------------- /commands/HelloController.php: -------------------------------------------------------------------------------- 1 | 20 | * 21 | * @since 2.0 22 | */ 23 | class HelloController extends Controller 24 | { 25 | /** 26 | * This command echoes what you have entered as the message. 27 | * 28 | * @param string $message the message to be echoed 29 | */ 30 | public function actionIndex($message = 'hello world') 31 | { 32 | sleep(3); 33 | echo $message . "\n"; 34 | 35 | return ExitCode::OK; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /commands/JobsController.php: -------------------------------------------------------------------------------- 1 | 17 | * 18 | * @since 2.0 19 | */ 20 | 21 | use Kcloze\Jobs\JobObject; 22 | use Kcloze\Jobs\Logs; 23 | use Kcloze\Jobs\Queue\BaseTopicQueue; 24 | use Kcloze\Jobs\Queue\Queue; 25 | use yii\console\Controller; 26 | use yii\console\ExitCode; 27 | 28 | class JobsController extends Controller 29 | { 30 | /** 31 | * This command echoes what you have entered as the message. 32 | * 33 | * @param string $message the message to be echoed 34 | * @param mixed $a 35 | * @param mixed $b 36 | * @param mixed $c 37 | */ 38 | public function actionIndex($message, $a, $b, $c) 39 | { 40 | echo $message . $a . $b . $c . "\n"; 41 | sleep(5); 42 | 43 | return ExitCode::OK; 44 | } 45 | 46 | public function actionAdd() 47 | { 48 | //往topic为MyJob的任务增加执行job 49 | for ($i = 0; $i < 100; $i++) { 50 | $result=$this->addOneJob('MyJob', 'hello', 'index', [time()]); 51 | var_dump($result); 52 | } 53 | 54 | echo 'done' . PHP_EOL; 55 | } 56 | 57 | //可以把这个方法移到service或者通用类库里面 58 | public function addOneJob($jobName, $jobClass, $jobMethod = '', $jobParams = [], $jobExt = []) 59 | { 60 | $config = require APP_PATH . '/config/swoole-jobs.php'; 61 | $logger = Logs::getLogger($config['logPath'] ?? '', $config['logSaveFileApp'] ?? ''); 62 | //exit; 63 | $queue = Queue::getQueue($config['job']['queue'], $logger); 64 | //设置工作进程参数 65 | $queue->setTopics($config['job']['topics']); 66 | 67 | $jobExtras['delay'] = isset($jobExt['delay']) ? $jobExt['delay'] : 0; 68 | $jobExtras['priority'] = isset($jobExt['priority']) ? $jobExt['priority'] : BaseTopicQueue::HIGH_LEVEL_1; 69 | 70 | $job = new JobObject($jobName, $jobClass, $jobMethod, $jobParams, $jobExtras); 71 | $result = $queue->push($jobName, $job); 72 | 73 | return $result; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yiisoft/yii2-app-basic", 3 | "description": "Yii 2 Basic Project Template", 4 | "keywords": ["yii2", "framework", "basic", "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": "dev", 16 | "require": { 17 | "php": ">=5.4.0", 18 | "yiisoft/yii2": "^2.0.14", 19 | "yiisoft/yii2-bootstrap": "^2.0.0", 20 | "yiisoft/yii2-swiftmailer": "^2.0.0", 21 | "kcloze/swoole-jobs": "*" 22 | }, 23 | 24 | "config": { 25 | "process-timeout": 1800, 26 | "fxp-asset": { 27 | "enabled": false 28 | } 29 | }, 30 | "scripts": { 31 | "post-install-cmd": [ 32 | "yii\\composer\\Installer::postInstall" 33 | ], 34 | "post-create-project-cmd": [ 35 | "yii\\composer\\Installer::postCreateProject", 36 | "yii\\composer\\Installer::postInstall" 37 | ] 38 | }, 39 | "extra": { 40 | "yii\\composer\\Installer::postCreateProject": { 41 | "setPermission": [ 42 | { 43 | "runtime": "0777", 44 | "web/assets": "0777", 45 | "yii": "0755" 46 | } 47 | ] 48 | }, 49 | "yii\\composer\\Installer::postInstall": { 50 | "generateCookieValidationKey": [ 51 | "config/web.php" 52 | ] 53 | } 54 | }, 55 | "repositories":{ 56 | 57 | "packagist": { 58 | "type": "composer", 59 | "url": "https://mirrors.aliyun.com/composer" 60 | } 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /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#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "353f89ed44d9efe33b72a6a366c73af8", 8 | "packages": [ 9 | { 10 | "name": "bramus/router", 11 | "version": "1.4.2", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/bramus/router.git", 15 | "reference": "60926db086b797c77081ea1165d1f590464adf13" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/bramus/router/zipball/60926db086b797c77081ea1165d1f590464adf13", 20 | "reference": "60926db086b797c77081ea1165d1f590464adf13", 21 | "shasum": "", 22 | "mirrors": [ 23 | { 24 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 25 | "preferred": true 26 | } 27 | ] 28 | }, 29 | "require": { 30 | "php": ">=5.3.0" 31 | }, 32 | "require-dev": { 33 | "friendsofphp/php-cs-fixer": "~2.14", 34 | "phpunit/php-code-coverage": "~2.0", 35 | "phpunit/phpunit": "~4.0" 36 | }, 37 | "type": "library", 38 | "autoload": { 39 | "psr-0": { 40 | "Bramus": "src/" 41 | } 42 | }, 43 | "notification-url": "https://packagist.org/downloads/", 44 | "license": [ 45 | "MIT" 46 | ], 47 | "authors": [ 48 | { 49 | "name": "Bram(us) Van Damme", 50 | "email": "bramus@bram.us", 51 | "homepage": "http://www.bram.us" 52 | } 53 | ], 54 | "description": "A lightweight and simple object oriented PHP Router", 55 | "homepage": "https://github.com/bramus/router", 56 | "keywords": [ 57 | "router", 58 | "routing" 59 | ], 60 | "time": "2019-02-27T10:21:04+00:00" 61 | }, 62 | { 63 | "name": "cebe/markdown", 64 | "version": "1.1.2", 65 | "source": { 66 | "type": "git", 67 | "url": "https://github.com/cebe/markdown.git", 68 | "reference": "25b28bae8a6f185b5030673af77b32e1163d5c6e" 69 | }, 70 | "dist": { 71 | "type": "zip", 72 | "url": "https://api.github.com/repos/cebe/markdown/zipball/25b28bae8a6f185b5030673af77b32e1163d5c6e", 73 | "reference": "25b28bae8a6f185b5030673af77b32e1163d5c6e", 74 | "shasum": "", 75 | "mirrors": [ 76 | { 77 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 78 | "preferred": true 79 | } 80 | ] 81 | }, 82 | "require": { 83 | "lib-pcre": "*", 84 | "php": ">=5.4.0" 85 | }, 86 | "require-dev": { 87 | "cebe/indent": "*", 88 | "facebook/xhprof": "*@dev", 89 | "phpunit/phpunit": "4.1.*" 90 | }, 91 | "bin": [ 92 | "bin/markdown" 93 | ], 94 | "type": "library", 95 | "extra": { 96 | "branch-alias": { 97 | "dev-master": "1.1.x-dev" 98 | } 99 | }, 100 | "autoload": { 101 | "psr-4": { 102 | "cebe\\markdown\\": "" 103 | } 104 | }, 105 | "notification-url": "https://packagist.org/downloads/", 106 | "license": [ 107 | "MIT" 108 | ], 109 | "authors": [ 110 | { 111 | "name": "Carsten Brandt", 112 | "email": "mail@cebe.cc", 113 | "homepage": "http://cebe.cc/", 114 | "role": "Creator" 115 | } 116 | ], 117 | "description": "A super fast, highly extensible markdown parser for PHP", 118 | "homepage": "https://github.com/cebe/markdown#readme", 119 | "keywords": [ 120 | "extensible", 121 | "fast", 122 | "gfm", 123 | "markdown", 124 | "markdown-extra" 125 | ], 126 | "time": "2017-07-16T21:13:23+00:00" 127 | }, 128 | { 129 | "name": "doctrine/lexer", 130 | "version": "dev-master", 131 | "source": { 132 | "type": "git", 133 | "url": "https://github.com/doctrine/lexer.git", 134 | "reference": "6c4b4c3432406c73a4979b7e56efbffb0462ef64" 135 | }, 136 | "dist": { 137 | "type": "zip", 138 | "url": "https://api.github.com/repos/doctrine/lexer/zipball/6c4b4c3432406c73a4979b7e56efbffb0462ef64", 139 | "reference": "6c4b4c3432406c73a4979b7e56efbffb0462ef64", 140 | "shasum": "", 141 | "mirrors": [ 142 | { 143 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 144 | "preferred": true 145 | } 146 | ] 147 | }, 148 | "require": { 149 | "php": "^7.2" 150 | }, 151 | "require-dev": { 152 | "doctrine/coding-standard": "^6.0", 153 | "phpstan/phpstan": "^0.11.8", 154 | "phpunit/phpunit": "^8.2" 155 | }, 156 | "type": "library", 157 | "extra": { 158 | "branch-alias": { 159 | "dev-master": "1.2.x-dev" 160 | } 161 | }, 162 | "autoload": { 163 | "psr-4": { 164 | "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" 165 | } 166 | }, 167 | "notification-url": "https://packagist.org/downloads/", 168 | "license": [ 169 | "MIT" 170 | ], 171 | "authors": [ 172 | { 173 | "name": "Guilherme Blanco", 174 | "email": "guilhermeblanco@gmail.com" 175 | }, 176 | { 177 | "name": "Roman Borschel", 178 | "email": "roman@code-factory.org" 179 | }, 180 | { 181 | "name": "Johannes Schmitt", 182 | "email": "schmittjoh@gmail.com" 183 | } 184 | ], 185 | "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", 186 | "homepage": "https://www.doctrine-project.org/projects/lexer.html", 187 | "keywords": [ 188 | "annotations", 189 | "docblock", 190 | "lexer", 191 | "parser", 192 | "php" 193 | ], 194 | "time": "2019-07-30T19:38:35+00:00" 195 | }, 196 | { 197 | "name": "egulias/email-validator", 198 | "version": "2.1.10", 199 | "source": { 200 | "type": "git", 201 | "url": "https://github.com/egulias/EmailValidator.git", 202 | "reference": "a6c8d7101b19a451c1707b1b79bbbc56e4bdb7ec" 203 | }, 204 | "dist": { 205 | "type": "zip", 206 | "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/a6c8d7101b19a451c1707b1b79bbbc56e4bdb7ec", 207 | "reference": "a6c8d7101b19a451c1707b1b79bbbc56e4bdb7ec", 208 | "shasum": "", 209 | "mirrors": [ 210 | { 211 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 212 | "preferred": true 213 | } 214 | ] 215 | }, 216 | "require": { 217 | "doctrine/lexer": "^1.0.1", 218 | "php": ">= 5.5" 219 | }, 220 | "require-dev": { 221 | "dominicsayers/isemail": "dev-master", 222 | "phpunit/phpunit": "^4.8.35||^5.7||^6.0", 223 | "satooshi/php-coveralls": "^1.0.1", 224 | "symfony/phpunit-bridge": "^4.4@dev" 225 | }, 226 | "suggest": { 227 | "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" 228 | }, 229 | "type": "library", 230 | "extra": { 231 | "branch-alias": { 232 | "dev-master": "2.0.x-dev" 233 | } 234 | }, 235 | "autoload": { 236 | "psr-4": { 237 | "Egulias\\EmailValidator\\": "EmailValidator" 238 | } 239 | }, 240 | "notification-url": "https://packagist.org/downloads/", 241 | "license": [ 242 | "MIT" 243 | ], 244 | "authors": [ 245 | { 246 | "name": "Eduardo Gulias Davis" 247 | } 248 | ], 249 | "description": "A library for validating emails against several RFCs", 250 | "homepage": "https://github.com/egulias/EmailValidator", 251 | "keywords": [ 252 | "email", 253 | "emailvalidation", 254 | "emailvalidator", 255 | "validation", 256 | "validator" 257 | ], 258 | "time": "2019-07-19T20:52:08+00:00" 259 | }, 260 | { 261 | "name": "enqueue/amqp-ext", 262 | "version": "0.8.x-dev", 263 | "source": { 264 | "type": "git", 265 | "url": "https://github.com/php-enqueue/amqp-ext.git", 266 | "reference": "d6a3424d72bd138f73813b50cfba2fb354621f6f" 267 | }, 268 | "dist": { 269 | "type": "zip", 270 | "url": "https://api.github.com/repos/php-enqueue/amqp-ext/zipball/d6a3424d72bd138f73813b50cfba2fb354621f6f", 271 | "reference": "d6a3424d72bd138f73813b50cfba2fb354621f6f", 272 | "shasum": "", 273 | "mirrors": [ 274 | { 275 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 276 | "preferred": true 277 | } 278 | ] 279 | }, 280 | "require": { 281 | "enqueue/amqp-tools": "^0.8.35@dev", 282 | "ext-amqp": "^1.9.3", 283 | "php": ">=5.6", 284 | "queue-interop/amqp-interop": "^0.7.4@dev" 285 | }, 286 | "require-dev": { 287 | "empi89/php-amqp-stubs": "*@dev", 288 | "enqueue/enqueue": "^0.8@dev", 289 | "enqueue/null": "^0.8@dev", 290 | "enqueue/test": "^0.8@dev", 291 | "phpunit/phpunit": "~5.4.0", 292 | "queue-interop/queue-spec": "^0.5.3@dev", 293 | "symfony/config": "^2.8|^3|^4", 294 | "symfony/dependency-injection": "^2.8|^3|^4" 295 | }, 296 | "suggest": { 297 | "enqueue/enqueue": "If you'd like to use advanced features like Client abstract layer or Symfony integration features" 298 | }, 299 | "type": "library", 300 | "extra": { 301 | "branch-alias": { 302 | "dev-master": "0.8.x-dev" 303 | } 304 | }, 305 | "autoload": { 306 | "psr-4": { 307 | "Enqueue\\AmqpExt\\": "" 308 | }, 309 | "exclude-from-classmap": [ 310 | "/Tests/" 311 | ] 312 | }, 313 | "notification-url": "https://packagist.org/downloads/", 314 | "license": [ 315 | "MIT" 316 | ], 317 | "description": "Message Queue Amqp Transport", 318 | "homepage": "https://enqueue.forma-pro.com/", 319 | "keywords": [ 320 | "AMQP", 321 | "messaging", 322 | "queue" 323 | ], 324 | "time": "2018-11-22T13:24:40+00:00" 325 | }, 326 | { 327 | "name": "enqueue/amqp-tools", 328 | "version": "0.8.x-dev", 329 | "source": { 330 | "type": "git", 331 | "url": "https://github.com/php-enqueue/amqp-tools.git", 332 | "reference": "f92f5cdb7f3f2fba0f6a52b30fa184be8eed5e3c" 333 | }, 334 | "dist": { 335 | "type": "zip", 336 | "url": "https://api.github.com/repos/php-enqueue/amqp-tools/zipball/f92f5cdb7f3f2fba0f6a52b30fa184be8eed5e3c", 337 | "reference": "f92f5cdb7f3f2fba0f6a52b30fa184be8eed5e3c", 338 | "shasum": "", 339 | "mirrors": [ 340 | { 341 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 342 | "preferred": true 343 | } 344 | ] 345 | }, 346 | "require": { 347 | "php": ">=5.6", 348 | "queue-interop/amqp-interop": "^0.7@dev", 349 | "queue-interop/queue-interop": "^0.6@dev|^1.0.0-alpha1" 350 | }, 351 | "require-dev": { 352 | "enqueue/null": "^0.8@dev", 353 | "enqueue/test": "^0.8@dev", 354 | "phpunit/phpunit": "~5.4.0" 355 | }, 356 | "type": "library", 357 | "extra": { 358 | "branch-alias": { 359 | "dev-master": "0.8.x-dev" 360 | } 361 | }, 362 | "autoload": { 363 | "psr-4": { 364 | "Enqueue\\AmqpTools\\": "" 365 | }, 366 | "exclude-from-classmap": [ 367 | "/Tests/" 368 | ] 369 | }, 370 | "notification-url": "https://packagist.org/downloads/", 371 | "license": [ 372 | "MIT" 373 | ], 374 | "description": "Message Queue Amqp Tools", 375 | "homepage": "https://enqueue.forma-pro.com/", 376 | "keywords": [ 377 | "AMQP", 378 | "messaging", 379 | "queue" 380 | ], 381 | "time": "2018-11-22T13:24:40+00:00" 382 | }, 383 | { 384 | "name": "guzzlehttp/guzzle", 385 | "version": "dev-master", 386 | "source": { 387 | "type": "git", 388 | "url": "https://github.com/guzzle/guzzle.git", 389 | "reference": "de7437d73816cb67ed35d476784d69e010a688b5" 390 | }, 391 | "dist": { 392 | "type": "zip", 393 | "url": "https://api.github.com/repos/guzzle/guzzle/zipball/de7437d73816cb67ed35d476784d69e010a688b5", 394 | "reference": "de7437d73816cb67ed35d476784d69e010a688b5", 395 | "shasum": "", 396 | "mirrors": [ 397 | { 398 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 399 | "preferred": true 400 | } 401 | ] 402 | }, 403 | "require": { 404 | "ext-json": "*", 405 | "guzzlehttp/promises": "^1.0", 406 | "guzzlehttp/psr7": "^1.4", 407 | "php": ">=5.5" 408 | }, 409 | "require-dev": { 410 | "ext-curl": "*", 411 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", 412 | "psr/log": "^1.1" 413 | }, 414 | "suggest": { 415 | "psr/log": "Required for using the Log middleware" 416 | }, 417 | "type": "library", 418 | "extra": { 419 | "branch-alias": { 420 | "dev-master": "6.3-dev" 421 | } 422 | }, 423 | "autoload": { 424 | "psr-4": { 425 | "GuzzleHttp\\": "src/" 426 | }, 427 | "files": [ 428 | "src/functions_include.php" 429 | ] 430 | }, 431 | "notification-url": "https://packagist.org/downloads/", 432 | "license": [ 433 | "MIT" 434 | ], 435 | "authors": [ 436 | { 437 | "name": "Michael Dowling", 438 | "email": "mtdowling@gmail.com", 439 | "homepage": "https://github.com/mtdowling" 440 | } 441 | ], 442 | "description": "Guzzle is a PHP HTTP client library", 443 | "homepage": "http://guzzlephp.org/", 444 | "keywords": [ 445 | "client", 446 | "curl", 447 | "framework", 448 | "http", 449 | "http client", 450 | "rest", 451 | "web service" 452 | ], 453 | "time": "2019-08-05T16:15:18+00:00" 454 | }, 455 | { 456 | "name": "guzzlehttp/promises", 457 | "version": "dev-master", 458 | "source": { 459 | "type": "git", 460 | "url": "https://github.com/guzzle/promises.git", 461 | "reference": "17d36ed176c998839582c739ce0753381598edf0" 462 | }, 463 | "dist": { 464 | "type": "zip", 465 | "url": "https://api.github.com/repos/guzzle/promises/zipball/17d36ed176c998839582c739ce0753381598edf0", 466 | "reference": "17d36ed176c998839582c739ce0753381598edf0", 467 | "shasum": "", 468 | "mirrors": [ 469 | { 470 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 471 | "preferred": true 472 | } 473 | ] 474 | }, 475 | "require": { 476 | "php": ">=5.6" 477 | }, 478 | "require-dev": { 479 | "phpunit/phpunit": "^5.7.27 || ^7.5" 480 | }, 481 | "type": "library", 482 | "extra": { 483 | "branch-alias": { 484 | "dev-master": "1.4-dev" 485 | } 486 | }, 487 | "autoload": { 488 | "psr-4": { 489 | "GuzzleHttp\\Promise\\": "src/" 490 | }, 491 | "files": [ 492 | "src/functions_include.php" 493 | ] 494 | }, 495 | "notification-url": "https://packagist.org/downloads/", 496 | "license": [ 497 | "MIT" 498 | ], 499 | "authors": [ 500 | { 501 | "name": "Michael Dowling", 502 | "email": "mtdowling@gmail.com", 503 | "homepage": "https://github.com/mtdowling" 504 | } 505 | ], 506 | "description": "Guzzle promises library", 507 | "keywords": [ 508 | "promise" 509 | ], 510 | "time": "2019-07-02T14:54:06+00:00" 511 | }, 512 | { 513 | "name": "guzzlehttp/psr7", 514 | "version": "1.x-dev", 515 | "source": { 516 | "type": "git", 517 | "url": "https://github.com/guzzle/psr7.git", 518 | "reference": "239400de7a173fe9901b9ac7c06497751f00727a" 519 | }, 520 | "dist": { 521 | "type": "zip", 522 | "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", 523 | "reference": "239400de7a173fe9901b9ac7c06497751f00727a", 524 | "shasum": "", 525 | "mirrors": [ 526 | { 527 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 528 | "preferred": true 529 | } 530 | ] 531 | }, 532 | "require": { 533 | "php": ">=5.4.0", 534 | "psr/http-message": "~1.0", 535 | "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" 536 | }, 537 | "provide": { 538 | "psr/http-message-implementation": "1.0" 539 | }, 540 | "require-dev": { 541 | "ext-zlib": "*", 542 | "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" 543 | }, 544 | "suggest": { 545 | "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" 546 | }, 547 | "type": "library", 548 | "extra": { 549 | "branch-alias": { 550 | "dev-master": "1.6-dev" 551 | } 552 | }, 553 | "autoload": { 554 | "psr-4": { 555 | "GuzzleHttp\\Psr7\\": "src/" 556 | }, 557 | "files": [ 558 | "src/functions_include.php" 559 | ] 560 | }, 561 | "notification-url": "https://packagist.org/downloads/", 562 | "license": [ 563 | "MIT" 564 | ], 565 | "authors": [ 566 | { 567 | "name": "Michael Dowling", 568 | "email": "mtdowling@gmail.com", 569 | "homepage": "https://github.com/mtdowling" 570 | }, 571 | { 572 | "name": "Tobias Schultze", 573 | "homepage": "https://github.com/Tobion" 574 | } 575 | ], 576 | "description": "PSR-7 message implementation that also provides common utility methods", 577 | "keywords": [ 578 | "http", 579 | "message", 580 | "psr-7", 581 | "request", 582 | "response", 583 | "stream", 584 | "uri", 585 | "url" 586 | ], 587 | "time": "2019-07-01T23:21:34+00:00" 588 | }, 589 | { 590 | "name": "kcloze/swoole-jobs", 591 | "version": "dev-master", 592 | "source": { 593 | "type": "git", 594 | "url": "https://github.com/kcloze/swoole-jobs.git", 595 | "reference": "e30eaef6ceaec07cdb3ba5fe4055ea9b9457e35a" 596 | }, 597 | "dist": { 598 | "type": "zip", 599 | "url": "https://api.github.com/repos/kcloze/swoole-jobs/zipball/e30eaef6ceaec07cdb3ba5fe4055ea9b9457e35a", 600 | "reference": "e30eaef6ceaec07cdb3ba5fe4055ea9b9457e35a", 601 | "shasum": "", 602 | "mirrors": [ 603 | { 604 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 605 | "preferred": true 606 | } 607 | ] 608 | }, 609 | "require": { 610 | "bramus/router": "^1.3", 611 | "enqueue/amqp-ext": "^0.8", 612 | "ext-redis": "*", 613 | "ext-swoole": ">=1.8.9", 614 | "guzzlehttp/guzzle": "^6.3", 615 | "php": ">=7.0", 616 | "symfony/console": "^4.2" 617 | }, 618 | "require-dev": { 619 | "phpunit/phpunit": "^4.8.35 || ^5.7" 620 | }, 621 | "bin": [ 622 | "swoole-jobs" 623 | ], 624 | "type": "library", 625 | "autoload": { 626 | "psr-4": { 627 | "Kcloze\\Jobs\\": "src" 628 | } 629 | }, 630 | "notification-url": "https://packagist.org/downloads/", 631 | "license": [ 632 | "MIT" 633 | ], 634 | "authors": [ 635 | { 636 | "name": "kcloze", 637 | "email": "pei.greet@qq.com" 638 | } 639 | ], 640 | "description": "基于swoole的job调度组件,类似gearman的分布式任务处理系统", 641 | "homepage": "https://github.com/kcloze/swoole-jobs", 642 | "keywords": [ 643 | "job", 644 | "scheduler", 645 | "swoole", 646 | "调度" 647 | ], 648 | "time": "2019-08-11T01:36:54+00:00" 649 | }, 650 | { 651 | "name": "psr/container", 652 | "version": "dev-master", 653 | "source": { 654 | "type": "git", 655 | "url": "https://github.com/php-fig/container.git", 656 | "reference": "014d250daebff39eba15ba990eeb2a140798e77c" 657 | }, 658 | "dist": { 659 | "type": "zip", 660 | "url": "https://api.github.com/repos/php-fig/container/zipball/014d250daebff39eba15ba990eeb2a140798e77c", 661 | "reference": "014d250daebff39eba15ba990eeb2a140798e77c", 662 | "shasum": "", 663 | "mirrors": [ 664 | { 665 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 666 | "preferred": true 667 | } 668 | ] 669 | }, 670 | "require": { 671 | "php": ">=5.3.0" 672 | }, 673 | "type": "library", 674 | "extra": { 675 | "branch-alias": { 676 | "dev-master": "1.0.x-dev" 677 | } 678 | }, 679 | "autoload": { 680 | "psr-4": { 681 | "Psr\\Container\\": "src/" 682 | } 683 | }, 684 | "notification-url": "https://packagist.org/downloads/", 685 | "license": [ 686 | "MIT" 687 | ], 688 | "authors": [ 689 | { 690 | "name": "PHP-FIG", 691 | "homepage": "http://www.php-fig.org/" 692 | } 693 | ], 694 | "description": "Common Container Interface (PHP FIG PSR-11)", 695 | "homepage": "https://github.com/php-fig/container", 696 | "keywords": [ 697 | "PSR-11", 698 | "container", 699 | "container-interface", 700 | "container-interop", 701 | "psr" 702 | ], 703 | "time": "2018-12-29T15:36:03+00:00" 704 | }, 705 | { 706 | "name": "psr/http-message", 707 | "version": "dev-master", 708 | "source": { 709 | "type": "git", 710 | "url": "https://github.com/php-fig/http-message.git", 711 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" 712 | }, 713 | "dist": { 714 | "type": "zip", 715 | "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", 716 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", 717 | "shasum": "", 718 | "mirrors": [ 719 | { 720 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 721 | "preferred": true 722 | } 723 | ] 724 | }, 725 | "require": { 726 | "php": ">=5.3.0" 727 | }, 728 | "type": "library", 729 | "extra": { 730 | "branch-alias": { 731 | "dev-master": "1.0.x-dev" 732 | } 733 | }, 734 | "autoload": { 735 | "psr-4": { 736 | "Psr\\Http\\Message\\": "src/" 737 | } 738 | }, 739 | "notification-url": "https://packagist.org/downloads/", 740 | "license": [ 741 | "MIT" 742 | ], 743 | "authors": [ 744 | { 745 | "name": "PHP-FIG", 746 | "homepage": "http://www.php-fig.org/" 747 | } 748 | ], 749 | "description": "Common interface for HTTP messages", 750 | "homepage": "https://github.com/php-fig/http-message", 751 | "keywords": [ 752 | "http", 753 | "http-message", 754 | "psr", 755 | "psr-7", 756 | "request", 757 | "response" 758 | ], 759 | "time": "2016-08-06T14:39:51+00:00" 760 | }, 761 | { 762 | "name": "psr/log", 763 | "version": "1.0.2", 764 | "source": { 765 | "type": "git", 766 | "url": "https://github.com/php-fig/log.git", 767 | "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" 768 | }, 769 | "dist": { 770 | "type": "zip", 771 | "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", 772 | "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", 773 | "shasum": "", 774 | "mirrors": [ 775 | { 776 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 777 | "preferred": true 778 | } 779 | ] 780 | }, 781 | "require": { 782 | "php": ">=5.3.0" 783 | }, 784 | "type": "library", 785 | "extra": { 786 | "branch-alias": { 787 | "dev-master": "1.0.x-dev" 788 | } 789 | }, 790 | "autoload": { 791 | "psr-4": { 792 | "Psr\\Log\\": "Psr/Log/" 793 | } 794 | }, 795 | "notification-url": "https://packagist.org/downloads/", 796 | "license": [ 797 | "MIT" 798 | ], 799 | "authors": [ 800 | { 801 | "name": "PHP-FIG", 802 | "homepage": "http://www.php-fig.org/" 803 | } 804 | ], 805 | "description": "Common interface for logging libraries", 806 | "homepage": "https://github.com/php-fig/log", 807 | "keywords": [ 808 | "log", 809 | "psr", 810 | "psr-3" 811 | ], 812 | "time": "2016-10-10T12:19:37+00:00" 813 | }, 814 | { 815 | "name": "psr/simple-cache", 816 | "version": "dev-master", 817 | "source": { 818 | "type": "git", 819 | "url": "https://github.com/php-fig/simple-cache.git", 820 | "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" 821 | }, 822 | "dist": { 823 | "type": "zip", 824 | "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", 825 | "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", 826 | "shasum": "", 827 | "mirrors": [ 828 | { 829 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 830 | "preferred": true 831 | } 832 | ] 833 | }, 834 | "require": { 835 | "php": ">=5.3.0" 836 | }, 837 | "type": "library", 838 | "extra": { 839 | "branch-alias": { 840 | "dev-master": "1.0.x-dev" 841 | } 842 | }, 843 | "autoload": { 844 | "psr-4": { 845 | "Psr\\SimpleCache\\": "src/" 846 | } 847 | }, 848 | "notification-url": "https://packagist.org/downloads/", 849 | "license": [ 850 | "MIT" 851 | ], 852 | "authors": [ 853 | { 854 | "name": "PHP-FIG", 855 | "homepage": "http://www.php-fig.org/" 856 | } 857 | ], 858 | "description": "Common interfaces for simple caching", 859 | "keywords": [ 860 | "cache", 861 | "caching", 862 | "psr", 863 | "psr-16", 864 | "simple-cache" 865 | ], 866 | "time": "2017-10-23T01:57:42+00:00" 867 | }, 868 | { 869 | "name": "queue-interop/amqp-interop", 870 | "version": "0.7.5", 871 | "source": { 872 | "type": "git", 873 | "url": "https://github.com/queue-interop/amqp-interop.git", 874 | "reference": "e1679b0a308e320c508afa74b5148bf58479dd0d" 875 | }, 876 | "dist": { 877 | "type": "zip", 878 | "url": "https://api.github.com/repos/queue-interop/amqp-interop/zipball/e1679b0a308e320c508afa74b5148bf58479dd0d", 879 | "reference": "e1679b0a308e320c508afa74b5148bf58479dd0d", 880 | "shasum": "", 881 | "mirrors": [ 882 | { 883 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 884 | "preferred": true 885 | } 886 | ] 887 | }, 888 | "require": { 889 | "php": ">=5.5", 890 | "queue-interop/queue-interop": "^0.6.2|0.7.x-dev|^1.0.0-alpha1" 891 | }, 892 | "require-dev": { 893 | "phpunit/phpunit": "~5.4.0" 894 | }, 895 | "type": "library", 896 | "extra": { 897 | "branch-alias": { 898 | "dev-master": "0.7.x-dev" 899 | } 900 | }, 901 | "autoload": { 902 | "psr-4": { 903 | "Interop\\Amqp\\": "src/" 904 | } 905 | }, 906 | "notification-url": "https://packagist.org/downloads/", 907 | "license": [ 908 | "MIT" 909 | ], 910 | "time": "2018-08-08T17:31:15+00:00" 911 | }, 912 | { 913 | "name": "queue-interop/queue-interop", 914 | "version": "1.0.0-alpha2", 915 | "source": { 916 | "type": "git", 917 | "url": "https://github.com/queue-interop/queue-interop.git", 918 | "reference": "b43af85f635439fa2c9a6d8fd486489da4869741" 919 | }, 920 | "dist": { 921 | "type": "zip", 922 | "url": "https://api.github.com/repos/queue-interop/queue-interop/zipball/b43af85f635439fa2c9a6d8fd486489da4869741", 923 | "reference": "b43af85f635439fa2c9a6d8fd486489da4869741", 924 | "shasum": "", 925 | "mirrors": [ 926 | { 927 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 928 | "preferred": true 929 | } 930 | ] 931 | }, 932 | "require": { 933 | "php": "^7.1.3" 934 | }, 935 | "require-dev": { 936 | "phpunit/phpunit": "^5.5", 937 | "queue-interop/queue-spec": "^0.6@dev" 938 | }, 939 | "type": "library", 940 | "extra": { 941 | "branch-alias": { 942 | "dev-master": "0.7-dev" 943 | } 944 | }, 945 | "autoload": { 946 | "psr-4": { 947 | "Interop\\Queue\\": "src/" 948 | } 949 | }, 950 | "notification-url": "https://packagist.org/downloads/", 951 | "license": [ 952 | "MIT" 953 | ], 954 | "description": "Promoting the interoperability of MQs objects. Based on Java JMS", 955 | "homepage": "https://github.com/queue-interop/queue-interop", 956 | "keywords": [ 957 | "MQ", 958 | "jms", 959 | "message queue", 960 | "messaging", 961 | "queue" 962 | ], 963 | "time": "2018-11-22T17:53:21+00:00" 964 | }, 965 | { 966 | "name": "ralouphie/getallheaders", 967 | "version": "3.0.3", 968 | "source": { 969 | "type": "git", 970 | "url": "https://github.com/ralouphie/getallheaders.git", 971 | "reference": "120b605dfeb996808c31b6477290a714d356e822" 972 | }, 973 | "dist": { 974 | "type": "zip", 975 | "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", 976 | "reference": "120b605dfeb996808c31b6477290a714d356e822", 977 | "shasum": "", 978 | "mirrors": [ 979 | { 980 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 981 | "preferred": true 982 | } 983 | ] 984 | }, 985 | "require": { 986 | "php": ">=5.6" 987 | }, 988 | "require-dev": { 989 | "php-coveralls/php-coveralls": "^2.1", 990 | "phpunit/phpunit": "^5 || ^6.5" 991 | }, 992 | "type": "library", 993 | "autoload": { 994 | "files": [ 995 | "src/getallheaders.php" 996 | ] 997 | }, 998 | "notification-url": "https://packagist.org/downloads/", 999 | "license": [ 1000 | "MIT" 1001 | ], 1002 | "authors": [ 1003 | { 1004 | "name": "Ralph Khattar", 1005 | "email": "ralph.khattar@gmail.com" 1006 | } 1007 | ], 1008 | "description": "A polyfill for getallheaders.", 1009 | "time": "2019-03-08T08:55:37+00:00" 1010 | }, 1011 | { 1012 | "name": "swiftmailer/swiftmailer", 1013 | "version": "dev-master", 1014 | "source": { 1015 | "type": "git", 1016 | "url": "https://github.com/swiftmailer/swiftmailer.git", 1017 | "reference": "a53dab202d27506cad9f0238e8ef2c53dee91c88" 1018 | }, 1019 | "dist": { 1020 | "type": "zip", 1021 | "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/a53dab202d27506cad9f0238e8ef2c53dee91c88", 1022 | "reference": "a53dab202d27506cad9f0238e8ef2c53dee91c88", 1023 | "shasum": "", 1024 | "mirrors": [ 1025 | { 1026 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 1027 | "preferred": true 1028 | } 1029 | ] 1030 | }, 1031 | "require": { 1032 | "egulias/email-validator": "~2.0", 1033 | "php": ">=7.0.0", 1034 | "symfony/polyfill-iconv": "^1.0", 1035 | "symfony/polyfill-intl-idn": "^1.10", 1036 | "symfony/polyfill-mbstring": "^1.0" 1037 | }, 1038 | "require-dev": { 1039 | "mockery/mockery": "~0.9.1", 1040 | "symfony/phpunit-bridge": "^3.4.19|^4.1.8" 1041 | }, 1042 | "suggest": { 1043 | "ext-intl": "Needed to support internationalized email addresses", 1044 | "true/punycode": "Needed to support internationalized email addresses, if ext-intl is not installed" 1045 | }, 1046 | "type": "library", 1047 | "extra": { 1048 | "branch-alias": { 1049 | "dev-master": "6.2-dev" 1050 | } 1051 | }, 1052 | "autoload": { 1053 | "files": [ 1054 | "lib/swift_required.php" 1055 | ] 1056 | }, 1057 | "notification-url": "https://packagist.org/downloads/", 1058 | "license": [ 1059 | "MIT" 1060 | ], 1061 | "authors": [ 1062 | { 1063 | "name": "Chris Corbyn" 1064 | }, 1065 | { 1066 | "name": "Fabien Potencier", 1067 | "email": "fabien@symfony.com" 1068 | } 1069 | ], 1070 | "description": "Swiftmailer, free feature-rich PHP mailer", 1071 | "homepage": "https://swiftmailer.symfony.com", 1072 | "keywords": [ 1073 | "email", 1074 | "mail", 1075 | "mailer" 1076 | ], 1077 | "time": "2019-06-28T15:39:50+00:00" 1078 | }, 1079 | { 1080 | "name": "symfony/console", 1081 | "version": "4.4.x-dev", 1082 | "source": { 1083 | "type": "git", 1084 | "url": "https://github.com/symfony/console.git", 1085 | "reference": "d96646ee66718f47905c50afceaa514bc4e9cc67" 1086 | }, 1087 | "dist": { 1088 | "type": "zip", 1089 | "url": "https://api.github.com/repos/symfony/console/zipball/d96646ee66718f47905c50afceaa514bc4e9cc67", 1090 | "reference": "d96646ee66718f47905c50afceaa514bc4e9cc67", 1091 | "shasum": "", 1092 | "mirrors": [ 1093 | { 1094 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 1095 | "preferred": true 1096 | } 1097 | ] 1098 | }, 1099 | "require": { 1100 | "php": "^7.1.3", 1101 | "symfony/polyfill-mbstring": "~1.0", 1102 | "symfony/polyfill-php73": "^1.8", 1103 | "symfony/service-contracts": "^1.1" 1104 | }, 1105 | "conflict": { 1106 | "symfony/dependency-injection": "<3.4", 1107 | "symfony/event-dispatcher": "<4.3|>=5", 1108 | "symfony/lock": "<4.4", 1109 | "symfony/process": "<3.3" 1110 | }, 1111 | "provide": { 1112 | "psr/log-implementation": "1.0" 1113 | }, 1114 | "require-dev": { 1115 | "psr/log": "~1.0", 1116 | "symfony/config": "^3.4|^4.0|^5.0", 1117 | "symfony/dependency-injection": "^3.4|^4.0|^5.0", 1118 | "symfony/event-dispatcher": "^4.3", 1119 | "symfony/lock": "^4.4|^5.0", 1120 | "symfony/process": "^3.4|^4.0|^5.0", 1121 | "symfony/var-dumper": "^4.3|^5.0" 1122 | }, 1123 | "suggest": { 1124 | "psr/log": "For using the console logger", 1125 | "symfony/event-dispatcher": "", 1126 | "symfony/lock": "", 1127 | "symfony/process": "" 1128 | }, 1129 | "type": "library", 1130 | "extra": { 1131 | "branch-alias": { 1132 | "dev-master": "4.4-dev" 1133 | } 1134 | }, 1135 | "autoload": { 1136 | "psr-4": { 1137 | "Symfony\\Component\\Console\\": "" 1138 | }, 1139 | "exclude-from-classmap": [ 1140 | "/Tests/" 1141 | ] 1142 | }, 1143 | "notification-url": "https://packagist.org/downloads/", 1144 | "license": [ 1145 | "MIT" 1146 | ], 1147 | "authors": [ 1148 | { 1149 | "name": "Fabien Potencier", 1150 | "email": "fabien@symfony.com" 1151 | }, 1152 | { 1153 | "name": "Symfony Community", 1154 | "homepage": "https://symfony.com/contributors" 1155 | } 1156 | ], 1157 | "description": "Symfony Console Component", 1158 | "homepage": "https://symfony.com", 1159 | "time": "2019-08-08T15:14:45+00:00" 1160 | }, 1161 | { 1162 | "name": "symfony/polyfill-iconv", 1163 | "version": "dev-master", 1164 | "source": { 1165 | "type": "git", 1166 | "url": "https://github.com/symfony/polyfill-iconv.git", 1167 | "reference": "685968b11e61a347c18bf25db32effa478be610f" 1168 | }, 1169 | "dist": { 1170 | "type": "zip", 1171 | "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/685968b11e61a347c18bf25db32effa478be610f", 1172 | "reference": "685968b11e61a347c18bf25db32effa478be610f", 1173 | "shasum": "", 1174 | "mirrors": [ 1175 | { 1176 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 1177 | "preferred": true 1178 | } 1179 | ] 1180 | }, 1181 | "require": { 1182 | "php": ">=5.3.3" 1183 | }, 1184 | "suggest": { 1185 | "ext-iconv": "For best performance" 1186 | }, 1187 | "type": "library", 1188 | "extra": { 1189 | "branch-alias": { 1190 | "dev-master": "1.12-dev" 1191 | } 1192 | }, 1193 | "autoload": { 1194 | "psr-4": { 1195 | "Symfony\\Polyfill\\Iconv\\": "" 1196 | }, 1197 | "files": [ 1198 | "bootstrap.php" 1199 | ] 1200 | }, 1201 | "notification-url": "https://packagist.org/downloads/", 1202 | "license": [ 1203 | "MIT" 1204 | ], 1205 | "authors": [ 1206 | { 1207 | "name": "Nicolas Grekas", 1208 | "email": "p@tchwork.com" 1209 | }, 1210 | { 1211 | "name": "Symfony Community", 1212 | "homepage": "https://symfony.com/contributors" 1213 | } 1214 | ], 1215 | "description": "Symfony polyfill for the Iconv extension", 1216 | "homepage": "https://symfony.com", 1217 | "keywords": [ 1218 | "compatibility", 1219 | "iconv", 1220 | "polyfill", 1221 | "portable", 1222 | "shim" 1223 | ], 1224 | "time": "2019-08-06T08:03:45+00:00" 1225 | }, 1226 | { 1227 | "name": "symfony/polyfill-intl-idn", 1228 | "version": "dev-master", 1229 | "source": { 1230 | "type": "git", 1231 | "url": "https://github.com/symfony/polyfill-intl-idn.git", 1232 | "reference": "6af626ae6fa37d396dc90a399c0ff08e5cfc45b2" 1233 | }, 1234 | "dist": { 1235 | "type": "zip", 1236 | "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/6af626ae6fa37d396dc90a399c0ff08e5cfc45b2", 1237 | "reference": "6af626ae6fa37d396dc90a399c0ff08e5cfc45b2", 1238 | "shasum": "", 1239 | "mirrors": [ 1240 | { 1241 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 1242 | "preferred": true 1243 | } 1244 | ] 1245 | }, 1246 | "require": { 1247 | "php": ">=5.3.3", 1248 | "symfony/polyfill-mbstring": "^1.3", 1249 | "symfony/polyfill-php72": "^1.9" 1250 | }, 1251 | "suggest": { 1252 | "ext-intl": "For best performance" 1253 | }, 1254 | "type": "library", 1255 | "extra": { 1256 | "branch-alias": { 1257 | "dev-master": "1.12-dev" 1258 | } 1259 | }, 1260 | "autoload": { 1261 | "psr-4": { 1262 | "Symfony\\Polyfill\\Intl\\Idn\\": "" 1263 | }, 1264 | "files": [ 1265 | "bootstrap.php" 1266 | ] 1267 | }, 1268 | "notification-url": "https://packagist.org/downloads/", 1269 | "license": [ 1270 | "MIT" 1271 | ], 1272 | "authors": [ 1273 | { 1274 | "name": "Laurent Bassin", 1275 | "email": "laurent@bassin.info" 1276 | }, 1277 | { 1278 | "name": "Symfony Community", 1279 | "homepage": "https://symfony.com/contributors" 1280 | } 1281 | ], 1282 | "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", 1283 | "homepage": "https://symfony.com", 1284 | "keywords": [ 1285 | "compatibility", 1286 | "idn", 1287 | "intl", 1288 | "polyfill", 1289 | "portable", 1290 | "shim" 1291 | ], 1292 | "time": "2019-08-06T08:03:45+00:00" 1293 | }, 1294 | { 1295 | "name": "symfony/polyfill-mbstring", 1296 | "version": "dev-master", 1297 | "source": { 1298 | "type": "git", 1299 | "url": "https://github.com/symfony/polyfill-mbstring.git", 1300 | "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" 1301 | }, 1302 | "dist": { 1303 | "type": "zip", 1304 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", 1305 | "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", 1306 | "shasum": "", 1307 | "mirrors": [ 1308 | { 1309 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 1310 | "preferred": true 1311 | } 1312 | ] 1313 | }, 1314 | "require": { 1315 | "php": ">=5.3.3" 1316 | }, 1317 | "suggest": { 1318 | "ext-mbstring": "For best performance" 1319 | }, 1320 | "type": "library", 1321 | "extra": { 1322 | "branch-alias": { 1323 | "dev-master": "1.12-dev" 1324 | } 1325 | }, 1326 | "autoload": { 1327 | "psr-4": { 1328 | "Symfony\\Polyfill\\Mbstring\\": "" 1329 | }, 1330 | "files": [ 1331 | "bootstrap.php" 1332 | ] 1333 | }, 1334 | "notification-url": "https://packagist.org/downloads/", 1335 | "license": [ 1336 | "MIT" 1337 | ], 1338 | "authors": [ 1339 | { 1340 | "name": "Nicolas Grekas", 1341 | "email": "p@tchwork.com" 1342 | }, 1343 | { 1344 | "name": "Symfony Community", 1345 | "homepage": "https://symfony.com/contributors" 1346 | } 1347 | ], 1348 | "description": "Symfony polyfill for the Mbstring extension", 1349 | "homepage": "https://symfony.com", 1350 | "keywords": [ 1351 | "compatibility", 1352 | "mbstring", 1353 | "polyfill", 1354 | "portable", 1355 | "shim" 1356 | ], 1357 | "time": "2019-08-06T08:03:45+00:00" 1358 | }, 1359 | { 1360 | "name": "symfony/polyfill-php72", 1361 | "version": "dev-master", 1362 | "source": { 1363 | "type": "git", 1364 | "url": "https://github.com/symfony/polyfill-php72.git", 1365 | "reference": "04ce3335667451138df4307d6a9b61565560199e" 1366 | }, 1367 | "dist": { 1368 | "type": "zip", 1369 | "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/04ce3335667451138df4307d6a9b61565560199e", 1370 | "reference": "04ce3335667451138df4307d6a9b61565560199e", 1371 | "shasum": "", 1372 | "mirrors": [ 1373 | { 1374 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 1375 | "preferred": true 1376 | } 1377 | ] 1378 | }, 1379 | "require": { 1380 | "php": ">=5.3.3" 1381 | }, 1382 | "type": "library", 1383 | "extra": { 1384 | "branch-alias": { 1385 | "dev-master": "1.12-dev" 1386 | } 1387 | }, 1388 | "autoload": { 1389 | "psr-4": { 1390 | "Symfony\\Polyfill\\Php72\\": "" 1391 | }, 1392 | "files": [ 1393 | "bootstrap.php" 1394 | ] 1395 | }, 1396 | "notification-url": "https://packagist.org/downloads/", 1397 | "license": [ 1398 | "MIT" 1399 | ], 1400 | "authors": [ 1401 | { 1402 | "name": "Nicolas Grekas", 1403 | "email": "p@tchwork.com" 1404 | }, 1405 | { 1406 | "name": "Symfony Community", 1407 | "homepage": "https://symfony.com/contributors" 1408 | } 1409 | ], 1410 | "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", 1411 | "homepage": "https://symfony.com", 1412 | "keywords": [ 1413 | "compatibility", 1414 | "polyfill", 1415 | "portable", 1416 | "shim" 1417 | ], 1418 | "time": "2019-08-06T08:03:45+00:00" 1419 | }, 1420 | { 1421 | "name": "symfony/polyfill-php73", 1422 | "version": "dev-master", 1423 | "source": { 1424 | "type": "git", 1425 | "url": "https://github.com/symfony/polyfill-php73.git", 1426 | "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188" 1427 | }, 1428 | "dist": { 1429 | "type": "zip", 1430 | "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/2ceb49eaccb9352bff54d22570276bb75ba4a188", 1431 | "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188", 1432 | "shasum": "", 1433 | "mirrors": [ 1434 | { 1435 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 1436 | "preferred": true 1437 | } 1438 | ] 1439 | }, 1440 | "require": { 1441 | "php": ">=5.3.3" 1442 | }, 1443 | "type": "library", 1444 | "extra": { 1445 | "branch-alias": { 1446 | "dev-master": "1.12-dev" 1447 | } 1448 | }, 1449 | "autoload": { 1450 | "psr-4": { 1451 | "Symfony\\Polyfill\\Php73\\": "" 1452 | }, 1453 | "files": [ 1454 | "bootstrap.php" 1455 | ], 1456 | "classmap": [ 1457 | "Resources/stubs" 1458 | ] 1459 | }, 1460 | "notification-url": "https://packagist.org/downloads/", 1461 | "license": [ 1462 | "MIT" 1463 | ], 1464 | "authors": [ 1465 | { 1466 | "name": "Nicolas Grekas", 1467 | "email": "p@tchwork.com" 1468 | }, 1469 | { 1470 | "name": "Symfony Community", 1471 | "homepage": "https://symfony.com/contributors" 1472 | } 1473 | ], 1474 | "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", 1475 | "homepage": "https://symfony.com", 1476 | "keywords": [ 1477 | "compatibility", 1478 | "polyfill", 1479 | "portable", 1480 | "shim" 1481 | ], 1482 | "time": "2019-08-06T08:03:45+00:00" 1483 | }, 1484 | { 1485 | "name": "symfony/service-contracts", 1486 | "version": "dev-master", 1487 | "source": { 1488 | "type": "git", 1489 | "url": "https://github.com/symfony/service-contracts.git", 1490 | "reference": "3cd78bb952668d7bc1701f9599cf009353d50886" 1491 | }, 1492 | "dist": { 1493 | "type": "zip", 1494 | "url": "https://api.github.com/repos/symfony/service-contracts/zipball/3cd78bb952668d7bc1701f9599cf009353d50886", 1495 | "reference": "3cd78bb952668d7bc1701f9599cf009353d50886", 1496 | "shasum": "", 1497 | "mirrors": [ 1498 | { 1499 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 1500 | "preferred": true 1501 | } 1502 | ] 1503 | }, 1504 | "require": { 1505 | "php": "^7.1.3", 1506 | "psr/container": "^1.0" 1507 | }, 1508 | "suggest": { 1509 | "symfony/service-implementation": "" 1510 | }, 1511 | "type": "library", 1512 | "extra": { 1513 | "branch-alias": { 1514 | "dev-master": "1.1-dev" 1515 | } 1516 | }, 1517 | "autoload": { 1518 | "psr-4": { 1519 | "Symfony\\Contracts\\Service\\": "" 1520 | } 1521 | }, 1522 | "notification-url": "https://packagist.org/downloads/", 1523 | "license": [ 1524 | "MIT" 1525 | ], 1526 | "authors": [ 1527 | { 1528 | "name": "Nicolas Grekas", 1529 | "email": "p@tchwork.com" 1530 | }, 1531 | { 1532 | "name": "Symfony Community", 1533 | "homepage": "https://symfony.com/contributors" 1534 | } 1535 | ], 1536 | "description": "Generic abstractions related to writing services", 1537 | "homepage": "https://symfony.com", 1538 | "keywords": [ 1539 | "abstractions", 1540 | "contracts", 1541 | "decoupling", 1542 | "interfaces", 1543 | "interoperability", 1544 | "standards" 1545 | ], 1546 | "time": "2019-08-02T12:15:04+00:00" 1547 | }, 1548 | { 1549 | "name": "twbs/bootstrap", 1550 | "version": "v3.0.3", 1551 | "source": { 1552 | "type": "git", 1553 | "url": "https://github.com/twbs/bootstrap.git", 1554 | "reference": "6d03173a1aad98e75f7d33e65b411c519176c59a" 1555 | }, 1556 | "dist": { 1557 | "type": "zip", 1558 | "url": "https://api.github.com/repos/twbs/bootstrap/zipball/6d03173a1aad98e75f7d33e65b411c519176c59a", 1559 | "reference": "6d03173a1aad98e75f7d33e65b411c519176c59a", 1560 | "shasum": "", 1561 | "mirrors": [ 1562 | { 1563 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 1564 | "preferred": true 1565 | } 1566 | ] 1567 | }, 1568 | "type": "library", 1569 | "extra": { 1570 | "branch-alias": { 1571 | "dev-master": "3.0.x-dev" 1572 | } 1573 | }, 1574 | "notification-url": "https://packagist.org/downloads/", 1575 | "license": [ 1576 | "Apache-2.0" 1577 | ], 1578 | "authors": [ 1579 | { 1580 | "name": "Jacob Thornton", 1581 | "email": "jacobthornton@gmail.com" 1582 | }, 1583 | { 1584 | "name": "Mark Otto", 1585 | "email": "markdotto@gmail.com" 1586 | } 1587 | ], 1588 | "description": "Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.", 1589 | "homepage": "http://getbootstrap.com", 1590 | "keywords": [ 1591 | "bootstrap", 1592 | "css" 1593 | ], 1594 | "time": "2013-12-05T16:09:10+00:00" 1595 | }, 1596 | { 1597 | "name": "yiisoft/yii2", 1598 | "version": "2.1.x-dev", 1599 | "source": { 1600 | "type": "git", 1601 | "url": "https://github.com/yiisoft/yii2-framework.git", 1602 | "reference": "86f1bfd7016524a6988005f3cdf9d01528df39fb" 1603 | }, 1604 | "dist": { 1605 | "type": "zip", 1606 | "url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/86f1bfd7016524a6988005f3cdf9d01528df39fb", 1607 | "reference": "86f1bfd7016524a6988005f3cdf9d01528df39fb", 1608 | "shasum": "", 1609 | "mirrors": [ 1610 | { 1611 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 1612 | "preferred": true 1613 | } 1614 | ] 1615 | }, 1616 | "require": { 1617 | "cebe/markdown": "~1.0.0 | ~1.1.0", 1618 | "ext-ctype": "*", 1619 | "ext-mbstring": "*", 1620 | "lib-pcre": "*", 1621 | "php": ">=7.1.0", 1622 | "psr/http-message": "~1.0.0", 1623 | "psr/log": "~1.0.2", 1624 | "psr/simple-cache": "~1.0.0", 1625 | "yiisoft/yii2-composer": "~2.0.4" 1626 | }, 1627 | "suggest": { 1628 | "ezyang/htmlpurifier": "version '~4.6' required at 'yii\\helpers\\HtmlPurifier' for 'html' data format support (e.g. 'yii\\i18n\\Formatter:asHtml()' and 'yii\\helpers\\StringHelper::truncateHtml()')" 1629 | }, 1630 | "bin": [ 1631 | "yii" 1632 | ], 1633 | "type": "library", 1634 | "extra": { 1635 | "branch-alias": { 1636 | "dev-master": "2.0.x-dev" 1637 | } 1638 | }, 1639 | "autoload": { 1640 | "psr-4": { 1641 | "yii\\": "" 1642 | }, 1643 | "classmap": [ 1644 | "Yii.php" 1645 | ] 1646 | }, 1647 | "notification-url": "https://packagist.org/downloads/", 1648 | "license": [ 1649 | "BSD-3-Clause" 1650 | ], 1651 | "authors": [ 1652 | { 1653 | "name": "Qiang Xue", 1654 | "role": "Founder and project lead", 1655 | "email": "qiang.xue@gmail.com", 1656 | "homepage": "http://www.yiiframework.com/" 1657 | }, 1658 | { 1659 | "name": "Alexander Makarov", 1660 | "role": "Core framework development", 1661 | "email": "sam@rmcreative.ru", 1662 | "homepage": "http://rmcreative.ru/" 1663 | }, 1664 | { 1665 | "name": "Maurizio Domba", 1666 | "role": "Core framework development", 1667 | "homepage": "http://mdomba.info/" 1668 | }, 1669 | { 1670 | "name": "Carsten Brandt", 1671 | "role": "Core framework development", 1672 | "email": "mail@cebe.cc", 1673 | "homepage": "http://cebe.cc/" 1674 | }, 1675 | { 1676 | "name": "Timur Ruziev", 1677 | "role": "Core framework development", 1678 | "email": "resurtm@gmail.com", 1679 | "homepage": "http://resurtm.com/" 1680 | }, 1681 | { 1682 | "name": "Paul Klimov", 1683 | "role": "Core framework development", 1684 | "email": "klimov.paul@gmail.com" 1685 | }, 1686 | { 1687 | "name": "Dmitry Naumenko", 1688 | "role": "Core framework development", 1689 | "email": "d.naumenko.a@gmail.com" 1690 | }, 1691 | { 1692 | "name": "Boudewijn Vahrmeijer", 1693 | "role": "Core framework development", 1694 | "email": "info@dynasource.eu", 1695 | "homepage": "http://dynasource.eu" 1696 | } 1697 | ], 1698 | "description": "Yii PHP Framework Version 2", 1699 | "homepage": "http://www.yiiframework.com/", 1700 | "keywords": [ 1701 | "framework", 1702 | "yii2" 1703 | ], 1704 | "time": "2018-06-12T19:38:40+00:00" 1705 | }, 1706 | { 1707 | "name": "yiisoft/yii2-bootstrap", 1708 | "version": "2.0.0-beta", 1709 | "source": { 1710 | "type": "git", 1711 | "url": "https://github.com/yiisoft/yii2-bootstrap.git", 1712 | "reference": "d2518d1f6fb0b3e0e3aba50b9c35f56d580eb3c4" 1713 | }, 1714 | "dist": { 1715 | "type": "zip", 1716 | "url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/d2518d1f6fb0b3e0e3aba50b9c35f56d580eb3c4", 1717 | "reference": "d2518d1f6fb0b3e0e3aba50b9c35f56d580eb3c4", 1718 | "shasum": "", 1719 | "mirrors": [ 1720 | { 1721 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 1722 | "preferred": true 1723 | } 1724 | ] 1725 | }, 1726 | "require": { 1727 | "twbs/bootstrap": "3.0.*", 1728 | "yiisoft/yii2": "*" 1729 | }, 1730 | "type": "yii2-extension", 1731 | "autoload": { 1732 | "psr-4": { 1733 | "yii\\bootstrap\\": "" 1734 | } 1735 | }, 1736 | "notification-url": "https://packagist.org/downloads/", 1737 | "license": [ 1738 | "BSD-3-Clause" 1739 | ], 1740 | "authors": [ 1741 | { 1742 | "name": "Qiang Xue", 1743 | "role": "Founder and project lead", 1744 | "email": "qiang.xue@gmail.com", 1745 | "homepage": "http://www.yiiframework.com/" 1746 | } 1747 | ], 1748 | "description": "The Twitter Bootstrap extension for the Yii framework", 1749 | "keywords": [ 1750 | "bootstrap", 1751 | "yii2" 1752 | ], 1753 | "time": "2014-04-13T21:58:59+00:00" 1754 | }, 1755 | { 1756 | "name": "yiisoft/yii2-composer", 1757 | "version": "dev-master", 1758 | "source": { 1759 | "type": "git", 1760 | "url": "https://github.com/yiisoft/yii2-composer.git", 1761 | "reference": "602673880e00bc2cc6d874b0714382775b372ac2" 1762 | }, 1763 | "dist": { 1764 | "type": "zip", 1765 | "url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/602673880e00bc2cc6d874b0714382775b372ac2", 1766 | "reference": "602673880e00bc2cc6d874b0714382775b372ac2", 1767 | "shasum": "", 1768 | "mirrors": [ 1769 | { 1770 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 1771 | "preferred": true 1772 | } 1773 | ] 1774 | }, 1775 | "require": { 1776 | "composer-plugin-api": "^1.0" 1777 | }, 1778 | "require-dev": { 1779 | "composer/composer": "^1.0", 1780 | "phpunit/phpunit": "<7" 1781 | }, 1782 | "type": "composer-plugin", 1783 | "extra": { 1784 | "class": "yii\\composer\\Plugin", 1785 | "branch-alias": { 1786 | "dev-master": "2.0.x-dev" 1787 | } 1788 | }, 1789 | "autoload": { 1790 | "psr-4": { 1791 | "yii\\composer\\": "" 1792 | } 1793 | }, 1794 | "notification-url": "https://packagist.org/downloads/", 1795 | "license": [ 1796 | "BSD-3-Clause" 1797 | ], 1798 | "authors": [ 1799 | { 1800 | "name": "Qiang Xue", 1801 | "email": "qiang.xue@gmail.com" 1802 | }, 1803 | { 1804 | "name": "Carsten Brandt", 1805 | "email": "mail@cebe.cc" 1806 | } 1807 | ], 1808 | "description": "The composer plugin for Yii extension installer", 1809 | "keywords": [ 1810 | "composer", 1811 | "extension installer", 1812 | "yii2" 1813 | ], 1814 | "time": "2019-07-16T13:22:50+00:00" 1815 | }, 1816 | { 1817 | "name": "yiisoft/yii2-swiftmailer", 1818 | "version": "dev-master", 1819 | "source": { 1820 | "type": "git", 1821 | "url": "https://github.com/yiisoft/yii2-swiftmailer.git", 1822 | "reference": "1f862a1a87f2bfb115fe4cdb6e08f23b59d7229c" 1823 | }, 1824 | "dist": { 1825 | "type": "zip", 1826 | "url": "https://api.github.com/repos/yiisoft/yii2-swiftmailer/zipball/1f862a1a87f2bfb115fe4cdb6e08f23b59d7229c", 1827 | "reference": "1f862a1a87f2bfb115fe4cdb6e08f23b59d7229c", 1828 | "shasum": "", 1829 | "mirrors": [ 1830 | { 1831 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 1832 | "preferred": true 1833 | } 1834 | ] 1835 | }, 1836 | "require": { 1837 | "swiftmailer/swiftmailer": "~6.0", 1838 | "yiisoft/yii2": ">=2.0.4" 1839 | }, 1840 | "require-dev": { 1841 | "phpunit/phpunit": "<7" 1842 | }, 1843 | "type": "yii2-extension", 1844 | "extra": { 1845 | "branch-alias": { 1846 | "dev-master": "2.1.x-dev" 1847 | } 1848 | }, 1849 | "autoload": { 1850 | "psr-4": { 1851 | "yii\\swiftmailer\\": "src" 1852 | } 1853 | }, 1854 | "notification-url": "https://packagist.org/downloads/", 1855 | "license": [ 1856 | "BSD-3-Clause" 1857 | ], 1858 | "authors": [ 1859 | { 1860 | "name": "Paul Klimov", 1861 | "email": "klimov.paul@gmail.com" 1862 | } 1863 | ], 1864 | "description": "The SwiftMailer integration for the Yii framework", 1865 | "keywords": [ 1866 | "email", 1867 | "mail", 1868 | "mailer", 1869 | "swift", 1870 | "swiftmailer", 1871 | "yii2" 1872 | ], 1873 | "time": "2019-05-23T16:25:45+00:00" 1874 | } 1875 | ], 1876 | "packages-dev": [], 1877 | "aliases": [], 1878 | "minimum-stability": "dev", 1879 | "stability-flags": [], 1880 | "prefer-stable": false, 1881 | "prefer-lowest": false, 1882 | "platform": { 1883 | "php": ">=5.4.0" 1884 | }, 1885 | "platform-dev": [] 1886 | } 1887 | -------------------------------------------------------------------------------- /config/console.php: -------------------------------------------------------------------------------- 1 | 'basic-console', 8 | 'basePath' => dirname(__DIR__), 9 | 'bootstrap' => ['log'], 10 | 'controllerNamespace' => 'app\commands', 11 | 'aliases' => [ 12 | '@bower' => '@vendor/bower-asset', 13 | '@npm' => '@vendor/npm-asset', 14 | ], 15 | 'components' => [ 16 | 'cache' => [ 17 | 'class' => 'yii\caching\FileCache', 18 | ], 19 | 'log' => [ 20 | 'class' => 'yii\log\Logger', 21 | 'targets' => [ 22 | [ 23 | 'class' => 'yii\log\FileTarget', 24 | 'levels' => ['error', 'warning'], 25 | ], 26 | ], 27 | ], 28 | 'db' => $db, 29 | ], 30 | 'params' => $params, 31 | /* 32 | 'controllerMap' => [ 33 | 'fixture' => [ // Fixture generation command line. 34 | 'class' => 'yii\faker\FixtureController', 35 | ], 36 | ], 37 | */ 38 | ]; 39 | 40 | // if (YII_ENV_DEV) { 41 | // // configuration adjustments for 'dev' environment 42 | // $config['bootstrap'][] = 'gii'; 43 | // $config['modules']['gii'] = [ 44 | // 'class' => 'yii\gii\Module', 45 | // ]; 46 | // } 47 | 48 | return $config; 49 | -------------------------------------------------------------------------------- /config/db.php: -------------------------------------------------------------------------------- 1 | 'yii\db\Connection', 5 | 'dsn' => 'mysql:host=localhost;dbname=yii2basic', 6 | 'username' => 'root', 7 | 'password' => '', 8 | 'charset' => 'utf8', 9 | 10 | // Schema cache options (for production environment) 11 | //'enableSchemaCache' => true, 12 | //'schemaCacheDuration' => 60, 13 | //'schemaCache' => 'cache', 14 | ]; 15 | -------------------------------------------------------------------------------- /config/params.php: -------------------------------------------------------------------------------- 1 | 'admin@example.com', 5 | ]; 6 | -------------------------------------------------------------------------------- /config/swoole-jobs.php: -------------------------------------------------------------------------------- 1 | __DIR__ . '/../runtime/logs/swoole-jobs', 6 | 'pidPath' => __DIR__ . '/../runtime/logs/swoole-jobs', 7 | 'processName' => ':swooleTopicQueueYii2', // 设置进程名, 方便管理, 默认值 swooleTopicQueue 8 | //job任务相关 9 | 'job' => [ 10 | 'topics' => [ 11 | ['name'=> 'MyJob', 'workerMinNum'=>1, 'workerMaxNum'=>2], 12 | ['name'=> 'MyJob2', 'workerMinNum'=>1, 'workerMaxNum'=>2], 13 | ['name'=> 'MyJob3', 'workerMinNum'=>1, 'workerMaxNum'=>1], 14 | ], 15 | 'queue' => [ 16 | 'class' => '\Kcloze\Jobs\Queue\RedisTopicQueue', 17 | 'host' => '192.168.3.9', 18 | 'port' => 6379, 19 | //'password'=> 'pwd', 20 | ], 21 | 22 | ], 23 | //框架类型及装载类 24 | 'framework' => [ 25 | 'type' => 'yii', 26 | 'config' => require __DIR__ . '/console.php', 27 | //可以自定义,但是该类必须继承\Kcloze\Jobs\Action\BaseAction 28 | 'class'=> 'Kcloze\Jobs\Action\YiiAction', 29 | 30 | ], 31 | 32 | ]; 33 | -------------------------------------------------------------------------------- /config/test.php: -------------------------------------------------------------------------------- 1 | 'basic-tests', 10 | 'basePath' => dirname(__DIR__), 11 | 'aliases' => [ 12 | '@bower' => '@vendor/bower-asset', 13 | '@npm' => '@vendor/npm-asset', 14 | ], 15 | 'language' => 'en-US', 16 | 'components' => [ 17 | 'db' => $db, 18 | 'mailer' => [ 19 | 'useFileTransport' => true, 20 | ], 21 | 'assetManager' => [ 22 | 'basePath' => __DIR__ . '/../web/assets', 23 | ], 24 | 'urlManager' => [ 25 | 'showScriptName' => true, 26 | ], 27 | 'user' => [ 28 | 'identityClass' => 'app\models\User', 29 | ], 30 | 'request' => [ 31 | 'cookieValidationKey' => 'test', 32 | 'enableCsrfValidation' => false, 33 | // but if you absolutely need it set cookie domain to localhost 34 | /* 35 | 'csrfCookie' => [ 36 | 'domain' => 'localhost', 37 | ], 38 | */ 39 | ], 40 | ], 41 | 'params' => $params, 42 | ]; 43 | -------------------------------------------------------------------------------- /config/test_db.php: -------------------------------------------------------------------------------- 1 | 'basic', 8 | 'basePath' => dirname(__DIR__), 9 | 'bootstrap' => ['log'], 10 | 'aliases' => [ 11 | '@bower' => '@vendor/bower-asset', 12 | '@npm' => '@vendor/npm-asset', 13 | ], 14 | 'components' => [ 15 | 'request' => [ 16 | // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation 17 | 'cookieValidationKey' => '', 18 | ], 19 | 'cache' => [ 20 | 'class' => 'yii\caching\FileCache', 21 | ], 22 | 'user' => [ 23 | 'identityClass' => 'app\models\User', 24 | 'enableAutoLogin' => true, 25 | ], 26 | 'errorHandler' => [ 27 | 'errorAction' => 'site/error', 28 | ], 29 | 'mailer' => [ 30 | 'class' => 'yii\swiftmailer\Mailer', 31 | // send all mails to a file by default. You have to set 32 | // 'useFileTransport' to false and configure a transport 33 | // for the mailer to send real emails. 34 | 'useFileTransport' => true, 35 | ], 36 | 'log' => [ 37 | 'traceLevel' => YII_DEBUG ? 3 : 0, 38 | 'targets' => [ 39 | [ 40 | 'class' => 'yii\log\FileTarget', 41 | 'levels' => ['error', 'warning'], 42 | ], 43 | ], 44 | ], 45 | 'db' => $db, 46 | /* 47 | 'urlManager' => [ 48 | 'enablePrettyUrl' => true, 49 | 'showScriptName' => false, 50 | 'rules' => [ 51 | ], 52 | ], 53 | */ 54 | ], 55 | 'params' => $params, 56 | ]; 57 | 58 | if (YII_ENV_DEV) { 59 | // configuration adjustments for 'dev' environment 60 | $config['bootstrap'][] = 'debug'; 61 | $config['modules']['debug'] = [ 62 | 'class' => 'yii\debug\Module', 63 | // uncomment the following to add your IP if you are not connecting from localhost. 64 | //'allowedIPs' => ['127.0.0.1', '::1'], 65 | ]; 66 | 67 | $config['bootstrap'][] = 'gii'; 68 | $config['modules']['gii'] = [ 69 | 'class' => 'yii\gii\Module', 70 | // uncomment the following to add your IP if you are not connecting from localhost. 71 | //'allowedIPs' => ['127.0.0.1', '::1'], 72 | ]; 73 | } 74 | 75 | return $config; 76 | -------------------------------------------------------------------------------- /controllers/SiteController.php: -------------------------------------------------------------------------------- 1 | [ 22 | 'class' => AccessControl::className(), 23 | 'only' => ['logout'], 24 | 'rules' => [ 25 | [ 26 | 'actions' => ['logout'], 27 | 'allow' => true, 28 | 'roles' => ['@'], 29 | ], 30 | ], 31 | ], 32 | 'verbs' => [ 33 | 'class' => VerbFilter::className(), 34 | 'actions' => [ 35 | 'logout' => ['post'], 36 | ], 37 | ], 38 | ]; 39 | } 40 | 41 | /** 42 | * @inheritdoc 43 | */ 44 | public function actions() 45 | { 46 | return [ 47 | 'error' => [ 48 | 'class' => 'yii\web\ErrorAction', 49 | ], 50 | 'captcha' => [ 51 | 'class' => 'yii\captcha\CaptchaAction', 52 | 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null, 53 | ], 54 | ]; 55 | } 56 | 57 | /** 58 | * Displays homepage. 59 | * 60 | * @return string 61 | */ 62 | public function actionIndex() 63 | { 64 | return $this->render('index'); 65 | } 66 | 67 | /** 68 | * Login action. 69 | * 70 | * @return Response|string 71 | */ 72 | public function actionLogin() 73 | { 74 | if (!Yii::$app->user->isGuest) { 75 | return $this->goHome(); 76 | } 77 | 78 | $model = new LoginForm(); 79 | if ($model->load(Yii::$app->request->post()) && $model->login()) { 80 | return $this->goBack(); 81 | } 82 | 83 | $model->password = ''; 84 | return $this->render('login', [ 85 | 'model' => $model, 86 | ]); 87 | } 88 | 89 | /** 90 | * Logout action. 91 | * 92 | * @return Response 93 | */ 94 | public function actionLogout() 95 | { 96 | Yii::$app->user->logout(); 97 | 98 | return $this->goHome(); 99 | } 100 | 101 | /** 102 | * Displays contact page. 103 | * 104 | * @return Response|string 105 | */ 106 | public function actionContact() 107 | { 108 | $model = new ContactForm(); 109 | if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) { 110 | Yii::$app->session->setFlash('contactFormSubmitted'); 111 | 112 | return $this->refresh(); 113 | } 114 | return $this->render('contact', [ 115 | 'model' => $model, 116 | ]); 117 | } 118 | 119 | /** 120 | * Displays about page. 121 | * 122 | * @return string 123 | */ 124 | public function actionAbout() 125 | { 126 | return $this->render('about'); 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /mail/layouts/html.php: -------------------------------------------------------------------------------- 1 | 8 | beginPage() ?> 9 | 10 | 11 | 12 | 13 | <?= Html::encode($this->title) ?> 14 | head() ?> 15 | 16 | 17 | beginBody() ?> 18 | 19 | endBody() ?> 20 | 21 | 22 | endPage() ?> 23 | -------------------------------------------------------------------------------- /models/ContactForm.php: -------------------------------------------------------------------------------- 1 | 'Verification Code', 42 | ]; 43 | } 44 | 45 | /** 46 | * Sends an email to the specified email address using the information collected by this model. 47 | * @param string $email the target email address 48 | * @return bool whether the model passes validation 49 | */ 50 | public function contact($email) 51 | { 52 | if ($this->validate()) { 53 | 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 | return true; 61 | } 62 | return false; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /models/LoginForm.php: -------------------------------------------------------------------------------- 1 | hasErrors()) { 48 | $user = $this->getUser(); 49 | 50 | if (!$user || !$user->validatePassword($this->password)) { 51 | $this->addError($attribute, 'Incorrect username or password.'); 52 | } 53 | } 54 | } 55 | 56 | /** 57 | * Logs in a user using the provided username and password. 58 | * @return bool whether the user is logged in successfully 59 | */ 60 | public function login() 61 | { 62 | if ($this->validate()) { 63 | return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0); 64 | } 65 | return false; 66 | } 67 | 68 | /** 69 | * Finds user by [[username]] 70 | * 71 | * @return User|null 72 | */ 73 | public function getUser() 74 | { 75 | if ($this->_user === false) { 76 | $this->_user = User::findByUsername($this->username); 77 | } 78 | 79 | return $this->_user; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /models/User.php: -------------------------------------------------------------------------------- 1 | [ 15 | 'id' => '100', 16 | 'username' => 'admin', 17 | 'password' => 'admin', 18 | 'authKey' => 'test100key', 19 | 'accessToken' => '100-token', 20 | ], 21 | '101' => [ 22 | 'id' => '101', 23 | 'username' => 'demo', 24 | 'password' => 'demo', 25 | 'authKey' => 'test101key', 26 | 'accessToken' => '101-token', 27 | ], 28 | ]; 29 | 30 | 31 | /** 32 | * @inheritdoc 33 | */ 34 | public static function findIdentity($id) 35 | { 36 | return isset(self::$users[$id]) ? new static(self::$users[$id]) : null; 37 | } 38 | 39 | /** 40 | * @inheritdoc 41 | */ 42 | public static function findIdentityByAccessToken($token, $type = null) 43 | { 44 | foreach (self::$users as $user) { 45 | if ($user['accessToken'] === $token) { 46 | return new static($user); 47 | } 48 | } 49 | 50 | return null; 51 | } 52 | 53 | /** 54 | * Finds user by username 55 | * 56 | * @param string $username 57 | * @return static|null 58 | */ 59 | public static function findByUsername($username) 60 | { 61 | foreach (self::$users as $user) { 62 | if (strcasecmp($user['username'], $username) === 0) { 63 | return new static($user); 64 | } 65 | } 66 | 67 | return null; 68 | } 69 | 70 | /** 71 | * @inheritdoc 72 | */ 73 | public function getId() 74 | { 75 | return $this->id; 76 | } 77 | 78 | /** 79 | * @inheritdoc 80 | */ 81 | public function getAuthKey() 82 | { 83 | return $this->authKey; 84 | } 85 | 86 | /** 87 | * @inheritdoc 88 | */ 89 | public function validateAuthKey($authKey) 90 | { 91 | return $this->authKey === $authKey; 92 | } 93 | 94 | /** 95 | * Validates password 96 | * 97 | * @param string $password password to validate 98 | * @return bool if password provided is valid for current user 99 | */ 100 | public function validatePassword($password) 101 | { 102 | return $this->password === $password; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /requirements.php: -------------------------------------------------------------------------------- 1 | Error\n\n" 33 | . "

The path to yii framework seems to be incorrect.

\n" 34 | . '

You need to install Yii framework via composer or adjust the framework path in file ' . basename(__FILE__) . ".

\n" 35 | . '

Please refer to the README on how to install Yii.

\n"; 36 | 37 | if (!empty($_SERVER['argv'])) { 38 | // do not print HTML when used in console mode 39 | echo strip_tags($message); 40 | } else { 41 | echo $message; 42 | } 43 | exit(1); 44 | } 45 | 46 | require_once($frameworkPath . '/requirements/YiiRequirementChecker.php'); 47 | $requirementsChecker = new YiiRequirementChecker(); 48 | 49 | $gdMemo = $imagickMemo = 'Either GD PHP extension with FreeType support or ImageMagick PHP extension with PNG support is required for image CAPTCHA.'; 50 | $gdOK = $imagickOK = false; 51 | 52 | if (extension_loaded('imagick')) { 53 | $imagick = new Imagick(); 54 | $imagickFormats = $imagick->queryFormats('PNG'); 55 | if (in_array('PNG', $imagickFormats)) { 56 | $imagickOK = true; 57 | } else { 58 | $imagickMemo = 'Imagick extension should be installed with PNG support in order to be used for image CAPTCHA.'; 59 | } 60 | } 61 | 62 | if (extension_loaded('gd')) { 63 | $gdInfo = gd_info(); 64 | if (!empty($gdInfo['FreeType Support'])) { 65 | $gdOK = true; 66 | } else { 67 | $gdMemo = 'GD extension should be installed with FreeType support in order to be used for image CAPTCHA.'; 68 | } 69 | } 70 | 71 | /** 72 | * Adjust requirements according to your application specifics. 73 | */ 74 | $requirements = array( 75 | // Database : 76 | array( 77 | 'name' => 'PDO extension', 78 | 'mandatory' => true, 79 | 'condition' => extension_loaded('pdo'), 80 | 'by' => 'All DB-related classes', 81 | ), 82 | array( 83 | 'name' => 'PDO SQLite extension', 84 | 'mandatory' => false, 85 | 'condition' => extension_loaded('pdo_sqlite'), 86 | 'by' => 'All DB-related classes', 87 | 'memo' => 'Required for SQLite database.', 88 | ), 89 | array( 90 | 'name' => 'PDO MySQL extension', 91 | 'mandatory' => false, 92 | 'condition' => extension_loaded('pdo_mysql'), 93 | 'by' => 'All DB-related classes', 94 | 'memo' => 'Required for MySQL database.', 95 | ), 96 | array( 97 | 'name' => 'PDO PostgreSQL extension', 98 | 'mandatory' => false, 99 | 'condition' => extension_loaded('pdo_pgsql'), 100 | 'by' => 'All DB-related classes', 101 | 'memo' => 'Required for PostgreSQL database.', 102 | ), 103 | // Cache : 104 | array( 105 | 'name' => 'Memcache extension', 106 | 'mandatory' => false, 107 | 'condition' => extension_loaded('memcache') || extension_loaded('memcached'), 108 | 'by' => 'MemCache', 109 | 'memo' => extension_loaded('memcached') ? 'To use memcached set MemCache::useMemcached to true.' : '' 110 | ), 111 | // CAPTCHA: 112 | array( 113 | 'name' => 'GD PHP extension with FreeType support', 114 | 'mandatory' => false, 115 | 'condition' => $gdOK, 116 | 'by' => 'Captcha', 117 | 'memo' => $gdMemo, 118 | ), 119 | array( 120 | 'name' => 'ImageMagick PHP extension with PNG support', 121 | 'mandatory' => false, 122 | 'condition' => $imagickOK, 123 | 'by' => 'Captcha', 124 | 'memo' => $imagickMemo, 125 | ), 126 | // PHP ini : 127 | 'phpExposePhp' => array( 128 | 'name' => 'Expose PHP', 129 | 'mandatory' => false, 130 | 'condition' => $requirementsChecker->checkPhpIniOff("expose_php"), 131 | 'by' => 'Security reasons', 132 | 'memo' => '"expose_php" should be disabled at php.ini', 133 | ), 134 | 'phpAllowUrlInclude' => array( 135 | 'name' => 'PHP allow url include', 136 | 'mandatory' => false, 137 | 'condition' => $requirementsChecker->checkPhpIniOff("allow_url_include"), 138 | 'by' => 'Security reasons', 139 | 'memo' => '"allow_url_include" should be disabled at php.ini', 140 | ), 141 | 'phpSmtp' => array( 142 | 'name' => 'PHP mail SMTP', 143 | 'mandatory' => false, 144 | 'condition' => strlen(ini_get('SMTP')) > 0, 145 | 'by' => 'Email sending', 146 | 'memo' => 'PHP mail SMTP server required', 147 | ), 148 | ); 149 | 150 | // OPcache check 151 | if (!version_compare(phpversion(), '5.5', '>=')) { 152 | $requirements[] = array( 153 | 'name' => 'APC extension', 154 | 'mandatory' => false, 155 | 'condition' => extension_loaded('apc'), 156 | 'by' => 'ApcCache', 157 | ); 158 | } 159 | 160 | $requirementsChecker->checkYii()->check($requirements)->render(); 161 | -------------------------------------------------------------------------------- /runtime/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /swoole-jobs.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | define('APP_PATH', __DIR__); 11 | define('SWOOLE_JOBS_ROOT_PATH', __DIR__); 12 | 13 | 14 | 15 | use Kcloze\Jobs\Command\AppCommand; 16 | use Kcloze\Jobs\Command\HttpCommand; 17 | use Symfony\Component\Console\Application; 18 | 19 | require SWOOLE_JOBS_ROOT_PATH . '/vendor/autoload.php'; 20 | require APP_PATH . '/vendor/yiisoft/yii2/Yii.php'; 21 | 22 | $config = require_once APP_PATH . '/config/swoole-jobs.php'; 23 | 24 | $application = new Application(); 25 | $appCommand = new AppCommand($config); 26 | $application->add($appCommand); 27 | 28 | //check if it has http command 29 | $option=$argv[1] ?? ''; 30 | if (isset($config['httpServer']) && $option==='http') { 31 | $httpCommand = new HttpCommand($config); 32 | $application->add($httpCommand); 33 | $application->setDefaultCommand($appCommand->getName()); 34 | } else { 35 | $application->setDefaultCommand($appCommand->getName(), true); 36 | } 37 | 38 | $application->run(); 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /tests/_bootstrap.php: -------------------------------------------------------------------------------- 1 | amOnPage(Url::toRoute('/site/about')); 10 | $I->see('About', 'h1'); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/acceptance/ContactCest.php: -------------------------------------------------------------------------------- 1 | amOnPage(Url::toRoute('/site/contact')); 10 | } 11 | 12 | public function contactPageWorks(AcceptanceTester $I) 13 | { 14 | $I->wantTo('ensure that contact page works'); 15 | $I->see('Contact', 'h1'); 16 | } 17 | 18 | public function contactFormCanBeSubmitted(AcceptanceTester $I) 19 | { 20 | $I->amGoingTo('submit contact form with correct data'); 21 | $I->fillField('#contactform-name', 'tester'); 22 | $I->fillField('#contactform-email', 'tester@example.com'); 23 | $I->fillField('#contactform-subject', 'test subject'); 24 | $I->fillField('#contactform-body', 'test content'); 25 | $I->fillField('#contactform-verifycode', 'testme'); 26 | 27 | $I->click('contact-button'); 28 | 29 | $I->wait(2); // wait for button to be clicked 30 | 31 | $I->dontSeeElement('#contact-form'); 32 | $I->see('Thank you for contacting us. We will respond to you as soon as possible.'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tests/acceptance/HomeCest.php: -------------------------------------------------------------------------------- 1 | amOnPage(Url::toRoute('/site/index')); 10 | $I->see('My Company'); 11 | 12 | $I->seeLink('About'); 13 | $I->click('About'); 14 | $I->wait(2); // wait for page to be opened 15 | 16 | $I->see('This is the About page.'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/acceptance/LoginCest.php: -------------------------------------------------------------------------------- 1 | amOnPage(Url::toRoute('/site/login')); 10 | $I->see('Login', 'h1'); 11 | 12 | $I->amGoingTo('try to login with correct credentials'); 13 | $I->fillField('input[name="LoginForm[username]"]', 'admin'); 14 | $I->fillField('input[name="LoginForm[password]"]', 'admin'); 15 | $I->click('login-button'); 16 | $I->wait(2); // wait for button to be clicked 17 | 18 | $I->expectTo('see user info'); 19 | $I->see('Logout'); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/acceptance/_bootstrap.php: -------------------------------------------------------------------------------- 1 | [ 21 | 'db' => require __DIR__ . '/../../config/test_db.php' 22 | ] 23 | ] 24 | ); 25 | 26 | 27 | $application = new yii\console\Application($config); 28 | $exitCode = $application->run(); 29 | exit($exitCode); 30 | -------------------------------------------------------------------------------- /tests/bin/yii.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ------------------------------------------------------------- 4 | rem Yii command line bootstrap script for Windows. 5 | rem 6 | rem @author Qiang Xue 7 | rem @link http://www.yiiframework.com/ 8 | rem @copyright Copyright (c) 2008 Yii Software LLC 9 | rem @license http://www.yiiframework.com/license/ 10 | rem ------------------------------------------------------------- 11 | 12 | @setlocal 13 | 14 | set YII_PATH=%~dp0 15 | 16 | if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe 17 | 18 | "%PHP_COMMAND%" "%YII_PATH%yii" %* 19 | 20 | @endlocal 21 | -------------------------------------------------------------------------------- /tests/functional.suite.yml: -------------------------------------------------------------------------------- 1 | # Codeception Test Suite Configuration 2 | 3 | # suite for functional (integration) tests. 4 | # emulate web requests and make application process them. 5 | # (tip: better to use with frameworks). 6 | 7 | # RUN `build` COMMAND AFTER ADDING/REMOVING MODULES. 8 | #basic/web/index.php 9 | class_name: FunctionalTester 10 | modules: 11 | enabled: 12 | - Filesystem 13 | - Yii2 14 | -------------------------------------------------------------------------------- /tests/functional/ContactFormCest.php: -------------------------------------------------------------------------------- 1 | amOnPage(['site/contact']); 8 | } 9 | 10 | public function openContactPage(\FunctionalTester $I) 11 | { 12 | $I->see('Contact', 'h1'); 13 | } 14 | 15 | public function submitEmptyForm(\FunctionalTester $I) 16 | { 17 | $I->submitForm('#contact-form', []); 18 | $I->expectTo('see validations errors'); 19 | $I->see('Contact', 'h1'); 20 | $I->see('Name cannot be blank'); 21 | $I->see('Email cannot be blank'); 22 | $I->see('Subject cannot be blank'); 23 | $I->see('Body cannot be blank'); 24 | $I->see('The verification code is incorrect'); 25 | } 26 | 27 | public function submitFormWithIncorrectEmail(\FunctionalTester $I) 28 | { 29 | $I->submitForm('#contact-form', [ 30 | 'ContactForm[name]' => 'tester', 31 | 'ContactForm[email]' => 'tester.email', 32 | 'ContactForm[subject]' => 'test subject', 33 | 'ContactForm[body]' => 'test content', 34 | 'ContactForm[verifyCode]' => 'testme', 35 | ]); 36 | $I->expectTo('see that email address is wrong'); 37 | $I->dontSee('Name cannot be blank', '.help-inline'); 38 | $I->see('Email is not a valid email address.'); 39 | $I->dontSee('Subject cannot be blank', '.help-inline'); 40 | $I->dontSee('Body cannot be blank', '.help-inline'); 41 | $I->dontSee('The verification code is incorrect', '.help-inline'); 42 | } 43 | 44 | public function submitFormSuccessfully(\FunctionalTester $I) 45 | { 46 | $I->submitForm('#contact-form', [ 47 | 'ContactForm[name]' => 'tester', 48 | 'ContactForm[email]' => 'tester@example.com', 49 | 'ContactForm[subject]' => 'test subject', 50 | 'ContactForm[body]' => 'test content', 51 | 'ContactForm[verifyCode]' => 'testme', 52 | ]); 53 | $I->seeEmailIsSent(); 54 | $I->dontSeeElement('#contact-form'); 55 | $I->see('Thank you for contacting us. We will respond to you as soon as possible.'); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /tests/functional/LoginFormCest.php: -------------------------------------------------------------------------------- 1 | amOnRoute('site/login'); 8 | } 9 | 10 | public function openLoginPage(\FunctionalTester $I) 11 | { 12 | $I->see('Login', 'h1'); 13 | 14 | } 15 | 16 | // demonstrates `amLoggedInAs` method 17 | public function internalLoginById(\FunctionalTester $I) 18 | { 19 | $I->amLoggedInAs(100); 20 | $I->amOnPage('/'); 21 | $I->see('Logout (admin)'); 22 | } 23 | 24 | // demonstrates `amLoggedInAs` method 25 | public function internalLoginByInstance(\FunctionalTester $I) 26 | { 27 | $I->amLoggedInAs(\app\models\User::findByUsername('admin')); 28 | $I->amOnPage('/'); 29 | $I->see('Logout (admin)'); 30 | } 31 | 32 | public function loginWithEmptyCredentials(\FunctionalTester $I) 33 | { 34 | $I->submitForm('#login-form', []); 35 | $I->expectTo('see validations errors'); 36 | $I->see('Username cannot be blank.'); 37 | $I->see('Password cannot be blank.'); 38 | } 39 | 40 | public function loginWithWrongCredentials(\FunctionalTester $I) 41 | { 42 | $I->submitForm('#login-form', [ 43 | 'LoginForm[username]' => 'admin', 44 | 'LoginForm[password]' => 'wrong', 45 | ]); 46 | $I->expectTo('see validations errors'); 47 | $I->see('Incorrect username or password.'); 48 | } 49 | 50 | public function loginSuccessfully(\FunctionalTester $I) 51 | { 52 | $I->submitForm('#login-form', [ 53 | 'LoginForm[username]' => 'admin', 54 | 'LoginForm[password]' => 'admin', 55 | ]); 56 | $I->see('Logout (admin)'); 57 | $I->dontSeeElement('form#login-form'); 58 | } 59 | } -------------------------------------------------------------------------------- /tests/functional/_bootstrap.php: -------------------------------------------------------------------------------- 1 | model = $this->getMockBuilder('app\models\ContactForm') 19 | ->setMethods(['validate']) 20 | ->getMock(); 21 | 22 | $this->model->expects($this->once()) 23 | ->method('validate') 24 | ->will($this->returnValue(true)); 25 | 26 | $this->model->attributes = [ 27 | 'name' => 'Tester', 28 | 'email' => 'tester@example.com', 29 | 'subject' => 'very important letter subject', 30 | 'body' => 'body of current message', 31 | ]; 32 | 33 | expect_that($this->model->contact('admin@example.com')); 34 | 35 | // using Yii2 module actions to check email was sent 36 | $this->tester->seeEmailIsSent(); 37 | 38 | $emailMessage = $this->tester->grabLastSentEmail(); 39 | expect('valid email is sent', $emailMessage)->isInstanceOf('yii\mail\MessageInterface'); 40 | expect($emailMessage->getTo())->hasKey('admin@example.com'); 41 | expect($emailMessage->getFrom())->hasKey('tester@example.com'); 42 | expect($emailMessage->getSubject())->equals('very important letter subject'); 43 | expect($emailMessage->toString())->contains('body of current message'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /tests/unit/models/LoginFormTest.php: -------------------------------------------------------------------------------- 1 | user->logout(); 15 | } 16 | 17 | public function testLoginNoUser() 18 | { 19 | $this->model = new LoginForm([ 20 | 'username' => 'not_existing_username', 21 | 'password' => 'not_existing_password', 22 | ]); 23 | 24 | expect_not($this->model->login()); 25 | expect_that(\Yii::$app->user->isGuest); 26 | } 27 | 28 | public function testLoginWrongPassword() 29 | { 30 | $this->model = new LoginForm([ 31 | 'username' => 'demo', 32 | 'password' => 'wrong_password', 33 | ]); 34 | 35 | expect_not($this->model->login()); 36 | expect_that(\Yii::$app->user->isGuest); 37 | expect($this->model->errors)->hasKey('password'); 38 | } 39 | 40 | public function testLoginCorrect() 41 | { 42 | $this->model = new LoginForm([ 43 | 'username' => 'demo', 44 | 'password' => 'demo', 45 | ]); 46 | 47 | expect_that($this->model->login()); 48 | expect_not(\Yii::$app->user->isGuest); 49 | expect($this->model->errors)->hasntKey('password'); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /tests/unit/models/UserTest.php: -------------------------------------------------------------------------------- 1 | username)->equals('admin'); 13 | 14 | expect_not(User::findIdentity(999)); 15 | } 16 | 17 | public function testFindUserByAccessToken() 18 | { 19 | expect_that($user = User::findIdentityByAccessToken('100-token')); 20 | expect($user->username)->equals('admin'); 21 | 22 | expect_not(User::findIdentityByAccessToken('non-existing')); 23 | } 24 | 25 | public function testFindUserByUsername() 26 | { 27 | expect_that($user = User::findByUsername('admin')); 28 | expect_not(User::findByUsername('not-admin')); 29 | } 30 | 31 | /** 32 | * @depends testFindUserByUsername 33 | */ 34 | public function testValidateUser($user) 35 | { 36 | $user = User::findByUsername('admin'); 37 | expect_that($user->validateAuthKey('test100key')); 38 | expect_not($user->validateAuthKey('test102key')); 39 | 40 | expect_that($user->validatePassword('admin')); 41 | expect_not($user->validatePassword('123456')); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /vagrant/config/.gitignore: -------------------------------------------------------------------------------- 1 | # local configuration 2 | vagrant-local.yml -------------------------------------------------------------------------------- /vagrant/config/vagrant-local-example.yml: -------------------------------------------------------------------------------- 1 | # Your personal GitHub token 2 | 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: yii2basic 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 23 | -------------------------------------------------------------------------------- /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 yii2basic.dev; 10 | root /app/web/; 11 | index index.php; 12 | 13 | access_log /app/vagrant/nginx/log/yii2basic.access.log; 14 | error_log /app/vagrant/nginx/log/yii2basic.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 | -------------------------------------------------------------------------------- /vagrant/nginx/log/.gitignore: -------------------------------------------------------------------------------- 1 | #nginx logs 2 | yii2basic.access.log 3 | yii2basic.error.log -------------------------------------------------------------------------------- /vagrant/provision/always-as-root.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #== Bash helpers == 4 | 5 | function info { 6 | echo " " 7 | echo "--> $1" 8 | echo " " 9 | } 10 | 11 | #== Provision script == 12 | 13 | info "Provision-script user: `whoami`" 14 | 15 | info "Restart web-stack" 16 | service php7.0-fpm restart 17 | service nginx restart 18 | service mysql restart -------------------------------------------------------------------------------- /vagrant/provision/once-as-root.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #== Import script args == 4 | 5 | timezone=$(echo "$1") 6 | 7 | #== Bash helpers == 8 | 9 | function info { 10 | echo " " 11 | echo "--> $1" 12 | echo " " 13 | } 14 | 15 | #== Provision script == 16 | 17 | info "Provision-script user: `whoami`" 18 | 19 | export DEBIAN_FRONTEND=noninteractive 20 | 21 | info "Configure timezone" 22 | timedatectl set-timezone ${timezone} --no-ask-password 23 | 24 | info "Prepare root password for MySQL" 25 | debconf-set-selections <<< "mariadb-server-10.0 mysql-server/root_password password \"''\"" 26 | debconf-set-selections <<< "mariadb-server-10.0 mysql-server/root_password_again password \"''\"" 27 | echo "Done!" 28 | 29 | info "Update OS software" 30 | apt-get update 31 | apt-get upgrade -y 32 | 33 | info "Install additional software" 34 | 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 mariadb-server-10.0 php.xdebug 35 | 36 | info "Configure MySQL" 37 | sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/mariadb.conf.d/50-server.cnf 38 | mysql -uroot <<< "CREATE USER 'root'@'%' IDENTIFIED BY ''" 39 | mysql -uroot <<< "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'" 40 | mysql -uroot <<< "DROP USER 'root'@'localhost'" 41 | mysql -uroot <<< "FLUSH PRIVILEGES" 42 | echo "Done!" 43 | 44 | info "Configure PHP-FPM" 45 | sed -i 's/user = www-data/user = vagrant/g' /etc/php/7.0/fpm/pool.d/www.conf 46 | sed -i 's/group = www-data/group = vagrant/g' /etc/php/7.0/fpm/pool.d/www.conf 47 | sed -i 's/owner = www-data/owner = vagrant/g' /etc/php/7.0/fpm/pool.d/www.conf 48 | cat << EOF > /etc/php/7.0/mods-available/xdebug.ini 49 | zend_extension=xdebug.so 50 | xdebug.remote_enable=1 51 | xdebug.remote_connect_back=1 52 | xdebug.remote_port=9000 53 | xdebug.remote_autostart=1 54 | EOF 55 | echo "Done!" 56 | 57 | info "Configure NGINX" 58 | sed -i 's/user www-data/user vagrant/g' /etc/nginx/nginx.conf 59 | echo "Done!" 60 | 61 | info "Enabling site configuration" 62 | ln -s /app/vagrant/nginx/app.conf /etc/nginx/sites-enabled/app.conf 63 | echo "Done!" 64 | 65 | info "Initailize databases for MySQL" 66 | mysql -uroot <<< "CREATE DATABASE yii2basic" 67 | mysql -uroot <<< "CREATE DATABASE yii2basic_test" 68 | echo "Done!" 69 | 70 | info "Install composer" 71 | curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -------------------------------------------------------------------------------- /vagrant/provision/once-as-vagrant.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #== Import script args == 4 | 5 | github_token=$(echo "$1") 6 | 7 | #== Bash helpers == 8 | 9 | function info { 10 | echo " " 11 | echo "--> $1" 12 | echo " " 13 | } 14 | 15 | #== Provision script == 16 | 17 | info "Provision-script user: `whoami`" 18 | 19 | info "Configure composer" 20 | composer config --global github-oauth.github.com ${github_token} 21 | echo "Done!" 22 | 23 | info "Install project dependencies" 24 | cd /app 25 | composer --no-progress --prefer-dist install 26 | 27 | info "Create bash-alias 'app' for vagrant user" 28 | echo 'alias app="cd /app"' | tee /home/vagrant/.bash_aliases 29 | 30 | info "Enabling colorized prompt for guest console" 31 | sed -i "s/#force_color_prompt=yes/force_color_prompt=yes/" /home/vagrant/.bashrc 32 | -------------------------------------------------------------------------------- /views/layouts/main.php: -------------------------------------------------------------------------------- 1 | 15 | beginPage() ?> 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | <?= Html::encode($this->title) ?> 24 | head() ?> 25 | 26 | 27 | beginBody() ?> 28 | 29 |
30 | Yii::$app->name, 33 | 'brandUrl' => Yii::$app->homeUrl, 34 | 'options' => [ 35 | 'class' => 'navbar-inverse navbar-fixed-top', 36 | ], 37 | ]); 38 | echo Nav::widget([ 39 | 'options' => ['class' => 'navbar-nav navbar-right'], 40 | 'items' => [ 41 | ['label' => 'Home', 'url' => ['/site/index']], 42 | ['label' => 'About', 'url' => ['/site/about']], 43 | ['label' => 'Contact', 'url' => ['/site/contact']], 44 | Yii::$app->user->isGuest ? ( 45 | ['label' => 'Login', 'url' => ['/site/login']] 46 | ) : ( 47 | '
  • ' 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 | . '
  • ' 55 | ) 56 | ], 57 | ]); 58 | NavBar::end(); 59 | ?> 60 | 61 |
    62 | isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], 64 | ]) ?> 65 | 66 | 67 |
    68 |
    69 | 70 |
    71 |
    72 |

    © My Company

    73 | 74 |

    75 |
    76 |
    77 | 78 | endBody() ?> 79 | 80 | 81 | endPage() ?> 82 | -------------------------------------------------------------------------------- /views/site/about.php: -------------------------------------------------------------------------------- 1 | title = 'About'; 8 | $this->params['breadcrumbs'][] = $this->title; 9 | ?> 10 |
    11 |

    title) ?>

    12 | 13 |

    14 | This is the About page. You may modify the following file to customize its content: 15 |

    16 | 17 | 18 |
    19 | -------------------------------------------------------------------------------- /views/site/contact.php: -------------------------------------------------------------------------------- 1 | title = 'Contact'; 12 | $this->params['breadcrumbs'][] = $this->title; 13 | ?> 14 |
    15 |

    title) ?>

    16 | 17 | session->hasFlash('contactFormSubmitted')): ?> 18 | 19 |
    20 | Thank you for contacting us. We will respond to you as soon as possible. 21 |
    22 | 23 |

    24 | Note that if you turn on the Yii debugger, you should be able 25 | to view the mail message on the mail panel of the debugger. 26 | mailer->useFileTransport): ?> 27 | Because the application is in development mode, the email is not sent but saved as 28 | a file under mailer->fileTransportPath) ?>. 29 | Please configure the useFileTransport property of the mail 30 | application component to be false to enable email sending. 31 | 32 |

    33 | 34 | 35 | 36 |

    37 | If you have business inquiries or other questions, please fill out the following form to contact us. 38 | Thank you. 39 |

    40 | 41 |
    42 |
    43 | 44 | 'contact-form']); ?> 45 | 46 | field($model, 'name')->textInput(['autofocus' => true]) ?> 47 | 48 | field($model, 'email') ?> 49 | 50 | field($model, 'subject') ?> 51 | 52 | field($model, 'body')->textarea(['rows' => 6]) ?> 53 | 54 | field($model, 'verifyCode')->widget(Captcha::className(), [ 55 | 'template' => '
    {image}
    {input}
    ', 56 | ]) ?> 57 | 58 |
    59 | 'btn btn-primary', 'name' => 'contact-button']) ?> 60 |
    61 | 62 | 63 | 64 |
    65 |
    66 | 67 | 68 |
    69 | -------------------------------------------------------------------------------- /views/site/error.php: -------------------------------------------------------------------------------- 1 | title = $name; 11 | ?> 12 |
    13 | 14 |

    title) ?>

    15 | 16 |
    17 | 18 |
    19 | 20 |

    21 | The above error occurred while the Web server was processing your request. 22 |

    23 |

    24 | Please contact us if you think this is a server error. Thank you. 25 |

    26 | 27 |
    28 | -------------------------------------------------------------------------------- /views/site/index.php: -------------------------------------------------------------------------------- 1 | title = 'My Yii Application'; 6 | ?> 7 |
    8 | 9 |
    10 |

    Congratulations!

    11 | 12 |

    You have successfully created your Yii-powered application.

    13 | 14 |

    Get started with Yii

    15 |
    16 | 17 |
    18 | 19 |
    20 |
    21 |

    Heading

    22 | 23 |

    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.

    27 | 28 |

    Yii Documentation »

    29 |
    30 |
    31 |

    Heading

    32 | 33 |

    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.

    37 | 38 |

    Yii Forum »

    39 |
    40 |
    41 |

    Heading

    42 | 43 |

    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.

    47 | 48 |

    Yii Extensions »

    49 |
    50 |
    51 | 52 |
    53 |
    54 | -------------------------------------------------------------------------------- /views/site/login.php: -------------------------------------------------------------------------------- 1 | title = 'Login'; 11 | $this->params['breadcrumbs'][] = $this->title; 12 | ?> 13 | 48 | -------------------------------------------------------------------------------- /web/assets/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /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 th { 76 | white-space: nowrap; 77 | } 78 | 79 | .hint-block { 80 | display: block; 81 | margin-top: 5px; 82 | color: #999; 83 | } 84 | 85 | .error-summary { 86 | color: #a94442; 87 | background: #fdf7f7; 88 | border-left: 3px solid #eed3d7; 89 | padding: 10px 20px; 90 | margin: 0 0 15px 0; 91 | } 92 | 93 | /* align the logout "link" (button in form) of the navbar */ 94 | .nav li > form > button.logout { 95 | padding: 15px; 96 | border: none; 97 | } 98 | 99 | @media(max-width:767px) { 100 | .nav li > form > button.logout { 101 | display:block; 102 | text-align: left; 103 | width: 100%; 104 | padding: 10px 15px; 105 | } 106 | } 107 | 108 | .nav > li > form > button.logout:focus, 109 | .nav > li > form > button.logout:hover { 110 | text-decoration: none; 111 | } 112 | 113 | .nav > li > form > button.logout:focus { 114 | outline: none; 115 | } 116 | -------------------------------------------------------------------------------- /web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kcloze/swoole-jobs-yii2/1aeb09ea10ada9ab08791b1a4038be870c379958/web/favicon.ico -------------------------------------------------------------------------------- /web/index-test.php: -------------------------------------------------------------------------------- 1 | run(); 17 | -------------------------------------------------------------------------------- /web/index.php: -------------------------------------------------------------------------------- 1 | run(); 13 | -------------------------------------------------------------------------------- /web/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: -------------------------------------------------------------------------------- /widgets/Alert.php: -------------------------------------------------------------------------------- 1 | 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 23 | * @author Alexander Makarov 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 | } 76 | -------------------------------------------------------------------------------- /yii: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | run(); 24 | exit($exitCode); 25 | -------------------------------------------------------------------------------- /yii.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ------------------------------------------------------------- 4 | rem Yii command line bootstrap script for Windows. 5 | rem 6 | rem @author Qiang Xue 7 | rem @link http://www.yiiframework.com/ 8 | rem @copyright Copyright (c) 2008 Yii Software LLC 9 | rem @license http://www.yiiframework.com/license/ 10 | rem ------------------------------------------------------------- 11 | 12 | @setlocal 13 | 14 | set YII_PATH=%~dp0 15 | 16 | if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe 17 | 18 | "%PHP_COMMAND%" "%YII_PATH%yii" %* 19 | 20 | @endlocal 21 | --------------------------------------------------------------------------------