本文整理汇总了PHP中Floxim\Floxim\System\Fx::debug方法的典型用法代码示例。如果您正苦于以下问题:PHP Fx::debug方法的具体用法?PHP Fx::debug怎么用?PHP Fx::debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Floxim\Floxim\System\Fx
的用法示例。
在下文中一共展示了Fx::debug方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: route
public function route($url = null, $context = null)
{
if ($url instanceof \Floxim\Main\Page\Entity) {
$url = fx::collection(array($url));
}
if ($url instanceof \Floxim\Floxim\System\Collection) {
$path = $url;
$url = $path->last()->get('url');
} else {
$url = preg_replace("~^/~", '', $url);
$path = $this->getPath($url, $context['site_id']);
if (!$path) {
return;
}
}
$page = $path->last();
if (!$page) {
return null;
} else {
$url = preg_replace("~\\?.+\$~", '', $url);
if ($url && !$page->hasVirtualPath() && urldecode($url) != $page['url'] && $page['url'] !== '404/') {
fx::http()->redirect($page['url'], 301);
fx::debug($url, '!=', $page['url']);
die;
}
}
fx::env('page', $page);
fx::http()->status('200');
$layout_ib = $this->getLayoutInfoblock($page);
fx::trigger('before_layout_render', array('layout_infoblock' => $layout_ib));
$res = $layout_ib->render();
return $res;
}
示例2: parse
public function parse($string)
{
$this->state_stack = array();
$this->prev_state = null;
$this->position = 0;
$this->state = $this->init_state;
$this->parts = $this->splitString($string);
if ($this->debug) {
fx::debug($string, $this->parts);
}
while (($ch = current($this->parts)) !== false) {
$this->position += mb_strlen($ch);
$this->step($ch);
next($this->parts);
}
return $this->res;
}
示例3: compile
/**
* Convert the tree of tokens in the php code
* @param string $tree source code of the template
* @return string of php code
*/
public function compile($tree, $class_name)
{
$code = $this->makeCode($tree, $class_name);
$code = self::addTabs($code);
if (fx::config('templates.check_php_syntax')) {
$is_correct = self::isPhpSyntaxCorrect($code);
if ($is_correct !== true) {
$error_line = $is_correct[1][1];
$lines = explode("\n", $code);
$lines[$error_line - 1] = '[[bad ' . $lines[$error_line - 1] . ']]';
$lined = join("\n", $lines);
$error = $is_correct[0] . ': ' . $is_correct[1][0] . ' (line ' . $error_line . ')';
fx::debug($error, $lined);
fx::log($error, $is_correct, $lined);
throw new \Exception('Syntax error');
}
}
return $code;
}
示例4: prepareFileData
protected function prepareFileData($file_data, $file)
{
// convert fx::attributes to the canonical Smarty-syntax
$T = new Html($file_data);
try {
$file_data = $T->transformToFloxim();
} catch (\Exception $e) {
fx::debug('Floxim html parser error', $e->getMessage(), $file);
}
// remove fx-comments
$file_data = preg_replace("~\\{\\*.*?\\*\\}~s", '', $file_data);
$file_data = trim($file_data);
if (!preg_match("~^{(template|preset)~", $file_data)) {
$file_data = $this->wrapFile($file, $file_data);
}
return $file_data;
}
示例5: dropAll
public function dropAll()
{
fx::debug()->dropAll();
return array('reload' => '#admin.log.all');
}