Exemplo n.º 1
0
 /**
  * Class constructor
  * 
  * @return  void
  */
 public function __construct()
 {
     // Calls the parent constructor
     parent::__construct();
     // Checks if the static variables are set
     if (!self::$_hasStatic) {
         // Sets the static variables
         self::_setStaticVars();
     }
     // Creates an INI file parser with the default configuration file
     $this->_ini = new Woops_Ini_Parser(self::$_env->getSourcePath('config.ini.php'));
     // Gets the ini values
     $this->_iniValues = $this->_ini->getIniArray();
     // Creates the base form tag
     $this->_content = new Woops_Xhtml_Tag('form');
     $this->_content['action'] = Woops_Core_Env_Getter::getInstance()->getSourceWebPath('scripts/install/');
     // Adds the form method
     // GET is used on IIS, as I've got a strange bug on my test VM. I'll need to check this out...
     $this->_content['method'] = self::$_env->PHP_SAPI_NAME === 'isapi' ? 'GET' : 'POST';
     // Creates the container for the menu
     $menu = $this->_content->div;
     // Current installation step
     $step = $this->_getModuleVar('install-step');
     switch ($step) {
         // Welcome
         case false:
             // Creates the welcome screen
             $this->_welcomeScreen();
             break;
             // General configuration
         // General configuration
         case 1:
             // Install step 1
             $this->_installStep1();
             // Creates the menu
             $this->_createMenu($menu);
             break;
             // Database engine
         // Database engine
         case 2:
             // Steps before are completed
             $this->_step1 = true;
             // Install step 2
             $this->_installStep2();
             // Creates the menu
             $this->_createMenu($menu);
             break;
             // Database parameters
         // Database parameters
         case 3:
             // Steps before are completed
             $this->_step1 = true;
             $this->_step2 = true;
             $this->_installStep3();
             // Creates the menu
             $this->_createMenu($menu);
             break;
             // Database parameters
         // Database parameters
         case 4:
             // Steps before are completed
             $this->_step1 = true;
             $this->_step2 = true;
             $this->_step3 = true;
             $this->_installStep4();
             // Creates the menu
             $this->_createMenu($menu);
             break;
     }
 }
Exemplo n.º 2
0
 /**
  * Sets the needed static variables
  * 
  * @return  void
  */
 private static function _setStaticVars()
 {
     self::$_conf = Woops_Core_Config_Getter::getInstance();
     self::$_modManager = Woops_Core_Module_Manager::getInstance();
     self::$_request = Woops_Core_Request_Getter::getInstance();
     self::$_env = Woops_Core_Env_Getter::getInstance();
     self::$_str = Woops_String_Utils::getInstance();
     self::$_moduleVariables = self::$_request->getWoopsVar('mod');
     // Static variables are set
     self::$_hasStatic = true;
 }