Setting up Development Environment
From OrangeHRM
This article provides information on setting up the development environment required for OrangeHRM development. All the installation instructions assume that the subjected product is not installed in your operating system. It's recommended that you check whether already installed products exist before going for new installations.
Installing Apache, MySQL and PHP (AMP)
OrangeHRM is an AMP based product (written in PHP, data is on MySQL and runs in Apache). So, you need to have all these software products installed. You can refer to online documentation of each of these and install them separately or else you can use an AMP stack to install all three at once which can be a quick start comparing to manual installation. XAMPP is a popular AMP stack and is available for both Linux and Windows.
Installing Eclipse IDE
Eclipse IDE (or an IDE based on it) is the recommended IDE for OrangeHRM. There are customized versions for PHP like PDT and Easy Eclipse for PHP. You can use PHP Eclipse plugin if a version of core Eclipse is already available.
Installing Subversion (SVN)
Subversion (SVN) is the version control system used in OrangeHRM. You need to have SVN installed to get a check-out from latest code base, get a diff (changes you made - needed in Review Requests), get code updates, commit your changes back to repository etc. Follow installation instructions at Subversion site based on your operating system. There is also a Windows version available called TortoiseSVN.
Installing PEAR Packages
OrangeHRM mainly uses PHPUnit (for unit testing purposes) and Phing (for system-wide tasks like making builds) PEAR packages. Refer the article Installing PEAR Packages for installing these two and their dependencies.
Getting a Checkout from OrangeHRM SVN Repository
The OrangeHRM archives that you download from Source Forge don't contain all the files that need for development. So you have to get a checkout from OrangeHRM SVN repository.
First change your directory to Apache web folder. In XAMPP this can be 'htdocs' folder and in Linux systems, at default it is '/var/www/html'. Then make sure you have root permissions. After that you can make a checkout from latest trunk code using following command. For a detailed introduction to SVN commands, refer Basic SVN Commands article.
svn checkout https://orangehrm.svn.sourceforge.net/svnroot/orangehrm/trunk/php/orangehrm orangehrm
Installing OrangeHRM
Provided that you got a checkout as 'orangehrm' and both Apache and MySQL are running, you can initiate OrangeHRM installer by entering 'http://localhost/orangehrm' in your web browser. You need an installed copy of OrangeHRM to develop in. You can get more detailed installation instructions at our web site.
Setting User Permissions
If you are in a Linux based system, before and after installation, you would need to set proper permission of 'orangehrm' folder to Apache and the user account that you use to login and work.
Running Unit Tests
OrangeHRM employs Test Driven Development. Before you start coding for your assigned task, you first have to run all the unit tests in OrangeHRM and confirm that all of them are passing. The recommended way to run all tests is using Phing. Change your directory to 'build' directory in OrangeHRM and run following command in command prompt. Refer Running Unit Tests article for more detailed explanation on running unit tests.
phing test
Usually you should see that all tests are passing. If you see some tests are failing, before starting your development, you should contact the senior developer assigned to you and get his guidelines to fix them. Only when all tests are passing, you should start your development.
Increasing Runtime Memory
Sometimes when you run all tests, you would see an error like "Allowed memory size of 33554432 bytes exhausted". This means PHP engine has reached the limit of memory allocated for it to use at run time. You can increase it by altering the 'memory_limit' value in php.ini like below. Try to put a value which is above the mentioned limit in the error and which is a reasonable portion of your RAM.
memory_limit = 64M
Updating Code
OrangeHRM is developed continuously by a dedicated development team and code base is updated continuously. Therefore you need to update your working daily. Use 'svn update' command for that. Refer Basic SVN Commands for more detailed instructions. Updating working copy and running all unit tests are some of the frequent development habits you need to get used to.
Understanding OrangeHRM Code Base
Before starting your assigned task, you would need to understand the flow of OrangeHRM code base. Get an idea at OrangeHRM Code Overview. Once done, you can start your assigned task and make a review request as mentioned in Using Review Board once you finished your task.
