定制 stagem/class-finder 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 2
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固