Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Adjustments to JCli::fetchConfigurationData #302

Merged
merged 1 commit into from

2 participants

@LouisLandry

Allow CLI apps to better handle default situations and not explicitly require JPATH_BASE
to be defined.

@LouisLandry LouisLandry Making some adjustments to the JCli fetchConfigurationData method to
better handle default situations and not explicitly require JPATH_BASE
to be defined.
9c97450
@eddieajau eddieajau merged commit 9542398 into joomla:staging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 27, 2011
  1. @LouisLandry

    Making some adjustments to the JCli fetchConfigurationData method to

    LouisLandry authored
    better handle default situations and not explicitly require JPATH_BASE
    to be defined.
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 12 deletions.
  1. +16 −12 libraries/joomla/application/cli.php
View
28 libraries/joomla/application/cli.php
@@ -261,22 +261,26 @@ public function set($key, $value = null)
*/
protected function fetchConfigurationData()
{
- // Set the configuration file name.
- $file = JPATH_BASE . '/configuration.php';
+ // Instantiate variables.
+ $config = array();
- // Import the configuration file.
- if (!is_file($file))
+ // Handle the convention-based default case for configuration file.
+ if (defined('JPATH_BASE'))
{
- return false;
- }
- include_once $file;
+ // Set the configuration file name and check to see if it exists.
+ $file = JPATH_BASE . '/configuration.php';
+ if (is_file($file))
+ {
+ // Import the configuration file.
+ include_once $file;
- // Instantiate the configuration object.
- if (!class_exists('JConfig'))
- {
- return false;
+ // Instantiate the configuration object if it exists.
+ if (class_exists('JConfig'))
+ {
+ $config = new JConfig();
+ }
+ }
}
- $config = new JConfig();
return $config;
}
Something went wrong with that request. Please try again.