Hi all,
I want to understand about the shared service In my application, I created many services as: security, view, db, logger, escaper,flash, modelCache,...
But,
In all requests, Phalcon always executes all services as above, both shared and not shared services
So, How about the performance?
For example:
$di->set('security', function() {
var_dump(0);
$security = new Phalcon\Security();
$security->setWorkFactor(12);
return $security;
} , true);
Each request, always var_dump(0) is execute
Another example:
$di->set("db", function() use ($config) {
var_dump(0);
return new \Phalcon\Db\Adapter\Pdo\Mysql(array(
"host" => $config->host,
"username" => $config->username,
"password" => $config->password,
"dbname" => $config->name
));
}, true);
In this examle, Each request, var_dump(0) still executes. So, Phalcon will create a connnect to DB??????
Please give for me a explanation
Thank you and have a nice day