Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-8918

CLI.php does not load needed configuration to fully support command line use, therefore fails on some configurations

    Details

    • Type: Patch
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 4.0.5
    • Fix Version/s: 4.1.0
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      CLi.php as currently coded does not fully support loading needed configuration for database info, site keys, etc. This problem is easily seen on multi-site installations.
      Please also reference a patch I have provided with a directly related issue in issue CRM-8917

      civicrm.config.php also does all the CIVICRM_CONFDIR handling. Therefore, it is inappropriate to check for drush. Instead, it should check for civicrm_conf_init.

      The patch is to change one line of code in cli.php and remove unneeded code.

      change line 109:
      Old code:
      if (! function_exists( 'drush_get_context' ) ) {
      New code:
      if (! function_exists( 'civicrm_conf_init' ) ) {

      Complete remove lines 117-121 (the following lines):
      if ( defined( 'CIVICRM_CONFDIR' ) )

      { $_SERVER['SCRIPT_FILENAME' ] = CIVICRM_CONFDIR . "/sites/all/modules/civicrm/bin/cli.php"; }

      else

      { die("\nUsage: Please define CIVICRM_CONFDIR in settings_location.php at the top level civicrm directory"); }

        Attachments

          Activity

            People

            • Assignee:
              mover Michał Mach
              Reporter:
              diablodale Dale Phurrough (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: