Yii2 Boilerplate
Structure for enterprise-grade websites for Yii2 framework., (*1)
Easiest initial deploy ever
-
Install Vagrant., (*2)
-
Install Virtualbox., (*3)
-
If you have PHP 5.4+ installed already, you've just installed all prequisites for YiiBoilerplate., (*4)
-
Now just clone the Yii2Boilerplate repo:, (*5)
git clone git@github.com/combc/Yii2-Boilerplate.git <yourprojectname>
-
Create your own github personal API tokens https://github.com/blog/1509-personal-api-tokens. Paste it into a Vagrantfile., (*6)
Example:, (*7)
s.args = [
#YOUR GITHUB TOKEN HERE
"d1d8c6a9e9b706a596b96b9994bf0549109083ba",
...
]
Note: Yii2Install, (*8)
-
Inside cloned directory run and wait for complete:, (*9)
vagrant up
-
You're done. Open up the http://yii2frontend.dev:8080/. It's your future frontend. Open up http://yii2backend.dev:8080/. It's your future backend. You can start working., (*10)
-
Change the origin repo to the new repository in order to push your new project:, (*11)
git remote remove origin
git remote add origin <NEW-GIT-REMOTE>
Don't forget to vagrant halt
the virtual machine before turning off your workstation, virtualbox can fail to shut itself down in time before kill -9
arrives., (*12)
Yii 2 Advanced Application Template
Yii2Boilerplate uses Yii 2 Advanced Application Template is a skeleton Yii 2 application best for developing complex Web applications with multiple tiers., (*13)
Vagrant config
Database
You can select up data between MySQL 5.6 and Postgres 9.3. Enter the Vagrantfile name of the database, default mysql., (*14)
Example:, (*15)
s.args = [
...
#YOUR DATABASE TYPE HERE [mysql|pgsql]
"pgsql"
]
If you have chosen MySQL:, (*16)
PhpMyAdmin adress: http://localhost:8080/phpmyadmin/, (*17)
If you have chosen Postgres:, (*18)
PhpPgAdmin adress: http://localhost:8080/phppgadmin/, (*19)
Database default credential:
login: vagrant, (*20)
password: vagrant, (*21)
database: yii2boilerplate, (*22)
database for tests: yii2boilerplate_tests, (*23)
MailCatcher
MailCatcher runs a super simple SMTP server which catches any message sent to it to display in a web interface., (*24)
smtp://0.0.0.0:1026, (*25)
http://0.0.0.0:1081, (*26)
Default common/config/main-local.php:, (*27)
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
'useFileTransport' => false,
],
Virtual Machine config
Use the vagrantfile to the desired options of memory and cpu., (*28)
DEFAULT: memory = 1024 MB, cpus = 2, (*29)
config.vm.provider "virtualbox" do |v|
#v.memory = 512
#v.cpus = 1
v.memory = 1024
v.cpus = 2
end
More http://docs.vagrantup.com/v2/virtualbox/configuration.html, (*30)
XDebug conf
XDebug SessionId: XDEBUG, (*31)
XDebug port 9000, (*32)
On run configuration:
Project URL: http://yii2backend.dev:8080/
Index file: backend/web/index.php
or
Project URL: http://yii2frontend.dev:8080/
Index file: backend/web/index.php
The installed
- Ubuntu 14.04
- Apache 2.4
- PHP 5.6
-
Composer, (*33)
composer
-
Coceception, (*34)
codecept
-
PHP Dead Code Detector,, (*35)
phpdcd
-
PHP Mess Detector,, (*36)
phpmd
-
PHP_CodeSniffer,, (*37)
phpcs
-
PHP Copy/Paste Detector,, (*38)
phpcpd
-
PHP Documentation Generator,, (*39)
phpdox
License
And of course:, (*40)
MIT: LICENSE, (*41)
====, (*42)
ComBC
http://combc.eu, (*43)