<?php

/*
 * Install.class.php    (安装控制器)
 * @projectname  QCCMS
 * @package      
 * @author       qccms
 * @copyright    qccms
 * @license     
 * @version      2013-08-14
 */

class Install {

	private $Output, $Process, $step;

	public function __construct($step) {
		$this->Output = new Output();
		$this->Process = new Process();
		$this->step = $step;
	}

	//执行安装步骤
	public function execInstall() {
		switch ($this->step) {
			case 0:
				echo $license = $this->Output->outputLicense($this->Process->getLicense());
				break;
			case 1:
				$env = $this->Process->checkEnv();
				$dirFile= $this->Process->getDirFile();
				$funsResult=  $this->Process->checkFuns();
				echo $this->Output->outputStep1($this->step,$env,$dirFile,$funsResult);
				break;
			case 2:
				echo $this->Output->outputStep2($this->step);
				break;
			case 3:
				$process= $this->Process->dbSetup($_POST);
				echo $this->Output->outputStep3($this->step,$process);
				break;
			case 4:
				echo $this->Output->outputStep4($this->step);
				break;
		}
	}

}

?>
