Alternc  latest
Alternc logiel libre pour l'h├ębergement
 All Classes Namespaces Files Functions Variables Pages
m_debug_alternc Class Reference

This class manage debug. More...

Public Member Functions

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

Public Attributes

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

Detailed Description

This class manage debug.

Available to admin account only

Definition at line 26 of file m_debug_alternc.php.

Member Function Documentation

m_debug_alternc::activate ( )

Definition at line 48 of file m_debug_alternc.php.

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

Definition at line 60 of file m_debug_alternc.php.

60  {
61  $this->infos .= "\n$txt";
62  return true;
63  }
m_debug_alternc::desactivate ( )

Definition at line 54 of file m_debug_alternc.php.

54  {
55  setcookie('alternc_debugme', '0');
56  $this->status = false;
57  return true;
58  }
m_debug_alternc::dump ( )

Definition at line 65 of file m_debug_alternc.php.

References $cuid, and $generation_started.

65  {
66  global $cuid;
67  if ($cuid != 2000) {
68  return false;
69  }
70  if (!$this->status) {
71  return false;
72  }
73 
74  $generation_time = (microtime(true) - $this->generation_started) * 1000;
75 
76  echo "<fieldset style='background-color: silver;'>";
77  echo "<pre>";
78  echo "+++ BEGIN Debug Mode+++\n";
79  echo "Total generation time : $generation_time ms\n";
80  print_r("\n--- Total SQL Query : " . $this->nb_sql_query . " req / " . $this->tps_sql_query . " ms ---\n");
81  print_r($this->infos);
82  echo "\n\n--- GET ---\n";
83  print_r($_GET);
84  echo "\n\n--- POST ---\n";
85  print_r($_POST);
86  echo "\n\n--- SESSION ---\n";
87  @print_r($_SESSION);
88  echo "\n\n--- COOKIE ---\n";
89  print_r($_COOKIE);
90  echo "\n\n--- SERVER ---\n";
91  print_r($_SERVER);
92  echo "\n\n+++ END Debug Mode+++";
93  echo "</pre>";
94  echo "</fieldset>";
95  return true;
96  }
$cuid
Definition: bootstrap.php:43
m_debug_alternc::m_debug_alternc ( )

Constructor.

Definition at line 38 of file m_debug_alternc.php.

38  {
39  if (isset($_COOKIE['alternc_debugme']) && $_COOKIE['alternc_debugme']) {
40  $this->status = true;
41  ini_set('display_errors', '1');
42  }
43  $this->nb_sql_query = 0;
44  $this->tps_sql_query = 0;
45  $this->generation_started = microtime(true);
46  }

Member Data Documentation

m_debug_alternc::$generation_started = null

Definition at line 32 of file m_debug_alternc.php.

Referenced by dump().

m_debug_alternc::$infos = ""

Definition at line 28 of file m_debug_alternc.php.

m_debug_alternc::$nb_sql_query = 0

Definition at line 30 of file m_debug_alternc.php.

m_debug_alternc::$status = false

Definition at line 29 of file m_debug_alternc.php.

m_debug_alternc::$tps_sql_query = 0

Definition at line 31 of file m_debug_alternc.php.


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