Fixed undefined variable argv (#3295)

* Fixed undefined variable argv

* Update PharBuilder.php
This commit is contained in:
李铭昕 2021-02-21 13:26:55 +08:00 committed by GitHub
parent d465da34d4
commit 9678155127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -192,13 +192,14 @@ class PharBuilder
return <<<EOD
<?php
\$mountLink = ["{$mountLink}"];
array_walk(\$mountLink, function (\$item){
\$file = realpath(\$argv[0]).'/'.\$item;
\$path = dirname(realpath(\$argv[0]));
array_walk(\$mountLink, function (\$item) use (\$path) {
\$file = \$path . '/' . \$item;
if(!file_exists(\$file)){
if(rtrim(\$item, '/')!=\$item){
mkdir(\$file, 0777, true);
@mkdir(\$file, 0777, true);
}else{
file_exists(dirname(\$file)) || mkdir(dirname(\$file), 0777, true);
file_exists(dirname(\$file)) || @mkdir(dirname(\$file), 0777, true);
file_put_contents(\$file,"");
}
}