本文整理汇总了PHP中debug::set方法的典型用法代码示例。如果您正苦于以下问题:PHP debug::set方法的具体用法?PHP debug::set怎么用?PHP debug::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类debug
的用法示例。
在下文中一共展示了debug::set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: route
public static function route($config, $re_route)
{
$router_vars = self::get_router_vars($config);
if (count($router_vars) > 1) {
if (utils::key_exists(array($router_vars['controller']), $re_route)) {
if (in_array($router_vars['action'], $re_route[$router_vars['controller']])) {
$router_vars['controller'] = $router_vars['action'];
$router_vars['action'] = !empty($router_vars['fnc_args']) ? $router_vars['fnc_args'][0] : $config['action'];
if (count($router_vars['fnc_args']) > 1) {
array_shift($router_vars['fnc_args']);
} else {
$router_vars['fnc_args'] = array();
}
}
}
}
if ($router_vars['controller'] == "base") {
$router_vars['controller'] = $config['class'];
}
if (!file_exists(APP . 'controllers' . DS . $router_vars['controller'] . '.php')) {
throw new NotFoundException();
}
require_once APP . 'controllers' . DS . $router_vars['controller'] . '.php';
if (!class_exists($router_vars['controller'])) {
throw new NotFoundException();
}
$instance = new $router_vars['controller']();
if (!method_exists($instance, $router_vars['action'])) {
throw new NotFoundException();
}
$instance->{$router_vars}['action']($router_vars['fnc_args'], $router_vars['gets']);
if (DEBUG) {
debug::set("router", "router", $router_vars);
debug::set("session", "session", session::get_all());
debug::show();
}
}
示例2: join_str
public static function join_str($fields = array('*'), $join = array(), $where = array(), $sort = array(), $order = "DESC", $offset = 0, $limit = 0)
{
$sql = "SELECT %s FROM %s%s%s%s%s;";
$fields_str = "";
$from = self::filter_table(self::$settings['table']);
if (empty($fields)) {
$fields_str = "*";
} else {
if (str_replace("`", "", $fields[0]) == "*") {
$fields_str = "*";
} else {
foreach ($fields as $field) {
if ($field != "*") {
if (substr($field, 0, 1) == ":") {
$fields_str .= sprintf("%s, ", self::filter_field($from . "." . substr($field, 1, strlen($field) - 1)));
} else {
$fields_str .= sprintf("%s, ", self::filter_field($field));
}
}
}
$fields_str = substr($fields_str, 0, -2);
}
}
$join_str = "";
foreach ($join as $_join) {
$join_str .= " " . self::join_type($_join['jtype']);
foreach ($_join['join'] as $k => $v) {
$join_str .= " " . self::filter_table($k);
$join_str .= " ON ";
$join_str .= substr(self::where_str($v), 7, strlen(self::where_str($v)) - 1);
}
}
$sql = sprintf($sql, $fields_str, $from, $join_str, self::where_str($where), self::order_str($sort, $order), self::limit_str($offset, $limit));
debug::set('sql', self::$settings['class'] . '::join', $sql);
return $sql;
}