summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-10-17 04:31:06 +0200
committeradmin <devnull@localhost>2006-10-17 04:31:06 +0200
commit30578eadecee1b7fd96e82b17100bba5347d362e (patch)
tree47fa59c191f36b9b2377e04acccd0e0e1f26f15c /system/libraries
parent9a661810d2b9b96c458c1f369f0059b31012b6a8 (diff)
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Loader.php23
1 files changed, 20 insertions, 3 deletions
diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php
index b402464e2..336caf7dd 100644
--- a/system/libraries/Loader.php
+++ b/system/libraries/Loader.php
@@ -592,8 +592,24 @@ class CI_Loader {
}
ob_start();
+
+ // If the PHP installation does not support short tags we'll
+ // do a little string replacement, changing the short tags
+ // to standard PHP echo statements.
+ if (ini_get("short_open_tag") == 0)
+ {
+ $file = file_get_contents($path);
+
+ $file = str_replace('<?=', '<?php echo', $file);
+ $file = preg_replace("/;*\s*\?>/", " ;?>", $file);
+
+ echo eval('?>'.$file.'<?php ');
+ }
+ else
+ {
+ include($path);
+ }
- include($path);
log_message('debug', 'File loaded: '.$path);
// Return the file data if requested to
@@ -700,11 +716,12 @@ class CI_Loader {
* @param string
* @return null
*/
- function _ci_init_class($class, $prefix = '', $config = NULL)
+ function _ci_init_class($class, $prefix = '', $config = FALSE)
{
// Is there an associated config file for this class?
- if ($config === NULL)
+ if ($config !== NULL)
{
+ $cong = NULL;
if (file_exists(APPPATH.'config/'.$class.EXT))
{
include_once(APPPATH.'config/'.$class.EXT);