├── .bowerrc ├── .gitignore ├── LICENSE.md ├── README.md ├── assets └── AppAsset.php ├── commands └── HelloController.php ├── composer.json ├── composer.lock ├── config ├── assets-prod.php ├── console.php ├── db.php ├── params.php └── web.php ├── controllers └── SiteController.php ├── mail └── layouts │ └── html.php ├── models ├── ContactForm.php ├── LoginForm.php └── User.php ├── requirements.php ├── runtime └── .gitignore ├── tests ├── README.md ├── codeception.yml └── codeception │ ├── .gitignore │ ├── _bootstrap.php │ ├── _output │ └── .gitignore │ ├── _pages │ ├── AboutPage.php │ ├── ContactPage.php │ └── LoginPage.php │ ├── acceptance.suite.yml │ ├── acceptance │ ├── AboutCept.php │ ├── ContactCept.php │ ├── HomeCept.php │ ├── LoginCept.php │ └── _bootstrap.php │ ├── bin │ ├── _bootstrap.php │ ├── yii │ └── yii.bat │ ├── config │ ├── acceptance.php │ ├── config.php │ ├── functional.php │ └── unit.php │ ├── fixtures │ └── .gitignore │ ├── functional.suite.yml │ ├── functional │ ├── AboutCept.php │ ├── ContactCept.php │ ├── HomeCept.php │ ├── LoginCept.php │ └── _bootstrap.php │ ├── templates │ └── .gitignore │ ├── unit.suite.yml │ └── unit │ ├── _bootstrap.php │ ├── fixtures │ ├── .gitkeep │ └── data │ │ └── .gitkeep │ ├── models │ ├── ContactFormTest.php │ ├── LoginFormTest.php │ └── UserTest.php │ └── templates │ └── fixtures │ └── .gitkeep ├── tools └── gulp │ ├── assets-config.php │ ├── gulpfile.js │ ├── node_modules │ └── .gitignore │ └── package.json ├── 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 ├── yii └── yii.bat /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory" : "vendor/bower" 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 | -------------------------------------------------------------------------------- /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 | # Yii2 and Gulp 2 | Simple app with working Yii2 asset command and Gulp. 3 | 4 | This is configured [yiisoft/yii2-app-basic](https://github.com/yiisoft/yii2-app-basic) which uses Gulp. 5 | 6 | ## App installation 7 | 8 | * Install NodeJS from [here](http://nodejs.org/) 9 | * Install Gulp globaly ``npm install -g gulp``. 10 | * IMPORTANT: Make sure that Gulp works fine. Check it with ``gulp --version``, if it works you should see something like ``CLI version 3.8.11`` 11 | * Clone this repository 12 | ``git clone https://github.com/lukicdarkoo/yii2-and-gulp.git`` 13 | * Navigate to ``/yii2-and-gulp`` and run ``composer update --prefer-dist`` 14 | * Navigate to ``/yii2-and-gulp/tools/gulp`` and run ``npm update`` 15 | * To generate combined and compressed *.js and *.css files navigate to ``/yii2-and-gulp`` and run ``yii asset tools/gulp/assets-config.php config/assets-prod.php`` 16 | * FINISH! Run app and check source code, you should see only one *.js and one *.css file, combined and compressed. 17 | 18 | 19 | ## Integrate to your app 20 | 21 | * Copy directory ``/tools`` to your application 22 | * Change **bundles** and **targets** for your needs in ``/tools/grunt/assets-config.php``, check Yii2 Guide [Using the asset Command](http://www.yiiframework.com/doc-2.0/guide-structure-assets.html#using-the-asset-command) 23 | * Configure component to your config file: 24 | ``` 25 | 'assetManager' => [ 26 | 'bundles' => require(__DIR__ . '/' . 'assets-prod.php' ), 27 | ], 28 | ``` 29 | * Install NodeJS from [here](http://nodejs.org/) 30 | * Install Gulp globaly ``npm install -g gulp``. 31 | * IMPORTANT: Make sure does Gulp work fine. Check it with ``gulp --version``, if it works you should see something like ``CLI version 3.8.11`` 32 | * Navigate to ``/your-app-root/tools/gulp`` and run ``npm update`` 33 | * To generate combined and compressed *.js and *.css files navigate to ``/your-app-root`` and run ``yii asset tools/gulp/assets-config.php config/assets-prod.php`` 34 | * FINISH! Run app and check source code, you should see only one *.js and one *.css file, combined and compressed. 35 | -------------------------------------------------------------------------------- /assets/AppAsset.php: -------------------------------------------------------------------------------- 1 | 14 | * @since 2.0 15 | */ 16 | class AppAsset extends AssetBundle 17 | { 18 | public $basePath = '@webroot'; 19 | public $baseUrl = '@web'; 20 | public $css = [ 21 | 'css/site.css', 22 | ]; 23 | public $js = [ 24 | ]; 25 | public $jsOptions = [ 26 | 'position' => \yii\web\View::POS_HEAD 27 | ]; 28 | public $depends = [ 29 | 'yii\web\YiiAsset', 30 | 'yii\bootstrap\BootstrapAsset', 31 | ]; 32 | } 33 | -------------------------------------------------------------------------------- /commands/HelloController.php: -------------------------------------------------------------------------------- 1 | 18 | * @since 2.0 19 | */ 20 | class HelloController extends Controller 21 | { 22 | /** 23 | * This command echoes what you have entered as the message. 24 | * @param string $message the message to be echoed. 25 | */ 26 | public function actionIndex($message = 'hello world') 27 | { 28 | echo $message . "\n"; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lukicdarkoo/yii2-and-gulp", 3 | "description": "Yii 2 Basic Application and Gulp", 4 | "keywords": ["yii2", "gulp"], 5 | "homepage": "http://www.yiiframework.com/", 6 | "type": "project", 7 | "license": "BSD-3-Clause", 8 | "support": { 9 | "issues": "https://github.com/lukicdarkoo/yii2-and-gulp/issues", 10 | "source": "https://github.com/lukicdarkoo/yii2-and-gulp" 11 | }, 12 | "minimum-stability": "dev", 13 | "require": { 14 | "php": ">=5.4.0", 15 | "yiisoft/yii2": "*", 16 | "yiisoft/yii2-bootstrap": "*", 17 | "yiisoft/yii2-swiftmailer": "*" 18 | }, 19 | "require-dev": { 20 | "yiisoft/yii2-codeception": "*", 21 | "yiisoft/yii2-debug": "*", 22 | "yiisoft/yii2-gii": "*", 23 | "yiisoft/yii2-faker": "*" 24 | }, 25 | "config": { 26 | "process-timeout": 1800 27 | }, 28 | "scripts": { 29 | "post-create-project-cmd": [ 30 | "yii\\composer\\Installer::postCreateProject" 31 | ] 32 | }, 33 | "extra": { 34 | "yii\\composer\\Installer::postCreateProject": { 35 | "setPermission": [ 36 | { 37 | "runtime": "0777", 38 | "web/assets": "0777", 39 | "yii": "0755" 40 | } 41 | ], 42 | "generateCookieValidationKey": [ 43 | "config/web.php" 44 | ] 45 | }, 46 | "asset-installer-paths": { 47 | "npm-asset-library": "vendor/npm", 48 | "bower-asset-library": "vendor/bower" 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "hash": "80f4231ab64bee3ffb22c87bfdc3a50c", 8 | "packages": [ 9 | { 10 | "name": "bower-asset/bootstrap", 11 | "version": "v3.3.2", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/twbs/bootstrap.git", 15 | "reference": "bcf7dd38b5ab180256e2e4fb5da0369551b3f082" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/twbs/bootstrap/zipball/bcf7dd38b5ab180256e2e4fb5da0369551b3f082", 20 | "reference": "bcf7dd38b5ab180256e2e4fb5da0369551b3f082", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "bower-asset/jquery": ">=1.9.1" 25 | }, 26 | "type": "bower-asset-library", 27 | "extra": { 28 | "bower-asset-main": [ 29 | "less/bootstrap.less", 30 | "dist/css/bootstrap.css", 31 | "dist/js/bootstrap.js", 32 | "dist/fonts/glyphicons-halflings-regular.eot", 33 | "dist/fonts/glyphicons-halflings-regular.svg", 34 | "dist/fonts/glyphicons-halflings-regular.ttf", 35 | "dist/fonts/glyphicons-halflings-regular.woff" 36 | ], 37 | "bower-asset-ignore": [ 38 | "/.*", 39 | "_config.yml", 40 | "CNAME", 41 | "composer.json", 42 | "CONTRIBUTING.md", 43 | "docs", 44 | "js/tests", 45 | "test-infra" 46 | ] 47 | }, 48 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 49 | "keywords": [ 50 | "css", 51 | "framework", 52 | "front-end", 53 | "js", 54 | "less", 55 | "mobile-first", 56 | "responsive", 57 | "web" 58 | ] 59 | }, 60 | { 61 | "name": "bower-asset/jquery", 62 | "version": "2.1.3", 63 | "source": { 64 | "type": "git", 65 | "url": "https://github.com/jquery/jquery.git", 66 | "reference": "8f2a9d9272d6ed7f32d3a484740ab342c02541e0" 67 | }, 68 | "dist": { 69 | "type": "zip", 70 | "url": "https://api.github.com/repos/jquery/jquery/zipball/8f2a9d9272d6ed7f32d3a484740ab342c02541e0", 71 | "reference": "8f2a9d9272d6ed7f32d3a484740ab342c02541e0", 72 | "shasum": "" 73 | }, 74 | "require-dev": { 75 | "bower-asset/qunit": "1.14.0", 76 | "bower-asset/requirejs": "2.1.10", 77 | "bower-asset/sinon": "1.8.1", 78 | "bower-asset/sizzle": "2.1.1-patch2" 79 | }, 80 | "type": "bower-asset-library", 81 | "extra": { 82 | "bower-asset-main": "dist/jquery.js", 83 | "bower-asset-ignore": [ 84 | "**/.*", 85 | "build", 86 | "speed", 87 | "test", 88 | "*.md", 89 | "AUTHORS.txt", 90 | "Gruntfile.js", 91 | "package.json" 92 | ] 93 | }, 94 | "license": [ 95 | "MIT" 96 | ], 97 | "keywords": [ 98 | "javascript", 99 | "jquery", 100 | "library" 101 | ] 102 | }, 103 | { 104 | "name": "bower-asset/jquery.inputmask", 105 | "version": "3.1.61", 106 | "source": { 107 | "type": "git", 108 | "url": "https://github.com/RobinHerbots/jquery.inputmask.git", 109 | "reference": "f2c086411d2557fc485c47afb3cecfa6c1de9ee2" 110 | }, 111 | "dist": { 112 | "type": "zip", 113 | "url": "https://api.github.com/repos/RobinHerbots/jquery.inputmask/zipball/f2c086411d2557fc485c47afb3cecfa6c1de9ee2", 114 | "reference": "f2c086411d2557fc485c47afb3cecfa6c1de9ee2", 115 | "shasum": "" 116 | }, 117 | "require": { 118 | "bower-asset/jquery": ">=1.7" 119 | }, 120 | "type": "bower-asset-library", 121 | "extra": { 122 | "bower-asset-main": [ 123 | "./dist/inputmask/jquery.inputmask.js", 124 | "./dist/inputmask/jquery.inputmask.extensions.js", 125 | "./dist/inputmask/jquery.inputmask.date.extensions.js", 126 | "./dist/inputmask/jquery.inputmask.numeric.extensions.js", 127 | "./dist/inputmask/jquery.inputmask.phone.extensions.js", 128 | "./dist/inputmask/jquery.inputmask.regex.extensions.js" 129 | ], 130 | "bower-asset-ignore": [ 131 | "**/.*", 132 | "qunit/", 133 | "nuget/", 134 | "tools/", 135 | "js/", 136 | "*.md", 137 | "build.properties", 138 | "build.xml", 139 | "jquery.inputmask.jquery.json" 140 | ] 141 | }, 142 | "license": [ 143 | "http://opensource.org/licenses/mit-license.php" 144 | ], 145 | "description": "jquery.inputmask is a jquery plugin which create an input mask.", 146 | "keywords": [ 147 | "form", 148 | "input", 149 | "inputmask", 150 | "jquery", 151 | "mask", 152 | "plugins" 153 | ] 154 | }, 155 | { 156 | "name": "bower-asset/punycode", 157 | "version": "v1.3.2", 158 | "source": { 159 | "type": "git", 160 | "url": "https://github.com/bestiejs/punycode.js.git", 161 | "reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3" 162 | }, 163 | "dist": { 164 | "type": "zip", 165 | "url": "https://api.github.com/repos/bestiejs/punycode.js/zipball/38c8d3131a82567bfef18da09f7f4db68c84f8a3", 166 | "reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3", 167 | "shasum": "" 168 | }, 169 | "type": "bower-asset-library", 170 | "extra": { 171 | "bower-asset-main": "punycode.js", 172 | "bower-asset-ignore": [ 173 | "coverage", 174 | "tests", 175 | ".*", 176 | "component.json", 177 | "Gruntfile.js", 178 | "node_modules", 179 | "package.json" 180 | ] 181 | } 182 | }, 183 | { 184 | "name": "bower-asset/yii2-pjax", 185 | "version": "dev-master", 186 | "source": { 187 | "type": "git", 188 | "url": "https://github.com/yiisoft/jquery-pjax.git", 189 | "reference": "b7491aec282bfd2e78faf33b18df865299b88d36" 190 | }, 191 | "dist": { 192 | "type": "zip", 193 | "url": "https://api.github.com/repos/yiisoft/jquery-pjax/zipball/b7491aec282bfd2e78faf33b18df865299b88d36", 194 | "reference": "b7491aec282bfd2e78faf33b18df865299b88d36", 195 | "shasum": "" 196 | }, 197 | "require": { 198 | "bower-asset/jquery": ">=1.8" 199 | }, 200 | "type": "bower-asset-library", 201 | "extra": { 202 | "bower-asset-main": "./jquery.pjax.js", 203 | "bower-asset-ignore": [ 204 | ".travis.yml", 205 | "Gemfile", 206 | "Gemfile.lock", 207 | "vendor/", 208 | "script/", 209 | "test/" 210 | ], 211 | "branch-alias": { 212 | "dev-master": "2.0.2-dev" 213 | } 214 | }, 215 | "license": [ 216 | "MIT" 217 | ] 218 | }, 219 | { 220 | "name": "cebe/markdown", 221 | "version": "dev-master", 222 | "source": { 223 | "type": "git", 224 | "url": "https://github.com/cebe/markdown.git", 225 | "reference": "f89dc1da1fc6823f0286d6cad736a642efd0f59e" 226 | }, 227 | "dist": { 228 | "type": "zip", 229 | "url": "https://api.github.com/repos/cebe/markdown/zipball/f89dc1da1fc6823f0286d6cad736a642efd0f59e", 230 | "reference": "f89dc1da1fc6823f0286d6cad736a642efd0f59e", 231 | "shasum": "" 232 | }, 233 | "require": { 234 | "lib-pcre": "*", 235 | "php": ">=5.4.0" 236 | }, 237 | "require-dev": { 238 | "cebe/indent": "*", 239 | "facebook/xhprof": "*@dev", 240 | "phpunit/phpunit": "3.7.*" 241 | }, 242 | "bin": [ 243 | "bin/markdown" 244 | ], 245 | "type": "library", 246 | "extra": { 247 | "branch-alias": { 248 | "dev-master": "1.0.x-dev" 249 | } 250 | }, 251 | "autoload": { 252 | "psr-4": { 253 | "cebe\\markdown\\": "" 254 | } 255 | }, 256 | "notification-url": "https://packagist.org/downloads/", 257 | "license": [ 258 | "MIT" 259 | ], 260 | "authors": [ 261 | { 262 | "name": "Carsten Brandt", 263 | "email": "mail@cebe.cc", 264 | "homepage": "http://cebe.cc/", 265 | "role": "Creator" 266 | } 267 | ], 268 | "description": "A super fast, highly extensible markdown parser for PHP", 269 | "homepage": "https://github.com/cebe/markdown#readme", 270 | "keywords": [ 271 | "extensible", 272 | "fast", 273 | "gfm", 274 | "markdown", 275 | "markdown-extra" 276 | ], 277 | "time": "2014-12-18 00:45:32" 278 | }, 279 | { 280 | "name": "ezyang/htmlpurifier", 281 | "version": "v4.6.0", 282 | "source": { 283 | "type": "git", 284 | "url": "https://github.com/ezyang/htmlpurifier.git", 285 | "reference": "6f389f0f25b90d0b495308efcfa073981177f0fd" 286 | }, 287 | "dist": { 288 | "type": "zip", 289 | "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/6f389f0f25b90d0b495308efcfa073981177f0fd", 290 | "reference": "6f389f0f25b90d0b495308efcfa073981177f0fd", 291 | "shasum": "" 292 | }, 293 | "require": { 294 | "php": ">=5.2" 295 | }, 296 | "type": "library", 297 | "autoload": { 298 | "psr-0": { 299 | "HTMLPurifier": "library/" 300 | }, 301 | "files": [ 302 | "library/HTMLPurifier.composer.php" 303 | ] 304 | }, 305 | "notification-url": "https://packagist.org/downloads/", 306 | "license": [ 307 | "LGPL" 308 | ], 309 | "authors": [ 310 | { 311 | "name": "Edward Z. Yang", 312 | "email": "admin@htmlpurifier.org", 313 | "homepage": "http://ezyang.com" 314 | } 315 | ], 316 | "description": "Standards compliant HTML filter written in PHP", 317 | "homepage": "http://htmlpurifier.org/", 318 | "keywords": [ 319 | "html" 320 | ], 321 | "time": "2013-11-30 08:25:19" 322 | }, 323 | { 324 | "name": "swiftmailer/swiftmailer", 325 | "version": "dev-master", 326 | "source": { 327 | "type": "git", 328 | "url": "https://github.com/swiftmailer/swiftmailer.git", 329 | "reference": "db95cfa68a8bc91d1c54f75c416f481c9a8bd100" 330 | }, 331 | "dist": { 332 | "type": "zip", 333 | "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/db95cfa68a8bc91d1c54f75c416f481c9a8bd100", 334 | "reference": "db95cfa68a8bc91d1c54f75c416f481c9a8bd100", 335 | "shasum": "" 336 | }, 337 | "require": { 338 | "php": ">=5.3.3" 339 | }, 340 | "require-dev": { 341 | "mockery/mockery": "~0.9.1" 342 | }, 343 | "type": "library", 344 | "extra": { 345 | "branch-alias": { 346 | "dev-master": "5.3-dev" 347 | } 348 | }, 349 | "autoload": { 350 | "files": [ 351 | "lib/swift_required.php" 352 | ] 353 | }, 354 | "notification-url": "https://packagist.org/downloads/", 355 | "license": [ 356 | "MIT" 357 | ], 358 | "authors": [ 359 | { 360 | "name": "Chris Corbyn" 361 | }, 362 | { 363 | "name": "Fabien Potencier", 364 | "email": "fabien@symfony.com" 365 | } 366 | ], 367 | "description": "Swiftmailer, free feature-rich PHP mailer", 368 | "homepage": "http://swiftmailer.org", 369 | "keywords": [ 370 | "mail", 371 | "mailer" 372 | ], 373 | "time": "2015-01-18 13:49:36" 374 | }, 375 | { 376 | "name": "yiisoft/yii2", 377 | "version": "dev-master", 378 | "source": { 379 | "type": "git", 380 | "url": "https://github.com/yiisoft/yii2-framework.git", 381 | "reference": "f2c3cba2947a1dc3a3997288bd3affda2452ad73" 382 | }, 383 | "dist": { 384 | "type": "zip", 385 | "url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/f2c3cba2947a1dc3a3997288bd3affda2452ad73", 386 | "reference": "f2c3cba2947a1dc3a3997288bd3affda2452ad73", 387 | "shasum": "" 388 | }, 389 | "require": { 390 | "bower-asset/jquery": "2.1.*@stable | 1.11.*@stable", 391 | "bower-asset/jquery.inputmask": "3.1.*", 392 | "bower-asset/punycode": "1.3.*", 393 | "bower-asset/yii2-pjax": ">=2.0.1", 394 | "cebe/markdown": "~1.0.0", 395 | "ext-mbstring": "*", 396 | "ezyang/htmlpurifier": "4.6.*", 397 | "lib-pcre": "*", 398 | "php": ">=5.4.0", 399 | "yiisoft/yii2-composer": "*" 400 | }, 401 | "bin": [ 402 | "yii" 403 | ], 404 | "type": "library", 405 | "extra": { 406 | "branch-alias": { 407 | "dev-master": "2.0.x-dev" 408 | } 409 | }, 410 | "autoload": { 411 | "psr-4": { 412 | "yii\\": "" 413 | } 414 | }, 415 | "notification-url": "https://packagist.org/downloads/", 416 | "license": [ 417 | "BSD-3-Clause" 418 | ], 419 | "authors": [ 420 | { 421 | "name": "Qiang Xue", 422 | "email": "qiang.xue@gmail.com", 423 | "homepage": "http://www.yiiframework.com/", 424 | "role": "Founder and project lead" 425 | }, 426 | { 427 | "name": "Alexander Makarov", 428 | "email": "sam@rmcreative.ru", 429 | "homepage": "http://rmcreative.ru/", 430 | "role": "Core framework development" 431 | }, 432 | { 433 | "name": "Maurizio Domba", 434 | "homepage": "http://mdomba.info/", 435 | "role": "Core framework development" 436 | }, 437 | { 438 | "name": "Carsten Brandt", 439 | "email": "mail@cebe.cc", 440 | "homepage": "http://cebe.cc/", 441 | "role": "Core framework development" 442 | }, 443 | { 444 | "name": "Timur Ruziev", 445 | "email": "resurtm@gmail.com", 446 | "homepage": "http://resurtm.com/", 447 | "role": "Core framework development" 448 | }, 449 | { 450 | "name": "Paul Klimov", 451 | "email": "klimov.paul@gmail.com", 452 | "role": "Core framework development" 453 | } 454 | ], 455 | "description": "Yii PHP Framework Version 2", 456 | "homepage": "http://www.yiiframework.com/", 457 | "keywords": [ 458 | "framework", 459 | "yii2" 460 | ], 461 | "time": "2015-02-26 18:06:51" 462 | }, 463 | { 464 | "name": "yiisoft/yii2-bootstrap", 465 | "version": "dev-master", 466 | "source": { 467 | "type": "git", 468 | "url": "https://github.com/yiisoft/yii2-bootstrap.git", 469 | "reference": "2ce0254cc3860d65ca5d6a2d6c22e575ee812c2a" 470 | }, 471 | "dist": { 472 | "type": "zip", 473 | "url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/2ce0254cc3860d65ca5d6a2d6c22e575ee812c2a", 474 | "reference": "2ce0254cc3860d65ca5d6a2d6c22e575ee812c2a", 475 | "shasum": "" 476 | }, 477 | "require": { 478 | "bower-asset/bootstrap": "3.3.* | 3.2.* | 3.1.*", 479 | "yiisoft/yii2": "~2.0.0" 480 | }, 481 | "type": "yii2-extension", 482 | "extra": { 483 | "branch-alias": { 484 | "dev-master": "2.0.x-dev" 485 | } 486 | }, 487 | "autoload": { 488 | "psr-4": { 489 | "yii\\bootstrap\\": "" 490 | } 491 | }, 492 | "notification-url": "https://packagist.org/downloads/", 493 | "license": [ 494 | "BSD-3-Clause" 495 | ], 496 | "authors": [ 497 | { 498 | "name": "Qiang Xue", 499 | "email": "qiang.xue@gmail.com" 500 | } 501 | ], 502 | "description": "The Twitter Bootstrap extension for the Yii framework", 503 | "keywords": [ 504 | "bootstrap", 505 | "yii2" 506 | ], 507 | "time": "2015-02-26 10:03:31" 508 | }, 509 | { 510 | "name": "yiisoft/yii2-composer", 511 | "version": "dev-master", 512 | "source": { 513 | "type": "git", 514 | "url": "https://github.com/yiisoft/yii2-composer.git", 515 | "reference": "12e9db0629b51aebc3f0e63f234499a558249de3" 516 | }, 517 | "dist": { 518 | "type": "zip", 519 | "url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/12e9db0629b51aebc3f0e63f234499a558249de3", 520 | "reference": "12e9db0629b51aebc3f0e63f234499a558249de3", 521 | "shasum": "" 522 | }, 523 | "require": { 524 | "composer-plugin-api": "1.0.0" 525 | }, 526 | "type": "composer-plugin", 527 | "extra": { 528 | "class": "yii\\composer\\Plugin", 529 | "branch-alias": { 530 | "dev-master": "2.0.x-dev" 531 | } 532 | }, 533 | "autoload": { 534 | "psr-4": { 535 | "yii\\composer\\": "" 536 | } 537 | }, 538 | "notification-url": "https://packagist.org/downloads/", 539 | "license": [ 540 | "BSD-3-Clause" 541 | ], 542 | "authors": [ 543 | { 544 | "name": "Qiang Xue", 545 | "email": "qiang.xue@gmail.com" 546 | } 547 | ], 548 | "description": "The composer plugin for Yii extension installer", 549 | "keywords": [ 550 | "composer", 551 | "extension installer", 552 | "yii2" 553 | ], 554 | "time": "2015-02-24 11:03:41" 555 | }, 556 | { 557 | "name": "yiisoft/yii2-swiftmailer", 558 | "version": "dev-master", 559 | "source": { 560 | "type": "git", 561 | "url": "https://github.com/yiisoft/yii2-swiftmailer.git", 562 | "reference": "c3becc8341a9a6eaf0aab22cdcd85bb853272774" 563 | }, 564 | "dist": { 565 | "type": "zip", 566 | "url": "https://api.github.com/repos/yiisoft/yii2-swiftmailer/zipball/c3becc8341a9a6eaf0aab22cdcd85bb853272774", 567 | "reference": "c3becc8341a9a6eaf0aab22cdcd85bb853272774", 568 | "shasum": "" 569 | }, 570 | "require": { 571 | "swiftmailer/swiftmailer": "*", 572 | "yiisoft/yii2": "~2.0.0" 573 | }, 574 | "type": "yii2-extension", 575 | "extra": { 576 | "branch-alias": { 577 | "dev-master": "2.0.x-dev" 578 | } 579 | }, 580 | "autoload": { 581 | "psr-4": { 582 | "yii\\swiftmailer\\": "" 583 | } 584 | }, 585 | "notification-url": "https://packagist.org/downloads/", 586 | "license": [ 587 | "BSD-3-Clause" 588 | ], 589 | "authors": [ 590 | { 591 | "name": "Paul Klimov", 592 | "email": "klimov.paul@gmail.com" 593 | } 594 | ], 595 | "description": "The SwiftMailer integration for the Yii framework", 596 | "keywords": [ 597 | "email", 598 | "mail", 599 | "mailer", 600 | "swift", 601 | "swiftmailer", 602 | "yii2" 603 | ], 604 | "time": "2015-02-26 10:03:31" 605 | } 606 | ], 607 | "packages-dev": [ 608 | { 609 | "name": "bower-asset/typeahead.js", 610 | "version": "v0.10.5", 611 | "source": { 612 | "type": "git", 613 | "url": "https://github.com/twitter/typeahead.js.git", 614 | "reference": "5f198b87d1af845da502ea9df93a5e84801ce742" 615 | }, 616 | "dist": { 617 | "type": "zip", 618 | "url": "https://api.github.com/repos/twitter/typeahead.js/zipball/5f198b87d1af845da502ea9df93a5e84801ce742", 619 | "reference": "5f198b87d1af845da502ea9df93a5e84801ce742", 620 | "shasum": "" 621 | }, 622 | "require": { 623 | "bower-asset/jquery": ">=1.7" 624 | }, 625 | "require-dev": { 626 | "bower-asset/jasmine-ajax": "~1.3.1", 627 | "bower-asset/jasmine-jquery": "~1.5.2", 628 | "bower-asset/jquery": "~1.7" 629 | }, 630 | "type": "bower-asset-library", 631 | "extra": { 632 | "bower-asset-main": "dist/typeahead.bundle.js" 633 | } 634 | }, 635 | { 636 | "name": "fzaninotto/faker", 637 | "version": "dev-master", 638 | "source": { 639 | "type": "git", 640 | "url": "https://github.com/fzaninotto/Faker.git", 641 | "reference": "2495d3361ac1e9fc15608a1b33ec2dd41c56b2dc" 642 | }, 643 | "dist": { 644 | "type": "zip", 645 | "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/2495d3361ac1e9fc15608a1b33ec2dd41c56b2dc", 646 | "reference": "2495d3361ac1e9fc15608a1b33ec2dd41c56b2dc", 647 | "shasum": "" 648 | }, 649 | "require": { 650 | "php": ">=5.3.3" 651 | }, 652 | "require-dev": { 653 | "phpunit/phpunit": "~4.0", 654 | "squizlabs/php_codesniffer": "~1.5" 655 | }, 656 | "suggest": { 657 | "ext-intl": "*" 658 | }, 659 | "type": "library", 660 | "extra": { 661 | "branch-alias": { 662 | "dev-master": "1.5.x-dev" 663 | } 664 | }, 665 | "autoload": { 666 | "psr-4": { 667 | "Faker\\": "src/Faker/" 668 | } 669 | }, 670 | "notification-url": "https://packagist.org/downloads/", 671 | "license": [ 672 | "MIT" 673 | ], 674 | "authors": [ 675 | { 676 | "name": "François Zaninotto" 677 | } 678 | ], 679 | "description": "Faker is a PHP library that generates fake data for you.", 680 | "keywords": [ 681 | "data", 682 | "faker", 683 | "fixtures" 684 | ], 685 | "time": "2015-02-23 10:49:44" 686 | }, 687 | { 688 | "name": "phpspec/php-diff", 689 | "version": "dev-master", 690 | "source": { 691 | "type": "git", 692 | "url": "https://github.com/phpspec/php-diff.git", 693 | "reference": "30e103d19519fe678ae64a60d77884ef3d71b28a" 694 | }, 695 | "dist": { 696 | "type": "zip", 697 | "url": "https://api.github.com/repos/phpspec/php-diff/zipball/30e103d19519fe678ae64a60d77884ef3d71b28a", 698 | "reference": "30e103d19519fe678ae64a60d77884ef3d71b28a", 699 | "shasum": "" 700 | }, 701 | "type": "library", 702 | "autoload": { 703 | "psr-0": { 704 | "Diff": "lib/" 705 | } 706 | }, 707 | "notification-url": "https://packagist.org/downloads/", 708 | "license": [ 709 | "BSD-3-Clause" 710 | ], 711 | "authors": [ 712 | { 713 | "name": "Chris Boulton", 714 | "homepage": "http://github.com/chrisboulton", 715 | "role": "Original developer" 716 | } 717 | ], 718 | "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).", 719 | "time": "2013-11-01 13:02:21" 720 | }, 721 | { 722 | "name": "yiisoft/yii2-codeception", 723 | "version": "dev-master", 724 | "source": { 725 | "type": "git", 726 | "url": "https://github.com/yiisoft/yii2-codeception.git", 727 | "reference": "12a2cb182a8601ceb5e6440c8ad7d6e291834f61" 728 | }, 729 | "dist": { 730 | "type": "zip", 731 | "url": "https://api.github.com/repos/yiisoft/yii2-codeception/zipball/12a2cb182a8601ceb5e6440c8ad7d6e291834f61", 732 | "reference": "12a2cb182a8601ceb5e6440c8ad7d6e291834f61", 733 | "shasum": "" 734 | }, 735 | "require": { 736 | "yiisoft/yii2": "~2.0.0" 737 | }, 738 | "type": "yii2-extension", 739 | "extra": { 740 | "branch-alias": { 741 | "dev-master": "2.0.x-dev" 742 | } 743 | }, 744 | "autoload": { 745 | "psr-4": { 746 | "yii\\codeception\\": "" 747 | } 748 | }, 749 | "notification-url": "https://packagist.org/downloads/", 750 | "license": [ 751 | "BSD-3-Clause" 752 | ], 753 | "authors": [ 754 | { 755 | "name": "Mark Jebri", 756 | "email": "mark.github@yandex.ru" 757 | } 758 | ], 759 | "description": "The Codeception integration for the Yii framework", 760 | "keywords": [ 761 | "codeception", 762 | "yii2" 763 | ], 764 | "time": "2015-02-26 10:03:31" 765 | }, 766 | { 767 | "name": "yiisoft/yii2-debug", 768 | "version": "dev-master", 769 | "source": { 770 | "type": "git", 771 | "url": "https://github.com/yiisoft/yii2-debug.git", 772 | "reference": "8aa266ab08b51ef61b4786ec735a4e1697c15eed" 773 | }, 774 | "dist": { 775 | "type": "zip", 776 | "url": "https://api.github.com/repos/yiisoft/yii2-debug/zipball/8aa266ab08b51ef61b4786ec735a4e1697c15eed", 777 | "reference": "8aa266ab08b51ef61b4786ec735a4e1697c15eed", 778 | "shasum": "" 779 | }, 780 | "require": { 781 | "yiisoft/yii2": "~2.0.0", 782 | "yiisoft/yii2-bootstrap": "~2.0.0" 783 | }, 784 | "type": "yii2-extension", 785 | "extra": { 786 | "branch-alias": { 787 | "dev-master": "2.0.x-dev" 788 | } 789 | }, 790 | "autoload": { 791 | "psr-4": { 792 | "yii\\debug\\": "" 793 | } 794 | }, 795 | "notification-url": "https://packagist.org/downloads/", 796 | "license": [ 797 | "BSD-3-Clause" 798 | ], 799 | "authors": [ 800 | { 801 | "name": "Qiang Xue", 802 | "email": "qiang.xue@gmail.com" 803 | } 804 | ], 805 | "description": "The debugger extension for the Yii framework", 806 | "keywords": [ 807 | "debug", 808 | "debugger", 809 | "yii2" 810 | ], 811 | "time": "2015-02-26 10:03:31" 812 | }, 813 | { 814 | "name": "yiisoft/yii2-faker", 815 | "version": "dev-master", 816 | "source": { 817 | "type": "git", 818 | "url": "https://github.com/yiisoft/yii2-faker.git", 819 | "reference": "af4f1f4d2ba5357339ce3bc2b985512816c3e3db" 820 | }, 821 | "dist": { 822 | "type": "zip", 823 | "url": "https://api.github.com/repos/yiisoft/yii2-faker/zipball/af4f1f4d2ba5357339ce3bc2b985512816c3e3db", 824 | "reference": "af4f1f4d2ba5357339ce3bc2b985512816c3e3db", 825 | "shasum": "" 826 | }, 827 | "require": { 828 | "fzaninotto/faker": "*", 829 | "yiisoft/yii2": "~2.0.0" 830 | }, 831 | "type": "yii2-extension", 832 | "extra": { 833 | "branch-alias": { 834 | "dev-master": "2.0.x-dev" 835 | } 836 | }, 837 | "autoload": { 838 | "psr-4": { 839 | "yii\\faker\\": "" 840 | } 841 | }, 842 | "notification-url": "https://packagist.org/downloads/", 843 | "license": [ 844 | "BSD-3-Clause" 845 | ], 846 | "authors": [ 847 | { 848 | "name": "Mark Jebri", 849 | "email": "mark.github@yandex.ru" 850 | } 851 | ], 852 | "description": "Fixture generator. The Faker integration for the Yii framework.", 853 | "keywords": [ 854 | "Fixture", 855 | "faker", 856 | "yii2" 857 | ], 858 | "time": "2015-02-26 10:03:31" 859 | }, 860 | { 861 | "name": "yiisoft/yii2-gii", 862 | "version": "dev-master", 863 | "source": { 864 | "type": "git", 865 | "url": "https://github.com/yiisoft/yii2-gii.git", 866 | "reference": "ed68a18a1e8353c07ff07eb43b1242996898fc94" 867 | }, 868 | "dist": { 869 | "type": "zip", 870 | "url": "https://api.github.com/repos/yiisoft/yii2-gii/zipball/ed68a18a1e8353c07ff07eb43b1242996898fc94", 871 | "reference": "ed68a18a1e8353c07ff07eb43b1242996898fc94", 872 | "shasum": "" 873 | }, 874 | "require": { 875 | "bower-asset/typeahead.js": "0.10.*", 876 | "phpspec/php-diff": ">=1.0.2", 877 | "yiisoft/yii2": "~2.0.0", 878 | "yiisoft/yii2-bootstrap": "~2.0.0" 879 | }, 880 | "type": "yii2-extension", 881 | "extra": { 882 | "branch-alias": { 883 | "dev-master": "2.0.x-dev" 884 | } 885 | }, 886 | "autoload": { 887 | "psr-4": { 888 | "yii\\gii\\": "" 889 | } 890 | }, 891 | "notification-url": "https://packagist.org/downloads/", 892 | "license": [ 893 | "BSD-3-Clause" 894 | ], 895 | "authors": [ 896 | { 897 | "name": "Qiang Xue", 898 | "email": "qiang.xue@gmail.com" 899 | } 900 | ], 901 | "description": "The Gii extension for the Yii framework", 902 | "keywords": [ 903 | "code generator", 904 | "gii", 905 | "yii2" 906 | ], 907 | "time": "2015-02-26 10:03:31" 908 | } 909 | ], 910 | "aliases": [], 911 | "minimum-stability": "dev", 912 | "stability-flags": [], 913 | "prefer-stable": false, 914 | "prefer-lowest": false, 915 | "platform": { 916 | "php": ">=5.4.0" 917 | }, 918 | "platform-dev": [] 919 | } 920 | -------------------------------------------------------------------------------- /config/assets-prod.php: -------------------------------------------------------------------------------- 1 | [ 9 | 'class' => 'yii\\web\\AssetBundle', 10 | 'basePath' => '@webroot/assets', 11 | 'baseUrl' => '@web/assets', 12 | 'js' => [ 13 | 'all-b1fdf5f6bfc41de115b5cf76dd8f28e5.js', 14 | ], 15 | 'css' => [ 16 | 'all-a5f9c3d16c68f80aea88e79e14da6a00.css', 17 | ], 18 | ], 19 | 'yii\\web\\JqueryAsset' => [ 20 | 'sourcePath' => null, 21 | 'js' => [], 22 | 'css' => [], 23 | 'depends' => [ 24 | 'all', 25 | ], 26 | ], 27 | 'yii\\web\\YiiAsset' => [ 28 | 'sourcePath' => null, 29 | 'js' => [], 30 | 'css' => [], 31 | 'depends' => [ 32 | 'yii\\web\\JqueryAsset', 33 | 'all', 34 | ], 35 | ], 36 | 'yii\\bootstrap\\BootstrapAsset' => [ 37 | 'sourcePath' => null, 38 | 'js' => [], 39 | 'css' => [], 40 | 'depends' => [ 41 | 'all', 42 | ], 43 | ], 44 | 'app\\assets\\AppAsset' => [ 45 | 'sourcePath' => null, 46 | 'js' => [], 47 | 'css' => [], 48 | 'depends' => [ 49 | 'yii\\web\\YiiAsset', 50 | 'yii\\bootstrap\\BootstrapAsset', 51 | 'all', 52 | ], 53 | ], 54 | ]; -------------------------------------------------------------------------------- /config/console.php: -------------------------------------------------------------------------------- 1 | 'basic-console', 10 | 'basePath' => dirname(__DIR__), 11 | 'bootstrap' => ['log', 'gii'], 12 | 'controllerNamespace' => 'app\commands', 13 | 'modules' => [ 14 | 'gii' => 'yii\gii\Module', 15 | ], 16 | 'components' => [ 17 | 'cache' => [ 18 | 'class' => 'yii\caching\FileCache', 19 | ], 20 | 'log' => [ 21 | 'targets' => [ 22 | [ 23 | 'class' => 'yii\log\FileTarget', 24 | 'levels' => ['error', 'warning'], 25 | ], 26 | ], 27 | ], 28 | 'db' => $db, 29 | ], 30 | 'params' => $params, 31 | ]; 32 | -------------------------------------------------------------------------------- /config/db.php: -------------------------------------------------------------------------------- 1 | 'yii\db\Connection', 5 | 'dsn' => 'mysql:host=localhost;dbname=yii2basic', 6 | 'username' => 'root', 7 | 'password' => '', 8 | 'charset' => 'utf8', 9 | ]; 10 | -------------------------------------------------------------------------------- /config/params.php: -------------------------------------------------------------------------------- 1 | 'admin@example.com', 5 | ]; 6 | -------------------------------------------------------------------------------- /config/web.php: -------------------------------------------------------------------------------- 1 | 'basic', 7 | 'basePath' => dirname(__DIR__), 8 | 'bootstrap' => ['log'], 9 | 'components' => [ 10 | 'assetManager' => [ 11 | 'bundles' => require(__DIR__ . '/' . 'assets-prod.php' ), 12 | ], 13 | 14 | 'request' => [ 15 | 'cookieValidationKey' => 'test', 16 | ], 17 | 'cache' => [ 18 | 'class' => 'yii\caching\FileCache', 19 | ], 20 | 'user' => [ 21 | 'identityClass' => 'app\models\User', 22 | 'enableAutoLogin' => true, 23 | ], 24 | 'errorHandler' => [ 25 | 'errorAction' => 'site/error', 26 | ], 27 | 'mailer' => [ 28 | 'class' => 'yii\swiftmailer\Mailer', 29 | // send all mails to a file by default. You have to set 30 | // 'useFileTransport' to false and configure a transport 31 | // for the mailer to send real emails. 32 | 'useFileTransport' => true, 33 | ], 34 | 'log' => [ 35 | 'traceLevel' => YII_DEBUG ? 3 : 0, 36 | 'targets' => [ 37 | [ 38 | 'class' => 'yii\log\FileTarget', 39 | 'levels' => ['error', 'warning'], 40 | ], 41 | ], 42 | ], 43 | 'db' => require(__DIR__ . '/db.php'), 44 | ], 45 | 'params' => $params, 46 | ]; 47 | 48 | if (YII_ENV_DEV) { 49 | // configuration adjustments for 'dev' environment 50 | $config['bootstrap'][] = 'debug'; 51 | $config['modules']['debug'] = 'yii\debug\Module'; 52 | 53 | $config['bootstrap'][] = 'gii'; 54 | $config['modules']['gii'] = 'yii\gii\Module'; 55 | } 56 | 57 | return $config; 58 | -------------------------------------------------------------------------------- /controllers/SiteController.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'class' => AccessControl::className(), 19 | 'only' => ['logout'], 20 | 'rules' => [ 21 | [ 22 | 'actions' => ['logout'], 23 | 'allow' => true, 24 | 'roles' => ['@'], 25 | ], 26 | ], 27 | ], 28 | 'verbs' => [ 29 | 'class' => VerbFilter::className(), 30 | 'actions' => [ 31 | 'logout' => ['post'], 32 | ], 33 | ], 34 | ]; 35 | } 36 | 37 | public function actions() 38 | { 39 | return [ 40 | 'error' => [ 41 | 'class' => 'yii\web\ErrorAction', 42 | ], 43 | 'captcha' => [ 44 | 'class' => 'yii\captcha\CaptchaAction', 45 | 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null, 46 | ], 47 | ]; 48 | } 49 | 50 | public function actionIndex() 51 | { 52 | return $this->render('index'); 53 | } 54 | 55 | public function actionLogin() 56 | { 57 | if (!\Yii::$app->user->isGuest) { 58 | return $this->goHome(); 59 | } 60 | 61 | $model = new LoginForm(); 62 | if ($model->load(Yii::$app->request->post()) && $model->login()) { 63 | return $this->goBack(); 64 | } else { 65 | return $this->render('login', [ 66 | 'model' => $model, 67 | ]); 68 | } 69 | } 70 | 71 | public function actionLogout() 72 | { 73 | Yii::$app->user->logout(); 74 | 75 | return $this->goHome(); 76 | } 77 | 78 | public function actionContact() 79 | { 80 | $model = new ContactForm(); 81 | if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) { 82 | Yii::$app->session->setFlash('contactFormSubmitted'); 83 | 84 | return $this->refresh(); 85 | } else { 86 | return $this->render('contact', [ 87 | 'model' => $model, 88 | ]); 89 | } 90 | } 91 | 92 | public function actionAbout() 93 | { 94 | return $this->render('about'); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /mail/layouts/html.php: -------------------------------------------------------------------------------- 1 | 8 | beginPage() ?> 9 | 10 | 11 |
12 | 13 |The path to yii framework seems to be incorrect.
'; 19 | echo 'You need to install Yii framework via composer or adjust the framework path in file ' . basename(__FILE__) . '.
'; 20 | echo 'Please refer to the README on how to install Yii.
'; 21 | } 22 | 23 | require_once($frameworkPath . '/requirements/YiiRequirementChecker.php'); 24 | $requirementsChecker = new YiiRequirementChecker(); 25 | 26 | $gdMemo = $imagickMemo = 'Either GD PHP extension with FreeType support or ImageMagick PHP extension with PNG support is required for image CAPTCHA.'; 27 | $gdOK = $imagickOK = false; 28 | 29 | if (extension_loaded('imagick')) { 30 | $imagick = new Imagick(); 31 | $imagickFormats = $imagick->queryFormats('PNG'); 32 | if (in_array('PNG', $imagickFormats)) { 33 | $imagickOK = true; 34 | } else { 35 | $imagickMemo = 'Imagick extension should be installed with PNG support in order to be used for image CAPTCHA.'; 36 | } 37 | } 38 | 39 | if (extension_loaded('gd')) { 40 | $gdInfo = gd_info(); 41 | if (!empty($gdInfo['FreeType Support'])) { 42 | $gdOK = true; 43 | } else { 44 | $gdMemo = 'GD extension should be installed with FreeType support in order to be used for image CAPTCHA.'; 45 | } 46 | } 47 | 48 | /** 49 | * Adjust requirements according to your application specifics. 50 | */ 51 | $requirements = array( 52 | // Database : 53 | array( 54 | 'name' => 'PDO extension', 55 | 'mandatory' => true, 56 | 'condition' => extension_loaded('pdo'), 57 | 'by' => 'All DB-related classes', 58 | ), 59 | array( 60 | 'name' => 'PDO SQLite extension', 61 | 'mandatory' => false, 62 | 'condition' => extension_loaded('pdo_sqlite'), 63 | 'by' => 'All DB-related classes', 64 | 'memo' => 'Required for SQLite database.', 65 | ), 66 | array( 67 | 'name' => 'PDO MySQL extension', 68 | 'mandatory' => false, 69 | 'condition' => extension_loaded('pdo_mysql'), 70 | 'by' => 'All DB-related classes', 71 | 'memo' => 'Required for MySQL database.', 72 | ), 73 | array( 74 | 'name' => 'PDO PostgreSQL extension', 75 | 'mandatory' => false, 76 | 'condition' => extension_loaded('pdo_pgsql'), 77 | 'by' => 'All DB-related classes', 78 | 'memo' => 'Required for PostgreSQL database.', 79 | ), 80 | // Cache : 81 | array( 82 | 'name' => 'Memcache extension', 83 | 'mandatory' => false, 84 | 'condition' => extension_loaded('memcache') || extension_loaded('memcached'), 85 | 'by' => 'MemCache', 86 | 'memo' => extension_loaded('memcached') ? 'To use memcached set MemCache::useMemcached totrue
.' : ''
87 | ),
88 | array(
89 | 'name' => 'APC extension',
90 | 'mandatory' => false,
91 | 'condition' => extension_loaded('apc'),
92 | 'by' => 'ApcCache',
93 | ),
94 | // CAPTCHA:
95 | array(
96 | 'name' => 'GD PHP extension with FreeType support',
97 | 'mandatory' => false,
98 | 'condition' => $gdOK,
99 | 'by' => 'Captcha',
100 | 'memo' => $gdMemo,
101 | ),
102 | array(
103 | 'name' => 'ImageMagick PHP extension with PNG support',
104 | 'mandatory' => false,
105 | 'condition' => $imagickOK,
106 | 'by' => 'Captcha',
107 | 'memo' => $imagickMemo,
108 | ),
109 | // PHP ini :
110 | 'phpExposePhp' => array(
111 | 'name' => 'Expose PHP',
112 | 'mandatory' => false,
113 | 'condition' => $requirementsChecker->checkPhpIniOff("expose_php"),
114 | 'by' => 'Security reasons',
115 | 'memo' => '"expose_php" should be disabled at php.ini',
116 | ),
117 | 'phpAllowUrlInclude' => array(
118 | 'name' => 'PHP allow url include',
119 | 'mandatory' => false,
120 | 'condition' => $requirementsChecker->checkPhpIniOff("allow_url_include"),
121 | 'by' => 'Security reasons',
122 | 'memo' => '"allow_url_include" should be disabled at php.ini',
123 | ),
124 | 'phpSmtp' => array(
125 | 'name' => 'PHP mail SMTP',
126 | 'mandatory' => false,
127 | 'condition' => strlen(ini_get('SMTP'))>0,
128 | 'by' => 'Email sending',
129 | 'memo' => 'PHP mail SMTP server required',
130 | ),
131 | );
132 | $requirementsChecker->checkYii()->check($requirements)->render();
133 |
--------------------------------------------------------------------------------
/runtime/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------
/tests/README.md:
--------------------------------------------------------------------------------
1 | This directory contains various tests for the basic application.
2 |
3 | Tests in `codeception` directory are developed with [Codeception PHP Testing Framework](http://codeception.com/).
4 |
5 | After creating the basic application, follow these steps to prepare for the tests:
6 |
7 | 1. Install Codeception if it's not yet installed:
8 |
9 | ```
10 | composer global require "codeception/codeception=2.0.*"
11 | composer global require "codeception/specify=*"
12 | composer global require "codeception/verify=*"
13 | ```
14 |
15 | If you've never used Composer for global packages run `composer global status`. It should output:
16 |
17 | ```
18 | Changed current directory to 12 | This is the About page. You may modify the following file to customize its content: 13 |
14 | 15 |= __FILE__ ?>
16 |
23 | Note that if you turn on the Yii debugger, you should be able
24 | to view the mail message on the mail panel of the debugger.
25 | mailer->useFileTransport): ?>
26 | Because the application is in development mode, the email is not sent but saved as
27 | a file under = Yii::getAlias(Yii::$app->mailer->fileTransportPath) ?>
.
28 | Please configure the useFileTransport
property of the mail
29 | application component to be false to enable email sending.
30 |
31 |
36 | If you have business inquiries or other questions, please fill out the following form to contact us. Thank you. 37 |
38 | 39 |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 |You have successfully created your Yii-powered application.
11 | 12 | 13 |Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et 22 | dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip 23 | ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu 24 | fugiat nulla pariatur.
25 | 26 | 27 |Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et 32 | dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip 33 | ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu 34 | fugiat nulla pariatur.
35 | 36 | 37 |Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et 42 | dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip 43 | ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu 44 | fugiat nulla pariatur.
45 | 46 | 47 |Please fill out the following fields to login:
16 | 17 | 'login-form', 19 | 'options' => ['class' => 'form-horizontal'], 20 | 'fieldConfig' => [ 21 | 'template' => "{label}\napp\models\User::$users
.
45 |