bartlett/php-reflect

该软件包已被弃用且不再维护。作者建议使用https://github.com/Roave/BetterReflection软件包。

增加了类、接口、函数、常量、命名空间、特质等反向工程的能力。

4.4.1 2020-10-06 15:55 UTC

README

Latest Stable Version Minimum PHP Version) EOL

PHP Reflect

PHP Reflect是一个库,它增加了类、接口、函数、常量、命名空间、特质等反向工程的能力。

在PHP 7.1或更高版本上运行,可以解析PHP 5.2到PHP 7.4格式的源代码

要求

  • PHP 7.1.3或更高版本
  • PHPUnit 7或更高版本(如果您想运行单元测试)

安装

安装此库推荐的方式是通过composer。如果您还不知道composer是什么,请查看简介

composer require bartlett/php-reflect

构建PHAR发行版

要构建PHAR发行版,您需要获取此项目的副本https://github.com/humbug/box

警告:如果您想更新PHAR清单,请记住在编译存档之前运行以下命令!

php phar-manifest.php > manifest.txt

运行以下命令

box.phar compile

您应该得到类似以下输出的结果

Box version 3.8.4@120b0a3 2019-12-13 17:22:43 UTC

 // Loading the configuration file "/shared/backups/bartlett/php-reflect/box.json.dist".

🔨  Building the PHAR "/shared/backups/bartlett/php-reflect/bin/phpreflect.phar"

? No compactor to register
? Adding main file: /shared/backups/bartlett/php-reflect/bin/phpreflect
? Adding requirements checker
? Adding binary files
    > No file found
? Auto-discover files? No
? Exclude dev files? No
? Adding files
    > 890 file(s)
? Using stub file: /shared/backups/bartlett/php-reflect/phar-stub.php
? Skipping dumping the Composer autoloader
? Removing the Composer dump artefacts
? Compressing with the algorithm "GZ"
    > Warning: the extension "zlib" will now be required to execute the PHAR
? Setting file permissions to 0755
* Done.

No recommendation found.
No warning found.

 // PHAR: 916 files (987.43KB)
 // You can inspect the generated PHAR with the "info" command.

 // Memory usage: 20.52MB (peak: 21.40MB), time: 1sec

文档

PHP Reflect 4.2的文档可用在英文中,您可以在网上阅读或在以后阅读(多种格式)。

AsciiDoc源代码可在仓库的docs文件夹中找到。

贡献者

  • Laurent Laville(主开发者)
  • 感谢Nikita Popov编写的出色的PHP解析器,它简化了PHP Reflect的工作。
  • 还要感谢Remi Collet,他是早期贡献者。

许可

本项目采用BSD-3-Clause License许可 - 有关详细信息,请参阅LICENSE文件