- Install LAMP
- Install Apache (
sudo apt-get install apache2
) - Install mysql (
sudo apt-get install mysql-server mysql-client
) - Install PHP (
sudo apt-get install php5
) - Link php/mysql: (
sudo apt-get install php5-mysql
)
- Install Apache (
- Create a database/user. Log in to mysql (
mysql -u root -p
), and do something like:CREATE DATABASE coffee;
CREATE USER 'coffee'@'localhost' IDENTIFIED BY 'coffee';
GRANT ALL ON coffee.* TO coffee
- Download and unzip phpCAS
- phpCAS requires php5-curl (
sudo apt-get install php5-curl
)
- phpCAS requires php5-curl (
- Download and unzip htmlpurifier
- Set up PHPCodeSniffer, easiest via pear
sudo apt-get install php-pear
andsudo pear install PHP_CodeSniffer
.- This can be run using a command like
phpcs --standard=PSR2 -n **/*.php
(Which travis-ci will check.)
- This can be run using a command like
- Set up eslint:
sudo apt-get install npm
, then install usingsudo npm install -g eslint
to get eslint. To get the definitionssudo npm install -g eslint-config-google
- This can be run using a command like
eslint js
.
- This can be run using a command like
- Clone!
cd
to the web directory (probably something likecd /var/www
)git clone https://github.com/cwru-pat/coffee_stuff.git
- Change to this directory,
cd coffee_stuff
- Copy the settings file,
cp private/.default-config.php private/.config.php
. The fileprivate/.config.php
is ignored in .gitignore, so you can edit it without worrying about passwords being committed.- Edit the
$config['database'][...]
to reflect the mysql credentials created above. - Edit
$config['web']['path']
to point to the URL where you can view the system. - Edit
$config['phpCAS']['location']
to point to system path where theCAS.php
file inside the phpCAS directory is (it should probably not be a subdirectory of this repo). - Edit
$config['htmlpurifier']['location']
to point to system path where theHTMLPurifier.auto.php
file is inside the htmlpurifier library directory is (it should probably not be a subdirectory of this repo).
- Edit the
- A pre-commit hook to run tests exists. Run
cp pre-commit .git/hooks/pre-commmit
to enable it.
- For database changes, tables that do not exist are created, but changes to existing tables need to be done by hand (for now).
- To run tests by hand, try
./ci/ci-tests.sh
.