本文整理汇总了PHP中SqlParser::parseTableName方法的典型用法代码示例。如果您正苦于以下问题:PHP SqlParser::parseTableName方法的具体用法?PHP SqlParser::parseTableName怎么用?PHP SqlParser::parseTableName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SqlParser
的用法示例。
在下文中一共展示了SqlParser::parseTableName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: start
/**
* @param string $sql
*/
public function start($sql)
{
// find caller
$context = array();
$ns = str_replace('\\', '/', __NAMESPACE__);
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 10);
foreach ($backtrace as $i => $trace) {
if (strpos($trace['file'], $ns) === false) {
switch ($trace['class']) {
case 'Graphite\\Db\\Connection':
case 'Graphite\\Db\\Query\\AbstractQuery':
$next = $backtrace[$i + 1];
$initiator = $this->_formatClass($next['class'], $next['type'], $next['function']);
break;
case 'Graphite\\Db\\ActiveRecord\\Model':
$initiator = $this->_formatClass($this->staticCaller, $trace['type'], $trace['function']);
break;
case 'Graphite\\Db\\ActiveRecord\\Finder':
$initiator = $this->_formatClass($this->staticCaller, $trace['type'], 'find');
break;
default:
$initiator = $this->_formatClass($trace['class'], $trace['class'], $trace['function']);
}
$context['initiator'] = $initiator;
$context['file'] = empty($this->basePath) ? $trace['file'] : str_replace($this->basePath, '', $trace['file']);
$context['line'] = $trace['line'];
break;
}
}
$this->query = array('sql' => $sql, 'start' => microtime(true), 'type' => $this->parseType($sql), 'table' => SqlParser::parseTableName($sql), 'context' => $context);
if ($this->callback) {
call_user_func($this->callback, 'start', $this->query);
}
}