Skip to content

hugllc/HUGnetLib

Repository files navigation

HUGnetLib

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.

Project Setup

Directory Structure

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

Requirements

Development

  • 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

Running

  • php 5.3 or 5.4
  • php-mysql extensions
  • php-sqlite extensions

Setup

To function properly, the following must be in place:

  1. ./src/php should be installed in the php_include path as ./HUGnetLib/
  2. ./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

Testing

Unit Testing

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.

Running all of the tests

Calling phpunit with no arguments in the root directory of the project will cause all of the tests to be run.

$ phpunit

Running one or more sets of tests

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

Coding Style

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

Deploying

Ubuntu

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.

Troubleshooting & Useful Tools

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.

Contributing changes

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:

  1. Using git to create patches and emailing them to patches@hugllc.com
  2. Creating another github repository to make your changes to and submitting pull requests.

Git Checkins

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.

Filing Bug Reports

The bug tracker for this project is at http://dev.hugllc.com/bugs/ . If you want an account on that site, please email prices@hugllc.com.

License

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

About

This is the repository for the HUGnet code library.

Resources

License

Stars

Watchers

Forks

Packages

No packages published