定制 starbug/resource-locator 二次开发

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

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

starbug/resource-locator

最新稳定版本:v0.9.1

Composer 安装命令:

composer require starbug/resource-locator

包简介

Locate files and classes from a list of modules.

README 文档

README

The ResourceLocator class locates files and classes within directories and namespaces.

Basic example:

use Starbug\ResourceLocator\ResourceLocator;

$namespaces = [
  "Starbug\Core",
  "Starbug\Log",
  "Starbug\State",
  "Starbug\Var"
]
$paths = [
  "core",
  "modules/log",
  "modules/state",
  "var"
]

$locator = new ResourceLocator(dirname(__FILE__));
$locator->setNamespaces($namespaces);
$locator->setPaths($paths);

// This will check each module for a file at the path
// "etc/config.json" and return an array of matches.
// For instance, if core and log both contained the file,
// we would get:
// [
//   "core/etc/config.json",
//   "modules/log/config.json"
// ]
$locator->locate("config.json", "etc");

// This will check each module namespace and return
// the first one with a class named AdminController.
// For example, Starbug\Log\AdminController.
$locator->className("admin", "Controller");

统计信息

  • 总下载量: 4.64k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2020-10-17