static function getInstance() { if (is_null(index::$instance)) { $session = session::getInstance(); $zone = $session->getData('zone'); if (!$zone) { $zone = ZONE_DEFAULT; $session->setData('zone', $zone); } if ($zone && file_exists(LOCAL_PATH . LOCAL_DIR . 'module/' . $zone . '/index.php')) { require_once LOCAL_PATH . LOCAL_DIR . 'module/' . $zone . '/index.php'; } if (class_exists('module_' . $zone . '_index')) { $class = 'module_' . $zone . '_index'; index::$instance = new $class(); } else { index::$instance = new index(); } } return index::$instance; }