PHP Classes

File: sample.php

Recommend this page to a friend!
  Classes of Tom Schaefer   QTracer   sample.php   Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: sample
Class: QTracer
Get information about the current execution script
Author: By
Last change: change tick value for for hidden trace function operations
Date: 15 years ago
Size: 843 bytes
 

Contents

Class file image Download
<?php

include_once 'QConfig.class.php';
include_once
'QTracer.class.php';
include_once
'Test.class.php';

QConfig::set("use_trace", true);

/**
bit shift commands 1=on, 0 = off
0 filename
1 traced command
2 start time
3 local run time
4 start code line
5 end code line
6 local memory usage
7
8 total run-time
9 total memory usage
10 peak memory usage
*/
QConfig::set("trace_flags","111111111111");

// on windows you have to run the script from the console
// otherwise apache crashes due to an unsolved php bug.
// uncomment lines below if you know what you are doing
/*
register_tick_function("trace");
declare(ticks=2);
*/

$object = new Test();
$object->getComposite()->add(array("my"=>"value", "second"=> true));

$fp = fopen("trace.txt","w");
fwrite($fp, print_r(QTracer::get(),true));
fclose($fp);