php dev tools integrated to your browser

Clockwork screenshot Clockwork screenshot Clockwork screenshot

Metadata storage

Clockwork stores the collected data in a persistent manner.

By default we use a flat JSON file storage implementation and we also include an optional SQL storage implementation. To learn how to use included implementation see the "advanced metadata storage" section.

While in most cases you will want to use one of the included options, you can write a custom one (eg. using Redis or unsupported SQL database).

To create a storage implementation you will need to implement the Clockwork\Storage\StorageInterface interface, though it's recommended to extend the Clockwork\Storage\Storage base class instead.

The interface contains a bunch of methods for reading requests, a save and a cleanup method. All read methods should return either single or an array of Clockwork\Helpers\Request instances.

To use the custom storage implementation we need to set it on the main Clockwork class:

clock()->setStorage(new RedisStorage);

Feel free to take a look at existing storage implementations for inspiration.