Advertisement
Guest User

Untitled

a guest
Jul 25th, 2013
490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.38 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. error_reporting(E_ALL ^ E_NOTICE);
  5. @ini_set('display_errors', 'on');
  6.  
  7. define('DS', DIRECTORY_SEPARATOR);
  8. define('SITE_ROOT', str_replace('core', '', dirname(__FILE__)));
  9. define('CORE_PATH', dirname(__FILE__) );
  10. define('CORE_LIB_PATH', CORE_PATH.DS.'lib');
  11. define('CLASS_PATH', CORE_PATH.DS.'classes');
  12. define('TEMPLATES_PATH', CORE_PATH.DS.'templates');
  13. define('MODULES_PATH', CORE_PATH.DS.'modules');
  14. define('CACHE_PATH', CORE_PATH.DS.'cache');
  15. define('COMMON_PATH', CORE_PATH.DS.'common');
  16. define('PAGES_PATH', CORE_PATH.DS.'pages');
  17. define('LIB_PATH', SITE_ROOT.DS.'lib');
  18. define('DOCTRINE_MODELS_PATH', CORE_PATH.DS.'models');
  19.  
  20. $version = phpversion();
  21. if($version[0] != '5')
  22. {
  23. die('You are not running PHP 5+');
  24. }
  25.  
  26. require CLASS_PATH.DS.'autoload.php';
  27. spl_autoload_register('codon_autoload');
  28.  
  29. Config::Set('MODULES_PATH', CORE_PATH.DS.'modules');
  30. Config::Set('MODULES_AUTOLOAD', true);
  31.  
  32. require CORE_PATH.DS.'app.config.php';
  33. @include CORE_PATH.DS.'local.config.php';
  34.  
  35. /* Set the language */
  36. Lang::set_language(Config::Get('SITE_LANGUAGE'));
  37.  
  38. error_reporting(Config::Get('ERROR_LEVEL'));
  39. Debug::$debug_enabled = Config::Get('DEBUG_MODE');
  40.  
  41. /* Init caching engine */
  42. CodonCache::init($cache_settings);
  43.  
  44. if(DBASE_NAME != '' && DBASE_SERVER != '' && DBASE_NAME != 'DBASE_NAME')
  45. {
  46. require CLASS_PATH.DS.'ezdb/ezdb.class.php';
  47.  
  48. DB::$show_errors = Config::Get('DEBUG_MODE');
  49. DB::$throw_exceptions = false;
  50.  
  51. DB::init(DBASE_TYPE);
  52.  
  53. DB::set_log_errors(Config::Get('DEBUG_MODE'));
  54. DB::set_error_handler(array('Debug', 'db_error'));
  55.  
  56. DB::set_caching(false);
  57. DB::$table_prefix = TABLE_PREFIX;
  58. DB::set_cache_dir(CACHE_PATH);
  59. DB::$DB->debug_all = false;
  60.  
  61. if(Config::Get('DEBUG_MODE') == true)
  62. DB::show_errors();
  63. else
  64. DB::hide_errors();
  65.  
  66. if(!DB::connect(DBASE_USER, DBASE_PASS, DBASE_NAME, DBASE_SERVER))
  67. {  
  68. Debug::showCritical(Lang::gs('database.connection.failed').' ('.DB::$errno.': '.DB::$error.')');
  69. die();
  70. }
  71.  
  72. # Set the charset type to send to mysql
  73. if(Config::Get('DB_CHARSET_NAME') !== '')
  74. {
  75. DB::query('SET NAMES \''.Config::Get('DB_CHARSET_NAME').'\'');
  76. }
  77. }
  78.  
  79. include CORE_PATH.DS.'bootstrap.inc.php';
  80.  
  81. if(function_exists('pre_module_load'))
  82. {
  83. pre_module_load();
  84. }
  85.  
  86. MainController::loadEngineTasks();
  87.  
  88. if(function_exists('post_module_load'))
  89. post_module_load();
  90.  
  91. define('SKINS_PATH', LIB_PATH.DS.'skins'.DS.CURRENT_SKIN);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement