Windows-based Development

From Osi

Jump to: navigation, search

This page will help you get iHRIS set up and ready to begin testing, customizing or developing. While some of the tools presented may seem a little strange, this will provide a development experience similar to that on Linux with freely available, open-source tools. Some people may prefer Zend Studio, the PHP IDE, but that is not covered here.

FIXME: Much of this should be automated away.

Contents

Tools

Bazaar

Bazaar is the version control system used by the iHRIS project. Download the Windows Standalone Installer and accept all the defaults.

WAMP

Error creating thumbnail: convert: unable to open image `/var/lib/mediawiki/upload/thumb/WAMP_Screenshot.png/180px-WAMP_Screenshot.png': Permission denied.

WAMP is a single installer that provides an Apache Server with PHP5 and MySQL that runs under Windows. Download and install it.

Cygwin

Cygwin provides some command-line tools that Emacs uses. Install it before installing Emacs.

Emacs

Emacs is a powerful, prgrammable text editor. EmacsW32 provides an installer for Windows to make Emacs integrate more smoothly with Windows. Make sure that it finds Cygwin during the installation.

(I do not attempt to teach you how to use Emacs here. You should be able to find your way around Emacs initially, using the menus to load files and what-not, but if you want more information, see the EmacsNewbie page on the EmacsWiki.)

Setup

For the purpose of this tutorial, we'll assume that you want to work in the C:\wamp\ihris\ directory. If you want to use a different directory change things accordingly.

Code Checkout

Open a command prompt and go to the c:\wamp\ directory. Create the ihris directory ("mkdir ihris") and cd into it. Once inside the directory, check out the code branches:

C:\wamp\ihris>bzr co lp:~intrahealth+informatics/i2ce/main i2ce
C:\wamp\ihris>bzr co lp:~intrahealth+informatics/ihris-common/main ihris-common
C:\wamp\ihris>bzr co lp:~intrahealth+informatics/ihris-manage/main ihris-manage

Apache

We'll need to set up a few aliases for Apache. In Emacs, open up a new file and put the following in it:

Alias /iHRIS/ "c:/wamp/ihris/ihris-manage/sites/Demo/pages/" 

<Directory "c:/wamp/ihris/ihris-manage/sites/Demo/pages/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order allow,deny
    Allow from all
</Directory>

(You could also do this from within the WAMP tray applet, but this way allows more flexibility.)

Visit http://localhost/iHRIS/ in your browser to see if you changes have taken effect. If you get an empty page or a "Page not Found" message, then you'll need restart Apache.

MySQL Database

Point your browser to http://localhost/phpmyadmin/ and select "Privileges". Click "Add a new User" and add a user with the username "i2ce" and a password you can remember (You'll need it shortly).

Click "Databases" and select the newly created "i2ce" database.

Go to "Import" and, under "File to import", click "Browse". Select the file at c:/wamp/ihris/i2ce/I2CE_structure.sql and then click "Go". This will create the necessary database structure.

Configure ihris-manage

Open c:/wamp/ihris/ihris-manage/sites/Demo/pages/config.inc.php in emacs and look for the line that begins with $i2ce_config['db']['dsn'] and change it to read:

$i2ce_config['db']['dsn'] = 'mysql://'. $db_user . ':' . $db_pass . '@unix(/var/run/mysqld/mysqld.sock)/i2ce';

Look for $db_user and $db_pass at the top of the file and set them to the correct values.

php.ini

Edit c:\wamp\php\php.ini and make sure that the memory_limit setting is at least 16m.

Edit c:\wamp\Apache2\bin\php.ini and make sure that the include_path setting has c:\wamp\php\pear on the end. Also uncomment the following line:

;extension=php_gettext.dll

Install PEAR modules

Change to the c:\wamp\php\ and set up PEAR by typing "go-pear". After it is set up, install the necessary modules like this:

c:\wamp\php>pear install Text_Password
c:\wamp\php>pear install MDB2_Driver_mysql
c:\wamp\php>pear config-set preferred_state beta
c:\wamp\php>pear install i18nv2
Personal tools