This is a library of PHP code that does all of the functions of the HUGnet system. The main part of any PHP code for the project resides here. This way this code can be used for any user interface.
This project is broken up into the following directories:
- The test/ directory contains the unit tests
- The build/ directory contains build scripts, and other things useful for building the project
- The deb/ directory contains the base files for the debs
- The src/ This contains the source code
- phpunit (http://www.phpunit.de) with database test extension
- phpqatools (pear install pear.phpqatools.org/phpqatools)
- Apache Ant
- uglifyjs (To build the .js archives)
- Ubuntu or Debian build environment to build debs
- php 5.3 or 5.4
- php-mysql extensions
- php-sqlite extensions
To function properly, the following must be in place:
- ./src/php should be installed in the php_include path as ./HUGnetLib/
- ./src/webapi/html should be installed in the web root as ./HUGnetLib/
On Linux systems, this can be accomplished by symbolic links when working on the code. For example, in Ubuntu, you could create the following symbolic links:
- /usr/share/php/HUGnetLib -> /your/code/path/HUGnetLib.git/src/php
- /var/www/HUGnetLib -> /your/code/path/HUGnetLib.git/src/webapi/html
This project uses phpunit (http://phpunit.de) to run unit testing. There are currently thousands of tests that run in about 2 minutes. All of the tests reside in the test/suite/ directory. Every file in that directory should stand on its own. They can all be called separately with phpunit.
Calling phpunit with no arguments in the root directory of the project will cause all of the tests to be run.
$ phpunit
Any directory under test/suite/ can be referenced to only run those tests. The following would only test the database code:
$ phpunit test/suite/db
The code should all be in a uniform, documented code style. This style is checked using phpcs. To run the style checker do the following:
$ ant style
Currently there are only build scripts for building .deb files for Ubuntu. They are created by running 'ant deb'. The debs will be in the ./rel directory.
The unit tests are the best bet for troubleshooting.
Currently E_NOTICE must be set to OFF in report_errors in the php.ini file.
Any contributions need to be tested in the unit testing
All unit tests MUST pass for contributions to be even considered
Style must be consistant as reported by the style checker
All commit messages need to reference bugs in the Mantis bug tracker (see below)
Changes can be contributed by either:
- Using git to create patches and emailing them to [email protected]
- Creating another github repository to make your changes to and submitting pull requests.
All git checkins MUST REFERENCE A BUG in Mantis. This can be done in a number of ways. The commit message should contain one of the following forms:
- bug #XXXX
- fixed #XXXX
- fixes #XXXX
This automatically ties our git repositories into our Mantis bug tracker.
The bug tracker for this project is at http://dev.hugllc.com/bugs/ . If you want an account on that site, please email [email protected].
This is released under the GNU GPL V3. You can find the complete text in the LICENSE file, or at http://opensource.org/licenses/gpl-3.0.html