How do file references within a PHP Objects work?

Posted by bender on Stack Overflow See other posts from Stack Overflow or by bender
Published on 2010-04-22T15:26:34Z Indexed on 2010/04/22 15:33 UTC
Read the original article Hit count: 276

Filed under:
|
|
|

I'm trying to create an PHP object that can load objects in other files on demand when needed. My problem is that when I reference the files based on file location for the class definition, it can not find the files. So file structure:

/Test.php

/os/os.php (extends kernel)

/os/kernel.php

/os/libraries/lib1.php

/os/libraries/lib2.php

/os/libraries/lib3.php

In kernel.php, the libraries are referenced as 'libraries/lib1.php'. If I create an "os" object in Test.php. The lib files are not found.

© Stack Overflow or respective owner

Related posts about php

Related posts about objects