https://github.com/mix-php/init
Help execute static initialization of the class, usually for preloading singletons / 帮助执行类的静态初始化,通常用于预加载单例
https://github.com/mix-php/init
Last synced: 7 months ago
JSON representation
Help execute static initialization of the class, usually for preloading singletons / 帮助执行类的静态初始化,通常用于预加载单例
- Host: GitHub
- URL: https://github.com/mix-php/init
- Owner: mix-php
- Created: 2021-09-18T02:52:06.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-12-31T04:36:06.000Z (about 4 years ago)
- Last Synced: 2025-08-23T18:19:49.400Z (7 months ago)
- Language: PHP
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
> OpenMix 出品:[https://openmix.org](https://openmix.org/mix-php)
# Mix Init
Help execute static initialization of the class, usually for preloading singletons
帮助执行类的静态初始化,通常用于预加载单例
## Installation
```
composer require mix/init
```
## Quick start
定义类的静态初始化方法
```php
class Example
{
public static function init()
{
// do something
}
}
```
从目录执行
> 可以通过定制方法名称,达到在不同的场景初始化的目的
```php
Mix\Init\StaticInit::finder('/path/classdir')->exec('init');
```
## License
Apache License Version 2.0, http://www.apache.org/licenses/