本文整理汇总了PHP中kernel::is_debug方法的典型用法代码示例。如果您正苦于以下问题:PHP kernel::is_debug方法的具体用法?PHP kernel::is_debug怎么用?PHP kernel::is_debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kernel
的用法示例。
在下文中一共展示了kernel::is_debug方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: query_and_fetch_records
protected function query_and_fetch_records($sql, $index_by_id)
{
$result = $this->conn->select($sql);
if (kernel::is_debug()) {
debug::save('rdb', $sql);
}
if ($result === false) {
throw new server_except("select error: " . $this->conn->last_error() . " sql: {$sql}");
}
$records = [];
if ($index_by_id) {
while (($record = $result->fetch_record()) !== null) {
$records[(int) $record['id']] = $record;
}
} else {
while (($record = $result->fetch_record()) !== null) {
$records[] = $record;
}
}
$result->free();
return $records;
}
示例2: do_render_in
protected static function do_render_in($_view_dir, $_pps_type, target $_target)
{
foreach ($_target->get_param('link', []) as $_linked_name) {
$_file = $_pps_type . '/' . $_linked_name . '.' . $_pps_type;
$_pps_file = $_view_dir . '/' . $_file;
if (is_readable($_pps_file)) {
if (kernel::is_debug()) {
echo "\n/******** {$_file} ********/\n\n";
}
require $_pps_file;
}
}
$_layout_name = $_target->get_param('layout', '');
if ($_layout_name !== '') {
$_file = 'layout/' . $_layout_name . '.' . $_pps_type;
$_pps_file = $_view_dir . '/' . $_file;
if (is_readable($_pps_file)) {
if (kernel::is_debug()) {
echo "\n/******** {$_file} ********/\n\n";
}
require $_pps_file;
}
}
foreach ($_target->get_param('block', []) as $_block_name) {
$_file = 'block/' . $_block_name . '.' . $_pps_type;
$_pps_file = $_view_dir . '/' . $_file;
if (is_readable($_pps_file)) {
if (kernel::is_debug()) {
echo "\n/******** {$_file} ********/\n\n";
}
require $_pps_file;
}
}
if ($_target->get_target_name() !== '') {
$_file = 'page/' . $_target->get_target_file('.' . $_pps_type);
$_pps_file = $_view_dir . '/' . $_file;
if (is_readable($_pps_file)) {
if (kernel::is_debug()) {
echo "\n/******** {$_file} ********/\n\n";
}
require $_pps_file;
}
}
}
示例3: execute
protected function execute($sql)
{
$result = mysqli_query($this->conn, $sql);
if (kernel::is_debug()) {
debug::save('session', $sql);
}
if ($result === false) {
throw new server_except("except: {$sql}");
}
}