Used to create new projects using Symfony at XM Media.
- Download a copy of this repo (probably as a ZIP).
- Remove or update the
LICENSEfile. - Install Composer locally.
composer.jsonchanges:
- update the
name,licenseanddescription
- 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 upgradelocally (may not be needed). - Find and make changes near
@todo-symfonycomments throughout the site. - Setup server:
- Upload the files (exclude files that are OS dependent like
node_modules&app/config/parameters.ymlor that are only for editing like.ideaand a lot of what's in.gitignore). - Install Composer
- Install PHP packages/vendors:
php composer.phar installIt 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 devornpm run buildto compile JS & CSS files. (When going live, runnpm run buildinstead.) - Create the database:
php bin/console doctrine:schema:create - Create a user
php bin/console fos:user:createand 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/phpunitor 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.