Регистр файлов

This commit is contained in:
origami11 2017-02-16 10:14:36 +03:00
parent 4fd0187ea6
commit c8958cbee0
83 changed files with 25 additions and 53 deletions

View file

@ -0,0 +1,24 @@
<?php
class ActionLogger
{
public $before = array ();
public $file;
public $action;
public $processor;
function __construct($processor)
{
$this->processor = $processor;
$this->file = fopen(Shortcut::getUrl('access.log'), "a");
}
function execute(HTTPRequest $request)
{
$action = $request->getAction();
if(in_array($action, $this->before)) {
fwrite($this->file, "time: " . date("r", time()) . " query: ". json::encode(array_merge($_POST, $_GET)) . " by: " . UserAccess::$name . "\n");
}
return $this->processor->execute($request);
}
}