Answer the question
In order to leave comments, you need to log in
How to gradually transfer a self-written project to Phalcon?
Now there is a self-written project running on a bundle of PHP 5.3 + Mysql + Nginx + Apache,
I understand that it was necessary to switch to the framework for a long time, but this opportunity has appeared only now, tell me if it is possible not to immediately rewrite everything on Phalcon, but gradually start switching to it and how to do it right.
What additional technologies/components will be required.
Answer the question
In order to leave comments, you need to log in
At the moment, we are rewriting two projects from the under-framework to the Falcon. Everything happens gradually. In the main index.php file, there is a check - something like -
if (\Rapid\Migration::isPhalconRoute($_SERVER['REQUEST_URI'])) {
// то этот рут, обрабатывает фалкон.
}
/**
* Detects phalcon routes by uri
*
* @param $uri
* @return bool
*/
public static function isPhalconRoute($uri)
{
// Refactoring to phalcon (1:1 routes)
$phalconUris = array(
'/categories',
'/counter/itemhit',
'/counter/videohit',
'/counter/bloghit',
'/statistic/sales_views',
'/statistic/receive_vat',
'/contacts',
'/gallery',
'/blog',
'/pages',
'/users/login',
'/users/registration',
....
....
foreach ($phalconUris as $p_uri) {
if (strpos($uri, $p_uri) !== false) {
return true;
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question