Alternc  3.2
Alternc logiel libre pour l'h├ębergement
 All Data Structures Namespaces Files Functions Variables Pages
m_debug_alternc Class Reference

This class manage debug. More...

Public Member Functions

 m_debug_alternc ()
 Constructor.
 activate ()
 desactivate ()
 add ($txt)
 dump ()

Data Fields

 $infos = ""
 $status = false
 $nb_sql_query = 0
 $tps_sql_query = 0
 $generation_started = null

Detailed Description

This class manage debug.

Definition at line 26 of file m_debug_alternc.php.

Member Function Documentation

activate ( )

Definition at line 46 of file m_debug_alternc.php.

{
setcookie('alternc_debugme',true, time()+3600); // expire in 1 hour
$this->status="";
return true;
}
add (   $txt)

Definition at line 58 of file m_debug_alternc.php.

{
$this->infos .= "\n$txt";
return true;
}
desactivate ( )

Definition at line 52 of file m_debug_alternc.php.

{
setcookie('alternc_debugme',false);
$this->status=false;
return true;
}
dump ( )

Definition at line 63 of file m_debug_alternc.php.

References $cuid, and $generation_started.

{
global $cuid;
if ( $cuid!=2000 ) return false;
if ( ! $this->status ) return false;
$generation_time = (microtime(true) - $this->generation_started) * 1000;
echo "<fieldset style='background-color: silver;'>";
echo "<pre>";
echo "+++ BEGIN Debug Mode+++\n";
echo "Total generation time : $generation_time ms\n";
print_r("\n--- Total SQL Query : ".$this->nb_sql_query." req / ".$this->tps_sql_query." ms ---\n");
print_r($this->infos);
echo "\n\n--- GET ---\n";
print_r($_GET);
echo "\n\n--- POST ---\n";
print_r($_POST);
echo "\n\n--- SESSION ---\n";
@print_r($_SESSION);
echo "\n\n--- COOKIE ---\n";
print_r($_COOKIE);
echo "\n\n--- SERVER ---\n";
print_r($_SERVER);
echo "\n\n+++ END Debug Mode+++";
echo "</pre>";
echo "</fieldset>";
return true;
}

Constructor.

Definition at line 36 of file m_debug_alternc.php.

References isset.

{
if ( isset($_COOKIE['alternc_debugme']) && $_COOKIE['alternc_debugme'] ) {
$this->status=true;
ini_set('display_errors', true);
}
$this->nb_sql_query=0;
$this->tps_sql_query=0;
$this->generation_started=microtime(true);
}

Field Documentation

$generation_started = null

Definition at line 31 of file m_debug_alternc.php.

Referenced by dump().

$infos = ""

Definition at line 27 of file m_debug_alternc.php.

$nb_sql_query = 0

Definition at line 29 of file m_debug_alternc.php.

$status = false

Definition at line 28 of file m_debug_alternc.php.

$tps_sql_query = 0

Definition at line 30 of file m_debug_alternc.php.


The documentation for this class was generated from the following file: