PHPackages                             mix/init - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mix/init

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mix/init
========

Help execute static initialization, usually for preloading singletons

v3.0.5(4y ago)0573Apache-2.0PHPPHP &gt;=7.1.0

Since Sep 18Pushed 4y ago1 watchersCompare

[ Source](https://github.com/mix-php/init)[ Packagist](https://packagist.org/packages/mix/init)[ Docs](https://openmix.org/mix-php)[ RSS](/packages/mix-init/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

> OpenMix 出品：[https://openmix.org](https://openmix.org/mix-php)

Mix Init
========

[](#mix-init)

Help execute static initialization of the class, usually for preloading singletons

帮助执行类的静态初始化，通常用于预加载单例

Installation
------------

[](#installation)

```
composer require mix/init

```

Quick start
-----------

[](#quick-start)

定义类的静态初始化方法

```
class Example
{
    public static function init()
    {
        // do something
    }
}
```

从目录执行

> 可以通过定制方法名称，达到在不同的场景初始化的目的

```
Mix\Init\StaticInit::finder('/path/classdir')->exec('init');
```

License
-------

[](#license)

Apache License Version 2.0,

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~24 days

Total

5

Last Release

1654d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16074765?v=4)[LIU JIAN](/maintainers/onanying)[@onanying](https://github.com/onanying)

---

Top Contributors

[![onanying](https://avatars.githubusercontent.com/u/16074765?v=4)](https://github.com/onanying "onanying (11 commits)")

---

Tags

mixinit

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mix-init/health.svg)

```
[![Health](https://phpackages.com/badges/mix-init/health.svg)](https://phpackages.com/packages/mix-init)
```

###  Alternatives

[composer/composer

Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

29.5k196.2M3.1k](/packages/composer-composer)[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k251.2M25.2k](/packages/friendsofphp-php-cs-fixer)[symfony/stimulus-bundle

Integration with your Symfony app &amp; Stimulus!

17417.5M294](/packages/symfony-stimulus-bundle)[illuminate/session

The Illuminate Session package.

9939.3M849](/packages/illuminate-session)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
