luminar-organization/core
Composer 安装命令:
composer require luminar-organization/core
包简介
The core package of Luminar PHP ecosystem, providing essential functionality and structure
README 文档
README
Luminar Core is the foundational package for the Luminar PHP framework, providing the providing essential functionality and core components needed to build applications.
Table of Contents
Introduction
Luminar Core is a PHP library that includes the core components of the Luminar framework. This package provides the service container, configuration management, event dispatching, and utility functions.
Features
- Service Container: A powerful dependency injection container
- Configuration Management: Load and manage configuration files in YAML format.
- Event Dispatching: A flexible event system for handling application events.
- Utility Functions: Helpful functions for string manipulation and general utilities.
Installation
You can install Luminar Core using Composer, Run the following command in your project directory:
composer require luminar-organization/core
Usage
Service Container
Bind and resolve services using the Container class:
use Luminar\Core\Container\Container; $container = new Container(); $container->bind('example', function() { return new \SomeClass(); }); $instance = $container->resolve('example');
Configuration Management
Load configuration files and retrieve values:
use Luminar\Core\Config\Config; $config = new Config('/path/to/config'); $value = $config->get('database.host', 'localhost');
Event Dispatching
Register and dispatch events using the EventDispatcher class:
use Luminar\Core\Events\EventDispatcher; $dispatcher = new EventDispatcher(); $dispatcher->listen('event.name', function($data) { // Handle the event }); $dispatcher->dispatch('event.name', $data);
Utility Functions
Use helper and string utility functions:
use Luminar\Core\Support\Helpers; use Luminar\Core\Support\Str; $emailValid = Helpers::isValidEmail('test@example.com'); // Output will be boolean $randomStr = Helpers::randomString(12); // Output will be random string length of 12 characters $humanizedStr = Helpers::humanize('hello_world'); // Output will be Hello World $snakeCase = Str::snakeCase('HelloWorld'); // Output will be hello_world $camelCase = Str::camelCase('hello_world'); // Output will be helloWorld $titleCase = Str::titleCase('hello world'); // Output will be Hello World
Testing
To run the tests, ensure you have installed all development requirements:
composer install
After that run all tests:
composer run test
This will execute all tests located in the tests/ directory and provide feedback on the test results.
Contributing
We welcome contributions to Luminar Core! Please follow these steps to contribute:
- Fork the repository
- Create a new branch for your feature or bugfix
- Make your changes and add tests if applicable
- Submit a pull request with a clear description of your changes
Please refer to the CONTRIBUTING.md file for more details
License
Luminar Core is licensed under the MIT License. See the LICENSE file for more information
For more information about Luminar, visit our website or docs
luminar-organization/core 适用场景与选型建议
luminar-organization/core 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 260 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 08 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 luminar-organization/core 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 luminar-organization/core 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 260
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 11
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-08-17