<?php require 'cltr.php'; cltr\pdo_host('localhost'); cltr\pdo_dbname('my_blog'); cltr\pdo_user('root'); cltr\pdo_password('OloloO111'); cltr\pdo_table('page_time'); cltr\start(); sleep(1); cltr\stop();
def('cltr\\uri', function () { if (isset($_SERVER['REQUEST_URI'])) { return $_SERVER['REQUEST_URI']; } }); def('cltr\\host', function () { if (isset($_SERVER['HTTP_HOST'])) { return $_SERVER['HTTP_HOST']; } }); def('cltr\\time', function () { return microtime(true) - cltr\time_start(); }); def('cltr\\stop', function () { try { if (!cltr\pdo_host()) { return; } if (!cltr\time_start()) { return; } $db = cltr\pdo(); $db->query(' CREATE TABLE IF NOT EXISTS `' . cltr\pdo_table() . '` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `host` varchar(255) DEFAULT NULL, `uri` varchar(1024) DEFAULT NULL, `time` float(8,5) DEFAULT NULL, `memory` int(11) DEFAULT NULL, PRIMARY KEY (`id`)