A Symfony 2 Thing
-
The Toolkit is intended to run as a site under the Precip VM, so start by getting that: clwdev/precip
-
Set up your config.rb file in the precip root similar to:
drupal_sites = {
"toolkit" => {
"host" => "toolkit.vm",
"path" => "Toolkit/web",
"drupal" => "false",
"git_url" => "[email protected]:TUI-SAS-Web-Development/Toolkit.git",
"git_dir" => "Toolkit",
"commands" => {
"toolkit-composer" => {
"path" => "/srv/www/Toolkit",
"cmd" => "sudo composer",
},
"toolkit-console" => {
"path" => "/srv/www/Toolkit",
"cmd" => "sudo php app/console",
}
}
}
}
- Boot the VM with
vagrant up
. If it's already built,vagrant reload --provision
.
$ cd [your workspace]/precip
$ vagrant up
- SSH into the VM and install Symfony
$ vagrant ssh default
$ cd /srv/www/Toolkit
$ sudo composer install
If you have the config.rb with bin command settings, instead of SSH into vagrant box and running commands as 'sudo php app/console', you can do stuff like below from your host machine precip directory:
you may need to run the two commands below first:
$ vagrant plugin install vagrant-exec
$ vagrant exec --binstubs
~/www/precip (master)$ bin/toolkit-console cache:clear --env=dev
~/www/precip (master)$ bin/toolkit-composer require [package-provider/package-name]
~/www/precip (master)$ bin/toolkit-composer install
- Init the app
$ sudo php app/console doctrine:schema:create #subsequent use is doctrine:schema:update
$ sudo php app/console doctrine:fixtures:load
Note: this will likely get replaced by running a migration 0 (doctrine:migrations:migrate)
- Load the assets and clear cache
$ sudo app/console cache:clear # possible options are --env=prod --no-debug
$ sudo php app/console assetic:dump # option are --env=prod --no-debug
- You can also run the Symfony shell and run commands in that shell
$ sudo php app/console --shell
Symfony > cache:clear --env=prod
(We're working on getting Precip to build handy aliases for us so we don't have to ssh into the box to do all this. Soon.)
By default, when you point your browser to http://toolkit.vm, you will be running the prod environment. This means you are serving cached content and non-refreshed assets (css/js/images/content repository etc).
While developing, add 'app_dev.php' to your path to view the dev env of the application. http://toolkit.vm/app_dev.php It treats it like a base_url.
- This also seems like a good tutorial to start with: Basic CMS
- Information about creating menus using KnpMenuBundle
- Information for Dev Ops putting Env vars outside of project (like db conn credds)
- Something to run to fix PSR-x issues: PHP-cs-fixer
- how to Handle forms
- custom User event HTML emails
- adding invitations to registration (require token to register)
- form API reference field types
- Ice Age - Dont miss the migrations
- Doctrine query builder API
- Custom form field types and manipulation here
- If you install or update a bundle, or do anything that changes schema, like add a field, change a field mapping etc, then you'll need to generate a Doctrine Migration so others can run Migrations when they pull latest source code.
\\ to generate a migration file - you'll need to add and commit to source control
$ bin/toolkit-console doctrine:migrations:diff
\\ to run all migrations still pending
$ bin/toolkit-console doctrine:migrations:migrate
\\ to check migrations status
$ bin/toolkit-console doctrine:migrations:status