original_string: private function deleteDir($dirPath)
  	{
  		if (!is_dir($dirPath)) {
  			$success = unlink($dirPath);
  		} else {
  			$success = true;
  			foreach (array_reverse(elFinderVolumeFTP::listFilesInDirectory($dirPath, false)) as $path) {
  				$path = $dirPath . DIRECTORY_SEPARATOR . $path;
  				if(is_link($path)) {
  					unlink($path);
  				} else if (is_dir($path)) {
  					$success = rmdir($path);
  				} else {
  					$success = unlink($path);
  				}
  				if (!$success) {
  					break;
  				}
  			}
  			if($success) {
  				$success = rmdir($dirPath);
  			}
  		}
  		if(!$success) {
  			$this->setError(elFinder::ERROR_RM, $dirPath);
  			return false;
  		}
  		return $success;
  	}
code: private function deleteDir($dirPath)
  	{
  		if (!is_dir($dirPath)) {
  			$success = unlink($dirPath);
  		} else {
  			$success = true;
  			foreach (array_reverse(elFinderVolumeFTP::listFilesInDirectory($dirPath, false)) as $path) {
  				$path = $dirPath . DIRECTORY_SEPARATOR . $path;
  				if(is_link($path)) {
  					unlink($path);
  				} else if (is_dir($path)) {
  					$success = rmdir($path);
  				} else {
  					$success = unlink($path);
  				}
  				if (!$success) {
  					break;
  				}
  			}
  			if($success) {
  				$success = rmdir($dirPath);
  			}
  		}
  		if(!$success) {
  			$this->setError(elFinder::ERROR_RM, $dirPath);
  			return false;
  		}
  		return $success;
  	}
code_tokens: private function deleteDir ( $ dirPath ) { if ( ! is_dir ( $ dirPath ) ) { $ success = unlink ( $ dirPath ) ; } else { $ success = true ; foreach ( array_reverse ( elFinderVolumeFTP :: listFilesInDirectory ( $ dirPath , false ) ) as $ path ) { $ path = $ dirPath . DIRECTORY_SEPARATOR . $ path ; if ( is_link ( $ path ) ) { unlink ( $ path ) ; } else if ( is_dir ( $ path ) ) { $ success = rmdir ( $ path ) ; } else { $ success = unlink ( $ path ) ; } if ( ! $ success ) { break ; } } if ( $ success ) { $ success = rmdir ( $ dirPath ) ; } } if ( ! $ success ) { $ this -> setError ( elFinder :: ERROR_RM , $ dirPath ) ; return false ; } return $ success ; }
docstring: Delete local directory recursively.
  @param $dirPath string to directory to be erased.
  @return bool true on success and false on failure.
docstring_tokens: Delete local directory recursively .