src-dev/Mouf/Installer/ComposerInstaller.php
public function validateCurrentInstall() {
		if (!file_exists($this->installStatusFile)) {
			throw new MoufException("No install status file found. I don't know what install task should be run.");
		}
		
		$statusArray = json_decode(file_get_contents($this->installStatusFile), true);
		if ($statusArray['type'] == 'one') {
			$taskArray = $statusArray['task'];
			// Now, let's find the matching task and mark it "done".
			$installTask = $this->findInstallTaskFromArray($taskArray);
			$installTask->setStatus(AbstractInstallTask::STATUS_DONE);
			$this->save();
			
			// Finally, let's delete the install status file.
			unlink($this->installStatusFile);
		} else {
			$installTasks = $this->getInstallTasks();
			foreach ($installTasks as $installTask) {
				if ($installTask->getStatus() == AbstractInstallTask::STATUS_TODO) {
					$installTask->setStatus(AbstractInstallTask::STATUS_DONE);
					$this->save();
					break;
				}
			}
			$todoRemaining = false;
			foreach ($installTasks as $installTask) {
				if ($installTask->getStatus() == AbstractInstallTask::STATUS_TODO) {
					$todoRemaining = true;
					break;
				}
			}
			if (!$todoRemaining) {
				// Finally, let's delete the install status file if there are no actions in "todo" state
				unlink($this->installStatusFile);
			}
		}
		
	}
public function validateCurrentInstall() {
		if (!file_exists($this->installStatusFile)) {
			throw new MoufException("No install status file found. I don't know what install task should be run.");
		}
		
		$statusArray = json_decode(file_get_contents($this->installStatusFile), true);
		if ($statusArray['type'] == 'one') {
			$taskArray = $statusArray['task'];
			// Now, let's find the matching task and mark it "done".
			$installTask = $this->findInstallTaskFromArray($taskArray);
			$installTask->setStatus(AbstractInstallTask::STATUS_DONE);
			$this->save();
			
			// Finally, let's delete the install status file.
			unlink($this->installStatusFile);
		} else {
			$installTasks = $this->getInstallTasks();
			foreach ($installTasks as $installTask) {
				if ($installTask->getStatus() == AbstractInstallTask::STATUS_TODO) {
					$installTask->setStatus(AbstractInstallTask::STATUS_DONE);
					$this->save();
					break;
				}
			}
			$todoRemaining = false;
			foreach ($installTasks as $installTask) {
				if ($installTask->getStatus() == AbstractInstallTask::STATUS_TODO) {
					$todoRemaining = true;
					break;
				}
			}
			if (!$todoRemaining) {
				// Finally, let's delete the install status file if there are no actions in "todo" state
				unlink($this->installStatusFile);
			}
		}
		
	}
public function validateCurrentInstall ( ) { if ( ! file_exists ( $ this -> installStatusFile ) ) { throw new MoufException ( "No install status file found. I don't know what install task should be run." ) ; } $ statusArray = json_decode ( file_get_contents ( $ this -> installStatusFile ) , true ) ; if ( $ statusArray [ 'type' ] == 'one' ) { $ taskArray = $ statusArray [ 'task' ] ; // Now, let's find the matching task and mark it "done". $ installTask = $ this -> findInstallTaskFromArray ( $ taskArray ) ; $ installTask -> setStatus ( AbstractInstallTask :: STATUS_DONE ) ; $ this -> save ( ) ; // Finally, let's delete the install status file. unlink ( $ this -> installStatusFile ) ; } else { $ installTasks = $ this -> getInstallTasks ( ) ; foreach ( $ installTasks as $ installTask ) { if ( $ installTask -> getStatus ( ) == AbstractInstallTask :: STATUS_TODO ) { $ installTask -> setStatus ( AbstractInstallTask :: STATUS_DONE ) ; $ this -> save ( ) ; break ; } } $ todoRemaining = false ; foreach ( $ installTasks as $ installTask ) { if ( $ installTask -> getStatus ( ) == AbstractInstallTask :: STATUS_TODO ) { $ todoRemaining = true ; break ; } } if ( ! $ todoRemaining ) { // Finally, let's delete the install status file if there are no actions in "todo" state unlink ( $ this -> installStatusFile ) ; } } }
Marks the current install task as "done".
Marks the current install task as done .