Used to create new projects using Symfony at XM Media.
- Download a copy of this repo (probably as a ZIP).
- Remove or update the
LICENSE
file. - Install Composer locally.
composer.json
changes:
- update the
name
,license
anddescription
- Update
package.json
- Composer install & update (locally, no autoloader or scripts):
php composer.phar install --no-autoloader --no-scripts && php composer.phar update --no-autoloader --no-scripts
- Run
yarn && yarn upgrade
locally (may not be needed). - Find and make changes near
@todo-symfony
comments throughout the site. - Setup server:
- Upload the files (exclude files that are OS dependent like
node_modules
&app/config/parameters.yml
or that are only for editing like.idea
and a lot of what's in.gitignore
). - Install Composer
- Install PHP packages/vendors:
php composer.phar install
It will ask for the parameter values including database & SMTP. A secret can be retrieved from http://nux.net/secret - Install NVM: https://github.com/creationix/nvm#install-script
- Run
. ./node_setup.sh
(this will setup node & gulp). - Run
npm run dev
ornpm run build
to compile JS & CSS files. (When going live, runnpm run build
instead.) - Create the database:
php bin/console doctrine:schema:create
- Create a user
php bin/console fos:user:create
and then promote them (add the roleROLE_SUPER_ADMIN
)php bin/console fos:user:promote
- Setup mail spool: add cron task similar to:
* * * * * cd <path> && php bin/console swiftmailer:spool:send --message-limit=10 --time-limit=45 >> var/logs/mailer.log 2>&1
- Delete starter files:
README.md
(or update),TEMPLATES.md
.
Dev site can be accessed at https://[domain]/app_dev.php/
- PHP 7.1+
- MySQL 5.6+
- Yarn
- Production JS/CSS build:
yarn run build
- Dev JS/CSS build:
yarn run dev
- Dev JS/CSS watch:
yarn run watch
(files will not be versioned) - Dev JS/CSS HMR server:
yarn run dev-server
- Run JS unit tests:
yarn run test
- Run PHP unit tests:
php bin/phpunit
or no memory limitphp -d memory_limit=-1 bin/phpunit
- Run browser tests (Behat):
php bin/behat
- Start Chrome headless first:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-gpu --headless --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 --window-size-1200,1500
- Start Chrome headless first:
The following is needed in the Apache VirtualHost for the Webpack Dev Server/HMR to work:
ProxyPassMatch ^(\/dev-server\/.+$)|(sockjs-node) http://localhost:<port>
ProxyPassReverse / http://localhost:<port>
You'll probably want to customize the port number in the Apache ProxyPass config
and in package.json
(script.dev-server
) to be unique to each project if
running multiple sites on one server.