I use these funtions to autoload my filter classes folder:
set_include_path(implode(PATH_SEPARATOR, BASE_PATH.'/protected/core/filter'));
spl_autoload_register();
In the filter folder has these files:
-CFilter.php
-CFilterChain.php
-CFilerChainImp.php
-CTTMvcFilter.php
CFilterChain is a interface and CFilterChainImp implemented it. CFilter is an interface and CTTMvcFilter implemented it. The problem is this is will autoload fine if I run the code in XAMPP on windows. But can't run on linux such as Ubuntu 14.04. It will load CFilterChainImp before CFilterChain or otherwise it load classes before interfaces. So it will say that CFilterChain interface or CFilter interface not found because of its loading after classes CFilerChainImp and CTTMvcFilter. How can I auto load them but with interfaces first and then the classes.
Thank you so much!
Update: I have had a typo mistake before, I have edited the question to make it right.
CFIlter.php
Is this supposed to be CFIlter.php
or CFilter.php
? (Capitalization on the I
is different.) If the capitalization of the file name doesn't match the class name, it won't be loadable on Linux, because Linux is case-sensitive, whereas Windows is not.