Hi everybody, my team has just discovered that Autoloader works in different ways on different OS. Specifically we are developing locally on Mac OSX and Windows machines using MAMP and XAMPP.
At first I've started developing on Mac OSX without problems, later we have discovered that on Windows the Autoloader needs lowercase filenames so we have renamed every file and directory and it worked like a charm.
Now we have released the first version on our CentOS 7.1 beta server and we have sadly discovered that Autoloader is looking for CamelCase filenames.
I've found other people talking about this problem but seems that there is no cross-OS solution, if we rename each file and directory Windows developers won't be able to work locally using XAMPP.
We are thinking about extending Autoloader class forcing lowercase discovery as follows:
use Phalcon\Loader;
class YPJLoader extends Loader {
public function autoLoad($className) { parent::autoLoad(strtolower($className)); }
}
We have tried this but doesn't works, Autoloader can't find Class. Strange fact, if we use strtoupper it works under Windows. Anyone knows why? Any advice?
One more thing: I'm beginning to think that we should move from MAMP/XAMPP/LAMP to Vagrant and leave behind this problem, any advice? Pro & Cons?
Thank you in advance, any help would be appreciated
Carlo