PHPackages                             boxphp/core - 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. boxphp/core

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

boxphp/core
===========

BoxPHP Core - Config, Container, Event, Logger, Middleware

1.0.0(today)005MITPHPPHP &gt;=8.1

Since Jun 27Pushed todayCompare

[ Source](https://github.com/tvjojo/boxphp-core)[ Packagist](https://packagist.org/packages/boxphp/core)[ RSS](/packages/boxphp-core/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (3)Versions (2)Used By (5)

boxphp/core
===========

[](#boxphpcore)

BoxPHP 核心包 - 提供框架基础组件

安装
--

[](#安装)

```
composer require boxphp/core
```

组件
--

[](#组件)

### Config 配置管理

[](#config-配置管理)

```
use BoxPHP\Core\Config\ConfigRepository;

$config = new ConfigRepository();
$config->set('app.name', 'My App');
echo $config->get('app.name'); // My App
```

### Container 依赖注入

[](#container-依赖注入)

```
use BoxPHP\Core\Container\Container;

$container = new Container();
$container->bind('db', fn() => new PDO(...));
$container->singleton('logger', fn() => new Logger());

$db = $container->make('db');
```

### Event 事件系统

[](#event-事件系统)

```
use BoxPHP\Core\Event\EventDispatcher;

$events = new EventDispatcher();
$events->on('user.created', function ($user) {
    echo "User created: {$user['name']}";
});
$events->emit('user.created', ['name' => 'John']);
```

### Logger 日志

[](#logger-日志)

```
use BoxPHP\Core\Logger\FileLogger;

$logger = new FileLogger('/path/to/logs', 'app', 'debug');
$logger->info('User logged in', ['user_id' => 123]);
$logger->error('Something went wrong');
```

### Middleware 中间件管道

[](#middleware-中间件管道)

```
use BoxPHP\Core\Middleware\Pipeline;
use BoxPHP\Core\Middleware\MiddlewareInterface;

class MyMiddleware implements MiddlewareInterface {
    public function handle(mixed $request, callable $next): mixed {
        // 前置处理
        $response = $next($request);
        // 后置处理
        return $response;
    }
}

$pipeline = new Pipeline();
$pipeline->pipe(new MyMiddleware());
$result = $pipeline->run($request, fn($req) => 'response');
```

依赖
--

[](#依赖)

- PHP &gt;= 8.1
- psr/container ^2.0
- psr/event-dispatcher ^1.0
- psr/log ^3.0

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9910314?v=4)[tvjojo ](/maintainers/tvjojo)[@tvjojo](https://github.com/tvjojo)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/boxphp-core/health.svg)

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

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k86.9M2.2k](/packages/symfony-symfony)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

562565.8k42](/packages/ecotone-ecotone)[phpro/soap-client

A general purpose SoapClient library

8895.9M52](/packages/phpro-soap-client)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6941.5M396](/packages/drupal-core-recommended)[civicrm/civicrm-core

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

749284.3k37](/packages/civicrm-civicrm-core)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)

PHPackages © 2026

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