Setting up Development Environment

From OrangeHRM

Jump to: navigation, search

Contents

Introduction

This page summerises the steps needed to setup a development environment for OrangeHRM. It is targeted towards Orange HRM developers.

PLEASE NOTE: This document has only been tested in a unix environment. It needs to be updated/changed for any changes after testing on windows environments

Checking out source code

OrangeHRM uses subversion for source control. The following command checks out the the latest code from the trunk.

svn co https://orangehrm.svn.sourceforge.net/svnroot/orangehrm/trunk/php/orangehrm

It is suggested that the files be checked out to a directory under apache document root or that apache be configured to serve files from this location.

Pre requisites

Orange HRM Installation pre-requisites

Please follow the Orange HRM Installation Guide and verify that all pre-requisites listed there are are satisfied.

Extra requirements for the development envirionment.

Pear

It is recommended that Pear be installed if not already available on your system. This will make installing other php components easier.

Phing build tool (2.2.0 - patched)

Phing is a project build system based on Apache Ant [1]. Orange HRM uses Phing to run unit tests, generate code coverage reports, generate source code documentation and to build the destribution archive.

NOTE: Phing 2.2.0 does not work with PhpUnit 3.0 [2]. Until this is fixed in phing, Orange HRM uses a patched version of phing.

The patch is given in the phing ticket [3] and is at [4]

Install the patched phing version as follows:

pear install --alldeps phing-2.2.0.tgz

GraphViz

GraphViz.php [5] is required by PHPUnit reporting code. Install Graphviz via

pear install Image_Graphviz


PHPUnit 3.0

PHPUnit [6] is the unit testing framework used by OrangeHRM.

Install PHPUnit 3.0 as described in the PHPUnit documentation [7].

PhpDocumentor 1.3

PhpDocumentor [8] is used to generate documentation from php source code. It is suggested that PhpDocumentor be installed via pear with all dependencies:

pear install --alldeps pear/PhpDocumentor

PHP5 XSL

Generating test reports require that XSL support be build in to PHP5. Please refer to [9].

XDebug for PHP

Code coverage reports require the XDebug extension for PHP be installed [10] Installation is somewhat complicated. Please follow the instructions at [11].

For windows it looks like a binary dll has to be downloaded and php.ini has to be configured to use it.

Running the unit tests

  • Modifiy build/testConf.php and set rootPath and webPath
  • Use the following command to run the unit tests
cd build 
phing test
  • The tests will run and the results will be displayed on the screen.

Other build targets

phing test.report

Generates unit test report under
build/reports/tests/index.html

phing dist

Creates source zip file suitable for distribution. Zip file is created under
build/dist

phing clean

Cleans up all files created by the build

phing phpdoc

Generate api documentation for php classes under build/dist/apidocs

phing coverage

Generate unit test coverage report under build/reports/coverate NOTE: This is not working yet.

Subscribing to Developer mailing list

Every active developer should development mailing list: orangehrm-developement@lists.sourceforge.net Subversion commit messages are sent to this mailing list and this keeps the developers informed of changes done by others and also acts as a basic code review system.

Release

  • Exclude directories:
    • .svn
    • devDocs
  • Upgrades??
  • Default document updates

orangehrm/installer/guide/index.html : change references to version (eg: 2.0.4 -> 2.0.5)

  • Rename top level directory to orangehrm2
Personal tools