Example #1
0
 public static function init()
 {
     self::$start = self::time();
     self::$prev = self::$start;
     register_shutdown_function(function () {
         Logger::log('shutdown');
     });
     Logger::log('--------------------------------');
 }
Example #2
0
 /**
  * Test starting when already started.
  */
 public function testAlreadyStarted()
 {
     $this->assertTrue(\Logger::isActive());
     try {
         \Logger::start();
         $this->assertTrue(false);
     } catch (LogException $le) {
         $this->assertTrue(true);
     }
 }
Example #3
0
 /**
  * 获取系统日志实例
  * @return SystemLog
  */
 public static function getSystemLog($key = 'web')
 {
     if (isset(self::$SYS_LOG[$key])) {
         return self::$SYS_LOG[$key];
     }
     $logPath = Conf::get('LOG_PATH') . $key;
     $log = new Logger($logPath);
     $log->start();
     self::$SYS_LOG[$key] = $log;
     return self::$SYS_LOG[$key];
 }
Example #4
0
<?php

require_once __DIR__ . '/../../includes/helpers.php';
require_once __DIR__ . '/../../loader.php';
require_once __DIR__ . '/../../includes/Session.php';
Logger::start()->add(User::getUser($_SESSION['uid'])->username, $_SERVER['PHP_SELF'], 'Logout');
session_destroy();
redirect_to('login.php');
Example #5
0
require_once __DIR__ . '/../../includes/helpers.php';
require_once __DIR__ . '/../../loader.php';
$a = new Auth();
if (Auth::isLoggedIn()) {
    redirect_to('index.php');
    exit;
}
if (isset($_POST['submit'])) {
    $username = $_POST['username'];
    $password = $_POST['password'];
    $u = User::auth($username, $password);
    if ($u) {
        $a->login($u);
        $_SESSION['ACTIVITY'] = time();
        Logger::start()->add($username, $_SERVER['PHP_SELF'], 'Login');
        redirect_to('index.php');
    } else {
        $msg = opmsg("Username or Password Incorrect", "danger");
    }
} else {
    $username = "";
    $password = "";
    $msg = "";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
Example #6
0
require_once __DIR__ . '/../../loader.php';
Session::checkSession();
$a = new Auth();
if (!$a->isLoggedIn()) {
    redirect_to('login.php');
    exit;
}
$u = User::getUser();
$msg = "";
if (isset($_POST['addPicture'])) {
    $p = new Pics();
    $p->caption = $_POST['caption'];
    $p->slug = slugify($_POST['caption']);
    $upload = $p->start($_FILES['picture']);
    if ($upload) {
        Logger::start()->add($u->username, $_SERVER['PHP_SELF'], 'File Upload');
        $msg = opmsg("Picture uploaded successfully", "success");
    } else {
        $msg = opmsg($p->errors[0], "failed");
    }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<!--<link rel="icon" href="../../favicon.ico"> -->
<title>Photolia</title>
Example #7
0
 * @author     Tom Valk <*****@*****.**>
 * @copyright  2016 Tom Valk
 */
use Arvici\Heart\Config\Configuration;
/**
 * Define the base directory containing the 'App' folder.
 */
defined('BASEPATH') || define('BASEPATH', __DIR__ . DS);
/**
 * Define all the paths in the base.
 */
defined('APPPATH') || define('APPPATH', BASEPATH . 'App' . DS);
/**
 * Load all configuration files.
 */
$configDir = APPPATH . '/Config/';
foreach (glob($configDir . '*.php') as $fileName) {
    require_once $fileName;
}
/**
 * Set default timezone
 */
date_default_timezone_set(Configuration::get('app.timezone', 'UTC'));
/**
 * Start the logger.
 */
\Logger::start();
/**
 * Start the router.
 */
\Arvici\Component\Router::getInstance()->run();
Example #8
0
<?php

require_once __DIR__ . '/../../includes/helpers.php';
require_once __DIR__ . '/../../loader.php';
Session::checkSession();
$a = new Auth();
if (!$a->isLoggedIn()) {
    redirect_to('login.php');
    exit;
}
if (isset($_POST['reset'])) {
    Logger::start()->reset();
}
$u = User::getUser();
$l = Logger::start()->get();
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
	<!--<link rel="icon" href="../../favicon.ico"> -->
	<title>Photolia</title>

	<!-- Bootstrap core CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">    
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
	<link rel="stylesheet" href="../css/style.css"
	<!-- Custom styles for this template -->