2017 © Pedro Peláez
 

library request-logging

A simpe PHP class for logging incoming requests.

image

abbe98/request-logging

A simpe PHP class for logging incoming requests.

  • Saturday, October 4, 2014
  • by Abbe98
  • Repository
  • 1 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

request-logging

Request logging library in PHP, (*1)

Installation

Include rqeuest_logging.php or add the [composer package]0., (*2)

Define the database configuration:, (*3)

define('HOST', '127.0.0.1'); // the IP of the database
define('DBNAME', 'reqlog_test'); // the database name to be used
define('USERNAME', 'root'); // the username to be used with the database
define('PASSWORD', ''); // the password to be used with the username

And run the following SQL in the database you defined above:, (*4)

CREATE TABLE IF NOT EXISTS `requests` (
`id` int(255) NOT NULL,
  `ip` varchar(45) COLLATE utf8mb4_bin NOT NULL,
  `http_forwared` int(45) NOT NULL,
  `browser_ua` varchar(600) COLLATE utf8mb4_bin NOT NULL,
  `timestamp` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  `tag` varchar(700) COLLATE utf8mb4_bin NOT NULL
) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=27 ;

ALTER TABLE `requests`
 ADD PRIMARY KEY (`id`);

ALTER TABLE `requests`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=27;

Usage

Log the current request(IP, HTTP forwarded, Browser User Agent and Time Samp). The $tagString is optional:, (*5)

$log = new ReqLog($tagString);, (*6)

Get the number of visits from the current computer/browser(by adding $tagString you get the tag specific data):, (*7)

$log->num_visits();, (*8)

Get the number of visits from the current computer($tagString is optional):, (*9)

$log->num_ip_visits();, (*10)

Get the percent that the current browser version has($tagString is not supported):, (*11)

$log->this_browser_percent();, (*12)

Licensed under MIT., (*13)

The Versions

04/10 2014

dev-master

9999999-dev https://github.com/Abbe98/request-logging

A simpe PHP class for logging incoming requests.

  Sources   Download

MIT

The Requires

 

database logging ip requests

04/10 2014

1.1.0

1.1.0.0 https://github.com/Abbe98/request-logging

A simpe PHP class for logging incoming requests.

  Sources   Download

MIT

The Requires

 

database logging ip requests

11/09 2014

1.0.0

1.0.0.0 https://github.com/Abbe98/request-logging

A simpe PHP class for logging incoming requests.

  Sources   Download

MIT

The Requires

 

database logging ip requests