CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Multisite Install and $_SERVER['SCRIPT_FILENAME'] vs $cmsPath
Pages: [1]

Author Topic: Multisite Install and $_SERVER['SCRIPT_FILENAME'] vs $cmsPath  (Read 1267 times)

Bairnsfather

  • Guest
Multisite Install and $_SERVER['SCRIPT_FILENAME'] vs $cmsPath
March 22, 2009, 11:14:14 am
Over here at this post:  http://forum.civicrm.org/index.php/topic,6927.0.html

I found out why there were some problems in a multisite install, the installer wanted to install in the default folder vs. the site-specific folder.  There was still an issue, which I patched.

Basically without my patch the civicrm.settings.php was still created in the default folder instead of the specific site folder.

What I did was to replace $_SERVER['SCRIPT_FILENAME'] with $cmsPath in install/civicrm.php and that caused civicrm.settings.php to be installed in the correct site-specific folder.

This left me wondering, "What about other occurrences of $_SERVER['SCRIPT_FILENAME'] where $cmsPath should be used?"  So I did an exhaustive search in civicrm 2.2 and found it was used in two other files, in four places:


File "/sites/all/modules/civicrm/CRM/Utils/REST.php"; Line 262:              $apiPath = substr( $_SERVER['SCRIPT_FILENAME'] , 0 ,-15 );
File "/sites/all/modules/civicrm/install/index.php"; Line 48:  $crmPath = dirname ( dirname( $_SERVER['SCRIPT_FILENAME'] ) );
File "/sites/all/modules/civicrm/install/index.php"; Line 56:      if ( ! preg_match('/sites.[a-zA-Z0-9_.]+.modules/', $_SERVER['SCRIPT_FILENAME']) ) {
File "/sites/all/modules/civicrm/install/index.php"; Line 594:          return dirname($_SERVER['SCRIPT_FILENAME']) . DIRECTORY_SEPARATOR;


I can't quite deconstruct these to know which, or any, of them should be changed too.  Advice out there from those in-the-know would be awesome!


Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Multisite Install and $_SERVER['SCRIPT_FILENAME'] vs $cmsPath
March 23, 2009, 06:07:00 am
Check my reply here - http://forum.civicrm.org/index.php/topic,6927.0.html.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Multisite Install and $_SERVER['SCRIPT_FILENAME'] vs $cmsPath

This forum was archived on 2017-11-26.