stagem/class-finder
最新稳定版本:1.0
Composer 安装命令:
composer create-project stagem/class-finder
包简介
Extremely simple and fast Class Finder
关键字:
README 文档
README
Extremely simple and fast Class Finder.
The package allows you to get Fully Qualified Class Name (FQCN) from file or directory path.
There are no dependencies on the Composer Autoloader, Reflection, RegEx, or get_declared_classes().
Many similar packages already implement this functionality but all of them suffer from overengineering or performance issues. When your project becomes big and it has tens of thousands of classes with the huge numbers of config you need a simple and fast solution to operate all of it.
Installation
Use Composer to install this library in your projects:
$ composer require stagem/class-finder
Usage
Find in file path
<?php use Stagem\ClassFinder\ClassFinder; $class = (new ClassFinder())->getClassFromFile('/path/to/App/ClassName.php'); var_dump($class); // App\ClassName
Find in directory path
<?php use Stagem\ClassFinder\ClassFinder; $classes = (new ClassFinder())->getClassesInDir('/path/to/App/Model'); var_dump($classes); /** * array ( * 0 => '\\App\\Model\\Product', * 1 => '\\App\\Model\\Cart', * 2 => '\\App\\Model\\Order', * 3 => '\\App\\Model\\Shipment', * ) */
统计信息
- 总下载量: 9.22k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-06-10