perform the actual export work. return true if the export was successful, otherwise false.

@return bool
766491
protected function Perform()
    {
        $bSuccess = true;

        $this->PreArticleListHandling();
        $this->HandleArticleList();
        $this->PostArticleListHandling();

        return $bSuccess;
    }
1276857
protected function doExecute()
    {
        $folders = $this->io->getArguments();

        if (!count($folders)) {
            $this->clearCacheRoot();
        } else {
            foreach ($folders as $folder) {
                $this->clearCacheFolder($folder);
            }
        }

        $this->out('Cache cleared.');

        return true;
    }
943740
public function execute() {
		// if source is not specified
		if(!$this->Source) {
			// add an error
			$this->Error = 'No source provided';	
			// return false already
			return(false);
		}
		// check if the source file exists
		if(!file_exists($this->Source)) {
			// add an error
			$this->Error = 'Source file does not exist';	
			// return false already
			return(false);
		}
		// if no destination
		if(!$this->Destination) {
			// add an error
			$this->Error = 'No destination provided';	
			// return false already
			return(false);
		}
		// if the destination is not a folder and already exists
		if(!is_dir($this->Destination) && file_exists($this->Destination)) {
			// throw an exception
			$this->Error = 'Destination file already exists';	
			// return false
			return(false);
		}
		// if the destination is not a directory
		elseif(!is_dir($this->Destination)) {
			// try to explode by slash to find the file name
			$exploded = explode('/',$this->Destination);
			// get the last element wich is the file name
			$this->Name = $exploded[count($exploded)-1];
			// set the directory as being the path minus the name
			$this->Destination = str_replace($this->Name,'',$this->Destination);
		}
		// the destination if a folder without name
		elseif(is_dir($this->Destination)) {
			// if the trailing slash is ommited
			if(substr($this->Destination,-1) != '/') {
				// add it to the path
				$this->Destination .= '/';	
			}
			// generate a name being sha1(file) +sha1(microtime)
			$this->Name = substr(sha1_file($this->Source),0,30) . substr(sha1(microtime()),0,10);
		}
		// destination unknown !
		else {
			// add an error
			$this->Error = 'Destination is unkown or incorrect';
			// return an error
			return(false);
		}
		// check if the destination is writable
		if(!is_writable($this->Destination)) {
			// add an error
			$this->Error = 'Destination is not writable';
			// return an error
			return(false);
		}
		// compute filesize
		$this->Size = filesize($this->Source);
		// if a maximum size if set and we exceed it
		if($this->Limits->Size && $this->Size > $this->Limits->Size) {
			// add an error
			$this->Error = 'File is larger than maximum of '.\Polyfony\Format::size($this->Limits->Size);
			// return an error
			return(false);
		}
		// get the type of the uploaded document
		$this->Type = Filesystem::type($this->Source, true);
		// if failed to get a type
		if(!$this->Type) {
			// add an error
			$this->Error = 'Failed to get mimetype';
			// return an error
			return(false);		
		}
		// if type limitations are set and current type is not allowed
		if(count($this->Limits->Types) && !in_array($this->Type,$this->Limits->Types)) {
			// add an error
			$this->Error = 'This file is not in the list of allowed types : ' . implode(',',$this->Limits->Types);
			// return an error
			return(false);
		}
		// actually move the uploaded file
		$status = move_uploaded_file($this->Source,$this->Destination.$this->Name);
		// if it failed
		if(!$status) {
			// try to rename the file
			$status = rename($this->Source,$this->Destination.$this->Name);
			// if it failed
			if(!$status) {
				// add an error
				$this->Error = 'Moving the file to destination failed';	
				// return false
				return(false);
			}
			// it went well
			else {
				// return true
				return(true);
			}
		}
		// all went well
		else {
			// return success
			return(true);	
		}
	}
387566
public function isSuccessful()
    {
        $successful = false;

        $errorCode = $this->getErrorCode();
        if ($errorCode === 200 || $errorCode === 0) {
            $successful = true;
        }

        return $successful;
    }
999792
public function exportAction()
    {
        $this->checkGame();
        $content = serialize($this->game);

        $response = $this->getResponse();
        $headers = $response->getHeaders();
        $headers->addHeaderLine('Content-Encoding: UTF-8');
        $headers->addHeaderLine('Content-Type', 'text/plain; charset=UTF-8');
        $headers->addHeaderLine(
            'Content-Disposition',
            "attachment; filename=\"". $this->game->getIdentifier() .".txt\""
        );
        $headers->addHeaderLine('Accept-Ranges', 'bytes');
        $headers->addHeaderLine('Content-Length', strlen($content));
    
        $response->setContent($content);
    
        return $response;
    }
380685
public function export_to_file($filename, $include_headers = true)
    {
        $fh = fopen($filename, 'w');
        if (false === $fh) {
            return false;
        }
        $export = $this->export($include_headers);
        $res = fwrite($fh, $export);
        if (false === $res) {
            return false;
        }

        return fclose($fh);
    }
497254
public function execute()
    {
        $command = $this->getExecCommand();

        if (!$command) {
            return false;
        }

        if ($this->useExec) {
            $execCommand = $this->captureStdErr ? "$command 2>&1" : $command;
            exec($execCommand, $output, $this->_exitCode);
            $this->_stdOut = implode("\n", $output);
            if ($this->_exitCode!==0) {
                $this->_stdErr = $this->_stdOut;
                $this->_error = empty($this->_stdErr) ? 'Command failed' : $this->_stdErr;
                return false;
            }
        } else {
            $descriptors = array(
                1   => array('pipe','w'),
                2   => array('pipe', $this->getIsWindows() ? 'a' : 'w'),
            );
            if ($this->_stdIn!==null) {
                $descriptors[0] = array('pipe', 'r');
            }

            $process = proc_open($command, $descriptors, $pipes, $this->procCwd, $this->procEnv, $this->procOptions);

            if (is_resource($process)) {

                if ($this->_stdIn!==null) {
                    if (is_resource($this->_stdIn) &&
                        in_array(get_resource_type($this->_stdIn), array('file', 'stream'), true)) {
                        stream_copy_to_stream($this->_stdIn, $pipes[0]);
                    } else {
                        fwrite($pipes[0], $this->_stdIn);
                    }
                    fclose($pipes[0]);
                }
                $this->_stdOut = stream_get_contents($pipes[1]);
                $this->_stdErr = stream_get_contents($pipes[2]);
                fclose($pipes[1]);
                fclose($pipes[2]);

                $this->_exitCode = proc_close($process);

                if ($this->_exitCode!==0) {
                    $this->_error = $this->_stdErr ? $this->_stdErr : "Failed without error message: $command";
                    return false;
                }
            } else {
                $this->_error = "Could not run command $command";
                return false;
            }
        }

        $this->_executed = true;

        return true;
    }
720310
protected function backup()
    {
        if (empty($this->tempname)) {
            return true;
        }

        $module = $this->data;

        $module += array(
            'directory' => $this->tempname,
            'module_id' => $this->module_id
        );

        $result = $this->getBackupModule()->backup('module', $module);

        if ($result === true) {
            gplcart_file_delete_recursive($this->tempname);
            return true;
        }

        $this->error = $this->translation->text('Failed to backup module @id', array('@id' => $this->module_id));
        return false;
    }
1238080
public function execute()
    {
        $success = true;
        foreach ($this->commandList as $command) {
            if (!$this->runSingleCommand($command)) {
                $success = false;
                break;
            }
        }
        return $success;
    }
276414
public function execute()
    {
        $build = $this->phpci->buildPath;

        if ($this->directory == $build) {
            return false;
        }

        $this->wipeExistingDirectory();

        $cmd = 'mkdir -p "%s" && cp -R "%s" "%s"';
        if (IS_WIN) {
            $cmd = 'mkdir -p "%s" && xcopy /E "%s" "%s"';
        }

        $success = $this->phpci->executeCommand($cmd, $this->directory, $build, $this->directory);

        $this->deleteIgnoredFiles();

        return $success;
    }
1120577
protected function doExecute()
    {
        if ($this->console->getMode() !== 'dev') {
            throw new \RuntimeException(
                '<error>STOP!</error> please run <info>' . $this->getEnvCmd() . '</info>.'
            );
        }

        // backup
        if (!$this->getOption('no-backup')) {
            $this->backup();
        }

        $this->out()->out('<cmd>Rollback to 0 version...</cmd>');

        $this->executeCommand(['migration', 'migrate', '0']);

        $this->out()->out('<cmd>Migrating to latest version...</cmd>');

        $this->executeCommand(['migration', 'migrate']);

        return true;
    }
1235979
public function run()
    {
        // If the truthTest failed, don't run
        if ($this->truthTest !== true) {
            return false;
        }

        // If overlapping, don't run
        if ($this->isOverlapping()) {
            return false;
        }

        $compiled = $this->compile();

        // Write lock file if necessary
        $this->createLockFile();

        if (is_callable($this->before)) {
            call_user_func($this->before);
        }

        if (is_callable($compiled)) {
            $this->output = $this->exec($compiled);
        } else {
            exec($compiled, $this->output, $this->returnCode);
        }

        $this->finalise();

        return true;
    }
190348
public function run()
    {
        // If the truthTest failed, don't run
        if ($this->truthTest !== true) {
            return false;
        }

        // If overlapping, don't run
        if ($this->isOverlapping()) {
            return false;
        }

        // Write lock file if necessary
        $this->createLockFile();

        // Call before if required
        if (is_callable($this->before)) {
            call_user_func($this->before);
        }

        // If command is callable...
        if (is_callable($this->command)) {
            $this->output = $this->exec();
        } else {
            $args = \is_string($this->args) ? $this->args : implode(' ', $this->args);
            $command = $this->command . ' ' . $args;
            $process = new Process($command);

            $this->process = $process;

            if ($this->runInBackground()) {
                $process->start();
            } else {
                $process->run();
                $this->finalize();
            }
        }

        return true;
    }
746759
public function isSuccessful()
    {
        if (null === $this->data) {
            $this->initializeReport();
        }

        return isset($this->data['report']['state']) && 'successful' === $this->data['report']['state'];
    }
897518
public function save()
    {
        // No images to process
        if (0 === count($this->frames)) {
            return false;
        }

        return (boolean)file_put_contents($this->outFilePath, $this->getAnimation(), LOCK_EX);
    }
1098486
protected function download()
    {
        $this->data_url = $this->job['data']['sources'][$this->job['done']];

        $filename = md5($this->data_url);
        $destination = gplcart_file_private_module('installer', "$filename.zip", true);
        $result = $this->file_transfer->download($this->data_url, 'zip', $destination);

        if ($result === true) {
            return $this->file_transfer->getTransferred();
        }

        $this->setError($result);
        return false;
    }
560680
public function export() {
        
        try {
            if ($this->getRequestMethod()!=Request::HTTP_GET) {
                    throw new \common_exception_NotImplemented('Only GET method is accepted to export QIT Item.');
            }
            
            if(!$this->hasRequestParameter('id')) {
                $this->returnFailure(new \common_exception_MissingParameter('required parameter `id` is missing'));
            } 
            
            $id = $this->getRequestParameter('id');
            
            $item = new \core_kernel_classes_Resource($id); 

            $itemService = \taoItems_models_classes_ItemsService::singleton();

            if($itemService->hasItemModel($item, array(ItemModel::MODEL_URI))){
                
                $path = \tao_helpers_Export::getExportFile();
                $tmpZip = new \ZipArchive();
                $tmpZip->open($path , \ZipArchive::CREATE);
                
                $exporter = new QTIPackedItemExporter( $item , $tmpZip);
                $exporter->export(array('apip' => false));

                $exporter->getZip()->close();

                header('Content-Type: application/zip');
                \tao_helpers_Http::returnFile($path, false);

                return;
            } else {

                $this->returnFailure(new \common_exception_NotFound('item can\'t be found'));

            }
        } catch (\Exception $e) {
      
            $this->returnFailure($e);
        }
    }