<?php


//TemplateEngine::$debug = true;

if(DB::$debug)
    Route::$function_finish = function(){
        /*if(isset(users::$thisUser)){
            $user = users::$thisUser->email ?: false;
            if($user)
                $user .= (users::$thisUser->admin ? ' (ADMIN)' : '');
            else $user = 'guest';
        } else $user = 'guest';*/

        SYS::Loging('./user/'.date('Y.m.d').'_ua.log', array('page','ip','ua','get','cookie','post'));

        $user = 'guest';

        if(file_exists("./logSQL.log"))
            $fp=fopen("./logSQL.log","a");
        else $fp=fopen("./logSQL.log","w");
        fwrite($fp, "\n" . $user. " [" . Route::getUserMethod() . ']: ' . Route::getUserURL() . "\n" . DB::get_debug("\n") . "\n");
        fclose($fp);
    };

