/** * Sets the step based on a few checks * * @return void */ private function setStep() { // fetch step $step = isset($_GET['step']) ? (int) $_GET['step'] : 1; if ($step !== 1) { // invalid requirements, so force step 2 if (!InstallerStep2::checkRequirements()) { $step = 2; } } // installer step class exists if (class_exists('InstallerStep' . $step)) { // isAllowed exists if (is_callable(array('InstallerStep' . $step, 'isAllowed'))) { // step is actually allowed if (call_user_func(array('InstallerStep' . $step, 'isAllowed'))) { // step has been validated $this->step = $step; // step out return; } } } // fallback $this->step = 1; }
/** * Is this step allowed. * * @return bool */ public static function isAllowed() { return InstallerStep2::isAllowed() && InstallerStep2::checkRequirements(); }