Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
libphp.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * Set of include functions
9  *
10  * @author Anakeen 1999
11  * @version $Id: libphp.php,v 1.2 2003/08/18 15:46:42 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage CORE
15  * @deprecated
16  */
17 /**
18  */
19 // ---------------------------------------------------------------
20 //
21 // $Id: libphp.php,v 1.2 2003/08/18 15:46:42 eric Exp $
22 // (c) anakeen 1999 marc.claverie@anakeen.com
23 // yannick.lebriquer@anakeen.com
24 // marianne.lebriquer@anakeen.com
25 //
26 //
27 //
28 // Include libphp and control if they are not already included
29 // Should be included at the top level of your Php app
30 // All calls to libphpinclude should be done outside functions or class
31 // definition
32 // ---------------------------------------------------------------
34 $LEVEL = "";
35 /**
36  * like include_once
37  *
38  * @deprecated until PHP 4.0
39  */
40 function libphpinclude($module)
41 {
42 
43  $defname = strtoupper($module);
44  $defname = strtr($defname, ".", "_");
45 
46  global $$defname;
47  global $LEVEL;
48  if (!isset($$defname)) {
49  include ($module);
50  }
51 }
52 /**
53  * like print_r
54  *
55  * @deprecated until PHP 4.0
56  */
57 function libphpshowvar($name, $var, $f = 1)
58 {
59  $out = "";
60  if ($f) $out = $out . '<font face="sans-serif" size="-1">';
61  $out = $out . '<table width="100%" border="' . $f . '" align="center" cellpadding="0" border="0" cellspacing="0">';
62  $out = $out . '<tr valign="top">';
63  $out = $out . '<td width="20%" align="left" bgcolor="#CCFFEE">' . $name . '</th>';
64  if (!isset($var)) {
65  $out = $out . '<td width="10%" align="left">-- none --</th>';
66  $out = $out . '<td width="70%" align="left">-- no value --</th>';
67  } else {
68  $out = $out . '<td width="10%" align="left">' . gettype($var) . '</th>';
69  $out = $out . '<td width="70%" align="left">';
70  if (is_array($var)) {
71  while (list($k, $v) = each($var)) {
72  $out = $out . libphpshowvar($k, $v, 1);
73  }
74  reset($var);
75  } else {
76  if (strlen(strval($var)) > 0) $out = $out . strval($var);
77  else $out = $out . "-- empty --";
78  }
79  $out = $out . '</td>';
80  }
81  $out = $out . '</tr>';
82  $out = $out . '</table>';
83  if ($f) $out = $out . '</font>';
84  return ($out);
85 }
86 ?>
← centre documentaire © anakeen - published under CC License - Dynacase