Skip to content

myclabs/Units

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7b32c2f · Jun 9, 2016
Oct 27, 2014
Dec 23, 2013
Jun 9, 2016
May 30, 2014
Jan 6, 2014
Nov 28, 2013
Dec 5, 2013
Dec 20, 2013
Oct 27, 2014
Jan 6, 2014
Jan 22, 2014
May 26, 2014
Oct 27, 2014
Dec 6, 2013
Dec 5, 2013

Repository files navigation

Units

UML diagram

Getting started

The PHP intl extension is required, it can be installed easily on debian systems with apt-get install php5-intl.

$ composer install
$ app/console doctrine:database:create
$ app/console doctrine:schema:create
$ app/console unit:populate

Running the tests

Running the unit tests:

$ phpunit

Running the functional tests:

$ app/console doctrine:schema:drop --force --env=test
$ app/console doctrine:schema:create --env=test
$ app/console unit:populate --env=test
$ phpunit -c phpunit-functional.xml.dist

The functional test suite automatically generates a SQLite database in the tests/FunctionalTest directory. As such, it requires the pdo_sqlite extension and the user running the tests must have write permissions in that directory.

Continuous integration is done on CircleCI: https://circleci.com/gh/myclabs/Units

Running the server

$ app/console server:run

The server is now running at http://localhost:8000/.

If you are using Vagrant, run:

$ app/console server:run 0.0.0.0:8000

Deploying

Deployment is done use Capifony. Execute these commands on your local machine.

$ cap deploy # by default, in development
$ cap development deploy
$ cap testing deploy
$ cap production deploy

The first time, the server needs to be set up:

$ cap production deploy:setup

If you are running Capifony locally with a different user, set the user name at runtime:

$ cap -s user=myusername production deploy

Troubleshooting

Some server files could belong to the last deploying user, if necessary run the following command on the server:

$ chown -R root:deployers /home/web/units/shared/cached-copy

Capistrano may have some problem with authentication using interactive method. Uninstalling the net-ssh gem and reinstalling the 2.7.0 version solve this problem:

$ gem uninstall net-ssh
$ gem install net-ssh -v 2.7.0