本文整理汇总了PHP中debug::accumulator_start方法的典型用法代码示例。如果您正苦于以下问题:PHP debug::accumulator_start方法的具体用法?PHP debug::accumulator_start怎么用?PHP debug::accumulator_start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类debug
的用法示例。
在下文中一共展示了debug::accumulator_start方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sql_exec
function sql_exec($sql, $limit = 0, $offset = 0)
{
$this->_sql_result = null;
if ($this->is_debug_enabled()) {
debug::write_debug($sql);
debug::accumulator_start('db', 'sql_exec');
}
$this->_sql_result = $this->_sql_exec_operation($sql, $limit, $offset);
if ($this->is_debug_enabled()) {
debug::accumulator_stop('db', 'sql_exec');
}
if (!$this->_sql_result) {
error($this->_sql_exec_error($sql), __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
}
return $this->_sql_result;
}
示例2: sql_exec
function sql_exec($sql, $limit = 0, $offset = 0)
{
$this->_sql_result = null;
if ($this->is_debug_enabled()) {
$md5 = md5($sql);
if (isset($this->_executed_sql[$md5])) {
$this->_executed_sql[$md5]['times']++;
debug::write_debug('same SQL query at: ' . '<a href=#' . $this->_executed_sql[$md5]['pos'] . '><b>' . $this->_executed_sql[$md5]['pos'] . '</b></a>' . ' already executed for ' . $this->_executed_sql[$md5]['times'] . ' times');
} else {
debug::write_debug($sql);
$this->_executed_sql[$md5] = array('pos' => debug::sizeof(), 'times' => 0);
}
debug::accumulator_start('db', 'sql_exec');
}
$this->_sql_result = $this->_sql_exec_operation($sql, $limit, $offset);
if ($this->is_debug_enabled()) {
debug::accumulator_stop('db', 'sql_exec');
}
if (!$this->_sql_result) {
error($this->_sql_exec_error($sql), __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
}
return $this->_sql_result;
}
示例3: sizeof
function sql_exec($sql, $limit=0, $offset=0)
{
$this->_sql_result = null;
if($this->is_debug_enabled())
{
$debug_sql = preg_replace("~(\n|\r|\t)~", '', $sql);
$debug_sql = preg_replace("~\s+~", ' ', $debug_sql);
$md5 = md5($debug_sql);
if(isset($this->_executed_sql[$md5]))
{
$this->_executed_sql[$md5]['times']++;
debug :: write_debug("same SQL at: #" . $this->_executed_sql[$md5]['pos'] .
' already executed for ' . $this->_executed_sql[$md5]['times'] . ' times'
);
}
else
{
$pos = sizeof($this->_executed_sql);
debug :: write_debug('#' . $pos . ' ' . $debug_sql);
$this->_executed_sql[$md5] = array('pos' => $pos, 'times' => 0);
}
debug :: accumulator_start('db', 'sql_exec');
}
$this->_sql_result = $this->_sql_exec_operation($sql, $limit, $offset);
if($this->is_debug_enabled())
debug :: accumulator_stop('db', 'sql_exec');
if (!$this->_sql_result)
{
error(
$this->_sql_exec_error($sql),
__FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
}
return $this->_sql_result;
}