PHPackages                             lahaxearnaud/clockwork - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. lahaxearnaud/clockwork

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

lahaxearnaud/clockwork
======================

Server-side component of Clockwork, a Chrome extension for PHP development

v1.9(10y ago)1373MITPHPPHP &gt;=5.3.9

Since Jun 24Pushed 10y ago1 watchersCompare

[ Source](https://github.com/lahaxearnaud/clockwork)[ Packagist](https://packagist.org/packages/lahaxearnaud/clockwork)[ Docs](http://github.com/itsgoingd/clockwork)[ RSS](/packages/lahaxearnaud-clockwork/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (18)Used By (0)

Clockwork
=========

[](#clockwork)

**[Clockwork](http://github.com/itsgoingd/clockwork-chrome) is a Chrome extension for PHP development**, extending Developer Tools with a new panel providing all kinds of information useful for debugging and profiling your PHP applications, including information about request, headers, get and post data, cookies, session data, database queries, routes, visualisation of application runtime and more.

**Not a Chrome user?** Check out [embeddable web app version of Clockwork](http://github.com/itsgoingd/clockwork-web), supporting many modern browsers along Chrome with out of the box support for Laravel and Slim. There are also a third-party [Firebug extension](https://github.com/sidorovich/clockwork-firebug) and a [CLI client app](https://github.com/ptrofimov/clockwork-cli) available.

**This repository contains server-side component of Clockwork** that gathers all the data, stores them in JSON format and serves them for displaying in Chrome Developer Tools extension.

Installation
------------

[](#installation)

This extension provides out of the box support for Laravel, Slim 2 and CodeIgniter 2.1 frameworks, you can add support for any other or custom framework via an extensible API.

To install latest version simply add it to your `composer.json`:

```
"itsgoingd/clockwork": "~1.9"
```

### Laravel

[](#laravel)

Once Clockwork is installed, you need to register Laravel service provider, in your `app/config/app.php`:

```
'providers' => array(
	...
	'Clockwork\Support\Laravel\ClockworkServiceProvider'
)
```

When using Laravel 5, you need to add Clockwork middleware, in your `app/Http/Kernel.php`:

```
protected $middleware = [
	'Clockwork\Support\Laravel\ClockworkMiddleware',
	...
]
```

By default, Clockwork will only be available in debug mode, you can change this and other settings in the configuration file. Use the following Artisan command to publish the configuration file into your config directory:

```
$ php artisan vendor:publish --provider='Clockwork\Support\Laravel\ClockworkServiceProvider'

```

For Laravel 4 you can do the same with this command:

```
$ php artisan config:publish itsgoingd/clockwork --path vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/config/

```

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 register the facade in your `app/config/app.php`:

```
'aliases' => array(
	...
	'Clockwork' => 'Clockwork\Support\Laravel\Facade',
)
```

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');
```

### Lumen

[](#lumen)

Once Clockwork is installed, you need to register the Clockwork service provider, in your `bootstrap/app.php`:

```
$app->register(Clockwork\Support\Lumen\ClockworkServiceProvider::class);
```

You also need to add the Clockwork middleware, in the same file:

```
$app->middleware([
	...
	Clockwork\Support\Lumen\ClockworkMiddleware::class
]);
```

By default, Clockwork will only be available in debug mode (`APP_DEBUG` set to true), you can change this and other settings via environment variables. Simply specify the setting as environment variable prefixed with `CLOCKWORK_`, eg. `CLOCKWORK_ENABLE`, [full list of available settings](https://raw.githubusercontent.com/itsgoingd/clockwork/v1/Clockwork/Support/Laravel/config/clockwork.php).

Clockwork also comes with a facade, which provides an easy way to add records to the Clockwork log and events to the timeline. The facade will be automatically registered when you enable facades for your Lumen app, in `bootstrap/app.php`:

```
$app->withFacades();
```

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');
```

### Slim 2

[](#slim-2)

Once Clockwork is installed, you need to add Slim middleware to your app:

```
$app = new Slim(...);
$app->add(new Clockwork\Support\Slim\ClockworkMiddleware('/requests/storage/path'));
```

Clockwork is now available in Slim's DI container and can be used like this:

```
$app = Slim::getInstance();

$app->clockwork->startEvent('event_name', 'Event description.'); // event called 'Event description.' appears in Clockwork timeline tab

$app->clockwork->info('Message text.'); // 'Message text.' appears in Clockwork log tab
$app->log->info('Message text.'); // 'Message text.' appears in Clockwork log tab as well as application log file

$app->clockwork->endEvent('event_name');
```

### CodeIgniter 2.1

[](#codeigniter-21)

Once Clockwork is installed, you need to copy the Clockwork controller from `vendor/itsgoingd/clockwork/Clockwork/Support/CodeIgniter/Clockwork.php` to your controllers directory and set up the following route:

```
$route['__clockwork/(.*)'] = 'clockwork/$1';
```

Finally, you need to set up the Clockwork hooks by adding following to your `application/config/hooks.php` file:

```
Clockwork\Support\CodeIgniter\Register::registerHooks($hook);
```

To use Clockwork within your controllers/models/etc. you will need to extend your `CI_Controller` class. (If you haven't done so already) Create a new file at `application/core/MY_Controller.php`.

```
class MY_Controller extends CI_Controller
{
	public function __construct()
	{
		parent::__construct();
		$GLOBALS['EXT']->_call_hook('pre_controller_constructor');
	 }
}
```

Now you can use the following commands in your CodeIgniter app:

```
$this->clockwork->startEvent('event_name', 'Event description.'); // event called 'Event description.' appears in Clockwork timeline tab

$this->clockwork->info('Message text.'); // 'Message text.' appears in Clockwork log tab

$this->clockwork->endEvent('event_name');
```

### Other frameworks

[](#other-frameworks)

There is a [brief architecture overview](https://github.com/itsgoingd/clockwork/wiki/Development-notes) available, that should provide some help when implementing support for new frameworks or custom applications.

If you would like to see or are working on a support for yet unsupported framework feel free to open a new issue on github.

Addons
------

[](#addons)

- [clockwork-cli](https://github.com/ptrofimov/clockwork-cli) - Command-line interface to Clockwork by [ptrofimov](https://github.com/ptrofimov)
- [guzzle-clockwork](https://github.com/hannesvdvreken/guzzle-clockwork) - Plugin for logging Guzzle requests to Clockwork by [hannesvdvreken](https://github.com/hannesvdvreken)
- [silverstripe-clockwork](https://github.com/markguinn/silverstripe-clockwork) - Integration for SilverStripe CMS/framework by [markguinn](https://github.com/markguinn)
- [clockwork-firebug](https://github.com/sidorovich/clockwork-firebug) - Extension for Firebug (like for Chrome) by [Pavel Sidorovich](https://github.com/sidorovich)

Licence
-------

[](#licence)

Copyright (c) 2013 Miroslav Rigler

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 69.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~53 days

Recently: every ~85 days

Total

16

Last Release

3903d ago

Major Versions

v0.9.1 → v1.12013-09-27

PHP version history (2 changes)v0.9.0PHP &gt;=5.3.0

v1.3PHP &gt;=5.3.9

### Community

Maintainers

![](https://www.gravatar.com/avatar/bab37acc38e46b09f3452e2b81711dced89874ffa35a188687905242c4248011?d=identicon)[alahaxe](/maintainers/alahaxe)

---

Top Contributors

[![itsgoingd](https://avatars.githubusercontent.com/u/821582?v=4)](https://github.com/itsgoingd "itsgoingd (123 commits)")[![lahaxearnaud](https://avatars.githubusercontent.com/u/1364221?v=4)](https://github.com/lahaxearnaud "lahaxearnaud (16 commits)")[![pwhelan](https://avatars.githubusercontent.com/u/601645?v=4)](https://github.com/pwhelan "pwhelan (7 commits)")[![BradEstey](https://avatars.githubusercontent.com/u/578665?v=4)](https://github.com/BradEstey "BradEstey (5 commits)")[![matiux](https://avatars.githubusercontent.com/u/821668?v=4)](https://github.com/matiux "matiux (3 commits)")[![Garbee](https://avatars.githubusercontent.com/u/868301?v=4)](https://github.com/Garbee "Garbee (3 commits)")[![slovenianGooner](https://avatars.githubusercontent.com/u/1257629?v=4)](https://github.com/slovenianGooner "slovenianGooner (2 commits)")[![maximebeaudoin](https://avatars.githubusercontent.com/u/3246184?v=4)](https://github.com/maximebeaudoin "maximebeaudoin (2 commits)")[![hannesvdvreken](https://avatars.githubusercontent.com/u/1410358?v=4)](https://github.com/hannesvdvreken "hannesvdvreken (2 commits)")[![hermanzhu](https://avatars.githubusercontent.com/u/1592161?v=4)](https://github.com/hermanzhu "hermanzhu (2 commits)")[![jenssegers](https://avatars.githubusercontent.com/u/194377?v=4)](https://github.com/jenssegers "jenssegers (2 commits)")[![kylestev](https://avatars.githubusercontent.com/u/819571?v=4)](https://github.com/kylestev "kylestev (1 commits)")[![bstrahija](https://avatars.githubusercontent.com/u/125499?v=4)](https://github.com/bstrahija "bstrahija (1 commits)")[![danherd](https://avatars.githubusercontent.com/u/659658?v=4)](https://github.com/danherd "danherd (1 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (1 commits)")[![ingro](https://avatars.githubusercontent.com/u/879431?v=4)](https://github.com/ingro "ingro (1 commits)")[![Andreyco](https://avatars.githubusercontent.com/u/829963?v=4)](https://github.com/Andreyco "Andreyco (1 commits)")[![noevidenz](https://avatars.githubusercontent.com/u/1215393?v=4)](https://github.com/noevidenz "noevidenz (1 commits)")[![pborreli](https://avatars.githubusercontent.com/u/77759?v=4)](https://github.com/pborreli "pborreli (1 commits)")[![ptrofimov](https://avatars.githubusercontent.com/u/867178?v=4)](https://github.com/ptrofimov "ptrofimov (1 commits)")

---

Tags

laravelloggingdebuggingprofiling

### Embed Badge

![Health badge](/badges/lahaxearnaud-clockwork/health.svg)

```
[![Health](https://phpackages.com/badges/lahaxearnaud-clockwork/health.svg)](https://phpackages.com/packages/lahaxearnaud-clockwork)
```

###  Alternatives

[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M93](/packages/itsgoingd-clockwork)[sentry/sentry

PHP SDK for Sentry (http://sentry.io)

1.9k227.1M268](/packages/sentry-sentry)[sentry/sentry-laravel

Laravel SDK for Sentry (https://sentry.io)

1.3k114.3M152](/packages/sentry-sentry-laravel)[rollbar/rollbar

Monitors errors and exceptions and reports them to Rollbar

33723.7M81](/packages/rollbar-rollbar)[ptrofimov/clockwork-cli

Command-line interface for Clockwork, the tool for debugging and profiling PHP applications

43116.1k](/packages/ptrofimov-clockwork-cli)[moesif/moesif-laravel

Moesif Collection/Data Ingestion Middleware for Laravel

1065.8k](/packages/moesif-moesif-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
