PHP requirement is in order to run the site. Node, gulp and Bower requirements are for development only.
Prerequisite | How to check | How to install |
---|---|---|
PHP >= 5.4.x | php -v |
php.net |
Node.js 0.12.x | node -v |
nodejs.org |
gulp >= 3.8.10 | gulp -v |
npm install -g gulp |
Bower >= 1.3.12 | bower -v |
npm install -g bower |
$ mkdir ocs
(or whatever you like)$ git clone {this repo url} ocs
$ git submodule init
# Get WordPress$ git submodule update
.$ wp db import /path/to/data.sql
local-config-sample.php
to local-config.php
local-config.php
and add you database connection detailsWP_ENV
constant to production
/Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
)Custom code for the OCS currently lives in two places:
/app/plugins/ocs-site-customizations
: most OCS-specific functional code belongs here instead of.../app/themes/odfw-ocs-sage/
: templates, CSS, JS and other site assets.The OCS theme is built on top of the Sage starter theme. In order to develop CSS or JS you'll need to get the theme's tooling up and running. You can probably hack PHP without any further set up.
npm install -g npm@latest
$ npm install --global gulp bower
$ cd app/themes/odfw-ocs-sage
$ npm install
to have npm install additional theme dependencies$ bower install
to install frontend dependencies $ gulp watch
to work on theme. gulp will start a server at http://localhost:3000/ and will watch all of the files in the theme. Any changes you make will be compiled automatically (from sass/js/php...) and your browser will automatically update to reflect the changes. Note that while the gulp server will serve assets and refresh PHP you still need to run a LAMP stack (or equivalent server).gulp
— Compile and optimize the files in the assets directorygulp watch
— Compile assets when file changes are madegulp --production
— Compile assets for production (no source maps).functions.php
is only a file includer. Please add functions to the included file you think is most appropriate. If a function defines core site functionality (things that shouldn't break no matter the theme), put it into the ocs-site-customizations plugin./assets/
. Compiled equivalents are served from /dist/
. Do not edit files within /dist/
—your heart will be broken when gulp wipes them out.$ cd /path/to/wordpress
$ git fetch -t
to get the most recent tags. Each release version of Wordpress is tagged.$ git tag
to see the list$ git checkout 4.3.1
or whatever the most recent tag is$ cd ..
Need to get out of the Wordpress directory for the next steps or you will melt poor little git's brain.$ git add wordpress
to stage the update$ git commit -m "Update Wordpress to 4.3.1"
Either use the admin panel or use WP-CLI. With WP-CLI installed, navigate to the /wordpress
folder and run (eg):
$ wp plugin update hello-dolly
or
$ wp plugin update --all