50 строки
825 B
PHP
50 строки
825 B
PHP
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: Игорь
|
|
* Date: 23.01.2017
|
|
* Time: 01:58
|
|
*/
|
|
|
|
namespace PFRM;
|
|
|
|
|
|
class App {
|
|
|
|
protected $user_agent;
|
|
|
|
protected $user_IP;
|
|
|
|
protected $route_table;
|
|
|
|
function __construct() {
|
|
date_default_timezone_set('Europe/Moscow');
|
|
error_reporting(E_ALL);
|
|
$this->user_agent = $_SERVER['HTTP_USER_AGENT'];
|
|
$this->user_IP = $_SERVER['REMOTE_ADDR'];
|
|
$this->setRoute('/^\/$/','Index','index');
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function getUseragent() {
|
|
return $this->user_agent;
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function getUserIP() {
|
|
return $this->user_IP;
|
|
}
|
|
|
|
public function setRoute( $regexp, $controller, $action = 'index') {
|
|
$this->route_table[] = array($regexp,$controller,$action);
|
|
}
|
|
|
|
|
|
public function run(){
|
|
|
|
}
|
|
} |