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.

Definition at line 28 of file m_debug_alternc.php.

Member Function Documentation

m_debug_alternc::activate ( )

Definition at line 50 of file m_debug_alternc.php.

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

Definition at line 62 of file m_debug_alternc.php.

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

Definition at line 56 of file m_debug_alternc.php.

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

Definition at line 67 of file m_debug_alternc.php.

References $_COOKIE, $_SESSION, $cuid, and $generation_started.

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

Constructor.

Definition at line 40 of file m_debug_alternc.php.

References $_COOKIE.

40  {
41  if (isset($_COOKIE['alternc_debugme']) && $_COOKIE['alternc_debugme']) {
42  $this->status = true;
43  ini_set('display_errors', '1');
44  }
45  $this->nb_sql_query = 0;
46  $this->tps_sql_query = 0;
47  $this->generation_started = microtime(true);
48  }
$_COOKIE['oldid']
Definition: adm_login.php:95

Member Data Documentation

m_debug_alternc::$generation_started = null

Definition at line 34 of file m_debug_alternc.php.

Referenced by dump().

m_debug_alternc::$infos = ""

Definition at line 30 of file m_debug_alternc.php.

m_debug_alternc::$nb_sql_query = 0

Definition at line 32 of file m_debug_alternc.php.

m_debug_alternc::$status = false

Definition at line 31 of file m_debug_alternc.php.

m_debug_alternc::$tps_sql_query = 0

Definition at line 33 of file m_debug_alternc.php.


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