예제 #1
0
 public function delCookie($name)
 {
     try {
         SetCookie($name, "");
     } catch (Exception $e) {
         throw Exeption::ThrowDef('Failed delete cookie var - ' . $e);
     }
 }
예제 #2
0
파일: Ses.php 프로젝트: AstafievAndrey/flf
 public function delSesValue($ses_name)
 {
     try {
         unset($_SESSION[$ses_name]);
     } catch (Exception $e) {
         throw Exeption::ThrowDef('Failed delete sesions var - ' . $e);
     }
 }
예제 #3
0
파일: Logg.php 프로젝트: AstafievAndrey/flf
 function __destruct()
 {
     try {
         fclose($this->fp);
     } catch (Exception $e) {
         throw Exeption::ThrowDef('Failed close work file log' . $e->getMessage());
     }
 }
예제 #4
0
파일: Ini.php 프로젝트: AstafievAndrey/flf
 public function __construct()
 {
     if (file_exists(APP_DIR . '/config/default_application.ini')) {
         $this->ArrayIni = parse_ini_file(APP_DIR . '/config/' . APP_CONF);
     } else {
         throw Exeption::ThrowDef('File configuration not found');
     }
 }
예제 #5
0
 public function viewLayout($lay, $layout_params = null)
 {
     if (file_exists(APP_DIR . "/modules/" . $this->module_name . "/layouts/" . $lay . ".phtml")) {
         require_once APP_DIR . "/modules/" . $this->module_name . "/layouts/" . $lay . ".phtml";
     } else {
         throw Exeption::ThrowDef("Error : not found layout " . $lay);
     }
 }
예제 #6
0
 public function order($field = null)
 {
     if (is_string($field) && $field != null) {
         $this->_sql .= ' order by ' . $field;
     } else {
         throw Exeption::ThrowDef('Order is null or array');
     }
     return $this;
 }
예제 #7
0
<?php

use MVC\Controller;
use Thr\Exept as Exeption;
define("MODULE_DIR", dirname(__FILE__));
spl_autoload_register(function ($className) {
    $classes = MODULE_DIR . "/" . str_replace("\\", "/", $className) . ".php";
    $libs = APP_DIR . "/libs/" . str_replace("\\", "/", $className) . ".php";
    if (file_exists($classes)) {
        require_once $classes;
    } else {
        if (file_exists($libs)) {
            require_once $libs;
        } else {
            throw Exeption::ThrowDef("NOT FOUND CLASS - " . $libs);
        }
    }
});
$obj = new Controller();
$obj->run();