* finish task#1492.

This commit is contained in:
wwccss
2013-07-17 20:11:58 +08:00
parent bf8b7ae75b
commit d5b5deaae5
2 changed files with 131 additions and 87 deletions
+13 -32
View File
@@ -424,6 +424,19 @@ class helper
chdir($cwd);
}
}
/**
* Remove UTF8 Bom
*
* @param string $string
* @access public
* @return string
*/
public static function removeUTF8Bom($string)
{
if(substr($string, 0, 3) == pack('CCC', 239, 187, 191)) return substr($string, 3);
return $string;
}
}
/**
@@ -466,25 +479,6 @@ function getTime()
return ((float)$usec + (float)$sec);
}
/**
* Save the sql.
*
* @access protected
* @return void
*/
function saveSQL()
{
if(!class_exists('dao')) return;
global $app;
$sqlLog = $app->getLogRoot() . 'sql.' . date('Ymd') . '.log';
$fh = @fopen($sqlLog, 'a');
if(!$fh) return false;
fwrite($fh, date('Ymd H:i:s') . ": " . $app->getURI() . "\n");
foreach(dao::$querys as $query) fwrite($fh, " $query\n");
fwrite($fh, "\n");
fclose($fh);
}
/**
* dump a var.
*
@@ -561,16 +555,3 @@ function isonlybody()
{
return (isset($_GET['onlybody']) and $_GET['onlybody'] == 'yes');
}
/**
* Remove UTF8 Bom
*
* @param string $string
* @access public
* @return string
*/
function removeUTF8Bom($string)
{
if(substr($string, 0, 3) == pack('CCC', 239, 187, 191)) return substr($string, 3);
return $string;
}