Website for www.phphants.co.uk.
For more information, visit us at PHP Hampshire.
git clone https://github.com/phphants/phph-site.git
cd phph-site
composer install
Front end assets are built using Gulp. The two main useful commands are gulp
(to watch for
changes) and gulp build
(a one-off build of front end assets).
First, install gulp-cli
globally, if you haven't already:
$ npm install gulp-cli -g
Then just install the local packages:
$ npm install
Whilst working on front end assets it is useful to automatically rebuild the CSS/JS. This is the default
mode of the
Gulpfile.js
included, so you can just run gulp
directly:
$ gulp
[08:50:54] Using gulpfile ~/workspace/phph-site/gulpfile.js
[08:50:54] Starting 'styles'...
[08:50:54] Finished 'styles' after 17 ms
[08:50:54] Starting 'scripts'...
[08:50:54] Finished 'scripts' after 1.17 ms
[08:50:54] Starting 'build'...
[08:50:54] Finished 'build' after 773 μs
[08:50:54] Starting 'default'...
[08:50:54] Finished 'default' after 14 ms
Press Ctrl+C
(Win/Lin) or Cmd+C
(Mac) when you are finished to exit Gulp.
If you need to build the front end assets just once, you can run gulp build
which does the same as gulp
but exits
immediately after build (no watching files):
$ gulp build
[08:57:52] Using gulpfile ~/workspace/phph-site/gulpfile.js
[08:57:52] Starting 'styles'...
[08:57:52] Finished 'styles' after 17 ms
[08:57:52] Starting 'scripts'...
[08:57:52] Finished 'scripts' after 1.16 ms
[08:57:52] Starting 'build'...
[08:57:52] Finished 'build' after 793 μs
$
Afterwards, set up a virtual host to point to to the public/
directory of the project. For example in Apache:
<VirtualHost *:80>
ServerName phph.localhost
DocumentRoot /path/to/phph-site/public
</VirtualHost>