Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepereiradasilva committed Jan 2, 2017
1 parent 68a179f commit 8dcfdef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 0 additions & 4 deletions libraries/joomla/language/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,12 +421,8 @@ public static function parseIniFile($fileName, $debug = false)
if ($debug === true)
{
ini_set('track_errors', $trackErrors);

// @todo: the debug language should use the main debug like any other object
JFactory::getLanguage()->debugFile($fileName);
}

return is_array($strings) ? $strings : array();
}
}

18 changes: 13 additions & 5 deletions libraries/joomla/language/language.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function __construct($lang = null, $debug = false)
$this->metadata = $this->getMetadata($this->lang);
$this->setDebug($debug);

$this->override = JLanguageHelper::parseIniFile(JPATH_BASE . '/language/overrides/' . $lang . '.override.ini', $this->debug);
$this->override = $this->parse(JPATH_BASE . '/language/overrides/' . $lang . '.override.ini', $this->debug);

// Look for a language specific localise class
$class = str_replace('-', '_', $lang . 'Localise');
Expand Down Expand Up @@ -774,7 +774,7 @@ protected function loadLanguage($filename, $extension = 'unknown')
$this->counter++;

$result = false;
$strings = JLanguageHelper::parseIniFile($filename, $this->debug);
$strings = $this->parse($filename, $this->debug);

if ($strings !== array())
{
Expand All @@ -801,11 +801,19 @@ protected function loadLanguage($filename, $extension = 'unknown')
* @return array The array of parsed strings.
*
* @since 11.1
* @deprecated __DEPLOY_VERSION__ Use JLanguageHelper::parseIniFile() instead.
*/
protected function parse($fileName)
{
return JLanguageHelper::parseIniFile($fileName, $this->debug);
$strings = JLanguageHelper::parseIniFile($fileName, $this->debug);

// Debug the ini file if needed.
// @todo Debugging an ini file should not be coupled with the language object
if ($this->debug === true && file_exists($fileName))
{
$this->debugFile($fileName);
}

return $strings;
}

/**
Expand All @@ -817,7 +825,7 @@ protected function parse($fileName)
*
* @since 3.6.3
* @throws InvalidArgumentException
* @todo: the debug language should use the main debug like any other object
* @todo Debugging an ini file should not be coupled with the language object
*/
public function debugFile($filename)
{
Expand Down

0 comments on commit 8dcfdef

Please sign in to comment.