Example #1
0
function strip_request_slashes(&$request)
{
    foreach ($request as $key => $val) {
        if (!is_array($request[$key])) {
            $request[$key] = stripslashes($val);
        } else {
            strip_request_slashes($request[$key]);
        }
    }
}
Example #2
0
define('CONFIG_DIR', APP_DIR . 'config/');
// directory where libraries are located
define('LIBRARIES_DIR', APP_DIR . 'libraries/');
// directory for logs
define('LOGS_DIR', APP_DIR . 'logs/');
// output errors to brower
ini_set('display_errors', true);
// level of errors to log/display
ini_set('error_reporting', E_ALL);
// log errors
ini_set('log_errors', true);
// file for error logging
ini_set('error_log', LOGS_DIR . 'error_log');
require_once LIBRARIES_DIR . 'dabl/ClassLoader.php';
require_once LIBRARIES_DIR . 'dabl/print_r2.php';
// Strip added slashes if needed
if (get_magic_quotes_gpc()) {
    require_once LIBRARIES_DIR . 'dabl/strip_request_slashes.php';
    strip_request_slashes();
}
ClassLoader::addRepository('LIBRARIES', LIBRARIES_DIR);
ClassLoader::import('LIBRARIES:dabl');
if (is_file(APP_DIR . 'vendor/autoload.php')) {
    require_once APP_DIR . 'vendor/autoload.php';
}
// load all config files
$config_files = glob(CONFIG_DIR . '*.php');
sort($config_files);
foreach ($config_files as $filename) {
    require_once $filename;
}