完成变量混淆

This commit is contained in:
2022-11-19 17:43:43 +08:00
parent 4e17c7125f
commit d135407689
3 changed files with 63 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ namespace app\common\command\build;
use app\common\tools\PathTools;
use app\common\tools\phpparser\MinifyPrinterTools;
use app\common\tools\phpparser\NodeFakeVarVisitorTools;
use app\common\tools\phpparser\NodeVisitorTools;
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;
@@ -313,6 +314,11 @@ class Dist extends Command
}
}
$traverser = new NodeTraverser();
$traverser->addVisitor(new NodeFakeVarVisitorTools);
$stmts = $traverser->traverse($stmts);
$newCode = $prettyPrinter->prettyPrintFile($stmts);
@@ -410,6 +416,12 @@ class Dist extends Command
}
$traverser = new NodeTraverser();
$traverser->addVisitor(new NodeFakeVarVisitorTools);
$function_stmts = $traverser->traverse($function_stmts);
$prettyPrinter = new MinifyPrinterTools();
$function_code = $prettyPrinter->prettyPrintFile($function_stmts);