Ejemplo n.º 1
0
    $crypt = new \Phalcon\Crypt();
    $crypt->setCipher('blowfish');
    $crypt->setKey('vmS"TG<');
    return $crypt;
}, true);
/**
 * Start the session the first time some component request the session service
 */
$di->setShared('session', function () {
    $session = new SessionAdapter();
    $session->start();
    return $session;
});
$di->set('cookie', function () {
    $cookies = new Cookies();
    $cookies->useEncryption(true);
    return $cookies;
}, true);
$di->setShared('logger', function () use($config) {
    $logger = new Phalcon\Logger\Adapter\File($config->application->logDir . 'application.log');
    return $logger;
});
$di->setShared('flashSession', function () {
    $flash = new Phalcon\Flash\Session();
    $flash->setCssClasses(array('error' => 'alert alert-danger', 'success' => 'alert alert-success', 'warning' => 'alert alert-warning', 'notice' => 'alert alert-info'));
    return $flash;
});
$di->setShared('user', function () {
    return $user = (new Auth())->authByCookie();
});
$di->setShared('acl', function () {