Skip to content

Commit

Permalink
小程序包生成,根目录前不参与创建,避免虚拟机没权限
Browse files Browse the repository at this point in the history
  • Loading branch information
devil_gong committed Jan 11, 2019
1 parent 2a1dfce commit 4b25081
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions extend/base/FileUtil.php
Expand Up @@ -45,14 +45,18 @@ class FileUtil
*/
public static function CreateDir($aim_url)
{
// 根目录前不参与,避免虚拟机没有权限
$aim_dir = ROOT;
$aim_url = str_replace($aim_dir, '', $aim_url);

// 空转成目录
$aim_url = str_replace('', '/', $aim_url);
$aim_dir = '';
$arr = explode('/', $aim_url);
$result = true;
foreach($arr as $str)
{
$aim_dir .= $str . '/';
if(!file_exists($aim_dir))
if($aim_dir != '/' && !is_dir($aim_dir))
{
$result = mkdir($aim_dir);
}
Expand Down

0 comments on commit 4b25081

Please sign in to comment.