anax/commons
Composer 安装命令:
composer require anax/commons
包简介
Anax Commons module, stuff used by several modules.
关键字:
README 文档
README
A place to store common files to have one central copy of the latest version of the file.
This repo is used by scaffolding processes which copies files to set upp fresh installations. The repo also contains development files and various configurations files for external build tools.
The repo also contains commonly used sourcecode like interfaces and traits, such code that is usually shared between several Anax modules.
Functions
The module contains a set of functions that are used by several modules. The functions are available in src/functions.php and they are autoloaded when this module is used.
Class, interface, trait
The following classes, interfaces and traits exists.
| Class, interface, trait | Description |
|---|---|
Anax\Commons\AppInjectableInterface |
For classes that wants to be injectable by $app. |
Anax\Commons\AppInjectableTrait |
Implementation of the interface. |
Anax\Commons\ContainerInjectableInterface |
For classes that wants to be injectable by $di. |
Anax\Commons\ContainerInjectableTrait |
Implementation of the interface. |
Exceptions
There are no module specific exceptions supplied by this module.
App injectable
When a class wants to be injectable with $app it should implement the interface AppInjectableInterface which can be implemented by using the trait AppInjectableTrait.
Here is a sample when used together with a controller which can be injected with $app.
namespace Anax\Controller;
use Anax\Commons\AppInjectableInterface;
use Anax\Commons\AppInjectableTrait;
/**
* A sample controller to show how a controller class can be implemented.
* The controller will be injected with $app if implementing the interface
* AppInjectableInterface, like this sample class does.
* The controller is mounted on a particular route and can then handle all
* requests for that mount point.
*
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class SampleAppController implements AppInjectableInterface
{
use AppInjectableTrait;
Review the source of the actual interface and the trait to investigate their implementation.
Container injectable
When a class wants to be injectable with the service container $di it should implement the interface ContainerInjectableInterface which can be implemented by using the trait ContainerInjectableTrait.
Here is a sample when used together with a controller which can be injected with $di.
namespace Anax\Controller;
use Anax\Commons\ContainerInjectableInterface;
use Anax\Commons\ContainerInjectableTrait;
/**
* A sample controller to show how a controller class can be implemented.
* The controller will be injected with $di if implementing the interface
* ContainerInjectableInterface, like this sample class does.
* The controller is mounted on a particular route and can then handle all
* requests for that mount point.
*
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class SampleController implements ContainerInjectableInterface
{
use ContainerInjectableTrait;
Review the source of the actual interface and the trait to investigate their implementation.
Versioning
We use Semantic Versioning 2.0.0.
License
This software carries a MIT license. See LICENSE.txt for details.
.
..: Copyright (c) 2013 - 2019 Mikael Roos, mos@dbwebb.se
anax/commons 适用场景与选型建议
anax/commons 是一款 基于 Makefile 开发的 Composer 扩展包,目前已累计 16.46k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 08 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「anax」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 anax/commons 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 anax/commons 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 anax/commons 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
Anax View module, collect and render views.
Anax TextFilter module, frontmatter, shortcodes, markdown.
The Anax Lite framework, the bare essentials.
A me page for the ramverk1 course using Anax Flat.
Anax Navigation module, for menus, navbars and navigation.
统计信息
- 总下载量: 16.46k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 62
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-08-01