Executes all necessary scripts in the engine folder
@param  string $engineFolder The folder
@throws \Exception Raises error if any of the scripts fail
166397
private function ExecuteScripts($engineFolder)
    {
        $files = $this->SortFilesByVersion(Folder::GetFiles($engineFolder));
        
        $completeSql = '';
        foreach ($files as $file)
        {
            $sqlFile = Path::Combine($engineFolder, $file);
            $completeSql .= "\r\n" . File::GetContents($sqlFile);
        }
        try
        {
            $this->CleanAllForeignKeys();
            //$this->connection->StartTransaction();
            $this->connection->ExecuteMultiQuery($completeSql);
        }
        catch (\Exception $exc)
        {
            //$this->connection->RollBack();
            throw $exc;
            //throw new \Exception("Error executing SQL in folder $engineFolder: " . $completeSql, null, $exc);
        }
        //$this->connection->Commit();
    }
1359861
public function execute($arguments)
  {
    // Validate on given command.
    if (!isset($this->options['cmd'])) {
      throw new \Exception(sprintf('No command given for "%s"', $this->name));
      exit(1);
    }

    // If a explicit working directory is specifified, we change to that to call
    // the command.
    $workingDir = $this->getWorkingDir();
    if (isset($workingDir)) {
      chdir($workingDir);
    }

    // Execute the command.
    $status = NULL;
    $cmd = $this->options['cmd'];

    // If a explicit command dir is given, we use an absolute path to the command.
    $cmdDir = $this->getCmdDir();
    if (isset($cmdDir)) {
      $cmd = $cmdDir . '/' . $cmd;
    }
    $cmd = escapeshellcmd($cmd);

    // Add passed arguments to the command.
    foreach ($arguments as $arg) {
      $cmd .= ' ' . escapeshellarg($arg);
    }
    passthru($cmd, $status);
    exit($status);
  }
688529
public function executeSplit()
    {
        $command = $this->getCommand();
        $process = new Process($command);
        $process->setTimeout(null);
        $process->run();

        if (!$process->isSuccessful()) {
            throw new \Exception($process->getOutput(), 1);
        }

        $this->renameSplitFiles();
    }
358957
public function process_resource($manifestroot, &$fname, $folder) {
        $file = empty($folder) ? $manifestroot.'/'.$fname : $manifestroot.'/'.$folder.'/'.$fname;
        if (!file_exists($file) && $this->throwonerror) {
            throw new Exception('The file doesnt exist!');
        }

        GetDepFiles($manifestroot, $fname, $this->folder, $this->files);
        array_unshift($this->files, $folder.$fname);
        $this->init_empty_new();
        $this->href             = $folder.$fname;
        $this->identifierref    = $folder.$fname;
        $this->filename         = $fname;
        $this->isempty          = false;
        $this->folder           = $folder;
    }
1222166
public function execute($files)
  {
    printLn('=> PageWriter.');
    $pages = Application::db()->retrieve('page_list');

    $writer = new DataWriter();

    foreach($pages as $page) {
      $tmpl = $this->make_data($page);
      $writer->write($tmpl['slug'], 'index.html', $tmpl['html']);
    }
  }
805304
public function output() {
        $parts = explode('/', $this->output_path);
        // get rid of the filename
        array_pop($parts);

        $path = implode('/', $parts);
        if ($path && !file_exists($path)) {
            if (!mkdir($path, 0777, true)) {
                throw new \Exception("could not make directory $path");
            }
        }

        if (!file_put_contents($this->output_path, $this->render())) {
            throw new \Exception("could not write $filename");
        }
    }
1078866
protected void executeScript(String scriptPath) {
        URL scriptUrl = null;
        try {
            if (scriptPath.startsWith("classpath:")) {
                String script = scriptPath.substring("classpath:".length());
                scriptUrl = ClassUtil.getResource(script);
                if (scriptUrl == null) {
                    log.warn("Script '{}' not found!", scriptPath);
                }
            } else {
                File file = new File(scriptPath);
                if (file.exists()) {
                    scriptUrl = file.toURI().toURL();
                } else {
                    log.warn("Script '{}' not found!", scriptPath);
                }
            }

            // execute the script
            if (scriptUrl != null) {
                executeScript(scriptUrl);
            }

        } catch (Exception e) {
            log.error("Failed to parse '{}' as a url", scriptPath);
        }
    }
43186
private function executeContentRenderers(ContentRendererFactory $contentRenderers)
    {
        while (! $this->allFilesRendered()) {
            foreach ($this->files as &$file) {
                if ($file->isRendered()) {
                    continue;
                }
                $contentRenderers->renderFile($file);
            }
            unset($file);
        }
    }
90610
@Override
    public void execute() throws MojoExecutionException {
        try {
            ensureNotExisting();
            createDirectories();

            if ("blank".equalsIgnoreCase(skel)) {
                createApplicationConfiguration();
                createBlankPomFile();
                createPackageStructure();
                copyDefaultErrorTemplates();
            } else {
                createApplicationConfiguration();
                createPomFile();
                createPackageStructure();
                createDefaultController();
                createTests();
                copyAssets();
                createWelcomeTemplate();
                copyDefaultErrorTemplates();
            }

            printStartGuide();
        } catch (IOException e) {
            throw new MojoExecutionException("Error during project generation", e);
        }
    }
622568
@Override
    public void execute() throws BuildException {
        populateSettings();
        try (Engine engine = new Engine(Update.class.getClassLoader(), getSettings())) {
            try {
                engine.doUpdates();
            } catch (UpdateException ex) {
                if (this.isFailOnError()) {
                    throw new BuildException(ex);
                }
                log(ex.getMessage(), Project.MSG_ERR);
            }
        } catch (DatabaseException ex) {
            final String msg = "Unable to connect to the dependency-check database; unable to update the NVD data";
            if (this.isFailOnError()) {
                throw new BuildException(msg, ex);
            }
            log(msg, Project.MSG_ERR);
        } finally {
            getSettings().cleanup();
        }
    }
1370592
public function execute() {

        // Find section_included_setting
        if (!$this->get_setting_value('included')) {
            $this->log('section skipped by _included setting', backup::LOG_DEBUG, $this->name);

        } else { // Setting tells us it's ok to execute
            parent::execute();
        }
    }
581854
final function execute() {
		//parse content first, to allow for any ADDTEMPLATE items
		$content = $this->parseContent($this->data['bodycontent']);

		if( !$this->getLayoutClass()	){
			throw new \Exception('No layout class defined.');
		}
		$layoutClass = $this->getLayoutClass();
		$layout = new $layoutClass($this->getSkin(), $this);
		//set up standard content zones
		//head element (including opening body tag)
		$layout->addHTMLTo('head', $this->html('headelement') );
		//the logo image defined in LocalSettings
		$layout->addHTMLTo('logo', $this->data['logopath']);
		$layout->addHTMLTo('prepend:body', $this->html( 'prebodyhtml' ));
		//the article title
		if($this->showTitle){
			$layout->addHTMLTo('content-container.class', 'has-title');
			$layout->addHTMLTo('title-html', $this->data['title']);
		}
		//article content
		$layout->addHTMLTo('content-html', $content);
		//the site notice
		if( !empty($this->data['sitenotice'])){
			$layout->addHTMLTo('site-notice', $this->data['sitenotice']);
		}
		//the site tagline, if there is one
		if($this->showTagline){
			$layout->addHTMLTo('content-container.class', 'has-tagline');
			$layout->addHTMLTo('tagline', $this->getMsg('tagline') );
		}
		$breadcrumbTrees = $this->breadcrumbs();
		$layout->addTemplateTo('breadcrumbs', 'breadcrumbs', array('trees' => $breadcrumbTrees) );

		// if(\Skinny::hasContent('toc')){
		// 	$layout->addHTMLTo('toc', (\Skinny::getContent('toc')[0]['html']));
		// }

		// if ( $this->data['dataAfterContent'] ) {
		// 	$layout->addHTMLTo('append:content', $this->data['dataAfterContent']);
		// }
		//the contents of Mediawiki:Sidebar
		// $layout->addTemplate('classic-sidebar', 'classic-sidebar', array(
		// 	'sections'=>$this->data['sidebar']
		// ));
		// //list of language variants
		// $layout->addTemplate('language-variants', 'language-variants', array(
		// 	'variants'=>$this->data['language_urls']
		// ));

		//page footer
		$layout->addHookTo('footer-links', array($this,'getFooterLinks'));
		$layout->addHookTo('footer-icons', array($this,'getFooterIcons'));
		//mediawiki needs this to inject script tags after the footer
		$layout->addHookTo('append:body', array($this,'afterFooter'));


		$this->data['pageLanguage'] = $this->getSkin()->getTitle()->getPageViewLanguage()->getCode();

		//allow skins to set up before render
		$this->initialize();

		echo $layout->render();
		// $this->printTrail();
	}
835590
public function setEngine($engine)
    {
        $this->_database->exec(
            'ALTER TABLE ' .
            $this->_database->prepareIdentifier($this->_name) .
            ' ENGINE = ' .
            $this->_database->prepareValue($engine, Column::TYPE_VARCHAR)
        );
        // MySQL ignores invalid engine names. Check explicitly.
        // The getEngine() also implicitly updates $_engine.
        if (strcasecmp($this->getEngine(), $engine) != 0) {
            throw new \RuntimeException('Unsupported table engine: ' . $engine);
        }
    }
340422
private void executeMethod(String script) {
    parent.assertConnected();
    debugger.callFunctionOnObject(script, objectId, false);
  }
355208
public function run()
    {
        if (PHP_SAPI === 'cli' && is_subclass_of($this, ConsoleAppInterface::class))
        {
            $this->execConsoleApp();
        }
        else if (is_subclass_of($this, WebAppInterface::class))
        {
            $this->execWebApp();
        }
        else
        {
            throw new \Exception("No interface was implemented");
        }
    }
379451
protected function runProcedural()
    {
        $routerLinker = $this->ctrlRouterInfos;
        
        $runFct = function() use ($routerLinker) {
            $controllerFile = (string) $routerLinker->target;
            
            if (!file_exists(CTRL_DIR.$controllerFile)) {
                throw new Exception(
                    'Controller file '.$controllerFile.' not found.',
                    self::ERR_RUN_PROCEDURAL_FILE_NOT_FOUND
                );
            }
            
            include(CTRL_DIR.$controllerFile);
        };
        
        $runFct();
    }
624392
public function warmUp($cacheDir)
    {
        $dir = $cacheDir.'/victoire/Entity';
        $file = $dir.'/EntityProxy.php';

        if (!file_exists($dir)) {
            if (false === @mkdir($dir, 0777, true)) {
                throw new \RuntimeException(sprintf('Could not create directory "%s".', $dir));
            }
        }

        $generator = new EntityProxyGenerator($this->businessEntityHelper, $this->fileLocator);
        $cacheContent = $generator->generate();

        $this->writeCacheFile($file, $cacheContent);
        if (!class_exists('Victoire\\Bundle\\CoreBundle\\Entity\\EntityProxy')) {
            include_once $file;
        }
    }