lithemod/import
Composer 安装命令:
composer require lithemod/import
包简介
Support for facilitating the dynamic inclusion of PHP files and the management of external variables.
README 文档
README
Lithe Import is a PHP library designed to facilitate the dynamic inclusion of PHP files and the management of external variables.
Installation
You can install Import using Composer. Run the following command in your terminal:
composer require lithemod/import
Usage
Including a Single File
To include a single PHP file, use the file method:
use Lithe\Support\import; $result = import::file('path/to/your/testfile.php');
Including All Files from a Directory
To include all PHP files from a specified directory (and its subdirectories), you can set the directory and call the get method:
use Lithe\Support\import; $importer = import::dir('path/to/directory')->exceptions(['exclude.php']); $importer->get();
Using External Variables
You can specify external variables that should be available in the included files:
use Lithe\Support\import; $vars = ['var1' => 'value1']; import::with($vars)->dir('path/to/directory')->get();
Excluding Files
To exclude specific files from being included, use the exceptions method:
$importer = import::dir('path/to/directory')->exceptions(['exclude.php']); $importer->get();
Methods Overview
with(array $vars): Sets external variables to be available in the included files.dir(string $directory): Sets the directory for file inclusion.exceptions(array $exceptions): Specifies files to be excluded from inclusion.file(string $file): Includes a single PHP file and returns its result.get(): Includes all PHP files from the specified directory, excluding specified exceptions.
License
This project is licensed under the MIT License. See the LICENSE file for details.
lithemod/import 适用场景与选型建议
lithemod/import 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 293 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 10 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 lithemod/import 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lithemod/import 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 293
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2024-10-02