本文整理汇总了PHP中runner::now方法的典型用法代码示例。如果您正苦于以下问题:PHP runner::now方法的具体用法?PHP runner::now怎么用?PHP runner::now使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类runner
的用法示例。
在下文中一共展示了runner::now方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
$debug = 1;
$url = \bootstrap::get("url");
$backend_uri = false;
$backend_session = false;
$code = false;
//backend_mode($backend_uri, $backend_session, $code);
?>
<body class="page-md page-header-top-fixed">
<div class="backend-wrapper">
<?php
\runner::route('/backend/frame/header');
?>
<!-- BEGIN CONTAINER -->
<div class="page-container row container-fluid container-margin">
<h1>User settings</h1>
<?php
if (\runner::now("subpage")) {
\runner::route(\runner::now("subpage"));
}
?>
</div>
</div>
</body>
示例2: array
* Time: 11:35
*/
/*
// model parameters
$model = "menu";
$from = "cs_menu";
$select = array("label");
$where = array("cs_menu_id > ?" => 1);
$orderBy = 'cs_menu_id DESC';
$limit = 5;
// SQL
$SQL = "SELECT label FROM cs_menu ORDER BY cs_menu_id";
*/
$from = 'e_campaign';
$leftJoin = array('e_cron ON e_cron.campaign = e_campaign.id');
$select = array('primary_key' => "CONCAT(CAST(e_campaign.id AS char(128)), '-', CAST(COALESCE(e_cron.id, 0) AS char(128)))", 'id' => 'COALESCE(e_cron.id, 0)', 'campaign_id' => 'e_campaign.id', 'active' => 'e_campaign.active', 'sent' => "COALESCE((SELECT COUNT(DISTINCT d.id) FROM e_delivered AS d WHERE d.cron_id = e_cron.id), 0)", 'to_send' => "COALESCE((SELECT COUNT(DISTINCT s.email) FROM e_subscriber AS s WHERE s.unsubscribe IS NULL AND CONCAT(',',e_campaign.category,',') LIKE CONCAT('%,',s.category,',%')), 0) - COALESCE((SELECT COUNT(DISTINCT d.id) FROM e_delivered AS d WHERE d.cron_id = e_cron.id), 0)", 'test_address' => "COALESCE(e_cron.test_address, '')", 'limit_per_period' => 'COALESCE(e_cron.limit_per_period, 100)', 'period' => 'COALESCE(e_cron.period, 3600)', 'start' => 'e_cron.start', 'finish' => 'e_cron.finish');
$SQL = "SELECT id FROM e_cron WHERE start IS NOT NULL AND finish IS NULL";
\runner::now("e_cron_running", false);
//$orderBy = \Routerunner\Routerunner::BY_TREE;
if (isset($_GET["campaign_search"])) {
$where = array("label LIKE :like OR category LIKE :like OR mail_html LIKE :like" => '%' . $_GET["campaign_search"] . '%');
} elseif ($result = \db::query($SQL)) {
$where = array("e_cron.id = :id" => $result[0]["id"]);
\runner::now("e_cron_running", $result[0]["id"]);
} else {
$where = array("active = '1'" => null);
$limit = 50;
}
$orderBy = 'COALESCE(e_cron.id, 0) DESC, e_campaign.id DESC';
$primary_key = 'primary_key';
$force_list = true;
示例3:
<ul class="nav navbar-nav pull-right">
<li class="droddown dropdown-separator">
<span class="separator"></span>
</li>
<?php
\runner::route("languages");
?>
<li class="droddown dropdown-separator">
<span class="separator"></span>
</li>
<?php
\runner::route("usermenu");
?>
</ul>
</div>
<!-- END TOP NAVIGATION MENU -->
<?php
\runner::route('/backend/panel/menu');
?>
</div>
</div>
<!-- END HEADER MENU -->
<?php
if (\runner::now("page") == "editor") {
\runner::route('editor');
}
?>
</div>
<!-- END HEADER -->
示例4: __construct
public function __construct($route = null, $context = array(), $override = null, $root = false)
{
$route = str_replace('/', DIRECTORY_SEPARATOR, $route);
$this->rid = uniqid('', true);
if (substr($route, 0, 1) == '~' || substr($route, 0, 2) == '/~') {
$root = \runner::config("scaffold");
$route = str_replace('~', '', $route);
if (strpos($route, '@') !== false) {
$redirect_to = substr($route, strpos($route, '@') + 1);
if (strpos($redirect_to, '?')) {
$redirect_to = substr($redirect_to, 0, strpos($redirect_to, '?'));
}
\runner::now("redirected-subpage", $redirect_to);
$route = DIRECTORY_SEPARATOR . trim(substr($route, 0, strpos($route, '@')), DIRECTORY_SEPARATOR);
}
}
if (substr($route, 0, 1) == '@' || substr($route, 0, 2) == '/@') {
$root = \runner::config("BACKEND_DIR") . DIRECTORY_SEPARATOR . 'scaffold';
$route = str_replace('@', '', $route);
}
$this->parent = \Routerunner\Routerunner::getParentInstance(false);
if ($root && file_exists(realpath(\runner::config('SITEROOT') . $root))) {
$this->scaffold_root = realpath(\runner::config('SITEROOT') . $root);
} elseif (strpos($route, \Routerunner\Helper::$scaffold_class) !== false) {
$this->scaffold_suffix = DIRECTORY_SEPARATOR . substr($route, 0, strpos($route, \Routerunner\Helper::$scaffold_class) + strlen(\Routerunner\Helper::$scaffold_class));
$route = substr($route, strpos($route, \Routerunner\Helper::$scaffold_class) + strlen(\Routerunner\Helper::$scaffold_class) + 1);
} elseif (isset($this->parent->scaffold_root) && $this->parent->scaffold_root) {
$this->scaffold_root = $this->parent->scaffold_root;
} elseif (isset($this->parent->scaffold_suffix) && $this->parent->scaffold_suffix) {
$this->scaffold_suffix = $this->parent->scaffold_suffix;
}
if ($this->scaffold_suffix) {
$this->scaffold_root = realpath(\runner::config('SITEROOT') . \runner::config('scaffold') . $this->scaffold_suffix);
}
if (!$this->scaffold_root) {
$this->scaffold_root = realpath(\runner::config('SITEROOT') . \runner::config('scaffold'));
}
if (substr($route, 0, 1) === DIRECTORY_SEPARATOR) {
$this->route = $route;
} elseif ($this->parent) {
$this->route = $this->parent->runner->path . $this->parent->runner->route . DIRECTORY_SEPARATOR . $route;
} else {
$this->route = DIRECTORY_SEPARATOR . $route;
}
if (\Routerunner\Helper::includeRoute($this, 'runner', \runner::config("version"))) {
// return valid Router with runner included
if (!empty($this->runner->cache_key)) {
$this->cache_route = str_replace(array('{$url}', '{$route}'), array(\Routerunner\Bootstrap::$baseUri, $this->runner->path . $this->runner->route), $this->runner->cache_key);
} else {
$this->cache_route = \Routerunner\Bootstrap::$baseUri . '|' . $this->runner->path . $this->runner->route;
}
if ($override) {
$this->runner->override = $override;
}
if (is_array($context) && count($context)) {
$this->runner->context = array_merge($this->runner->context, $context);
}
$this->runner->files = \Routerunner\Helper::getFiles($this->runner);
$this->runner->route_parser();
if (\runner::config('silent')) {
$this->runner->html = str_replace(array("\t", PHP_EOL . PHP_EOL), "", $this->runner->html);
}
\Routerunner\Routerunner::getParentInstance();
if ($this->runner->cache_exp >= 0) {
$this->set_cache();
}
} else {
// exception: route not found
}
}
示例5:
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<?php
\runner::route('head');
\runner::route(\runner::now("page"));
\runner::route('foot');
echo \runner::js_after();
?>
</html>
示例6:
<?php
/**
* Created by PhpStorm.
* User: csibi
* Date: 2015.04.01.
* Time: 15:38
*/
\runner::now("main_class", "tt-slider-");
示例7: elseif
<?php
/**
* Created by PhpStorm.
* User: csibi
* Date: 2015.02.18.
* Time: 14:38
*/
if (\runner::now("newpwd") && \runner::now("newpwd") == "succeed") {
echo '<div class="alert alert-newpwd alert-success">Your new password has been sent to your e-mail address!</div>';
} elseif (\runner::now("newpwd") && \runner::now("newpwd") == "error") {
echo '<div class="alert alert-newpwd alert-danger">New password confirmation failed!</div>';
}
?>
<!-- BEGIN LOGIN FORM -->
<form id="<?php
echo \Routerunner\Form::$id;
?>
" action="admin/<?php
echo \bootstrap::get("url");
?>
" class="login-form" method="post">
<h3 class="form-title">Login to your account</h3>
<div class="alert alert-danger display-hide">
<button class="close" data-close="alert"></button>
<span>Enter any username and password. </span>
</div>
<?php
echo form::input("email");
?>
<?php
示例8: set
private static function set($user = null, $logout = false)
{
if (is_null($user)) {
// logout user
self::$me = false;
self::$email = null;
self::$name = null;
self::$group = null;
self::$scope = null;
self::$auth = null;
self::$custom = array();
self::$alias = 0;
self::close_token(self::$token);
if ($logout) {
$flash_var = \runner::config('User.UserFlashVar') ? \runner::config('User.UserFlashVar') : 'UserFlashVar';
if (isset($_SESSION['routerunner-logout-' . $flash_var]) && $_SESSION['routerunner-logout-' . $flash_var] === true) {
$cookie = \runner::config('User.TokenCookie') ? \runner::config('User.TokenCookie') : 'TokenCookie';
\Routerunner\Routerunner::$slim->setCookie($cookie, null, -1, '/');
$flash_var = \runner::config('User.UserFlashVar') ? \runner::config('User.UserFlashVar') : 'UserFlashVar';
\runner::now($flash_var, false);
\runner::stack($flash_var, false);
\runner::flash($flash_var, false);
unset($_SESSION['slim.flash'][$flash_var]);
setcookie($cookie, null, -1, '/');
unset($_COOKIE[$cookie]);
unset($_SESSION['routerunner-logout-' . $flash_var]);
} else {
$_SESSION['routerunner-logout-' . $flash_var] = true;
}
}
} elseif (isset($user) && !is_null($user) && is_array($user)) {
self::set();
// clear user if exists
$flash_var = \runner::config('User.UserFlashVar') ? \runner::config('User.UserFlashVar') : 'UserFlashVar';
if (\runner::now($flash_var)) {
$flash = \runner::now($flash_var);
} elseif (\runner::stack($flash_var)) {
$flash = \runner::stack($flash_var);
} else {
$flash = \runner::flash($flash_var);
}
$array_to_translate = \runner::config('User.UserArrayToTranslate') ? \runner::config('User.UserArrayToTranslate') : array();
if ($flash === $user) {
foreach ($user as $key => $value) {
$var = isset($array_to_translate[$key]) ? $array_to_translate[$key] : $key;
if ($var === 'email' || $var === 'name' || $var === 'alias') {
self::${$var} = $value;
} else {
self::$custom[$var] = $value;
}
}
if (self::get_user()) {
self::open_token();
self::set_session_token();
}
}
}
}
示例9: SQL_creator
//.........这里部分代码省略.........
$index++;
}
if ($orderByTree) {
$orderBy .= ' END';
}
} elseif (isset($where["direct"])) {
foreach ($result as $reference_row) {
$tree[] = $reference_row['reference'];
}
}
if ($ordering === \Routerunner\Routerunner::BY_INDEX_DESC || $ordering === \Routerunner\Routerunner::BY_TREE_DESC) {
$orderBy .= ' DESC';
}
if (!$where) {
$where = array();
}
$where['models.reference IN (' . implode(',', $tree) . ')'] = null;
$where['`' . $model_class . '`.`' . $primary_key . '` IS NOT NULL'] = null;
} elseif ($strict) {
$where['1 = 0'] = null;
}
if ($config_reference = \runner::config('reference')) {
$where['models.reference IN (' . $config_reference . ')'] = null;
}
} else {
// join models table and filter to reference
}
\runner::stack("parents", $parents);
\runner::stack("prevs", $prevs);
$SQL = '';
unset($where["direct"]);
$visible_references = array();
$params = array();
if (\runner::config("mode") != "backend" && \runner::config("mode") != "sitemap" && !\runner::now("skip_state_check") && !$skip_state) {
$_from = $from;
if (strpos($_from, "AS") !== false) {
$_from = substr($_from, 0, strpos($_from, "AS"));
}
$SQL = "SELECT models.reference FROM " . $_from;
if (strpos($_from, "models") !== false) {
$SQL .= " AS models";
}
$SQL .= PHP_EOL;
if ($leftJoin) {
foreach ($leftJoin as $join) {
$SQL .= 'LEFT JOIN ' . $join . PHP_EOL;
}
}
if (strpos($_from, "models") === false) {
$SQL .= "LEFT JOIN {PREFIX}models AS models ON models.table_from = '" . $_from . "' AND models.table_id = " . $_from . "." . $primary_key . PHP_EOL;
}
$_where = array();
if (isset($where) && is_array($where)) {
$_where = $where;
}
$time = time();
$_where["models.reference NOT IN (SELECT model FROM {PREFIX}model_states AS states WHERE states.active = 0 OR " . $time . " NOT BETWEEN COALESCE(begin, " . $time . ") AND COALESCE(end, " . $time . "))"] = null;
if (is_array($_where) && count($_where)) {
$SQL .= 'WHERE ';
$i = 0;
foreach ($_where as $filter => $param) {
if (!is_numeric($filter)) {
$SQL .= $filter;
}
if (preg_match('/(:[a-z0-9]+)/i', $filter, $match)) {
$params[$match[0]] = $param;
示例10:
<?php
/**
* Created by PhpStorm.
* User: csibi
* Date: 2015.07.13.
* Time: 11:10
*/
if (\runner::now("e_cron_running")) {
?>
<div class="row client-row">
<div class="col-md-12 bg-danger">
<h3>
Newsletter job is active with process id: <?php
echo \runner::now("e_cron_running");
?>
<br>
</h3>
<p>
Wait for finish or if you want to stop, open and click on "Stop immediately" button!
</p>
</div>
</div>
<?php
}
?>
<div class="row client-row">
<div class="col-md-1"><?php
echo \model::property("id");
?>
示例11: js_after_fn
public static function js_after_fn()
{
$return = '';
if ($jscript = \runner::now("javascript_after")) {
$return = <<<JSCRIPT
function() {
{$jscript}
}
JSCRIPT;
}
return $return;
}
示例12: function
}
</style>
<!-- END PAGE STYLES -->
<!-- BEGIN THIRD PARTY STYLES -->
<link rel="stylesheet" type="text/css" href="<?php
echo \runner::config("BACKEND_ROOT");
?>
backend/thirdparty/datepicker/bootstrap-material-datepicker.css"/>
<!-- END THIRD PARTY STYLES -->
<link rel="shortcut icon" href="favicon.ico"/>
<link href="<?php
echo \runner::config("BACKEND_ROOT");
?>
backend/css/frame.css" rel="stylesheet" type="text/css">
<?php
\runner::route(str_replace("pages/", "", \runner::now("page")));
?>
<script>
var routerunner_models = [];
var routerunner_attach = function(selector) {
window.routerunner_models.push(selector);
};
</script>
</head>
<!-- END HEAD -->
示例13: array
<?php
/**
* Created by PhpStorm.
* User: csibi
* Date: 2015.04.01.
* Time: 15:45
*/
$select = array("id" => "oc_category.category_id", "cat_url" => "oc_url_alias.keyword", "language_id" => 2, "label" => "oc_category_description.name", "description" => "oc_category_description.description", "image" => "oc_category.image", "public" => 1);
$from = "oc_category";
$leftJoin = array("oc_category_description ON oc_category_description.category_id = oc_category.category_id AND oc_category_description.language_id = " . \runner::config("oc_lang"), "oc_url_alias ON oc_url_alias.query = CONCAT('category_id=', CAST(oc_category.category_id AS char(5)))");
$orderBy = "oc_category.sort_order";
$where = array("oc_category.parent_id = ?" => 0, "oc_category.status = ?" => 1);
$primary_key = 'id';
\runner::now("debug::model->load", false);
$force_list = true;
示例14: switch
if (!user::me($email, $name, $group, $_custom, $_scope, $_auth)) {
switch ($bootstrap->url) {
case "forgotten":
//\runner::now("page", "pages/forgotten");
//break;
//\runner::now("page", "pages/forgotten");
//break;
default:
\runner::now("page", "pages/login");
break;
}
} else {
$mainframe = strpos($bootstrap->url, "/") !== false ? substr($bootstrap->url, 0, strpos($bootstrap->url, "/")) : $bootstrap->url;
$subframe = strpos($bootstrap->url, "/") !== false ? substr($bootstrap->url, strpos($bootstrap->url, "/") + 1) : false;
switch ($mainframe) {
case "newsletter":
case "user":
\runner::now("page", "pages/" . $mainframe);
\runner::now("subpage", $subframe);
break;
default:
$mainframe = "editor";
\runner::now("page", $mainframe);
break;
}
$granted = \user::auth($mainframe, $subframe);
if (!$granted) {
\runner::now("page", "pages/restricted");
\runner::now("subpage", null);
}
}
示例15: implode
$confirm = 'forgotten/' . implode('/', $user) . '/' . $secret;
if (\Routerunner\Crypt::checker($confirm, $crypt_hash, $secret)) {
//\Routerunner\Crypt::delete_crypt($crypt_hash, $confirm);
$alphabet = "abcdefghijklmnpqrstuwxyzABCDEFGHIJKLMNPQRSTUWXYZ123456789";
$pwd = "";
for ($i = 0; $i < 8; $i++) {
$n = rand(0, strlen($alphabet) - 1);
$pwd .= substr($alphabet, $n, 1);
}
$user['pwd'] = $pwd;
$input = $user["email"] . ";" . $pwd;
$unique_salt = "4pp3t1z3r";
$unique_logarithm = "09";
$unique_method = "CRYPT_BLOWFISH";
$pwd_to_store = \Routerunner\Crypt::crypter($input, null, null, 0, $unique_salt, $unique_logarithm, $unique_method);
if (\Routerunner\Mail::mailer('/mail/newpwd', $user)) {
$SQL = 'UPDATE member SET pwd = :pwd WHERE id = :id AND email = :email';
$params = array(':pwd' => $pwd_to_store, ':id' => $user['id'], ':email' => $user['email']);
\db::query($SQL, $params);
$isOk = true;
}
}
}
}
}
if ($isOk) {
\runner::now("newpwd", "succeed");
} else {
\runner::now("newpwd", "error");
}
}