Beispiel #1
0
 public static function getConfig()
 {
     $modules_path = rtrim(JO_Front::getInstance()->getModuleDirectory(), '/');
     $list = glob($modules_path . '/*');
     $modules = array();
     if ($list) {
         foreach ($list as $dir) {
             if (!in_array(basename($dir), array('admin', 'update', 'install'))) {
                 if (file_exists($dir . '/config.ini')) {
                     $config = new JO_Config_Ini($dir . '/config.ini');
                     $modules[basename($dir)] = $config->toArray();
                 }
             }
         }
     }
     return $modules;
 }
Beispiel #2
0
// Create application, bootstrap, and run
$application = new JO_Application(APPLICATION_ENV, APPLICATION_PATH . '/config/application.ini', isset($argv) ? $argv : null);
// Set Config
$configs_files = glob(APPLICATION_PATH . '/config/config_*.ini');
if ($configs_files) {
    foreach ($configs_files as $file) {
        $config = new JO_Config_Ini($file);
        $application->setOptions($config->toArray());
        JO_Registry::set(basename($file, '.ini'), $config->toArray());
    }
}
// Set Routers links
$routers_files = glob(APPLICATION_PATH . '/config/routers/*.ini');
if ($routers_files) {
    foreach ($routers_files as $file) {
        $config = new JO_Config_Ini($file, null, false, true);
        $application->setOptions($config->toArray());
        JO_Registry::set('routers_' . basename($file, '.ini'), $config->toArray());
    }
}
//dispatch application
$application->dispatch();
// error handler function
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
    if (!(error_reporting() & $errno)) {
        // This error code is not included in error_reporting
        return;
    }
    switch ($errno) {
        case E_USER_ERROR: