本文整理汇总了PHP中xdebug_start_trace函数的典型用法代码示例。如果您正苦于以下问题:PHP xdebug_start_trace函数的具体用法?PHP xdebug_start_trace怎么用?PHP xdebug_start_trace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xdebug_start_trace函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCanNotStartWhenStartedByThird
/**
* @expectedException RuntimeException
* @expectedExceptionMessage Can not start tracing, it has already been started.
*/
public function testCanNotStartWhenStartedByThird()
{
xdebug_start_trace();
$this->stopTraceOnTearDown = true;
$manager = new TraceManager();
$manager->start();
}
示例2: __construct
public function __construct($namespace)
{
$this->namespace = $namespace;
$temp = tempnam('', '');
$this->traceFile = $temp . '.xt';
xdebug_start_trace($temp, XDEBUG_TRACE_COMPUTERIZED);
}
示例3: display
public function display($tpl = null)
{
xdebug_start_trace(JPATH_COMPONENT . '/views/xdebug/function_trace');
$data = $this->get('Data');
$this->assign('data', $data);
parent::display($tpl);
xdebug_stop_trace();
}
示例4: startXDTrace
/**
* Start xdebug trace. Needs xdebug module (apt-get install php5-xdebug).
* @param string $trace_file (default = '/tmp/php5-xdebug'[.xt])
*/
public function startXDTrace($trace_file = '/tmp/php5-xdebug.trace')
{
xdebug_start_trace($trace_file);
if (!$this->_xdebug_on) {
$this->_xdebug_on = !empty(xdebug_get_tracefile_name());
}
}
示例5: execute
protected function execute(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output)
{
// scheme code
$code = $input->getOption(self::OPT_CODE);
// dealer offset
$offset = $input->getOption(self::OPT_OFFSET);
// Start the simulation
$result = \Akzo\Scheme\Service::getInstance()->initiateSimulation($code, $offset);
// Check if the scheme has been executed for all dealers, otherwise replay this command with the new offset
if (isset($result['moreDealersLeft']) && $result['moreDealersLeft']) {
$cmd = 'php ' . __DIR__ . '/../manageSchemes.php simulate -c ' . $code . ' -o ' . $result['moreDealersOffset'];
// FIXME: Use Symfony Process instead of plain exec
//$process = new \Symfony\Component\Process\Process(
//$cmd
//);
//$process->start();
if ($offset == 670) {
if (function_exists('xdebug_start_trace')) {
xdebug_start_trace();
}
$cmd = 'php ' . __DIR__ . '/../manageSchemesX.php simulate -c ' . $code . ' -o ' . $result['moreDealersOffset'];
}
$GLOBALS['logger']->info("Starting scheme for more dealers from offset ** {$result['moreDealersOffset']} **" . PHP_EOL . "Command: {$cmd}");
$output = array();
$returnVal = 123;
exec($cmd . ' >/dev/null 2>&1 &', $output, $returnVal);
$GLOBALS['logger']->info("Got output :" . PHP_EOL . print_r($output, 1) . PHP_EOL . "Return val: " . $returnVal);
}
}
示例6: startTrace
public static function startTrace($file = 'trace', $html = true)
{
if (!extension_loaded('xdebug')) {
throw new \RuntimeException('XDebug must be installed to use this function');
}
$flag = $html ? XDEBUG_TRACE_HTML : XDEBUG_TRACE_COMPUTERIZED;
\xdebug_start_trace($file, $flag);
}
示例7: startTrace
/**
* start_trace - turn on xdebug trace
*
* Requires xdebug extension
*
* @param string $tracefile file name for trace file
* @param string $collect_params argument for ini_set('xdebug.collect_params',?)
* Controls display of parameters in trace output
* @param string $collect_return argument for ini_set('xdebug.collect_return',?)
* Controls display of function return value in trace
*
* @return void
*/
public static function startTrace($tracefile = '', $collect_params = '3', $collect_return = 'On')
{
if (function_exists('xdebug_start_trace')) {
ini_set('xdebug.collect_params', $collect_params);
ini_set('xdebug.collect_return', $collect_return);
if ($tracefile == '') {
$tracefile = XOOPS_VAR_PATH . '/logs/php_trace';
}
xdebug_start_trace($tracefile);
}
}
示例8: traceStart
function traceStart($fileName = '')
{
ini_set("xdebug.collect_params", 3);
ini_set("xdebug.collect_return", 1);
if (!function_exists('xdebug_is_enabled') || !xdebug_is_enabled()) {
return;
}
if (!$fileName) {
$fileName = xdebug_call_function();
}
xdebug_start_trace(getcwd() . "/log/{$fileName}", XDEBUG_TRACE_APPEND);
}
示例9: start
/**
* Returns the name of the file which is used to trace.
*
* @throws \RuntimeException
* @return string
*/
public function start()
{
if (!static::$file) {
if (xdebug_get_tracefile_name()) {
throw new \RuntimeException('Can not start tracing, it has already been started.');
}
$file = tempnam(sys_get_temp_dir(), 'telltale');
xdebug_start_trace($file, \XDEBUG_TRACE_COMPUTERIZED);
static::$file = $file . '.xt';
}
return static::$file;
}
示例10: start_trace
/**
* If XDebug is installed starts the trace, with full variable contents and variable names.
*
* @param string $trace_file The file to put the trace log in
* @param int $options
*
* @return void
*/
public static function start_trace($trace_file, $options = null)
{
if (function_exists('xdebug_start_trace')) {
ini_set('xdebug.collect_params', 4);
if ($options !== null) {
xdebug_start_trace($trace_file, $options);
} else {
xdebug_start_trace($trace_file);
}
} else {
self::notice('xdebug is not installed');
}
}
示例11: start
static function start()
{
if (!self::$traceFile) {
self::init();
}
if (ini_get('xdebug.auto_trace')) {
return;
}
if (self::$running) {
throw new \BadMethodCallException();
}
foreach (static::$ini as $k => $v) {
self::$iniRestore[$k] = ini_get($k);
ini_set($k, $v);
}
self::$running = true;
$options = XDEBUG_TRACE_APPEND | XDEBUG_TRACE_COMPUTERIZED | XDEBUG_TRACE_NAKED_FILENAME;
xdebug_start_trace(self::$traceFile, $options);
}
示例12: xdebug_start_trace
<?php
xdebug_start_trace('/tmp/trace.%p');
require __DIR__ . '/tracing.inc';
$file = xdebug_stop_trace();
xdebug_start_trace($file, XDEBUG_TRACE_APPEND | XDEBUG_TRACE_NAKED_FILENAME);
require __DIR__ . '/tracing.inc';
xdebug_stop_trace();
var_dump(file_get_contents($file));
示例13: checkConnection
/**
* _checkConnection Checks if the PDO connection is active
*
* @access private
* @return void
*/
public function checkConnection() {
try {
$st = $this->_conn->query("SELECT 1");
} catch(\PDOException $pe) {
if ((strcasecmp($pe->getCode(), 'HY000') !== 0) && !stristr($pe->getMessage(), 'server has gone away'))
throw $pe;
if (function_exists('xdebug_start_trace'))
xdebug_start_trace();
$this->_resetConnection();
$this->_connect();
}
return true;
}
示例14: startTrace
/**
* Starts trace to trace.xt in the current directory.
* This is for temporary use when debugging.
* DO NOT CHECK IN A CALL TO THIS FUNCTION.
*/
public static function startTrace()
{
xdebug_start_trace('./trace');
}
示例15: log
/**
* Log same time range
*
* @param string $timePoint Time range name
* @param boolean $additional Additional metric flag OPTIONAL
*
* @return void
*/
public function log($timePoint, $additional = false)
{
if (!isset($this->points[$timePoint])) {
$this->points[$timePoint] = array('start' => microtime(true), 'open' => true, 'time' => 0);
if (self::$useXdebugStackTrace) {
xdebug_start_trace(LC_DIR_LOG . $timePoint . '.' . microtime(true), XDEBUG_TRACE_COMPUTERIZED);
}
} elseif ($this->points[$timePoint]['open']) {
$range = microtime(true) - $this->points[$timePoint]['start'];
if ($additional) {
$this->points[$timePoint]['time'] += $range;
} else {
$this->points[$timePoint]['time'] = $range;
}
$this->points[$timePoint]['open'] = false;
if (self::$useXdebugStackTrace) {
@xdebug_stop_trace();
}
} else {
$this->points[$timePoint]['start'] = microtime(true);
$this->points[$timePoint]['open'] = true;
if (self::$useXdebugStackTrace) {
xdebug_start_trace(LC_DIR_VAR . 'log' . LC_DS . $timePoint . '.' . microtime(true), XDEBUG_TRACE_COMPUTERIZED);
}
}
}