add function dirSlash()

This commit is contained in:
Jianxuan Li 2015-04-01 16:58:41 +08:00
parent 1369865cc4
commit 16351fc535
1 changed files with 15 additions and 2 deletions

View File

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