mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
增加打包配置设置
This commit is contained in:
@@ -561,7 +561,7 @@ class Dist extends Command
|
||||
*/
|
||||
public function buildAllAppDir()
|
||||
{
|
||||
$list = $this->appFilesystem->listContents('');
|
||||
$list = $this->appFilesystem->listContents('app');
|
||||
|
||||
foreach ($list as $item) {
|
||||
if ($item['type'] != 'dir') {
|
||||
|
||||
@@ -18,6 +18,7 @@ use PhpParser\Node\Scalar\LNumber;
|
||||
use PhpParser\Node\Scalar\String_;
|
||||
use PhpParser\NodeTraverser;
|
||||
use PhpParser\NodeVisitorAbstract;
|
||||
use think\facade\Config;
|
||||
|
||||
class ReadEnvVisitorNodeTools extends NodeVisitorAbstract
|
||||
{
|
||||
@@ -99,9 +100,14 @@ class ReadEnvVisitorNodeTools extends NodeVisitorAbstract
|
||||
return new Array_($value);
|
||||
} else if (is_string($value)) {
|
||||
|
||||
return new FuncCall(new Name('base64_decode'), [
|
||||
new Arg(new String_(base64_encode($value)))
|
||||
]);
|
||||
|
||||
$env_pack_mode = Config::get('dist.pack_env_mode');
|
||||
|
||||
if ($env_pack_mode == 0) {
|
||||
return new FuncCall(new Name('base64_decode'), [
|
||||
new Arg(new String_(base64_encode($value)))
|
||||
]);
|
||||
}
|
||||
|
||||
return new String_($value);
|
||||
} else if (is_integer($value)) {
|
||||
|
||||
@@ -29,16 +29,18 @@ return [
|
||||
'/config.php/',
|
||||
'/^public\/index\.php/',
|
||||
'/^public\/router\.php/',
|
||||
|
||||
|
||||
'/^app\/admin\/service\/initAdminData\/*/',
|
||||
],
|
||||
// 希望将env打包的文件
|
||||
'pack_env_path'=>[
|
||||
'pack_env_path' => [
|
||||
'/^app/',
|
||||
'/^config/',
|
||||
'/^database/',
|
||||
'/^extend/',
|
||||
'/^lib/',
|
||||
'/^route/',
|
||||
]
|
||||
],
|
||||
// 0:base64方式处理,1:明文打包
|
||||
'pack_env_mode' => 1
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user