php parser

https://github.com/nikic/PHP-Parser
Parsing PHP 5 and PHP 7 code into an abstract syntax tree (AST).
Invalid code can be parsed into a partial AST.
The AST contains accurate location information.



Dumping the AST in human-readable form.
Converting an AST back to PHP code.
Experimental: Formatting can be preserved for partially changed ASTs.



https://tomasvotruba.com/blog/2017/11/06/how-to-change-php-code-with-abstract-syntax-tree/

https://github.com/symfony/var-dumper



http://www.symfonychina.com/doc/current/components/var_dumper.html



http://www.symfonychina.com/doc/current/components/console.html



Console组件允许你创建command-line命令。你的console(控制台)命令可以用于任何反复(执行)的任务,比如cronjobs,imports(导入),或其他批处理工作。



安装 ¶
你可以通过下述两种方式安装:



通过Composer安装(Packagist上的symfony/console)



通过官方Git宝库(https://github.com/symfony/console)



然后,包容vendor/autoload.php文件,以开启Composer提供的自动加载机制。否则,你的程序将无法找到这个Symfony组件的类。



创建一个Console程序 ¶
首先,你要建立一个PHP脚本来定义控制台程序:
#!/usr/bin/env php
<?php
// application.php



require DIR.’/vendor/autoload.php’;



use Symfony\Component\Console\Application;



$application = new Application();



// … register commands / 注册命令



$application->run();
然后,你可以用add()来注册这个命令:
// …
$application->add(new GenerateAdminCommand());



https://github.com/nikic/PHP-Parser



{
“name”: “…/…”,
“config”: {
“platform”: {
“php”: “5.3.5”
}
},
“require”: {

}
}



“config”: {



"platform": {
"php": "7.0"
}


},



https://stackoverflow.com/questions/26277151/force-composer-to-require-php-version-between-version-x-and-version-y



https://andy-carter.com/blog/composer-php-platform



https://php.watch/articles/composer-platform-check



http://it.taocms.org/07/1147.htm
https://wooyun.js.org/drops/%E6%89%93%E9%80%A0%E8%87%AA%E5%B7%B1%E7%9A%84php%E5%8D%8A%E8%87%AA%E5%8A%A8%E5%8C%96%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%E5%B7%A5%E5%85%B7.html



https://xz.aliyun.com/t/8165
https://ucw.moe/archives/php-parser-ast.html
https://learnku.com/articles/21846
https://www.penlab.me/2019/09/01/php_parser/
https://github.com/ircmaxell/PHPPHP
http://php.html.js.cn/study/2016-02-02-php-parser-example.html


Category php