承接 cekta/di 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cekta/di

Composer 安装命令:

composer require cekta/di

包简介

psr/container implementation for humans

README 文档

README

Telegram chat Mutation testing badge Latest Stable Version License

A modern, high-performance PSR-11 Container implementation designed for developers who value simplicity and performance.

✨ Features

  • 🚀 Zero Runtime Overhead - All dependencies are resolved during compilation, not at runtime
    • No runtime reflection - All dependency resolution happens during compilation
    • Predictable performance - No dynamic analysis slowing down your application
  • OPcache Ready - Generated code works perfectly with PHP's opcode cache
  • 🔧 Flexible Configuration - Mix autowiring with explicit configuration
  • 📦 Full PSR-11 Compliance - Implements the standard Container Interface
  • 🔄 Modern PHP Support - Works with Union Types, Intersection Types, DNF Types, and variadic arguments
  • 🧩 Interface & Abstract Class Support - Full dependency injection for abstractions
  • 🎯 High Code Quality - Rigorously tested with mutation testing
  • Easy debugging - Generated container is plain PHP code you can read and understand

📦 Installation

composer require cekta/di

🚀 Quick Start

src/Controller.php

<?php

namespace App;

class Controller {
}

bin/build.php

<?php

require __DIR__ . './../vendor/autoload.php';

// Configure your dependencies.
$builder = new \Cekta\DI\ContainerBuilder(
    containers: [\App\Controller::class],
    fqcn: 'App\\Runtime\\Container'
);

// Generate the container
$code = $builder->compile();
file_put_contents(__DIR__ . '/../runtime/Container.php', $code);

CLI: generate container

php bin/build.php

app.php

<?php

require __DIR__ . './vendor/autoload.php';

// Use it in your application
$container = new \App\Runtime\Container();
$controller = $container->get(\App\Controller::class);

📚 Documentation

https://cekta.github.io/di/

🤝 Community

Join the Telegram chat for discussions in English or Russian.

统计信息

  • 总下载量: 673
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 82
  • 点击次数: 9
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 81
  • Watchers: 10
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-only
  • 更新时间: 2019-06-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固