Created
March 12, 2012 21:30
-
-
Save jlleblanc/2024800 to your computer and use it in GitHub Desktop.
eval() is evil, but sometimes evil wins...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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