updater/index.php
/**
	 * Recursively deletes the specified folder from the system
	 *
	 * @param string $folder
	 * @throws \Exception
	 */
Recursively deletes the specified folder from the system
@param string $folder
@throws \Exception
Recursively deletes the specified folder from the system @param string $folder @throws \ Exception
private function recursiveDelete($folder) {
		if(!file_exists($folder)) {
			return;
		}
		$iterator = new \RecursiveIteratorIterator(
			new \RecursiveDirectoryIterator($folder, \RecursiveDirectoryIterator::SKIP_DOTS),
			\RecursiveIteratorIterator::CHILD_FIRST
		);
		foreach ($iterator as $fileInfo) {
			$action = $fileInfo->isDir() ? 'rmdir' : 'unlink';
			$action($fileInfo->getRealPath());
		}
		$state = rmdir($folder);
		if($state === false) {
			throw new \Exception('Could not rmdir ' . $folder);
		}
	}
private function recursiveDelete ( $ folder ) { if ( ! file_exists ( $ folder ) ) { return ; } $ iterator = new \ RecursiveIteratorIterator ( new \ RecursiveDirectoryIterator ( $ folder , \ RecursiveDirectoryIterator :: SKIP_DOTS ) , \ RecursiveIteratorIterator :: CHILD_FIRST ) ; foreach ( $ iterator as $ fileInfo ) { $ action = $ fileInfo -> isDir ( ) ? 'rmdir' : 'unlink' ; $ action ( $ fileInfo -> getRealPath ( ) ) ; } $ state = rmdir ( $ folder ) ; if ( $ state === false ) { throw new \ Exception ( 'Could not rmdir ' . $ folder ) ; } }
Recursively deletes the specified folder from the system
 @param string $folder
 @throws \Exception
Recursively deletes the specified folder from the system @param string $folder @throws \ Exception