This is a very tiny symfony (2&3) bundle that simplifies usage of php-timecop. To use this extension you need a php server with configured timecop.so
extension. In case of troubles with compilation I can provide some extra instructions.
Using this extension same as php-timecop alone can be very dangerous especially on production environment. Use it wisely.
composer require kolemp/timecop-bundle
After installation add the bundle to app/AppKernel.php
. By default the extension is disabled. To enable it add a section to config.yml
for environments you want it to be enabled:
kolemp_timecop:
enabled: true
You can set the time by query parameter or the cookie. Both are named fakeTime
. The value given must be compatibile with relative date formats.
Example url: example.com?fakeTime=+3 days
You can disable any of time sources in config. By default all are enabled:
kolemp_timecop:
queryParameter: true
cookie: true
header: true
The time data is used in the following order: the header, the cookie, the query parameter.