Пример #1
0
    } else {
        if ($count == 0 && !empty($zero)) {
            return $zero;
        } else {
            if ($count == 0 && empty($zero)) {
                return $one;
            } else {
                return $many;
            }
        }
    }
});
$params = Bootstrap::$bag['config']->getDatabase();
$dsn = Config::get('database.adapter', 'mysql') . ":dbname=" . Config::get('database.dbname', SITE_NAME) . ";host=" . Config::get('database.host', 'localhost');
$params->setDsn($dsn);
Entitydb::$driver = Kvdb::instance($params);
context('nosql')->orm(function ($entity) {
    $args = func_get_args();
    $ns = isset($args[1]) ? $args[1] : 'core';
    $ns = !is_string($ns) ? 'core' : $ns;
    if (is_string($entity) && is_string($entity)) {
        static $i = array();
        $db = isAke($i, $entity, null);
        if (is_null($db)) {
            $i[$entity] = $db = new Redistorage($entity, $ns);
        }
        return $db;
    }
});
$core->route(function (Container $route) {
    $routes = container()->getRoutes();
Пример #2
0
if (false === $isAuth && true === context()->isPost()) {
    $login = $request->getLogin();
    $password = $request->getPassword();
    if (!is_null($login) && !is_null($password)) {
        $count = $dbAuth->where("login = {$login}")->where('password = '******'Wrong credentials.';
    }
}
if (true === $isAuth) {
    $session->setAuth($isAuth);
    Entitydb::tables();
    $action = $request->getAction();
    $action = is_null($action) ? 'home' : $action;
    $dbTable = container()->ebm('ema_table');
    $tables = $dbTable->fetch()->order(array('name', 'ns'))->exec();
    $ema = new Ema();
    $content = $ema->content($action, $tables);
}
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>entityMyAdmin</title>
        <link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.css" media="screen" rel="stylesheet" type="text/css" />
        <link href="http://fonts.googleapis.com/css?family=Oswald:400,300,700|Questrial:400,300,700,900,600&amp;subset=latin,latin-ext" rel="stylesheet" type="text/css" />