Good time of day. Faced such a problem - autoload composera does not work on hosting. Or rather the mapping that I asked in composer.json:
"autoload": { "psr-0": { "Classes": "" } }
In the root directory there is a classes folder, and there they are further down in folders.
For example, there is code that runs on my local server:
$catalogClient = Classes\Models\CatalogClient::first('all', array( 'conditions' => array( 'userID = ?', $_SESSION['user_id'] ), 'order' => 'id desc' ));
On the local server, the composer finds a class by namespace, and on the hosting an error
Class 'Classes\Models\CatalogClient' not found
There is an idea that php composer.phar install
needs to be done on the hosting in order to generate the correct autoload. But the hoster prohibits the execution of phar archives. I do not think that full paths are generated and stitched in autoloade, as on my local one (like C: ......). Anyway, I'm not sure that this is the problem) And in what - I can not understand) Any ideas? :)
Ps. Tag "Composer", or "Autoload" unfortunately not (PPS. Tried even so
config / environment.php:
$loader = require_once __DIR__ . "/../vendor/autoload.php"; $loader->add('Classes', __DIR__ . '/../');
Well, that is in the loader to say that look for the Classes directory in such a directory .. But something is still wrong :(