korium / now
此包已被弃用,不再维护。作者建议使用 ray/indentify-value-module 包。
提供当前时间
1.0.0
2016-01-26 08:28 UTC
Requires (Dev)
- ray/di: ~2.2
README
使用 NowInterface 提供当前时间
使用方法
use namespace Koriym\Now\Now; use namespace Koriym\Now\FakeNow; $now = new Now; (string) $now // 2015-11-09 01:00:00 $fakeNow = new FakeNow; (string) $fakeNow // 1970-01-01 00:00:00 = FakeNow::Time
针对 Ray.Di
use namespace Koriym\Now\NowInterface; public function configure() { // prod $this->bind(NowInterface::class)->to(Now::class); // develop $this->bind(NowInterface::class)->to(FakeNow::class); }