0.7.13.2
This commit is contained in:
@@ -76,6 +76,13 @@ class ProgressBar {
|
||||
// Functions
|
||||
//////////////////////////////////////////
|
||||
|
||||
function reviseprefs($array) { // bad practice
|
||||
$prefs_file = "/Users/".get_current_user()."/Library/Preferences/org.profiteroles.Yuba.php";
|
||||
$p = unserialize(file_get_contents($prefs_file));
|
||||
foreach ($array as $key => $value) { $p[$key] = "value"; }
|
||||
file_put_contents($prefs_file,serialize($result));
|
||||
}
|
||||
|
||||
function prettysize($size) {
|
||||
$unit=array('b','kb','mb','gb','tb','pb');
|
||||
return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];
|
||||
@@ -99,9 +106,20 @@ function msg($string) {
|
||||
global $messages_log_file;
|
||||
$logstring = "[".date('Y-m-d h:i:s')."] ".$string."\n";
|
||||
file_put_contents($messages_log_file, $logstring, FILE_APPEND);
|
||||
file_put_contents("/tmp/yuba/debug.log", $logstring, FILE_APPEND);
|
||||
return $string."\n";
|
||||
}
|
||||
|
||||
function dm($string) {
|
||||
global $p; if (!$p['debug']) { return; } // bad practice
|
||||
if (strpos($string,"\n") === false) {
|
||||
$logstring = "[".date('Y-m-d h:i:s')."] ".$string."\n";
|
||||
} else {
|
||||
$logstring = "[".date('Y-m-d h:i:s')."]\n".$string."\n".str_repeat("-",33)."\n";
|
||||
}
|
||||
file_put_contents("/tmp/yuba/debug.log", $logstring, FILE_APPEND);
|
||||
}
|
||||
|
||||
function timeToSeconds($val) {
|
||||
if (!is_numeric($val) && strpos($val,":") === false) {
|
||||
$val = str_replace(" s","",$val);
|
||||
|
||||
Reference in New Issue
Block a user