コード例 #1
0
 /**
  *	Update Vars
  *
  *	@param	mixed	Key
  *	@param	mixed	Value
  *	@return	void
  */
 protected function updateVars($key, $value)
 {
     $this->vars[$key] = $value;
     CTM_Registry::setVars($key, $value);
 }
コード例 #2
0
 /**
  *	Init intaller now
  *
  *	@return	void
  */
 public static function initNow()
 {
     global $install_sections, $upgrade_sections, $repair_sections, $installation;
     CTM_Controller::PHPErrors();
     CTM_Command::instance()->loadLibrary(CTM_SETUP_MODE == "install" ? "Install" : (CTM_SETUP_MODE == "repair" ? "Repair" : "Upgrade"), "setup");
     CTM_Registry::init();
     CTM_Registry::setVars("section", $_GET['section']);
     CTM_Registry::setVars("max_sections", CTM_Command::instance()->setup->max_sections);
     CTM_Command::instance()->registry();
     CTM_Command::instance()->lang->loadLanguageFile("core:global");
     CTM_Command::instance()->output->registry();
     $continue = true;
     if (CTM_SETUP_MODE == "install") {
         $setup_sections = $install_sections;
         $sections_folder = "install";
         if ($installation['is_installed'] == true) {
             require_once CTM_SETUP_PATH . "sources/sections/install/block.php";
             $section->run();
             $section->content($content);
             $continue = false;
         }
     } elseif (CTM_SETUP_MODE == "default") {
         self::instance()->output->setTitles(self::instance()->lang->words['Default']['HTML'], self::instance()->lang->words['Default']['Step']);
         $content = array("type" => "core", "section" => "default_page");
         $continue = false;
         $GLOBALS['hide_button'] = true;
         $GLOBALS['hide_sidebar'] = true;
     } elseif (CTM_SETUP_MODE == "upgrade") {
         $setup_sections = $upgrade_sections;
         $sections_folder = "upgrade";
         if ($installation['current_version'] == EW_THIS_VERSION) {
             require_once CTM_SETUP_PATH . "sources/sections/upgrade/block.php";
             $section->run();
             $section->content($content);
             $continue = false;
         }
     } elseif (CTM_SETUP_MODE == "repair") {
         $setup_sections = $repair_sections;
         $sections_folder = "repair";
         if ($installation['is_installed'] == false) {
             header("Location: ?app=install");
             exit;
         } elseif ($installation['current_version'] < EW_THIS_VERSION) {
             header("Location: ?app=upgrade");
             exit;
         }
     }
     if ($continue == true && (CTM_SETUP_MODE == "upgrade" || CTM_SETUP_MODE == "repair")) {
         self::instance()->DB->settings['mssql']['hostname'] = MSSQL_HOSTNAME;
         self::instance()->DB->settings['mssql']['hostport'] = MSSQL_HOSTPORT;
         self::instance()->DB->settings['mssql']['database'] = CTMEW_CORE;
         self::instance()->DB->settings['mssql']['username'] = MSSQL_USERNAME;
         self::instance()->DB->settings['mssql']['password'] = MSSQL_PASSWORD;
         self::instance()->DB->settings['mssql']['persistent'] = FALSE;
         self::instance()->DB->settings['mssql']['hideErrors'] = TRUE;
         self::instance()->DB->settings['mssql']['debug'] = FALSE;
         self::instance()->DB->Connect("mssql");
         if (!self::instance()->DB->IsConnected()) {
             self::instance()->output->setTitles(self::instance()->lang->words['Default']['HTML'], self::instance()->lang->words['Default']['Step']);
             $content = array("type" => "core", "section" => "show_error");
             $continue = false;
             $GLOBALS['show_error'] = self::instance()->lang->words['DBConnectError'];
             $GLOBALS['hide_button'] = true;
             $GLOBALS['hide_sidebar'] = true;
         }
     }
     if ($continue == true) {
         if ($_GET['section']) {
             if (file_exists(CTM_SETUP_PATH . "sources/sections/" . $sections_folder . "/" . $setup_sections[$_GET['section']] . ".php") && CTM_Command::instance()->setup->CheckSection()) {
                 require_once CTM_SETUP_PATH . "sources/sections/" . $sections_folder . "/" . $setup_sections[$_GET['section']] . ".php";
                 $section->run();
                 $section->content($content);
             } else {
                 require_once CTM_SETUP_PATH . "sources/sections/" . $sections_folder . "/" . $setup_sections[1] . ".php";
                 $section->run();
                 $section->content($content);
             }
         } else {
             require_once CTM_SETUP_PATH . "sources/sections/" . $sections_folder . "/" . $setup_sections[1] . ".php";
             $section->run();
             $section->content($content);
         }
     }
     $GLOBALS['section'] = $_GET['section'] ? $_GET['section'] : 1;
     $GLOBALS['__session'] = $_POST['session'] ? $_POST['session'] : $_SESSION['SETUP_SESSION'];
     echo CTM_Command::instance()->output->returnFullContent($content);
     exit("\r\n<!-- Cetemaster PHP Installer v1.1 - Copyright 2013 (c) Cetemaster Services (www.cetemaster.com.br) -->");
 }