diff --git a/.gitignore b/.gitignore index 45bf7bf41..6557c86a6 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,10 @@ composer.phar phpunit.phar # local phpunit config /phpunit.xml + +#Vagrant local files +/.vagrant + +#config files +/config/db.php +/config/env.php diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 000000000..c44639d8d --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,35 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure(2) do |config| + config.vm.box = "aauthor/trusty64" + + config.vm.network "forwarded_port", guest: 80, host: 8080, auto_correct: true + config.vm.network "forwarded_port", guest: 3306, host: 3307, auto_correct: true + + config.vm.provider "virtualbox" do |vb| + vb.name="yii2-basic" + end + + config.vm.hostname = "yii2-basic" + + config.vm.provision "shell", path: "vagrant/install.sh" + + # Uncomment the following line to include MySQL into Vagrant configuration + #config.vm.provision "shell", path: "vagrant/install-mysql.sh" + + # Uncomment the following line to include PostgreSQL into Vagrant configuration + #config.vm.provision "shell", path: "vagrant/install-postgre.sh" + + config.vm.provision "shell", path: "vagrant/config.sh" + + # Uncomment the following line to include MySQL into Vagrant configuration + #config.vm.provision "shell", path: "vagrant/config-mysql.sh" + + # Uncomment the following line to include PostgreSQL into Vagrant configuration + #config.vm.provision "shell", path: "vagrant/config-postgre.sh" + + config.vm.provision "shell", path: "vagrant/config-project.sh" + + config.vm.provision "shell", path: "vagrant/startup.sh", run: "always" +end diff --git a/assets/AppAsset.php b/assets/AppAsset.php index 0e495a8f8..6b46c9026 100644 --- a/assets/AppAsset.php +++ b/assets/AppAsset.php @@ -1,29 +1,21 @@ - * @since 2.0 - */ class AppAsset extends AssetBundle { - public $basePath = '@webroot'; - public $baseUrl = '@web'; - public $css = [ - 'css/site.css', - ]; - public $js = [ - ]; - public $depends = [ - 'yii\web\YiiAsset', - 'yii\bootstrap\BootstrapAsset', - ]; + public $sourcePath = '@app/files'; + + public $css = [ + 'less/application.less', + ]; + + public $js = [ + ]; + + public $depends = [ + 'yii\web\JqueryAsset', + 'app\assets\BootstrapAsset' + ]; } diff --git a/assets/BootstrapAsset.php b/assets/BootstrapAsset.php new file mode 100644 index 000000000..7fd7b3be9 --- /dev/null +++ b/assets/BootstrapAsset.php @@ -0,0 +1,18 @@ + + * @since 2.0 + */ +class BootstrapAsset extends AssetBundle +{ + public $sourcePath = '@bower/bootstrap/dist'; + public $js = [ + "js/bootstrap.min.js", + ]; +} diff --git a/commands/HelloController.php b/commands/HelloController.php deleted file mode 100644 index 86ab8b853..000000000 --- a/commands/HelloController.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @since 2.0 - */ -class HelloController extends Controller -{ - /** - * This command echoes what you have entered as the message. - * @param string $message the message to be echoed. - */ - public function actionIndex($message = 'hello world') - { - echo $message . "\n"; - } -} diff --git a/composer.json b/composer.json index 4ad378784..1bdcb8416 100644 --- a/composer.json +++ b/composer.json @@ -12,18 +12,33 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "dev", + "minimum-stability": "stable", + + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/CanDo-com/yii2-db.git" + }, + { + "type": "vcs", + "url": "git@github.com:yiisoft/yii2-httpclient.git" + } + ], + "require": { - "php": ">=5.4.0", + "php": ">=5.5.0", + "bower-asset/bootstrap": "3.3.* | 3.2.* | 3.1.*", "yiisoft/yii2": ">=2.0.5", - "yiisoft/yii2-bootstrap": "*", - "yiisoft/yii2-swiftmailer": "*" + "yiisoft/yii2-httpclient": "dev-master", + "yiisoft/yii2-swiftmailer": "*" }, "require-dev": { "yiisoft/yii2-codeception": "*", "yiisoft/yii2-debug": "*", "yiisoft/yii2-gii": "*", - "yiisoft/yii2-faker": "*" + "yiisoft/yii2-faker": "*", + "packagist/closurecompiler-bin": "*", + "cando/yii2-db": "dev-master" }, "config": { "process-timeout": 1800 diff --git a/composer.lock b/composer.lock new file mode 100644 index 000000000..529bc14ee --- /dev/null +++ b/composer.lock @@ -0,0 +1,1068 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "210287e435efdc2f9d9e7d55b449bb81", + "content-hash": "715b04cd64c679964669fa75e9675020", + "packages": [ + { + "name": "bower-asset/bootstrap", + "version": "v3.3.5", + "source": { + "type": "git", + "url": "https://github.com/twbs/bootstrap.git", + "reference": "16b48259a62f576e52c903c476bd42b90ab22482" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twbs/bootstrap/zipball/16b48259a62f576e52c903c476bd42b90ab22482", + "reference": "16b48259a62f576e52c903c476bd42b90ab22482", + "shasum": "" + }, + "require": { + "bower-asset/jquery": ">=1.9.1" + }, + "type": "bower-asset-library", + "extra": { + "bower-asset-main": [ + "less/bootstrap.less", + "dist/js/bootstrap.js" + ], + "bower-asset-ignore": [ + "/.*", + "_config.yml", + "CNAME", + "composer.json", + "CONTRIBUTING.md", + "docs", + "js/tests", + "test-infra" + ] + }, + "license": [ + "MIT" + ], + "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", + "keywords": [ + "css", + "framework", + "front-end", + "js", + "less", + "mobile-first", + "responsive", + "web" + ] + }, + { + "name": "bower-asset/jquery", + "version": "2.1.4", + "source": { + "type": "git", + "url": "https://github.com/jquery/jquery.git", + "reference": "7751e69b615c6eca6f783a81e292a55725af6b85" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jquery/jquery/zipball/7751e69b615c6eca6f783a81e292a55725af6b85", + "reference": "7751e69b615c6eca6f783a81e292a55725af6b85", + "shasum": "" + }, + "require-dev": { + "bower-asset/qunit": "1.14.0", + "bower-asset/requirejs": "2.1.10", + "bower-asset/sinon": "1.8.1", + "bower-asset/sizzle": "2.1.1-patch2" + }, + "type": "bower-asset-library", + "extra": { + "bower-asset-main": "dist/jquery.js", + "bower-asset-ignore": [ + "**/.*", + "build", + "dist/cdn", + "speed", + "test", + "*.md", + "AUTHORS.txt", + "Gruntfile.js", + "package.json" + ] + }, + "license": [ + "MIT" + ], + "keywords": [ + "javascript", + "jquery", + "library" + ] + }, + { + "name": "bower-asset/jquery.inputmask", + "version": "3.1.63", + "source": { + "type": "git", + "url": "https://github.com/RobinHerbots/jquery.inputmask.git", + "reference": "c40c7287eadc31e341ebbf0c02352eb55b9cbc48" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/RobinHerbots/jquery.inputmask/zipball/c40c7287eadc31e341ebbf0c02352eb55b9cbc48", + "reference": "c40c7287eadc31e341ebbf0c02352eb55b9cbc48", + "shasum": "" + }, + "require": { + "bower-asset/jquery": ">=1.7" + }, + "type": "bower-asset-library", + "extra": { + "bower-asset-main": [ + "./dist/inputmask/jquery.inputmask.js", + "./dist/inputmask/jquery.inputmask.extensions.js", + "./dist/inputmask/jquery.inputmask.date.extensions.js", + "./dist/inputmask/jquery.inputmask.numeric.extensions.js", + "./dist/inputmask/jquery.inputmask.phone.extensions.js", + "./dist/inputmask/jquery.inputmask.regex.extensions.js" + ], + "bower-asset-ignore": [ + "**/.*", + "qunit/", + "nuget/", + "tools/", + "js/", + "*.md", + "build.properties", + "build.xml", + "jquery.inputmask.jquery.json" + ] + }, + "license": [ + "http://opensource.org/licenses/mit-license.php" + ], + "description": "jquery.inputmask is a jquery plugin which create an input mask.", + "keywords": [ + "form", + "input", + "inputmask", + "jquery", + "mask", + "plugins" + ] + }, + { + "name": "bower-asset/punycode", + "version": "v1.3.2", + "source": { + "type": "git", + "url": "https://github.com/bestiejs/punycode.js.git", + "reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bestiejs/punycode.js/zipball/38c8d3131a82567bfef18da09f7f4db68c84f8a3", + "reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3", + "shasum": "" + }, + "type": "bower-asset-library", + "extra": { + "bower-asset-main": "punycode.js", + "bower-asset-ignore": [ + "coverage", + "tests", + ".*", + "component.json", + "Gruntfile.js", + "node_modules", + "package.json" + ] + } + }, + { + "name": "bower-asset/yii2-pjax", + "version": "v2.0.4", + "source": { + "type": "git", + "url": "https://github.com/yiisoft/jquery-pjax.git", + "reference": "3f20897307cca046fca5323b318475ae9dac0ca0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yiisoft/jquery-pjax/zipball/3f20897307cca046fca5323b318475ae9dac0ca0", + "reference": "3f20897307cca046fca5323b318475ae9dac0ca0", + "shasum": "" + }, + "require": { + "bower-asset/jquery": ">=1.8" + }, + "type": "bower-asset-library", + "extra": { + "bower-asset-main": "./jquery.pjax.js", + "bower-asset-ignore": [ + ".travis.yml", + "Gemfile", + "Gemfile.lock", + "vendor/", + "script/", + "test/" + ] + }, + "license": [ + "MIT" + ] + }, + { + "name": "cebe/markdown", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/cebe/markdown.git", + "reference": "54a2c49de31cc44e864ebf0500a35ef21d0010b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cebe/markdown/zipball/54a2c49de31cc44e864ebf0500a35ef21d0010b2", + "reference": "54a2c49de31cc44e864ebf0500a35ef21d0010b2", + "shasum": "" + }, + "require": { + "lib-pcre": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "cebe/indent": "*", + "facebook/xhprof": "*@dev", + "phpunit/phpunit": "4.1.*" + }, + "bin": [ + "bin/markdown" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "cebe\\markdown\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Carsten Brandt", + "email": "mail@cebe.cc", + "homepage": "http://cebe.cc/", + "role": "Creator" + } + ], + "description": "A super fast, highly extensible markdown parser for PHP", + "homepage": "https://github.com/cebe/markdown#readme", + "keywords": [ + "extensible", + "fast", + "gfm", + "markdown", + "markdown-extra" + ], + "time": "2015-03-06 05:28:07" + }, + { + "name": "ezyang/htmlpurifier", + "version": "v4.6.0", + "source": { + "type": "git", + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "6f389f0f25b90d0b495308efcfa073981177f0fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/6f389f0f25b90d0b495308efcfa073981177f0fd", + "reference": "6f389f0f25b90d0b495308efcfa073981177f0fd", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "HTMLPurifier": "library/" + }, + "files": [ + "library/HTMLPurifier.composer.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL" + ], + "authors": [ + { + "name": "Edward Z. Yang", + "email": "admin@htmlpurifier.org", + "homepage": "http://ezyang.com/" + } + ], + "description": "Standards compliant HTML filter written in PHP", + "homepage": "http://htmlpurifier.org/", + "keywords": [ + "html" + ], + "time": "2013-11-30 08:25:19" + }, + { + "name": "swiftmailer/swiftmailer", + "version": "v5.4.1", + "source": { + "type": "git", + "url": "https://github.com/swiftmailer/swiftmailer.git", + "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/0697e6aa65c83edf97bb0f23d8763f94e3f11421", + "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "mockery/mockery": "~0.9.1,<0.9.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.4-dev" + } + }, + "autoload": { + "files": [ + "lib/swift_required.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Corbyn" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Swiftmailer, free feature-rich PHP mailer", + "homepage": "http://swiftmailer.org/", + "keywords": [ + "email", + "mail", + "mailer" + ], + "time": "2015-06-06 14:19:39" + }, + { + "name": "yiisoft/yii2", + "version": "2.0.6", + "source": { + "type": "git", + "url": "https://github.com/yiisoft/yii2-framework.git", + "reference": "f42b2eb80f61992438661b01d0d74c6738e2ff38" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/f42b2eb80f61992438661b01d0d74c6738e2ff38", + "reference": "f42b2eb80f61992438661b01d0d74c6738e2ff38", + "shasum": "" + }, + "require": { + "bower-asset/jquery": "2.1.*@stable | 1.11.*@stable", + "bower-asset/jquery.inputmask": "3.1.*", + "bower-asset/punycode": "1.3.*", + "bower-asset/yii2-pjax": ">=2.0.1", + "cebe/markdown": "~1.0.0 | ~1.1.0", + "ext-mbstring": "*", + "ezyang/htmlpurifier": "4.6.*", + "lib-pcre": "*", + "php": ">=5.4.0", + "yiisoft/yii2-composer": "*" + }, + "bin": [ + "yii" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "yii\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Qiang Xue", + "email": "qiang.xue@gmail.com", + "homepage": "http://www.yiiframework.com/", + "role": "Founder and project lead" + }, + { + "name": "Alexander Makarov", + "email": "sam@rmcreative.ru", + "homepage": "http://rmcreative.ru/", + "role": "Core framework development" + }, + { + "name": "Maurizio Domba", + "homepage": "http://mdomba.info/", + "role": "Core framework development" + }, + { + "name": "Carsten Brandt", + "email": "mail@cebe.cc", + "homepage": "http://cebe.cc/", + "role": "Core framework development" + }, + { + "name": "Timur Ruziev", + "email": "resurtm@gmail.com", + "homepage": "http://resurtm.com/", + "role": "Core framework development" + }, + { + "name": "Paul Klimov", + "email": "klimov.paul@gmail.com", + "role": "Core framework development" + } + ], + "description": "Yii PHP Framework Version 2", + "homepage": "http://www.yiiframework.com/", + "keywords": [ + "framework", + "yii2" + ], + "time": "2015-08-05 22:00:30" + }, + { + "name": "yiisoft/yii2-composer", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/yiisoft/yii2-composer.git", + "reference": "ca8d23707ae47d20b0454e4b135c156f6da6d7be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/ca8d23707ae47d20b0454e4b135c156f6da6d7be", + "reference": "ca8d23707ae47d20b0454e4b135c156f6da6d7be", + "shasum": "" + }, + "require": { + "composer-plugin-api": "1.0.0" + }, + "type": "composer-plugin", + "extra": { + "class": "yii\\composer\\Plugin", + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "yii\\composer\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Qiang Xue", + "email": "qiang.xue@gmail.com" + } + ], + "description": "The composer plugin for Yii extension installer", + "keywords": [ + "composer", + "extension installer", + "yii2" + ], + "time": "2015-03-01 06:22:44" + }, + { + "name": "yiisoft/yii2-httpclient", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/yiisoft/yii2-httpclient.git", + "reference": "46d10b533ee05d7ed76e757d7ecfdcbac2b7d346" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yiisoft/yii2-httpclient/zipball/46d10b533ee05d7ed76e757d7ecfdcbac2b7d346", + "reference": "46d10b533ee05d7ed76e757d7ecfdcbac2b7d346", + "shasum": "" + }, + "require": { + "yiisoft/yii2": "*" + }, + "type": "yii2-extension", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "yii\\httpclient\\": "" + } + }, + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Paul Klimov", + "email": "klimov.paul@gmail.com" + } + ], + "description": "HTTP client extension for the Yii framework", + "keywords": [ + "curl", + "http", + "httpclient", + "yii2" + ], + "support": { + "issues": "https://github.com/yiisoft/yii2-httpclient/issues", + "forum": "http://www.yiiframework.com/forum/", + "wiki": "http://www.yiiframework.com/wiki/", + "irc": "irc://irc.freenode.net/yii", + "source": "https://github.com/yiisoft/yii2-httpclient" + }, + "time": "2015-09-09 10:42:06" + }, + { + "name": "yiisoft/yii2-swiftmailer", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/yiisoft/yii2-swiftmailer.git", + "reference": "4ec435a89e30b203cea99770910fb5499cb3627a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yiisoft/yii2-swiftmailer/zipball/4ec435a89e30b203cea99770910fb5499cb3627a", + "reference": "4ec435a89e30b203cea99770910fb5499cb3627a", + "shasum": "" + }, + "require": { + "swiftmailer/swiftmailer": "~5.0", + "yiisoft/yii2": ">=2.0.4" + }, + "type": "yii2-extension", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "yii\\swiftmailer\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Paul Klimov", + "email": "klimov.paul@gmail.com" + } + ], + "description": "The SwiftMailer integration for the Yii framework", + "keywords": [ + "email", + "mail", + "mailer", + "swift", + "swiftmailer", + "yii2" + ], + "time": "2015-05-10 22:12:32" + } + ], + "packages-dev": [ + { + "name": "bower-asset/typeahead.js", + "version": "v0.10.5", + "source": { + "type": "git", + "url": "https://github.com/twitter/typeahead.js.git", + "reference": "5f198b87d1af845da502ea9df93a5e84801ce742" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twitter/typeahead.js/zipball/5f198b87d1af845da502ea9df93a5e84801ce742", + "reference": "5f198b87d1af845da502ea9df93a5e84801ce742", + "shasum": "" + }, + "require": { + "bower-asset/jquery": ">=1.7" + }, + "require-dev": { + "bower-asset/jasmine-ajax": "~1.3.1", + "bower-asset/jasmine-jquery": "~1.5.2", + "bower-asset/jquery": "~1.7" + }, + "type": "bower-asset-library", + "extra": { + "bower-asset-main": "dist/typeahead.bundle.js" + } + }, + { + "name": "cando/yii2-db", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/CanDo-com/yii2-db.git", + "reference": "b939f26254d853068219e394e2cc71d89aadd033" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CanDo-com/yii2-db/zipball/b939f26254d853068219e394e2cc71d89aadd033", + "reference": "b939f26254d853068219e394e2cc71d89aadd033", + "shasum": "" + }, + "require-dev": { + "yiisoft/yii2": ">=2.0.6", + "yiisoft/yii2-gii": "*" + }, + "type": "library", + "autoload": { + "psr-4": { + "cando\\database\\": "" + } + }, + "authors": [ + { + "name": "Sergiy Misyura", + "email": "sergiy@cando.com" + } + ], + "description": "Database-related helpers for Yii2 framework", + "keywords": [ + "database", + "yii2" + ], + "support": { + "source": "https://github.com/CanDo-com/yii2-db/tree/master", + "issues": "https://github.com/CanDo-com/yii2-db/issues" + }, + "time": "2015-10-06 19:51:40" + }, + { + "name": "fzaninotto/faker", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/fzaninotto/Faker.git", + "reference": "d0190b156bcca848d401fb80f31f504f37141c8d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/d0190b156bcca848d401fb80f31f504f37141c8d", + "reference": "d0190b156bcca848d401fb80f31f504f37141c8d", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~1.5" + }, + "suggest": { + "ext-intl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5.x-dev" + } + }, + "autoload": { + "psr-4": { + "Faker\\": "src/Faker/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "François Zaninotto" + } + ], + "description": "Faker is a PHP library that generates fake data for you.", + "keywords": [ + "data", + "faker", + "fixtures" + ], + "time": "2015-05-29 06:29:14" + }, + { + "name": "packagist/closurecompiler-bin", + "version": "v2015.05.05", + "source": { + "type": "git", + "url": "https://github.com/packagist/closurecompiler-bin.git", + "reference": "d52231c49813347010fa605d0f102ada68bb8b4b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/packagist/closurecompiler-bin/zipball/d52231c49813347010fa605d0f102ada68bb8b4b", + "reference": "d52231c49813347010fa605d0f102ada68bb8b4b", + "shasum": "" + }, + "bin": [ + "bin/compiler.jar" + ], + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Google Inc.", + "homepage": "https://developers.google.com/closure/compiler/" + }, + { + "name": "Package Maintainer", + "email": "kaiwa@20minutemail.com", + "role": "maintainer" + } + ], + "description": "The Closure Compiler is a tool for making JavaScript download and run faster. It is a true compiler for JavaScript. Instead of compiling from a source language to machine code, it compiles from JavaScript to better JavaScript. It parses your JavaScript, analyzes it, removes dead code and rewrites and minimizes what's left. It also checks syntax, variable references, and types, and warns about common JavaScript pitfalls. Packaged for composer.", + "keywords": [ + "binary", + "closure", + "compiler", + "compress", + "google", + "javascript", + "minification", + "minify" + ], + "time": "2015-05-20 13:38:08" + }, + { + "name": "phpspec/php-diff", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/phpspec/php-diff.git", + "reference": "30e103d19519fe678ae64a60d77884ef3d71b28a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/php-diff/zipball/30e103d19519fe678ae64a60d77884ef3d71b28a", + "reference": "30e103d19519fe678ae64a60d77884ef3d71b28a", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "Diff": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Chris Boulton", + "homepage": "http://github.com/chrisboulton", + "role": "Original developer" + } + ], + "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).", + "time": "2013-11-01 13:02:21" + }, + { + "name": "yiisoft/yii2-bootstrap", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/yiisoft/yii2-bootstrap.git", + "reference": "1464f93834b1d5edb1f5625f7ffd6c3723fa4923" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/1464f93834b1d5edb1f5625f7ffd6c3723fa4923", + "reference": "1464f93834b1d5edb1f5625f7ffd6c3723fa4923", + "shasum": "" + }, + "require": { + "bower-asset/bootstrap": "3.3.* | 3.2.* | 3.1.*", + "yiisoft/yii2": ">=2.0.6" + }, + "type": "yii2-extension", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + }, + "asset-installer-paths": { + "npm-asset-library": "vendor/npm", + "bower-asset-library": "vendor/bower" + } + }, + "autoload": { + "psr-4": { + "yii\\bootstrap\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Qiang Xue", + "email": "qiang.xue@gmail.com" + } + ], + "description": "The Twitter Bootstrap extension for the Yii framework", + "keywords": [ + "bootstrap", + "yii2" + ], + "time": "2015-09-23 17:48:24" + }, + { + "name": "yiisoft/yii2-codeception", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/yiisoft/yii2-codeception.git", + "reference": "de5007e7a99359597abbfe1c88dca3ce620061c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yiisoft/yii2-codeception/zipball/de5007e7a99359597abbfe1c88dca3ce620061c5", + "reference": "de5007e7a99359597abbfe1c88dca3ce620061c5", + "shasum": "" + }, + "require": { + "yiisoft/yii2": ">=2.0.4" + }, + "type": "yii2-extension", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "yii\\codeception\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Mark Jebri", + "email": "mark.github@yandex.ru" + } + ], + "description": "The Codeception integration for the Yii framework", + "keywords": [ + "codeception", + "yii2" + ], + "time": "2015-05-10 22:08:30" + }, + { + "name": "yiisoft/yii2-debug", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/yiisoft/yii2-debug.git", + "reference": "1b302e67521d46feb2413d9d96ca94ed82b39b0e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yiisoft/yii2-debug/zipball/1b302e67521d46feb2413d9d96ca94ed82b39b0e", + "reference": "1b302e67521d46feb2413d9d96ca94ed82b39b0e", + "shasum": "" + }, + "require": { + "yiisoft/yii2": ">=2.0.4", + "yiisoft/yii2-bootstrap": "*" + }, + "type": "yii2-extension", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "yii\\debug\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Qiang Xue", + "email": "qiang.xue@gmail.com" + } + ], + "description": "The debugger extension for the Yii framework", + "keywords": [ + "debug", + "debugger", + "yii2" + ], + "time": "2015-08-06 16:14:06" + }, + { + "name": "yiisoft/yii2-faker", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/yiisoft/yii2-faker.git", + "reference": "b88ca69ee226a3610b2c26c026c3203d7ac50f6c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yiisoft/yii2-faker/zipball/b88ca69ee226a3610b2c26c026c3203d7ac50f6c", + "reference": "b88ca69ee226a3610b2c26c026c3203d7ac50f6c", + "shasum": "" + }, + "require": { + "fzaninotto/faker": "*", + "yiisoft/yii2": "*" + }, + "type": "yii2-extension", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "yii\\faker\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Mark Jebri", + "email": "mark.github@yandex.ru" + } + ], + "description": "Fixture generator. The Faker integration for the Yii framework.", + "keywords": [ + "Fixture", + "faker", + "yii2" + ], + "time": "2015-03-01 06:22:44" + }, + { + "name": "yiisoft/yii2-gii", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/yiisoft/yii2-gii.git", + "reference": "e5a023e8779bd774194842ec1b8fb4917cf04007" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yiisoft/yii2-gii/zipball/e5a023e8779bd774194842ec1b8fb4917cf04007", + "reference": "e5a023e8779bd774194842ec1b8fb4917cf04007", + "shasum": "" + }, + "require": { + "bower-asset/typeahead.js": "0.10.*", + "phpspec/php-diff": ">=1.0.2", + "yiisoft/yii2": ">=2.0.4", + "yiisoft/yii2-bootstrap": "~2.0" + }, + "type": "yii2-extension", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + }, + "asset-installer-paths": { + "npm-asset-library": "vendor/npm", + "bower-asset-library": "vendor/bower" + } + }, + "autoload": { + "psr-4": { + "yii\\gii\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Qiang Xue", + "email": "qiang.xue@gmail.com" + } + ], + "description": "The Gii extension for the Yii framework", + "keywords": [ + "code generator", + "gii", + "yii2" + ], + "time": "2015-05-10 22:09:31" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "yiisoft/yii2-httpclient": 20, + "cando/yii2-db": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.5.0" + }, + "platform-dev": [] +} diff --git a/config/db.php b/config/db.php.dist similarity index 70% rename from config/db.php rename to config/db.php.dist index c4c12529c..ad19af2d1 100644 --- a/config/db.php +++ b/config/db.php.dist @@ -2,7 +2,7 @@ return [ 'class' => 'yii\db\Connection', - 'dsn' => 'mysql:host=localhost;dbname=yii2basic', + 'dsn' => 'mysql:host=localhost;dbname=', 'username' => 'root', 'password' => '', 'charset' => 'utf8', diff --git a/config/env.php.debug b/config/env.php.debug new file mode 100644 index 000000000..13bd4557d --- /dev/null +++ b/config/env.php.debug @@ -0,0 +1,4 @@ + 'admin@example.com', ]; diff --git a/config/routes.php b/config/routes.php new file mode 100644 index 000000000..b62512838 --- /dev/null +++ b/config/routes.php @@ -0,0 +1,4 @@ + ['log'], 'components' => [ 'request' => [ - // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation - 'cookieValidationKey' => '', - ], - 'cache' => [ - 'class' => 'yii\caching\FileCache', - ], - 'user' => [ - 'identityClass' => 'app\models\User', - 'enableAutoLogin' => true, + 'enableCookieValidation' => false, + 'enableCsrfValidation' => false, ], 'errorHandler' => [ 'errorAction' => 'site/error', ], - 'mailer' => [ - 'class' => 'yii\swiftmailer\Mailer', - // send all mails to a file by default. You have to set - // 'useFileTransport' to false and configure a transport - // for the mailer to send real emails. - 'useFileTransport' => true, - ], 'log' => [ 'traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [ @@ -38,15 +24,25 @@ ], ], 'db' => require(__DIR__ . '/db.php'), - /* 'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, - 'rules' => [ - ], + 'rules' => require(__DIR__ . '/routes.php'), ], - */ - ], + 'assetManager' => [ + 'converter' => [ + 'class' => 'yii\web\AssetConverter', + 'commands' => [ + 'less' => [ + 'css', + 'lessc {from} {to} --no-color' + ], + ], + 'forceConvert' => true, + ], + 'forceCopy' => true, + ], + ], 'params' => $params, ]; @@ -56,11 +52,6 @@ $config['modules']['debug'] = [ 'class' => 'yii\debug\Module', ]; - - $config['bootstrap'][] = 'gii'; - $config['modules']['gii'] = [ - 'class' => 'yii\gii\Module', - ]; } return $config; diff --git a/controllers/SiteController.php b/controllers/SiteController.php index 4ffba24cb..a0316641b 100644 --- a/controllers/SiteController.php +++ b/controllers/SiteController.php @@ -2,93 +2,12 @@ namespace app\controllers; -use Yii; -use yii\filters\AccessControl; use yii\web\Controller; -use yii\filters\VerbFilter; -use app\models\LoginForm; -use app\models\ContactForm; class SiteController extends Controller { - public function behaviors() - { - return [ - 'access' => [ - 'class' => AccessControl::className(), - 'only' => ['logout'], - 'rules' => [ - [ - 'actions' => ['logout'], - 'allow' => true, - 'roles' => ['@'], - ], - ], - ], - 'verbs' => [ - 'class' => VerbFilter::className(), - 'actions' => [ - 'logout' => ['post'], - ], - ], - ]; - } - - public function actions() - { - return [ - 'error' => [ - 'class' => 'yii\web\ErrorAction', - ], - 'captcha' => [ - 'class' => 'yii\captcha\CaptchaAction', - 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null, - ], - ]; - } - - public function actionIndex() - { - return $this->render('index'); - } - - public function actionLogin() - { - if (!\Yii::$app->user->isGuest) { - return $this->goHome(); - } - - $model = new LoginForm(); - if ($model->load(Yii::$app->request->post()) && $model->login()) { - return $this->goBack(); - } - return $this->render('login', [ - 'model' => $model, - ]); - } - - public function actionLogout() - { - Yii::$app->user->logout(); - - return $this->goHome(); - } - - public function actionContact() - { - $model = new ContactForm(); - if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) { - Yii::$app->session->setFlash('contactFormSubmitted'); - - return $this->refresh(); - } - return $this->render('contact', [ - 'model' => $model, - ]); - } - - public function actionAbout() - { - return $this->render('about'); - } + public function actionIndex() + { + return $this->render('index'); + } } diff --git a/files/less/application.less b/files/less/application.less new file mode 100644 index 000000000..a5bad76c8 --- /dev/null +++ b/files/less/application.less @@ -0,0 +1,3 @@ + +@import "http://github.com/vendor/bower/bootstrap/less/bootstrap.less"; + diff --git a/mail/layouts/html.php b/mail/layouts/html.php deleted file mode 100644 index bddbc6129..000000000 --- a/mail/layouts/html.php +++ /dev/null @@ -1,22 +0,0 @@ - -beginPage() ?> - - -
- -