1. Go to this page and download the library: Download lahaxearnaud/clockwork library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
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');
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');
$app = new Slim(...);
$app->add(new Clockwork\Support\Slim\ClockworkMiddleware('/requests/storage/path'));
$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');
class MY_Controller extends CI_Controller
{
public function __construct()
{
parent::__construct();
$GLOBALS['EXT']->_call_hook('pre_controller_constructor');
}
}
$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');