|
ZenCart_Documentation
1.5.0
http://www.collinsharper.com
|
00001 <?php 00020 define('DEBUG_AUTOLOAD', false); 00025 define('IS_ADMIN_FLAG', true); 00029 // Start the clock for the page parse time log 00030 define('PAGE_PARSE_START_TIME', microtime()); 00040 if (defined('STRICT_ERROR_REPORTING') && STRICT_ERROR_REPORTING == true) { 00041 @ini_set('display_errors', TRUE); 00042 error_reporting(version_compare(PHP_VERSION, 5.3, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE : version_compare(PHP_VERSION, 5.4, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT : E_ALL & ~E_NOTICE); 00043 } else { 00044 error_reporting(0); 00045 } 00046 /* 00047 * turn off magic-quotes support, for both runtime and sybase, as both will cause problems if enabled 00048 */ 00049 if (version_compare(PHP_VERSION, 5.3, '<') && function_exists('set_magic_quotes_runtime')) set_magic_quotes_runtime(0); 00050 if (version_compare(PHP_VERSION, 5.4, '<') && @ini_get('magic_quotes_sybase') != 0) @ini_set('magic_quotes_sybase', 0); 00051 // set php_self in the local scope 00052 if (!isset($PHP_SELF)) $PHP_SELF = $_SERVER['PHP_SELF']; 00053 00057 if (file_exists('includes/local/configure.php')) { 00061 include('includes/local/configure.php'); 00062 } 00066 if (file_exists('includes/configure.php')) { 00070 include('includes/configure.php'); 00071 } 00072 if (!defined('DIR_FS_CATALOG') || !is_dir(DIR_FS_CATALOG.'/includes/classes') || !defined('DB_TYPE') || DB_TYPE == '') { 00073 if (file_exists('../includes/templates/template_default/templates/tpl_zc_install_suggested_default.php')) { 00074 require('../includes/templates/template_default/templates/tpl_zc_install_suggested_default.php'); 00075 exit; 00076 } elseif (file_exists('../zc_install/index.php')) { 00077 echo 'ERROR: Admin configure.php not found. Suggest running install? <a href="../zc_install/index.php">Click here for installation</a>'; 00078 } else { 00079 die('ERROR: admin/includes/configure.php file not found. Suggest running zc_install/index.php?'); 00080 } 00081 } 00085 if (file_exists(DIR_FS_ADMIN . 'includes/local/skip_version_check.ini')) { 00086 $lines = @file(DIR_FS_ADMIN . 'includes/local/skip_version_check.ini'); 00087 if (is_array($lines)) { 00088 foreach($lines as $line) { 00089 if (substr($line,0,14)=='admin_configure_php_check=') $check_cfg=substr(trim(strtolower(str_replace('admin_configure_php_check=','',$line))),0,3); 00090 } 00091 } 00092 } 00093 /* 00094 // turned off for now 00095 if ($check_cfg != 'off') { 00096 // if the admin/includes/configure.php file doesn't contain admin-related content, throw error 00097 $zc_pagepath = str_replace(basename($PHP_SELF),'',__FILE__); //remove page name from full path of current page 00098 $zc_pagepath = str_replace(array('\\','\\\\'),'/',$zc_pagepath); // convert '\' marks to '/' 00099 $zc_pagepath = str_replace('//','/',$zc_pagepath); //convert doubles to single 00100 $zc_pagepath = str_replace(strrchr($zc_pagepath,'/'),'',$zc_pagepath); // remove trailing '/' 00101 $zc_adminpage = str_replace('\\','/',DIR_FS_ADMIN); //convert "\" to '/' 00102 $zc_adminpage = str_replace('//','/',$zc_adminpage); // remove doubles 00103 $zc_adminpage = str_replace(strrchr($zc_adminpage,'/'),'',$zc_adminpage); // remove trailing '/' 00104 if (!defined('DIR_WS_ADMIN') || $zc_pagepath != $zc_adminpage ) { 00105 echo ('ERROR: The admin/includes/configure.php file has invalid configuration. Please rebuild, or verify specified paths.'); 00106 if (file_exists('../zc_install/index.php')) { 00107 echo '<br /><a href="../zc_install/index.php">Click here for installation</a>'; 00108 } 00109 echo '<br /><br /><br /><br />['.$zc_pagepath.'] «» [' .$zc_adminpage.']<br />'; 00110 } 00111 } 00112 */ 00116 if ($za_dir = @dir(DIR_WS_INCLUDES . 'extra_configures')) { 00117 while ($zv_file = $za_dir->read()) { 00118 if (preg_match('/\.php$/', $zv_file) > 0) { 00122 include(DIR_WS_INCLUDES . 'extra_configures/' . $zv_file); 00123 } 00124 } 00125 $za_dir->close(); 00126 } 00130 $template_dir = ''; 00131 define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/'); 00135 unset($loaderPrefix); // admin doesn't need this override 00136 $autoLoadConfig = array(); 00137 if (isset($loaderPrefix)) { 00138 $loaderPrefix = preg_replace('/[^a-z_]/', '', $loaderPrefix); 00139 } else { 00140 $loaderPrefix = 'config'; 00141 } 00142 $loader_file = $loaderPrefix . '.core.php'; 00143 require('includes/initsystem.php'); 00147 require(DIR_FS_CATALOG . 'includes/autoload_func.php');