245

Product support

Get help in the plugin support forum.

  • Added on Dec 11, 2014
  • Current version: 1.0.1
  • Platform Compatibility
    v3.x not tested
    v2.x not tested
    v1.x use latest
  • Created by
  • Public repository

Categories

After installing this plugin and installing chrome plugin Clockwork, you can use your Chrome developer tools for debugging and profiling your OctoberCMS website and admin panel, including information on request, headers, GET and POST data, cookies, session data, database queries, routes, visualization of application runtime and more.

Not a Chrome user? Check out embeddable web app version of Clockwork, supporting many modern browsers along chrome.

To add your controller's runtime to timeline, add following to your base controller's constructor:

$this->beforeFilter(function()
{
    Event::fire('clockwork.controller.start');
});
$this->afterFilter(function()
{
    Event::fire('clockwork.controller.end');
});

Clockwork also comes with a facade, which provides an easy way to add records to the Clockwork log and events to the timeline. You can use alias:

use Clockwork\Support\Laravel\Facade as Clockwork
// Or use alias Clockwork

Now you can use the following commands:

Clockwork::startEvent('event_name', 'Event description.'); // event called 'Event description.' appears in Clockwork timeline tab
Clockwork::info('Message text.'); // 'Message text.' appears in Clockwork log tab
Log::info('Message text.'); // 'Message text.' appears in Clockwork log tab as well as application log file

Clockwork::info(array('hello' => 'world')); // logs json representation of the array
Clockwork::info(new Object()); // logs string representation of the objects if the object implements __toString magic method, logs json representation of output of toArray method if the object implements it, if neither is the case, logs json representation of the object cast to array

Clockwork::endEvent('event_name');

Also you can use functions inside a Twig template

{{ info(var) }} // appears in Clockwork log tab
{{ startEvent('event_name', 'Event description.') }} // event called 'Event description.' appears in Clockwork timeline tab
{{ endEvent('event_name') }}
1.0.1

Twig functions and some changes

Dec 11, 2014

1.0.0

First version of plugin

Dec 11, 2014