Created
June 13, 2012 16:38
-
-
Save croxton/2925181 to your computer and use it in GitHub Desktop.
Rewrite and extend the Loader class on the fly, to make some useful properties public again
This file contains hidden or 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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
/** | |
* Rewrite and extend the Loader class on the fly, to make some useful properties public again | |
* | |
* @package CodeIgniter | |
* @author Mark Croxton ([email protected]) | |
* @copyright Copyright (c) 2012 Hallmark Design | |
* @link http://hallmark-design.co.uk | |
*/ | |
if ( ! class_exists('CI_Loader2')) | |
{ | |
$loader2 = file_get_contents(BASEPATH.'core/Loader.php'); | |
$loader2 = str_replace('protected $_ci_cached_vars', 'public $_ci_cached_vars', $loader2); | |
$loader2 = str_replace('protected $_ci_classes', 'public $_ci_classes', $loader2); | |
$loader2 = str_replace('class CI_Loader', 'class CI_Loader2', $loader2); | |
$loader2 = str_replace('<?php', '', $loader2); | |
eval($loader2); // can you hear those kittens screaming? | |
} | |
// extend our rewritten and renamed class | |
class CI_Loader extends CI_Loader2 { | |
/** | |
* Constructor | |
*/ | |
function __construct() | |
{ | |
parent::__construct(); | |
} | |
} | |
/* End of file Loader.php */ | |
/* Location: ./application/core/Loader.php */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment