I have an extension that is using autoloader to import helpers.
Everything works well in localhost development environment but in the live server the classes are not loaded. I get the error "Fatal error: Class 'MYExtensionText' not found"
1) In components/com_myextension/myextension.php
I have this code:
JLoader::import('MYExtension', __DIR__ . '/helpers');
2) In components/com_myextension/helpers/myextension.php
I have this code:
JLoader::discover('MYExtension', __DIR__);
JLoader::registerPrefix('MYExtension', __DIR__);
3) So, I expect that this classes are autoloaded in components/com_myextension/helpers/
myextension.php / MYExtension
text.php / MYExtensionText
model/list.php / MYExtensionModelList
This WORKS FINE in localhost (mamp with php 5.5) but does not work in the server, using CentOS 5 with php 5.4.
Any ideas?
var_dump(__DIR__);
tocomponents/com_myextension/myextension.php
on both your localhost and live host. Would like to know if the results are the same – Lodder Aug 12 '15 at 10:41__DIR__
withJPATH_ROOT . '/components/com_myextension/helpers/'
– Lodder Aug 12 '15 at 14:30