Skip to main content
Software View

Main navigation

  • Home
  • Trainer Profile
  • Blog
  • Contact
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Blog

Offline installation of Propel ORM tool (for PHP)

By Kamal Wickramanayake, 26 June, 2010

Linux users: The process is almost the same. See the bottom of this page.

Propel is a wonderful object-relational mapping (ORM) tool for PHP5. It can significantly bring down the amount of time you spend on persistence related coding in your PHP application. Propel is ideally installed using 'pear' command. Here you need your computer connected to the Internet during installation. Also you need to have sufficient privileges to run the 'pear' command to install Propel. The other way would be to download the Propel distribution and perform an offline installation as detailed below. Advantages:

  1. You need not have the computer connected to the Internet.
  2. You can do this even in a shared hosting environment without having system administrative privileges.

While I haven't tested, if you want only to deploy a Propel based PHP application (but not to run propel-gen command), you probably need not worry about most of the steps. I guess you only need the PHP files found inside propel-extracted-dir/runtime/classes. You might try by copying the entire content inside that directory (including 'propel' directory) into your application or copy to somewhere else and add the location to the php include path (either by editing the php.ini or by calling the set_include_path() method).

But you need to follow all the steps below if you want to run the 'propel-gen' command.

Versions of software used (Hopefully other versions might also work):

  1. Propel 1.4.2
    Download “Full Propel Package” from http://www.propelorm.org/
  2. Phing 2.4.1
    Download “Full Phing Package” from http://phing.info/
  3. XAMPP (win 32) 1.7.3
    Download from http://www.apachefriends.org/en/xampp.html . Linux users may not download XAMPP since Apache, MySQL, PHP installation using yum, apt-get or other package management software is much more convenient.

1. If you downloaded XAMPP, go about installing it. Selecting C:\ as the destination folder creates the C:\xampp directory at the end.

2. Create a new directory C:\php and extract Phing distribution to C:\php\phing.

3. Extract Propel distribution to C:\php\propel.

4. Go to My Computer -> Properties to edit environment variables.

5. Go to the environment variables section.

6. Go about creating a new system variable.

7. Define PHP_COMMAND variable as follows:

8. Define PHING_HOME variable:

9. Define PHP_CLASSPATH variable:

10. Go about editing the 'Path' environment variable.

11. Add '%PHING_HOME%\bin'

12. Also add 'C:\php\propel\generator\bin'

Now you can get a new command prompt and type the commands 'phing' and 'propel-gen'. They should work.

As said earlier, for PHP to locate the Propel related PHP files, edit the php.ini file or use the set_include_path() function to add C:/php/propel/runtime/classes to the PHP include path:

1. If you edit your php.ini, make the change like this (only add the last portion to the already existing value):

include_path = ".;c:\php\propel\runtime\classes"

2. If you use set_include_path() within PHP itself:

set_include_path(get_include_path().PATH_SEPARATOR."C:/php/propel/runtime/classes");

Linux users:

I have not tried offline installation of Propel on a Linux system. But I expect the following to work:

To set the environment variables, open and edit the /etc/profile file (or ~/.bash_profile if you want the commands only to be available for you, but not the other users). Add the following:

export PHP_COMMAND=/usr/bin/php
export PHING_HOME=/opt/php/phing
export PHP_CLASSPATH=/opt/php/phing/classes
export PATH=$PATH:$PHING_HOME/bin:/opt/php/propel/generator/bin

The above assumes that you extracted Phing and Propel distributions to the /opt/php directory. If you used a different directory, correctly mention the same.

Similar to the Windows case, go about editing the /etc/php.ini file or use set_include_path() function in you PHP scripts to add Propel classes to the PHP include path.
 

MySQL
PHP

Highlights

  • O'Reilly Book "97 Things Every Software Architect Should Know" Accepts A Write Up From Kamal
  • "Service Oriented Architecture - Making IT Infrastructure Speaks Business" - Presentation At The ISACA 4th Annual Conference
  • The Second Bacth Of ICTA Nanasala e-Society Members Receives Trainings On HTML/CSS and GIMP
  • GIMP Training For ICTA Nanasala Project
  • Agile Processes Training For PPSL (Pvt) Ltd
  • Computer Society of Sri Lanka (CSSL) - Talk on "Introduction to IT Governance and Enterprise Architecture"
  • Motorola Sends A Second Batch Through Software Patterns Training
  • Kamal To Act As The Marketing Director - ISACA Sri Lanka Chapter
  • ISACA Sri Lanka Chapter Invites Kamal To Join As A Board Member
  • Epic Lanka Technologies (Pvt) Ltd Receives Java SE And Java EE Trainings From Software View
  • Patterns Training For PPSL (Pvt) Ltd
  • ISACA Members Day Presentation On "Introduction To IT Governance And Enterprise Architecture"
  • Opening Lecture On Information Technology For SLIDA Master Of Public Management Course Delivered By Kamal
  • Customized Java Enterprise Edition Training For SLIDA
  • No One To Beat Software View - Epic Lanka Technologies (Pvt) Ltd
  • Motorola Receives Software Patterns Training From Software View
  • Custom Java Enterprise Edition Training for ICTA/SLIDA - Only from Software View!
  • Java EE 5, JavaServer Faces, Hibernate And Spring For PPSL (Pvt) Ltd
  • "Brain Trust" For Linux Journal Weekly Newsletter From Kamal
  • Java Platform, Enterprise Edition 5 Training At The CEIT, University Of Peradeniya
  • Another Group Of Around 100 Sri Lanka Telecom Engineers And Managers Were Service Oriented!
  • Java Platform, Enterprise Edition 5 Training Will Be Held At The CEIT, University Of Peradeniya
  • Service Oriented Architecture: Another Two Sessions Conducted at SLT
  • Photos of IET Monthly Forum at the Peradeniya University
RSS feed
Copyright © 2007 - 2023 Software View