Undefined property: CI_Loader::$theme after move from PHP4 -> PHP5 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Undefined property: CI_Loader::$theme after move from PHP4 -> PHP5 (/showthread.php?tid=14511) |
Undefined property: CI_Loader::$theme after move from PHP4 -> PHP5 - El Forum - 01-05-2009 [eluser]WanWizard[/eluser] I've been going though my code for the last few hours, but this issue got me baffled. I have a third party class that I use in my project. I have created a Theme.php file in my libraries directory, which loads this class, then defines the Theme class that extends this third party class: Code: // load the skin engine class This library is autoloaded in the config. The 3rd party class is PHP5 proof, I use it in other (non-CI) projects without problems. When running in PHP4 (4.3.11), I can do a $this->theme->render($template) without problems. A var_dump($this) tells me the class is instantiated just fine. When starting the exact same code in PHP5 (5.2.6), var_dump($this) tells me: Code: CI_Loader Object If I modify the Theme.php and remove the 'extends' bit, or load the original class without extending it, everything works fine. Is this a bug in CI? In PHP5? Or (more likely) did I do something stupid? Kind regards, WanWizard Undefined property: CI_Loader::$theme after move from PHP4 -> PHP5 - El Forum - 01-06-2009 [eluser]WanWizard[/eluser] Fixed the problem. Turned out that for some reason CI_BASE (in Base5.php) was instantiated twice, which ruined the result of get_instance(). Solution: Code: public function CI_Base() |