Merge branch 'development' of http://git.westgis.ac.cn/westdc/westdc-core into development

This commit is contained in:
Jianxuan Li 2015-04-07 10:14:48 +08:00
commit d9e92d5435
1 changed files with 15 additions and 2 deletions

View File

@ -62,7 +62,7 @@ class Tools {
/** /**
* @return string * @return string
*/ */
public function uuid() static public function uuid()
{ {
return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
// 32 bits for "time_low" // 32 bits for "time_low"
@ -84,6 +84,19 @@ class Tools {
mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )
); );
} }
/**
* 给文件夹末尾加斜线
* @param $directory
* @return string
*/
static function dirSlash($directory){
if(!preg_match("/(\\/|\\\)$/",$directory))
{
$directory.="/";
}
return $directory;
}
} }