First off, the same requirements as symfony2, besides this, we have these addons:
These are only required on dev servers:
git clone git@github.com:bellcom/hanzo.git
cd hanzo
php bin/vendors install
dosc/vhost.conf
for an examplenpm install
grunt watch
in a shell to keep files up2dateNote, to ease the flow, we use app_dev.php
as "index" on locale dev and test_dev.php
on test - so you do not use the environment files directly.
To access a dev page, the structure is as follows, {locale} is one of the configured locales: http://yourdomain.tld/{locale}
or http://yourdomain.tld/app_test.php/{locale}
prod is never used, well - in production but else...
At the moment da_DK
, sv_SE
, nb_NO
, nl_NL
, en_GB
, de_DE
, de_CH
and de_AT
is configured.
Please notice, you need to have all the utf8 locales for these languages installed (ex: da_DK.utf8) !
symfony console:
php app/console --help
for help on the cli interface for symfonyphp app/console cache:clear --env=dev_dk
php app/console cache:clear --env=test_dk
php app/console cache:clear --env=prod_dk
php app/console hanzo:redis:cache:clear --env=prod_dk
Note the env
parameter, this is important, stuff vill break if not ... oh! and run the command as the web user
redis:
redis-cli
is the commandline interface for handeling redis related tasks
redis supports tab-completionFLUSHDB
FLUSHALL
KEYS *xx*
KEYS *
HELP
or go see the docs, they are great.Currently we use redis for:
On dev we only use one redis server, so here the port number is 6379 (default)
Assets for themes are located under web/fx/THEME/
cd web/fx
compass create THEME_NAME --css-dir "css" --javascripts-dir "scripts" --images-dir "images"
--
Styles are grouped in seperate .scss
files. e.g. Payment styles are located in _payment.scss
and importet in style.scss
(@import "payment"). All sub .scss
files which should be imported into another instead of being a independet css file, should be prepended with a _
like _account.scss
. This way they wont be compiled themself.
The directory of a theme will look like this when built with compass (note that compass only generates the sass
and css
folders):
web/fx/THEME/
css/
style.scss
ie.css
scripts/
images/
sass/
_base.scss
_header.scss
_footer.scss
ie.scss
style.scss
config.rb
Follow the best practices
--
_base.scss
- Includes all globale variables and @importsstyle.scss
- Main stylesheet which includes _base and others
payment.scss
- Styles for paymentAll assets (css and js) are compiled using grunt
, all assets needed by a theme are added to the file resources.json
in the theme folder, eks: app/Resources/themes/2013s1/resources.json
There is a vagrant box provider, it requires:
To use, simply cd
to the root directory of the project and do a
$ vagrant up
It will take forever (the first time) - when done, you should be able to go to http://pdl.dev/
and http://c.pdl.dev/
To ssh into the box, do a:
$ vagrant ssh
To shut it down:
$ vagrant halt
If the page returns a "nginx - bad gateway" error run the following commands:
$ vagrant ssh
$ sudo chown www-data. /var/run/php5-fpm*
Is for processing orders, so they are send "to ax" in dev mode - and you get your confirmation emails.
To run the beanstalk jobs you do:
$ php app/console hanzo:ax:pheanstalk-worker --limit=10 --verbose --env=dev_dk
where --limit=10
can be anything, its the number of jobs executes before quitting - remember not to set it to 100.000, php does not handle memory that well...
also, you should always remember to restart the jobs when changing any related code.
There is a config file for supervisord in docs/supervisord-hanzo.conf - this is a copy of the configuration currently in production.