yii2-module/yii2-information
Composer 安装命令:
composer require yii2-module/yii2-information
包简介
A module that processes atomic information units
关键字:
README 文档
README
A module that processes atomic information units.
Installation
The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.
- Download
composer.pharfrom their website. - Then run the following command to install this library as dependency :
php composer.phar install yii2-module/yii2-information
Basic Usage
This module needs the following components to be set at the configuration level:
- 'db_information' should be a
\yii\db\Connection
If you already have a database connection, you may use the following trick :
'db_information' => function() { return \Yii::$app->get('db'); },
where 'db' is the id of your database connection.
This module needs the following parameters to be set at the configuration level:
- (none)
You should also modify the configuration of the yii application with the following changes :
[
...
'modules' => [
...
'information' => [
'class' => 'Yii2Module\Yii2Information\InformationModule',
],
...
],
...
]
Console API
The console API uses the following commands, assuming your working directory
is the directory where the yii (console) file is, and that the configuration
to this module has been named information.
./yii information/process/delete-for-module --moduleId={{moduleId}}
This method deletes all informations related to the module with the given id in the informations tables.
./yii information/process/module --moduleId={{moduleId}}
This method resolves all the records that are stored in the information tables for the module with the given id.
./yii information/process/data --moduleId={{moduleId}}
This method resolves only the information data that are stored for the module with the given id.
./yii information/process/relation --moduleId={{moduleId}}
This method resolves only the information relation that are stored for the module with the given id.
PHP API
The php API, available in the InformationModule component, is defined as
follow :
use PhpExtended\Information\InformationVisitorInterface;
use PhpExtended\Information\LoggerInformationVisitor;
use Psr\Log\LoggerInterface;
getStorageHandler(Module $module, LoggerInterface $logger, boolean $checkBeforeInsert = false) : InformationVisitorInterface
This method gets an information handler to handle all the informations that
could be thrown at it. If the $checkBeforeInsert parameter is set to
true, then this method will decorate the handler with another handler which
checks in the current database if the information exists, and if it exists, it
will skip storing it. That handler will not check for accuracy of the information,
only its existence. This handler is more useful in a multi threaded environment
due to the fact it maximizes parallelization of resolving records.
use PhpExtended\Information\InformationVisitorInterface;
use PhpExtended\Information\LoggerInformationVisitor;
use Psr\Log\LoggerInterface;
getResolverHandler(Module $module, LoggerInterface $logger) : InformationVisitorInterface
This method gets an information handler to handle all the informations that
could be thrown at it. It will try to resolve it like all the other process
methods below, and if it cannot, it will store the record like the storage
handler up there. This handler is more useful in a single threaded environment
due to the fact it minimizes the number of queries to the database.
processForModule(Module $module, LoggerInterface $logger = null) : void
This method processes all kinds of information for given module. In this context, processing means resolving individual information context to be able to store all of those informations within a relational database which is tailored to handle them. All informations that couldn't be stored accordingly stay in the informations database.
deleteForModule(Module $module) : void
This method deletes all informations related to the given module in the informations tables.
processInformationData(Module $module, LoggerInterface $logger = null) : void
This method processes all the informations of type data for given module. Such
informations are assuming the receiving database holds a path field in order
to store the information's primary key or identifier.
processInformationRelation(Module $module, LoggerInterface $logger = null) : void
This method processes all the informations of type relation for given module.
Such informations are assuming the receiving database holds a path field in
order to store the information's primary key or identifier.
License
MIT. See license file.
yii2-module/yii2-information 适用场景与选型建议
yii2-module/yii2-information 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.69k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 11 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「module」 「yii」 「information」 「yii2」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 yii2-module/yii2-information 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 yii2-module/yii2-information 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 yii2-module/yii2-information 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
A Laravel package for extracting link previews with customizable parsers, and caching support
Find informations about an email address owner
Priveate for SkeekS CMS
Convert and operate with FIPS codes for states, counties, etc.
Get IP address information from multi geoip providers
统计信息
- 总下载量: 2.69k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 11
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-11-24