ptest/frm/App.php

50 строки
825 B
PHP
Исходник Обычный вид История

2017-01-22 23:47:24 +00:00
<?php
/**
* Created by PhpStorm.
* User: Игорь
* Date: 23.01.2017
* Time: 01:58
*/
2017-01-23 10:25:19 +00:00
namespace PFRM;
2017-01-22 23:47:24 +00:00
class App {
2017-01-23 10:25:19 +00:00
protected $user_agent;
protected $user_IP;
protected $route_table;
2017-01-22 23:47:24 +00:00
function __construct() {
date_default_timezone_set('Europe/Moscow');
error_reporting(E_ALL);
2017-01-23 10:25:19 +00:00
$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;
2017-01-22 23:47:24 +00:00
}
2017-01-23 10:25:19 +00:00
/**
* @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(){
2017-01-22 23:47:24 +00:00
}
}