예제 #1
0
파일: ajax.php 프로젝트: Ashaan/phpgallery
 static function getInstance()
 {
     if (is_null(ajax::$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 . '/ajax.php')) {
             require_once LOCAL_PATH . LOCAL_DIR . 'module/' . $zone . '/ajax.php';
         }
         if (class_exists('module_' . $zone . '_ajax')) {
             $class = 'module_' . $zone . '_ajax';
             ajax::$instance = new $class();
         } else {
             ajax::$instance = new ajax();
         }
     }
     return ajax::$instance;
 }