I have a multi-module application. It works perfect on my Windows 8 dev-machine (nginx, php-fastcgi), but when I uploaded it to the production server (ubuntu, php-fpm) Phalcon seems to not load namespaces correctly. While I am on the production server, I can add the namespaces in the "registerNamespaces" method, then it seems to work OK. Why does it not load the namespaces from the modules? Any hints of where to start troubleshooting?
First error message:
Array ( [type] => 1 [message] => Class 'KitCloud\Module\Core\Controller\BaseController' not found [file] => /var/www/kit/kitcloud/dev/module/dashboard/controller/IndexController.php [line] => 5 )
When I add the following in my loader.php registerNamespaces method that error is replaced by another one.
'KitCloud\Module\Core\Controller' => $config->application->moduleDir.'/core/controller/',
Phalcon version: 1.3.2
Bootstrap:
$application = new \Phalcon\Mvc\Application($di);
$application->registerModules(\KitCloud\Module\Core\Helper\Misc::object_to_array($config->application->modules));
echo $application->handle()->getContent();
Modules array from config:
'modules' => array(
'core' => array(
'className' => 'KitCloud\Module\Core\Module',
'path' => '../module/core/Module.php',
'title' => _('Core')
),
'dashboard' => array(
'className' => 'KitCloud\Module\Dashboard\Module',
'path' => '../module/dashboard/Module.php',
'title' => _('Dashboard')
),
)
Module.php:
public function registerAutoloaders()
{
$loader = new Loader();
$loader->registerNamespaces(
array(
'KitCloud\Module\Core\Controller' => '../module/core/controller/',
'KitCloud\Module\Core\Model' => '../module/core/model/',
'KitCloud\Module\Core\Helper' => '../module/core/helper/',
)
);
$loader->register();
}