ashleydawson/class-meta-bundle
Composer 安装命令:
composer require ashleydawson/class-meta-bundle
包简介
Symfony bundle to add arbitrary metadata to classes and their constants by annotation
README 文档
README
Symfony bundle for my Class Meta library. This allows you to attach arbitrary metadata to classes and their constants via annotation.
Installation
To install via composer, use the following command:
$ composer require ashleydawson/class-meta-bundle
And then add the bundle to the AppKernel#registerBundles() method:
$bundles = [ // ... new AshleyDawson\ClassMetaBundle\AshleyDawsonClassMetaBundle(), ];
Configuration
Configuration allows you to set a cache provider. By default the cache provider is ArrayCache - so in production, I'd advise you change this to a more persistent cache strategy:
# app/config/config.yml services: my_class_meta_cache_provider: class: Doctrine\Common\Cache\FilesystemCache arguments: [ "%kernel.cache_dir%/ashleydawson/class_meta" ] ashley_dawson_class_meta: cache_provider_service_id: my_class_meta_cache_provider # Cache provider service ID (optional) cache_provider_ttl: 300 # 5 minutes TTL (optional)
Note: The cache is invalidated by file modify time, but if you want to also add a TTL (Time-to-live) to the cache it can be done via the cache_provider_ttl parameter.
Note: To disable the cache, simply pass the id of a Doctrine\Common\Cache\VoidCache service.
Basic Usage
To use the meta cache manager service in a controller, simply do:
public function indexAction() { $meta = $this->get('ashleydawson.class_meta')->getClassConstantsMeta('AppBundle\Enum\MyEnum'); dump($meta); }
For more documentation, please see the full library readme.
ashleydawson/class-meta-bundle 适用场景与选型建议
ashleydawson/class-meta-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.89k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2016 年 05 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「metadata」 「annotation」 「class」 「constant」 「meta」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ashleydawson/class-meta-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ashleydawson/class-meta-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ashleydawson/class-meta-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Collection of methods that I or you usually use.
A very simple yet useful helper class to handle PHP file uploads.
Yii2 Component to manage SEO data and metadata
Yii2 js base class
Class loader implementation (PSR-0, PSR-4)
Extremely simple meta tag generator.
统计信息
- 总下载量: 5.89k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-05-19