src/Budkit/Debug/Log.php
public function tick($class, array $params = array(), $usernameid = NULL, $decrement = false)
    {

        if (empty($class)):
            return false; //We need to know the class to tick
        endif;

        $handler = new File();
        $file = date("Y-m-d") . ".log";
        $folder = PATH_LOGS . DS . $class . DS;

        if (!$handler->isFile($folder . $file)) { //if its not a folder
            if (!$handler->create($folder . $file, "a+")) {
                throw new Exception("Could not create the log file {$file}");
                return false;
            }
        }

        unset($params["file"]);

        $tick = array_merge(array("time" => time(), "inc" => (!$decrement) ? "+1" : "-1"), $params);
        $line = json_encode($tick);

        if (!$handler->write($folder . $file, PHP_EOL . $line, "a+")) {
            throw new Exception("Could not write out to the stats file {$file}");
            return false;
        }

        return true;
    }
public function tick($class, array $params = array(), $usernameid = NULL, $decrement = false)
    {

        if (empty($class)):
            return false; //We need to know the class to tick
        endif;

        $handler = new File();
        $file = date("Y-m-d") . ".log";
        $folder = PATH_LOGS . DS . $class . DS;

        if (!$handler->isFile($folder . $file)) { //if its not a folder
            if (!$handler->create($folder . $file, "a+")) {
                throw new Exception("Could not create the log file {$file}");
                return false;
            }
        }

        unset($params["file"]);

        $tick = array_merge(array("time" => time(), "inc" => (!$decrement) ? "+1" : "-1"), $params);
        $line = json_encode($tick);

        if (!$handler->write($folder . $file, PHP_EOL . $line, "a+")) {
            throw new Exception("Could not write out to the stats file {$file}");
            return false;
        }

        return true;
    }
public function tick ( $ class , array $ params = array ( ) , $ usernameid = NULL , $ decrement = false ) { if ( empty ( $ class ) ) : return false ; //We need to know the class to tick endif ; $ handler = new File ( ) ; $ file = date ( "Y-m-d" ) . ".log" ; $ folder = PATH_LOGS . DS . $ class . DS ; if ( ! $ handler -> isFile ( $ folder . $ file ) ) { //if its not a folder if ( ! $ handler -> create ( $ folder . $ file , "a+" ) ) { throw new Exception ( "Could not create the log file {$file}" ) ; return false ; } } unset ( $ params [ "file" ] ) ; $ tick = array_merge ( array ( "time" => time ( ) , "inc" => ( ! $ decrement ) ? "+1" : "-1" ) , $ params ) ; $ line = json_encode ( $ tick ) ; if ( ! $ handler -> write ( $ folder . $ file , PHP_EOL . $ line , "a+" ) ) { throw new Exception ( "Could not write out to the stats file {$file}" ) ; return false ; } return true ; }
Ticks a user performed action

@param $class
@param array $params
@param null $usernameid
@param bool|false $decrement
@return bool
@throws Exception
Ticks a user performed action