Upcoming Events

NYC CiviCRM Meetup - September 7th
September 7th, 2010
This next NYC meetup will feature a case study or 2, a look at what's new in (more...)

Configuring, Customizing and Extending CiviCRM - New York
September 16th, 2010
This comprehensive two-day hands on training course is targeted at (more...)

CiviCRM User and Administrator Training - New York
September 16th, 2010
A comprehensive two day hands on training course covering the configuration, (more...)

CiviCRM Code and Test Sprint - New York
September 18th, 2010
This code and test sprint is targeted at experienced developers who want to (more...)

CiviCRM Toronto Meetup
September 21st, 2010
Come meet others from the Toronto Area who are interested in, using or (more...)

CiviCRM Philly Meetup – September 2010
September 23rd, 2010
Come meet others from the Philadelphia Area who are interested in, using or (more...)

CiviCRM Seminar - Dublin
September 28th, 2010
NfP Services are hosting a free seminar at The IBOA, Stephen St Upper, Dublin 8 (more...)

London developer and implementer training
September 30th, 2010
This comprehensive two-day hands on training course is targeted at implementers, (more...)

London user and administrator training
September 30th, 2010
A comprehensive two day hands on training course covering the configuration, (more...)

Berlin user and administrator training
October 6th, 2010
A comprehensive one day hands on training course covering the configuration, (more...)

Berlin developer and implementer training
October 7th, 2010
This comprehensive one-day hands on training course is targeted at implementers, (more...)

Benelux meetup in Brussels: Connect, communicate and activate your supporters and constituents
October 11th, 2010
Come meet others who are interested in, using or developing for CiviCRM. For (more...)

CiviCRM Toronto Meetup
October 19th, 2010
Come meet others from the Toronto Area who are interested in, using or (more...)

CiviCRM Toronto Meetup
November 16th, 2010
Come meet others from the Toronto Area who are interested in, using or (more...)

CiviCRM Components

Tools for engaging your supporters...

CiviContribute


CiviEvent


CiviMail


CiviMember


CiviReport


CiviCRM 2.0 on Joomla 1.5 without Legacy Support

Not Just a Contact Database

These optional components give you more power to connect and engage your supporters.

  • civiEVENT

  • Online event registration and participant tracking.

  • civiMEMBER

  • Online signup and membership management.

  • civiMAIL

  • Personalized email blasts and newsletters.

  • civiREPORT

  • Report generation and template management.

February 27, 2008 - 10:46 — deepak

This article covers - how to install CiviCRM v2.0 on Joomla 1.5 without Legacy support. It also provides some insight into the way components are organized and accessed through Joomla.

This post is intended as exploratory and to help push things forward towards 1.5 compatibility which is planned for the 2.1 release. Please note that CiviCRM 2.0 is officially NOT COMPATIBLE with Joomla 1.5 and that the CiviCRM team will not provide support for folks trying to run this combination.

 

For Joomla, CiviCRM is nothing but a component. When the component is loaded from the front end (doesn't require admin login), Joomla looks for a file with the component's name ending in .php file (civicrm.php in this case). Similarly if the component is loaded from the back end (admin area), Joomla looks for a file with the name like admin.componentName.php (admin.civicrm.php in our case).

If you extract the CiviCRM tarball, you can see both the files present in the list:

 admin.civicrm.php
 civicrm/
 civicrm.html.php
 civicrm.php
 civicrm.xml
 configure.php
 install.civicrm.php
 toolbar.civicrm.php
 uninstall.civicrm.php

 

XML component installation files

  • For the most part, XML component installation files for Joomla 1.5 are similar to the ones used in 1.0. For the installation and uninstallation queries, the SQL is now migrated to external files, with the flexibility of including different SQL files for different database types.

    And since, CiviCRM handles all the installation and un-installation operations from configure.php, which is called via admin.civicrm.php (in 2.0), limited set of changes are required in civicrm.xml file.

    Changes required in civicrm.xml file

    1. Replace tags <mosinstall> and </mosinstall> with <install> and </install> tags respectively.

    2. Add version attribute to <install> tag, for e.g <install type="component" version=”2.0”>

  • The back-end code is now sorted into a separate folder that you can specify in the folder parameter of the <files> tag in the <administration> section.

    Changes required in CiviCRM package structure:
    1. Create a new directory say admin, where we should move the back-end code.
    So the new package structure would look like:

     admin/
     civicrm.html.php
     civicrm.php
     civicrm.xml

    Where listing of admin directory would display:

     admin.civicrm.php
     civicrm/
     configure.php
     install.civicrm.php
     toolbar.civicrm.php
     uninstall.civicrm.php

    Changes required in civicrm.xml file
    The following section:

    <administration>
    ....
    ....
    <files>
    <filename>admin.civicrm.php</filename>
    <filename>toolbar.civicrm.php</filename>
    <filename>install.civicrm.php</filename>
    <filename>uninstall.civicrm.php</filename>
    <filename>configure.php</filename>
    . . . . . .
    . . . . . .
    </files>
    ....
    ....
    </administration>

    Should now look like :

    <administration>
    ....
    ....
    <files folder=”admin”>
    <filename>admin.civicrm.php</filename>
    <filename>toolbar.civicrm.php</filename>
    <filename>install.civicrm.php</filename>
    <filename>uninstall.civicrm.php</filename>
    <filename>configure.php</filename>
    . . . . . .
    . . . . . .
    </files>
    ....
    ....
    </administration>

 

Security fixes

  • Joomla 1.5 no longer support accessing variables like $mosConfig_absolute_path, $mosConfig_user through global environment, for e.g :
      include( $mosConfig_absolute_path . '/components/com_yourcomponent/yourcomponent.class.php' );

    And rather encourages to use constants like:

      define( 'YOURBASEPATH', dirname(__FILE__) );
      require_once( YOURBASEPATH . '/file_to_include.php' );

    Joomla 1.5 now allows access to these variables through object of JConfig class.
    Refer http://dev.joomla.org/component/option,com_jd-wiki/Itemid,31/id,tips:make_secure/ for details.

  • Changes in admin.civicrm.php file
    After applying changes, the following lines :

     if ( ! file_exists( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'civicrm.settings.php' ) ) {
      global $mosConfig_absolute_path;
      $path =
       $mosConfig_absolute_path . DIRECTORY_SEPARATOR .
       'administrator' . DIRECTORY_SEPARATOR .
       'components' . DIRECTORY_SEPARATOR .
       'com_civicrm' . DIRECTORY_SEPARATOR ;

      require_once $path . 'configure.php';
     }

    would look like :

     define( 'COM_PATH', dirname(__FILE__) );
     if ( ! file_exists( COM_PATH . DIRECTORY_SEPARATOR . 'civicrm.settings.php' ) ) {
      require_once COM_PATH . DIRECTORY_SEPARATOR . 'configure.php';
     }

  • Similarly for file configure.php, the following lines:

     global $mosConfig_user, $mosConfig_password, $mosConfig_host, $mosConfig_db;
     $dsn = 'mysql://' .
      $mosConfig_user . ':' .
      $mosConfig_password . '@' .
      $mosConfig_host . '/' .
      $mosConfig_db .
      '?new_link=true';

    would look like:

     $jConfig = new JConfig( );
     define( 'DSN', 'mysql://' .
      $jConfig->user . ':' .
       $jConfig->password . '@' .
       $jConfig->host . '/' .
       $jConfig->db .
       '?new_link=true' );

  • The corrected version of both the files - admin.civicrm.php and configure.php, can be seen at : admin.civicrm.php, configure.php

 

After having changed these three files - admin.civicrm.php, configure.php and civicrm.xml, we are ready with the package which can be installed on Joomla 1.5, without legacy support.
Also make sure variable '$live_site' is set in joomla/configuration.php before you begin with the installation.

 

Note: All The changes shown, are the minimal set of changes required to install CiviCRM without legacy support. There could be many improvements, most of which is expected to be seen with CiviCRM v2.1.

 

( categories: )

Comments

successful install beta3 on J1.5.6

I installed on Joomla 1.5.6 the current civiccrm-2.1-beta3 today. All went smooth using the install via upload of the zip file. I have done a very quick looksee of the component home/admin and done a few prelims as shown in install instructions, all seems aok. I am certainly not a developer, just a very avg user yet it installed nicely. This is a very good thing of which you should be proud. I wonder if there is any other tutorial instead of the tutorial videos? My system doesn't show them at all, just a blank screen? hmmm? I would appreciate info on developing civimembers mostly as I begin to learn it.
thanks much,
PapaLion

a little hesitant here

your corrected version of configure.php appears significantly different than the configure.php included in the 2.0.2 zip for Joomla, so I am a little lost on that last correction. Is this for a previous version of 2.0? Thanks!!

looks correct

Don't think configure.php has gone under any changes in v2.0 sub-revisions (2.0.x).
So should work for any 2.0.x version as long as there hasn't been any changes in the file

Significant changes are result of avoiding the use of global. Check http://dev.joomla.org/component/option,com_jd-wiki/Itemid,31/id,tips:make_secure/ for more details.

Works Great!

Thanks for that, worked straight up!

Awesome!

I am so psyched, thanks so much for documenting this!

Elin