forked from avdg/ppi-framework-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.php
53 lines (43 loc) · 2.02 KB
/
init.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
*
* @version 1.0
* @author Paul Dragoonis <dragoonis@php.net>
* @license http://opensource.org/licenses/mit-license.php MIT
* @copyright Digiflex Development
* @package PPI
*/
// ---- site wide -----
defined('DS') || define('DS', DIRECTORY_SEPARATOR);
defined('ROOTPATH') || define('ROOTPATH', getcwd() . DS);
defined('SYSTEMPATH') || define('SYSTEMPATH', dirname(__FILE__) . DS);
defined('BASEPATH') || define('BASEPATH', dirname(__FILE__) . DS);
defined('TESTPATH') || define('TESTPATH', SYSTEMPATH . 'Test' . DS);
defined('APPFOLDER') || define('APPFOLDER', ROOTPATH . 'App' . DS);
defined('VENDORPATH') || define('VENDORPATH', SYSTEMPATH . 'Vendor' . DS);
// ---- plugin paths ----
defined('PLUGINPATH') || define('PLUGINPATH', SYSTEMPATH . 'plugins' . DS);
defined('PLUGINCONTROLLERPATH') || define('PLUGINCONTROLLERPATH', PLUGINPATH . 'controllers' . DS);
defined('PLUGINMODELPATH') || define('PLUGINMODELPATH', PLUGINPATH . 'models' . DS);
// ---- app paths ------
defined('MODELPATH') || define('MODELPATH', APPFOLDER . 'Model' . DS);
defined('VIEWPATH') || define('VIEWPATH', APPFOLDER . 'View' . DS);
defined('CONTROLLERPATH') || define('CONTROLLERPATH', APPFOLDER . 'Controller' . DS);
defined('CONFIGPATH') || define('CONFIGPATH', APPFOLDER . 'Config' . DS);
defined('EXT') || define('EXT', '.php');
// ------- system constants -------
defined('PPI_VERSION') || define('PPI_VERSION', '1.1');
set_include_path('.' . PATH_SEPARATOR . SYSTEMPATH . PATH_SEPARATOR . get_include_path());
// Autoload registration
require 'Autoload.php';
PPI_Autoload::register();
PPI_Autoload::add('PPI', array('path' => SYSTEMPATH, 'prefix' => 'PPI_'));
PPI_Autoload::add('APP', array('path' => APPFOLDER, 'prefix' => 'APP_'));
// General stuff
require 'common.php';
// load up custom error handlers
require 'errors.php';
setErrorHandlers('ppi_error_handler', 'ppi_exception_handler');
if(version_compare(PHP_VERSION, '5.3.0', '<')) {
set_magic_quotes_runtime(0); // Kill magic quotes
}