Changeset 479 for trunk/lib/Utilities.inc.php
- Timestamp:
- May 3, 2014 11:09:03 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Utilities.inc.php
r477 r479 29 29 * Print variable dump. 30 30 * 31 * @param mixed $varThe variable to dump.32 * @param bool $displayPrint the dump in <pre> tags or hide it in html comments (non-CLI only).33 * @param bool $var_dumpUse var_dump instead of print_r.34 * @param string $fileValue of __FILE__.35 * @param string $lineValue of __LINE__31 * @param mixed $var The variable to dump. 32 * @param bool $display Print the dump in <pre> tags or hide it in html comments (non-CLI only). 33 * @param bool $var_dump Use var_dump instead of print_r. 34 * @param string $file Value of __FILE__. 35 * @param string $line Value of __LINE__ 36 36 */ 37 37 function dump($var, $display=false, $var_dump=false, $file='', $line='') … … 45 45 var_dump($var); 46 46 } else { 47 48 49 50 51 52 53 54 55 56 57 58 59 60 47 // Print human-readable descriptions of invisible types. 48 if (null === $var) { 49 echo '(null)'; 50 } else if (true === $var) { 51 echo '(bool: true)'; 52 } else if (false === $var) { 53 echo '(bool: false)'; 54 } else if (is_scalar($var) && '' === $var) { 55 echo '(empty string)'; 56 } else if (is_scalar($var) && preg_match('/^\s+$/', $var)) { 57 echo '(only white space)'; 58 } else { 59 print_r($var); 60 } 61 61 } 62 62 if (defined('_CLI')) { … … 144 144 function oTxt($text, $preserve_html=false) 145 145 { 146 146 $app =& App::getInstance(); 147 147 148 148 $search = array(); … … 546 546 function filePutContents($filename, $content) 547 547 { 548 548 $app =& App::getInstance(); 549 549 550 550 // Open file for writing and truncate to zero length. … … 754 754 function escapedList($in, $separator="', '") 755 755 { 756 756 $db =& DB::getInstance(); 757 757 758 758 if (is_array($in) && !empty($in)) { … … 982 982 function mailmanAddMember($email, $list, $send_welcome_message=false) 983 983 { 984 985 986 984 $app =& App::getInstance(); 985 986 $add_members = '/usr/lib/mailman/bin/add_members'; 987 987 // FIXME: checking of executable is disabled. 988 988 if (true || is_executable($add_members) && is_readable($add_members)) { … … 1014 1014 function mailmanRemoveMember($email, $list, $send_user_ack=false) 1015 1015 { 1016 1016 $app =& App::getInstance(); 1017 1017 1018 1018 $remove_members = '/usr/lib/mailman/bin/remove_members';
Note: See TracChangeset
for help on using the changeset viewer.