navarr/easy-upgrades
最新稳定版本:v1.0.0
Composer 安装命令:
composer require navarr/easy-upgrades
包简介
A simple trait to make it easier to upgrade things
README 文档
README
"Wow, I didn't know I needed this" - Everyone, ever
How to install
composer require navarr/easy-upgrades
Holy crap, that's it?
OF COURSE IT IS! What year do you think it is?!
How to use
In your class, use CallableUpdateTrait;, like so:
class SomeCrappyClass
{
use CallableUpdateTrait;
public function somethingTriggeredExternally($currentVersion, $futureVersion)
{
$this->runAt('2.0.0', $currentVersion, function() {
echo 'Hello, 2.0.0!',PHP_EOL;
});
}
}
Basically, using CallableUpdateTrait gives you the runAt method. Neat stuff!
Wait, this only contains one class that does practically nothing
Yes, but now you don't have to write it into every project, or every module, or whatever.
Why this?
It's a common function I wish I had in Magento 2 - so I made it. It doesn't need Magento, or have any dependencies. It just does what it says on the tin.
统计信息
- 总下载量: 25.98k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-08-30