The situation: I have two environments: my local dev machine (Dev), and my production server with Media Temple (Prod). I've installed Phalcon on both. Dev seems to be successfully running a very basic (1 controller) Phalcon site. However, Prod is having issues with the same code.
The problem:
I'm trying to convert non-camelcased controllers and actions to valid camelcased ones (e.g. "test-page" to "testPage"). This is working on Dev but not Prod. The error I'm receiving on Prod is:
php Warning: Invalid arguments supplied for camelize()
Using the following code:
$eventsManager->attach('dispatch', function ($event, $dispatcher) {
$controllerName = Phalcon\Text::camelize($dispatcher->getControllerName()); // Throwing an error here...
$dispatcher->setControllerName($controllerName);
$actionName = Phalcon\Text::camelize($dispatcher->getActionName()); // ... and here
$dispatcher->setActionName($actionName);
});
Looking at https://github.com/phalcon/cphalcon/blob/master/ext/kernel/string.c#L225 it looks like the camelize() function returns this error when the value is not a string.
The question(s): So this would mean that $dispatcher->getControllerName() is not returning a string?
Why would this be happening? What would cause this function return different types?