![]() |
Loader: do not load parent class after loading subclass - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19) +--- Thread: Loader: do not load parent class after loading subclass (/showthread.php?tid=65289) |
Loader: do not load parent class after loading subclass - tianhe - 05-25-2016 I encounter it while using CI->loader->library(XXX) with a subclass. I create a parent lib and a sub lib in different file. PHP Code: class Parent_lib { PHP Code: include_once('XXX'); It's OK when calling load->library('Sub_lib'). However, it will not load the Parent_lib when calling load->library('Parent_lib') somewhere after loading Sub_lib. In my opinion, it's better to check a duplicate loading just in _ci_init_library mothed. PHP Code: if (class_exists($class, FALSE)) change to PHP Code: if (class_exists($class, FALSE)) I have tried to fix it also with unittest, but there is no issue accociated with it.(https://github.com/bcit-ci/CodeIgniter/compare/develop...tianhe1986:develop_library_inheritance?expand=1) Could it be assigned to me after it is confirmed to be a bug? Forgive my poor English, maybe, Chinglish(Chinese English.) RE: Loader: do not load parent class after loading subclass - Narf - 05-25-2016 You're inventing a new mechanism, based solely on your own preferences ... that's not a bug. RE: Loader: do not load parent class after loading subclass - tianhe - 05-25-2016 (05-25-2016, 05:33 AM)Narf Wrote: You're inventing a new mechanism, based solely on your own preferences ... that's not a bug. Thanks for your reminding ^_^ |