add function dirSlash()
This commit is contained in:
parent
1369865cc4
commit
16351fc535
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue