noalyss Version-9
Static Public Member Functions
Noalyss\Dbg Class Reference
+ Collaboration diagram for Noalyss\Dbg:

Static Public Member Functions

static display_global ()
 for development , show GLOBAL and SESSION More...
 
static display_request ()
 for development , show request (POST, GET) More...
 
static display_size ()
 display a bar depending of the size of the screen , it helps for CSS to see the media-size More...
 
static echo_file ($msg, $print=true)
 display the file More...
 
static echo_function ($msg, $print=true)
 returns a string , for the function with a specific style More...
 
static echo_var ($n_level, $msg, $print=true)
 Display the value of a var if DEBUGNOALYSS is greater than $n_level, the debugging info has a certain formatting. More...
 
static hidden_info ($p_title, $msg)
 Show a icon to display large information on demand, when you click it , the content will be showned. More...
 
static timer_show ()
 stop the timer and show the elapsed time, it is used for optimising the code More...
 
static timer_start ()
 start a timer More...
 

Detailed Description

Definition at line 35 of file dbg.php.

Member Function Documentation

◆ display_global()

static Noalyss\Dbg::display_global ( )
static

for development , show GLOBAL and SESSION

Returns
void

Definition at line 148 of file dbg.php.

149 {
150 $id = uniqid("debug");
151 $title = \HtmlInput::title_box(_("GLOBALS"), $id, "hide");
152 ?>
153 <div class=" col-10 inner_box" style="display:none" id="<?= $id ?>">
154 <?= $title ?>
155 $GLOBALS
156 <pre><?= print_r($GLOBALS) ?></pre>
157
159 </div>
160 <input type="button" onclick="document.getElementById('<?= $id ?>').show();" value="Show session">
161 <?php
162 }
$opd_description style
$input_from type
Definition: balance.inc.php:65
static button_hide($div_name)
Hide the HTML popup.
static title_box($p_name, $p_div, $p_mod="close", $p_js="", $p_draggable="n", $p_enlarge='n')
Title for boxes, you can customize the symbol thanks symbol with the mode "custom".

References $id, $title, HtmlInput\button_hide(), style, HtmlInput\title_box(), type, and value.

+ Here is the call graph for this function:

◆ display_request()

static Noalyss\Dbg::display_request ( )
static

for development , show request (POST, GET)

Returns
void

Definition at line 119 of file dbg.php.

120 {
121 $id = uniqid("debug");
122 $title = \HtmlInput::title_box(_("REQUEST"), $id, "hide");
123 ?>
124 <div class=" col-10 inner_box" style="display:none" id="<?= $id ?>">
125 <?= $title ?>
126
127 <h2 style="margin-top:100px"> Memory Usage
128 <?php echo round(memory_get_usage() / 1024.0, 2) . " kb \n"; ?>
129 </h2>
130 $_POST
131 <pre><?php echo print_r($_POST) ?></pre>
132 $_GET
133 <pre><?= print_r($_GET) ?></pre>
135 <pre><?= print_r($_REQUEST) ?></pre>
136 $_FILES
137 <pre><?= print_r($_FILES) ?></pre>
139 </div>
140 <input type="button" onclick="document.getElementById('<?= $id ?>').show();" value="Show request">
141 <?php
142 }
h2($p_string, $p_class="", $raw="")
Definition: ac_common.php:68
$_REQUEST['ac']
$_GET['qcode']
$_POST['ac']
Definition: do.php:310

References $_GET, $_POST, $_REQUEST, $id, $title, HtmlInput\button_hide(), h2(), style, HtmlInput\title_box(), type, and value.

+ Here is the call graph for this function:

◆ display_size()

static Noalyss\Dbg::display_size ( )
static

display a bar depending of the size of the screen , it helps for CSS to see the media-size

Returns
void

Definition at line 104 of file dbg.php.

105 {
106 echo <<<EOF
107<div class="d-block d-sm-none " style="background-color:lightblue">Xtra Small</div>
108<div class="d-none d-sm-block d-md-none d-lg-none d-xl-none " style="background-color:red">Small</div>
109<div class="d-none d-md-block d-lg-none " style="background-color:orangered">Medium</div>
110<div class="d-none d-lg-block d-xl-none " style="background-color:orange">Large</div>
111<div class="d-none d-xl-block " style="background-color:wheat">X Large</div>
112EOF;
113 }

References style.

◆ echo_file()

static Noalyss\Dbg::echo_file (   $msg,
  $print = true 
)
static

display the file

Parameters
$msgname of file , usually always FILE
$printif true display , otherwise returns a string
Returns
string|void

Definition at line 88 of file dbg.php.

89 {
90 if (DEBUGNOALYSS > 1) {
91 $r = '<span style="font-size:12px;color:brown;background-color:lightyellow;display:table-row">';
92 $r.="[FILE: $msg]";
93
94 $r.= '</span>';
95 if ($print) { echo $r;}
96 return $r;
97 }
98 }
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r

References $r.

◆ echo_function()

static Noalyss\Dbg::echo_function (   $msg,
  $print = true 
)
static

returns a string , for the function with a specific style

Parameters
$msgfunction name FUNCTION or CLASS
$printif true display , otherwise returns a string
Returns
string|void

Definition at line 70 of file dbg.php.

71 {
72 if (DEBUGNOALYSS > 1) {
73 $r = '<span style="font-size:12px;color:brown;background-color:bisque;">';
74 $r.="[FUNC: $msg]";
75
76 $r.= '</span>';
77 if ($print) { echo $r;}
78 return $r;
79 }
80 }

References $r.

◆ echo_var()

static Noalyss\Dbg::echo_var (   $n_level,
  $msg,
  $print = true 
)
static

Display the value of a var if DEBUGNOALYSS is greater than $n_level, the debugging info has a certain formatting.

Parameters
$n_levelinteger if greater than DEBUGNOALYSS, the variable will be displaid
$msgvalue to display : could be an object array, ..
$printif true display , otherwise returns a string
Returns
string|void

Definition at line 45 of file dbg.php.

46 {
47 if (DEBUGNOALYSS > $n_level) {
48 $r= '<span style="font-size:12px;color:orangered;background-color:lightyellow;margin:1rem;border:1px black dashed">';
49 $type = gettype($msg);
50 if (in_array($type, ["string", "integer", "double"])) {
51 $r.= $msg;
52 } else {
53
54 $r.= "<pre>DBG";
55 $r.=print_r($msg,true);
56 $r.='</pre>';
57 }
58 $r.='</span>';
59 if ($print) { echo $r;}
60 return $r;
61 }
62 }

References $msg, $r, and $type.

Referenced by Acc_Ledger_Purchase\insert(), Extension\insert_profile_menu(), and contact\Summary().

◆ hidden_info()

static Noalyss\Dbg::hidden_info (   $p_title,
  $msg 
)
static

Show a icon to display large information on demand, when you click it , the content will be showned.

Parameters
string$p_titletitle of the dialog box
mixed$msgvar_export of the msg
Returns
string HTML to display

Definition at line 170 of file dbg.php.

171 {
172 $id=uniqid("debug");
173 $title=\HtmlInput::title_box($p_title,"$id"."_infodiv","hide");
174 $content=var_export($msg,true);
175
176 $button_close=\HtmlInput::button_hide("$id"."_infodiv");
177 $r=<<<EOF
178<div id="{$id}_infodiv" style="display: none;background:rgba(234, 221, 114, 0.66);color:black;font-size:80%;width:auto;">
179{$title}
180<div>
181<pre>
182 {$content}
183
184</pre>
185</div>
186{$button_close}
187</div>
188<a href="javascript:void(0)" onclick="$('{$id}_infodiv').show()">&#128374;</a>
189
190EOF;
191 return $r;
192 }
$content
Definition: xml.php:17

References $content, $id, $msg, $r, $title, HtmlInput\button_hide(), style, and HtmlInput\title_box().

+ Here is the call graph for this function:

◆ timer_show()

static Noalyss\Dbg::timer_show ( )
static

stop the timer and show the elapsed time, it is used for optimising the code

Returns
void

Definition at line 208 of file dbg.php.

209 {
210 global $timer;
211 // $delta=$timer-microtime(true) ;
212 echo '<span style="font-size:80%;color:navy;background:lightgreen">';
213 echo _("Temps écoulé : ");
214 echo (hrtime(true)-$timer)/1e+6;
215 echo '</span>';
216 }

◆ timer_start()

static Noalyss\Dbg::timer_start ( )
static

start a timer

Returns
void

Definition at line 198 of file dbg.php.

199 {
200 global $timer;
201 $timer=hrtime(true);
202 }

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