Skip to content

Instantly share code, notes, and snippets.

@jlleblanc
Created March 12, 2012 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlleblanc/2024800 to your computer and use it in GitHub Desktop.
Save jlleblanc/2024800 to your computer and use it in GitHub Desktop.
eval() is evil, but sometimes evil wins...
<?php
public function get_old_joomla_config()
{
if (!isset($this->old_config)) {
$path = JPath::clean($this->path);
$old_config = file_get_contents($path . '/configuration.php');
$old_config = JString::str_ireplace('JConfig', 'JConfigold', $old_config);
$old_config = JString::str_ireplace('<?php', '', $old_config);
// Yes, I know. eval() is evil. Goats have been sacrificed to bring
// you this code. I promise not to use it again for a long, long time.
eval($old_config);
$this->old_config = new JConfigold;
}
return $this->old_config;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment