* It is mainly there to show php warnings during testing/bug fixing phases.
* note for strict error reporting we also turn on show_errors as this may be disabled
* in php.ini. Otherwise we respect the php.ini setting
*
*/
if (defined('STRICT_ERROR_REPORTING') && STRICT_ERROR_REPORTING == true) {
@ini_set('display_errors', TRUE);
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);
} else {
error_reporting(0);
}
/*
* turn off magic-quotes support, for both runtime and sybase, as both will cause problems if enabled
*/
if (version_compare(PHP_VERSION, 5.3, '<') && function_exists('set_magic_quotes_runtime')) set_magic_quotes_runtime(0);
if (version_compare(PHP_VERSION, 5.4, '<') && @ini_get('magic_quotes_sybase') != 0) @ini_set('magic_quotes_sybase', 0);
// set php_self in the local scope
if (!isset($PHP_SELF)) $PHP_SELF = $_SERVER['PHP_SELF'];
/**
* Set the local configuration parameters - mainly for developers
*/
if (file_exists('includes/local/configure.php')) {
/**
* load any local(user created) configure file.
*/
include('includes/local/configure.php');
}
/**
* check for and load application configuration parameters
*/
if (file_exists('includes/configure.php')) {
/**
* load the main configure file.
*/
include('includes/configure.php');
}
if (!defined('DIR_FS_CATALOG') || !is_dir(DIR_FS_CATALOG.'/includes/classes') || !defined('DB_TYPE') || DB_TYPE == '') {
if (file_exists('../includes/templates/template_default/templates/tpl_zc_install_suggested_default.php')) {
require('../includes/templates/template_default/templates/tpl_zc_install_suggested_default.php');
exit;
} elseif (file_exists('../zc_install/index.php')) {
echo 'ERROR: Admin configure.php not found. Suggest running install? Click here for installation';
} else {
die('ERROR: admin/includes/configure.php file not found. Suggest running zc_install/index.php?');
}
}
/**
* ignore version-check if INI file setting has been set
*/
if (file_exists(DIR_FS_ADMIN . 'includes/local/skip_version_check.ini')) {
$lines = @file(DIR_FS_ADMIN . 'includes/local/skip_version_check.ini');
if (is_array($lines)) {
foreach($lines as $line) {
if (substr($line,0,14)=='admin_configure_php_check=') $check_cfg=substr(trim(strtolower(str_replace('admin_configure_php_check=','',$line))),0,3);
}
}
}
/*
// turned off for now
if ($check_cfg != 'off') {
// if the admin/includes/configure.php file doesn't contain admin-related content, throw error
$zc_pagepath = str_replace(basename($PHP_SELF),'',__FILE__); //remove page name from full path of current page
$zc_pagepath = str_replace(array('\\','\\\\'),'/',$zc_pagepath); // convert '\' marks to '/'
$zc_pagepath = str_replace('//','/',$zc_pagepath); //convert doubles to single
$zc_pagepath = str_replace(strrchr($zc_pagepath,'/'),'',$zc_pagepath); // remove trailing '/'
$zc_adminpage = str_replace('\\','/',DIR_FS_ADMIN); //convert "\" to '/'
$zc_adminpage = str_replace('//','/',$zc_adminpage); // remove doubles
$zc_adminpage = str_replace(strrchr($zc_adminpage,'/'),'',$zc_adminpage); // remove trailing '/'
if (!defined('DIR_WS_ADMIN') || $zc_pagepath != $zc_adminpage ) {
echo ('ERROR: The admin/includes/configure.php file has invalid configuration. Please rebuild, or verify specified paths.');
if (file_exists('../zc_install/index.php')) {
echo '
Click here for installation';
}
echo '
['.$zc_pagepath.'] «» [' .$zc_adminpage.']
';
}
}
*/
/**
* include the list of extra configure files
*/
if ($za_dir = @dir(DIR_WS_INCLUDES . 'extra_configures')) {
while ($zv_file = $za_dir->read()) {
if (preg_match('~^[^\._].*\.php$~i', $zv_file) > 0) {
/**
* load any user/contribution specific configuration files.
*/
include(DIR_WS_INCLUDES . 'extra_configures/' . $zv_file);
}
}
$za_dir->close();
}
/**
* init some vars
*/
$template_dir = '';
define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');
/**
* Prepare init-system
*/
unset($loaderPrefix); // admin doesn't need this override
$autoLoadConfig = array();
if (isset($loaderPrefix)) {
$loaderPrefix = preg_replace('/[^a-z_]/', '', $loaderPrefix);
} else {
$loaderPrefix = 'config';
}
$loader_file = $loaderPrefix . '.core.php';
require('includes/initsystem.php');
/**
* load the autoloader interpreter code.
*/
require(DIR_FS_CATALOG . 'includes/autoload_func.php');