Welcome Guest, Not a member yet? Register   Sign In
__autoload and CI
#1

[eluser]nourdine[/eluser]
I am trying to do some autoloading to avoid using include_once all the time in my classes but it looks like it breaks CI. I added to index.php this snippet:

Code:
set_include_path(get_include_path() . PATH_SEPARATOR .
                  realpath("./application/bean/form/") . PATH_SEPARATOR .
                  realpath("./application/validation/"));

function __autoload($class) {
  include $class . ".php";
}

and it really pisses CI off! Any idea how I can do this?

thanks
#2

[eluser]theprodigy[/eluser]
Quote:and it really pisses CI off!

What kind of error messages are you receiving? How is it "pissing of" CI?
#3

[eluser]nourdine[/eluser]
Code:
Warning: include(CI_Exceptions.php) [function.include]: failed to open stream: No such file or directory in /blablabla/index.php on line 8

looks like I destroy his own way of including stuff.

cheers
#4

[eluser]misplacedme[/eluser]
When you use the autoload function, that function is being called for the core classes, as well as the individual classes you've already created.




Theme © iAndrew 2016 - Forum software by © MyBB