-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
29 lines (26 loc) · 995 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
define( 'IN' , true );
define( 'ROOT' , dirname( __FILE__ ) . '/' );
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
error_reporting( E_ALL^E_NOTICE );
include_once( ROOT . 'engine/init.inc.php' );
session_cache_limiter('private, must-revalidate');
session_set_cookie_params( 60*60*24*1 ); //1day
session_start();
if( !isAjax() ){
header("content-Type: text/html; charset=Utf-8");
}
$class = safeUrlString($_REQUEST['c']?:c('default_class'));
$method = $_REQUEST['m']?:c('default_method');
$controllersFile = ROOT.'controllers/'.$class.'.class.php';
if( !is_file( $controllersFile ) ){
die( "can't find controller file " );
}else{
include_once( $controllersFile );
if( !class_exists( $class ) ) die('Error Can\'t find class' );
if( !method_exists( $class , $method ) ) die('Error Can\'t find method ' );
$class = new $class;
}
//print_r( $_SERVER );
call_user_func(array($class, $method ));
?>