Welcome Guest, Not a member yet? Register   Sign In
Config File is Double Loading
#4

[eluser]fjamal[/eluser]
[quote author="InsiteFX" date="1341917574"]Here is a newer spl_autoload
Code:
/*
| -------------------------------------------------------------------------
| Native spl_autoload_register() - by Kenneth Vogt
| -------------------------------------------------------------------------
|
| Here is an updated version of Phil Sturgeon’s code:
|
| Thanks to Phil Sturgeon and Kenneth Vogt.
|
| NOTE:
| Requires PHP 5.3.+
| As of CI 3.0 Dev - The constant EXT has been removed modified
| to use '.php' now instead of EXT.
| should work for all version of CI and PHP 5.3
|
| Place at the bottom of your ./application/config/config.php file.
| -------------------------------------------------------------------------
*/
spl_autoload_register(function($class)
{
if (strpos($class, 'CI_') !== 0)
{
  if (file_exists($file = APPPATH . 'core/' . $class . '.php'))
  {
   include $file;
  }
  elseif (file_exists($file = APPPATH . 'libraries/' . $class . '.php'))
  {
   include $file;
  }
}
});
[/quote]

Thanks. Unfortunately, my host only supports PHP 5.2.*


Messages In This Thread
Config File is Double Loading - by El Forum - 07-10-2012, 12:05 AM
Config File is Double Loading - by El Forum - 07-10-2012, 12:38 AM
Config File is Double Loading - by El Forum - 07-10-2012, 03:52 AM
Config File is Double Loading - by El Forum - 08-01-2012, 03:50 PM
Config File is Double Loading - by El Forum - 08-01-2012, 04:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB