- All request params should be fetched in route files, sanitized, and safely passed into controllers
- Route files should be feature specific
- Dependency injection is good
- Download and install Vagrant from https://www.vagrantup.com/downloads.html
- Install the vagrant-omnibus plugin:
vagrant plugin install vagrant-omnibus
- Download and install Virtualbox from https://www.virtualbox.org/wiki/Downloads
- Make sure you are syncing the Company Shared Folder in box.com to a local drive, which contains database dumps. The database dumps should be in "~/Box\ Sync/Company\ Shared\ Folder/database"
- Have a recent version of ruby installed. I used ruby 1.9.3p484 installed via macports.
- In the parent directory of your just-pikd working copy,
git clone git@github.com:jklein/just-pikd-chef.git
- In the just-pikd working copy, type
vagrant up
to start the VM. The first time you do this it will take longer since it needs to download the VM image. sudo npm install -g
to install npm globals like gulpnpm install
to get all of the dependencies for the project.sudo gem update --system
andsudo gem install compass
to get compass.curl -sS https://getcomposer.org/installer | php
install composersudo mv composer.phar /usr/local/bin/composer
move composer to a bin directory so you can just runcomposer
cd app && composer install && cd -
- This will install all PHP dependencies and generate the autoload filegulp
- This will build all JS/CSS and start watching the filesystem for changes.- localhost:8080 on the host machine will be forwarded to the VM's port 80, so hit localhost:8080 in a web browser to validate that things got set up properly.
- You can ssh to the VM using
vagrant ssh
as well. - Your git working copy is automatically mapped to
/usr/share/nginx/html
as a shared directory, so you should be able to edit code and see the changes right away.
- Small changes can be tested via
vagrant ssh
(the user has sudo access) - To do it properly, edit the chef cookbooks in the
cookbooks/
directory of the just-pikd-chef repo, and if you need to add a cookbook or recipe edit the Vagrantfile in this repo as well (we should add roles for this later and an environment flag). - Run
vagrant provision
to automatically run chef-solo against the running VM. If you are just editing the Vagrantfile this is enough, but if you edit the cookbooks themselves you'll need to reload first to get those changes onto the VM.vagrant reload --provision
will take care of that.
- Feel free to edit the dev database directly as much as you want.
- To save changes to the data file, run the pg_dump utility against the
database, e.g.
pg_dump -h localhost -U postgres -d product -W -Fc > /mnt/database/product.dump
- To update the schema files in schema/, run the dump_schema.php file:
php -f /usr/share/nginx/html/schema/dump_schema.php
- commit and push your changes for schema. The DB dump should sync to Box automatically.