承接 phpnomad/facade 相关项目开发

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

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

phpnomad/facade

最新稳定版本:1.1.1

Composer 安装命令:

composer require phpnomad/facade

包简介

README 文档

README

Latest Version Total Downloads PHP Version License

phpnomad/facade provides the base classes and interfaces for building static-bound service facades in PHPNomad. The abstract Facade class resolves its target through the DI container on demand, and the HasFacades interface lets an initializer register its facades with the framework during bootstrap. The pattern is how you end up calling Cache::get($key) or Logger::error($message) from anywhere in your code without wiring up the container at each call site.

Installation

composer require phpnomad/facade

Most applications pull this in as a transitive dependency of phpnomad/core, which ships concrete facades for cache, events, logging, templates, and URL and path resolution.

Overview

  • PHPNomad\Facade\Abstracts\Facade is a generic, container-aware base class. A concrete subclass implements abstractInstance() to name the bound interface, and the base pulls the resolved implementation from the DI container when a facade method is called.
  • PHPNomad\Facade\Interfaces\HasFacades is the contract initializers implement to advertise their facades. Return an array of facade instances from getFacades() and the framework hands each one a container reference during the loader phase.
  • Resolution is lazy. The container is queried when a facade method fires, not when the facade is registered, so services with expensive dependencies stay cheap until something actually calls them.
  • When container resolution throws a DiException, the base attempts to log a critical error through LoggerStrategy with the failing abstraction and the container reference before rethrowing, so you get a breadcrumb instead of a bare stack trace.

For working examples of concrete facades built on this base, see the Facades/ directory in phpnomad/core (Cache, Event, Logger, Template, UrlResolver, PathResolver, InstanceProvider).

Documentation

Full framework documentation lives at phpnomad.com.

License

MIT. See LICENSE.txt.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固