定制 hydrakit/core 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

hydrakit/core

Composer 安装命令:

composer require hydrakit/core

包简介

Core library for Hydra PHP framework

README 文档

README

The framework-agnostic foundation: the application object, the contracts every other package depends on, environment loading, and a base service provider. Core defines interfaces and orchestration — it ships no concrete container, kernel, or HTTP layer. Those are bound by the application at runtime.

Contracts

The public API every other package codes against.

  • KernelInterfacehandle() runs the request lifecycle and emits the response (returns nothing); terminate() performs post-response clean-up.
  • ServiceProviderInterfaceregister() binds services into the container; boot() runs once all providers are registered.
  • ContainerInterface — extends PSR-11's ContainerInterface and adds singleton() (autowires a class-string or uses a callable factory; every entry is shared — there is no transient binding yet), instance() (register an already-constructed object), and bound() (does a binding exist). Core declares this interface only; the concrete container is supplied by the app.

Environment

Environment reads <basePath>/.env and exposes typed accessors: get(), has(), string(), int(), and bool(). A missing .env is tolerated; a present-but-non-integer value passed to int() throws rather than silently coercing to 0.

Providers

Providers\ServiceProvider is a concrete base class with empty register() and boot() methods. App and package providers extend it and override what they need; bindings are registered here.

Application

Application accepts a ContainerInterface and owns the boot sequence:

  • register(ServiceProviderInterface) — registers a provider (and boots it immediately if the app has already booted).
  • boot() — boots every registered provider exactly once.
  • run() — boots, resolves the KernelInterface from the container, calls handle(), flushes the response with fastcgi_finish_request() when available, then calls terminate().

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 7
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固