Build the package

@return  bool

@since   1.0
549484
public function run()
	{
		$this->say('Building Extension package');

		$this->analyze();

		// Build component
		if ($this->hasComponent)
		{
			$this->buildComponent($this->params)->run();
		}

		// Modules
		if ($this->hasModules)
		{
			$path = $this->getSourceFolder() . "/modules";

			// Get every module
			$hdl = opendir($path);

			while ($entry = readdir($hdl))
			{
				// Only folders
				$p = $path . "/" . $entry;

				if (substr($entry, 0, 1) == '.')
				{
					continue;
				}

				if (!is_file($p))
				{
					// Module folder
					$this->modules[] = $entry;
					$this->buildModule($entry, $this->params)->run();
				}
			}

			closedir($hdl);
		}

		// Plugins
		if ($this->hasPlugins)
		{
			$path = $this->getSourceFolder() . "/plugins";

			// Get every plugin
			$hdl = opendir($path);

			while ($entry = readdir($hdl))
			{
				// Only folders
				$p = $path . "/" . $entry;

				if (substr($entry, 0, 1) == '.')
				{
					continue;
				}

				if (!is_file($p))
				{
					// Plugin type folder
					$type = $entry;

					$hdl2 = opendir($p);

					while ($plugin = readdir($hdl2))
					{
						// Only folders
						$p2 = $path . "/" . $entry;

						if (substr($plugin, 0, 1) == '.')
						{
							continue;
						}

						if (!is_file($p2))
						{
							$this->plugins[] = "plg_" . $type . "_" . $plugin;
							$this->buildPlugin($type, $plugin, $this->params)->run();
						}
					}

					closedir($hdl2);
				}
			}

			closedir($hdl);
		}

		if ($this->hasLibraries)
		{
			$path = $this->getSourceFolder() . "/libraries";

			// Get every library
			$hdl = opendir($path);

			while ($entry = readdir($hdl))
			{
				// Only folders
				$p = $path . "/" . $entry;

				if (substr($entry, 0, 1) == '.')
				{
					continue;
				}

				if (!is_file($p))
				{
					// Library folder
					$this->libraries[] = $entry;
					$this->buildLibrary($entry, $this->params, $this->hasComponent)->run();
				}
			}

			closedir($hdl);
		}

		if ($this->hasCBPlugins)
		{
			$path = $this->getSourceFolder() . "/components/com_comprofiler/plugin";

			// Get every plugin
			$hdl = opendir($path);

			while ($entry = readdir($hdl))
			{
				// Only folders
				$p = $path . "/" . $entry;

				if (substr($entry, 0, 1) == '.')
				{
					continue;
				}

				if (!is_file($p))
				{
					// Plugin type folder
					$type = $entry;

					$hdl2 = opendir($p);

					while ($plugin = readdir($hdl2))
					{
						// Only folders
						$p2 = $path . "/" . $entry;

						if (substr($plugin, 0, 1) == '.')
						{
							continue;
						}

						if (!is_file($p2))
						{
							$this->plugins[] = "plug_" . $plugin;
							$this->buildCBPlugin($type, $plugin, $this->params)->run();
						}
					}

					closedir($hdl2);
				}
			}

			closedir($hdl);
		}

		// Templates
		if ($this->hasTemplates)
		{
			$path = $this->getSourceFolder() . "/templates";

			// Get every module
			$hdl = opendir($path);

			while ($entry = readdir($hdl))
			{
				// Only folders
				$p = $path . "/" . $entry;

				if (substr($entry, 0, 1) == '.')
				{
					continue;
				}

				if (!is_file($p))
				{
					// Template folder
					$this->templates[] = $entry;
					$this->buildTemplate($entry, $this->params)->run();
				}
			}

			closedir($hdl);
		}

		// Build component
		if ($this->hasPackage)
		{
			$this->buildPackage($this->params)->run();
		}

		// Replacements (date, version etc.) in every php file
		$dir = new \RecursiveDirectoryIterator($this->getBuildFolder(), \RecursiveDirectoryIterator::SKIP_DOTS);
		$it  = new \RecursiveIteratorIterator($dir);

		foreach ($it as $file)
		{
			if (in_array(pathinfo($file, PATHINFO_EXTENSION), array('php', 'js')))
			{
				$this->replaceInFile($file);
			}
		}

		return true;
	}
982619
public function build()
    {
        if (isset($this->style)) {
            return $this->style;
        }

        $this->style = BuildUtil::removeNullElements([
            'backgroundColor' => $this->backgroundColor,
            'separator' => $this->separator,
            'separatorColor' => $this->separatorColor,
        ]);

        return $this->style;
    }
1259651
public static function build () {
		//Loop through all sections remaining
		while (count(Router::$sections) > 0) {
			//Get and remove
			$section  = array_shift(Router::$sections);

			//Get options from section
			$name	  = $section[0];
			$options  = $section[1];
			$callback = $section[2];
			$context  = $section[3];

			//Set everything accordling
			Router::$context 		= $context."/".(($context == "root")? "":$name);
			Router::$stackedOptions = $options;

			//Run to search more
			$callback();
		}

		//Sort everything based on key
		ksort(Router::$routes);
	}
123657
public function build()
	{
		$this->setLayout( 'locales/index.tpl' );
		$this->addModule( 'head', 'SharedHead' );
		$this->addModule( 'footer', 'SharedFooter' );
		$this->addModule( 'system_messages', 'SharedSystemMessages' );
		
		$params = $this->getParams();
		$action = \Sifo\Router::getReversalRoute( $params['path_parts'][0] );

		$params = $this->getParams();

		
		if ( $params['params'] !== false && in_array('saved-true', $params["params"]))
		{
			\Sifo\FlashMessages::set( 'File Saved OK.', \Sifo\FlashMessages::MSG_OK );
		}
		if ( $params['params'] !== false && in_array('created-true', $params["params"]))
		{
			\Sifo\FlashMessages::set( 'File Created OK.', \Sifo\FlashMessages::MSG_OK );
		}


		if ($this->getParsedParam( 'instance' ) !== false)
		{
			$this->assign('current_instance', $this->getParsedParam( 'instance' ));
			$this->assign('languages', $this->getLanguagesInstance($this->getParsedParam( 'instance' )));
			//var_dump($this->getLanguagesInstance($this->getParsedParam( 'instance' )));
		}
		if ($this->getParsedParam( 'language' ) !== false)
		{
			$this->assign('current_language', $this->getParsedParam( 'language' ));
			$temp = explode("_", $this->getParsedParam( 'language' ));
			if (  is_array( $temp))
			{
				$this->assign('lang', $temp[1]);
			}
		}

		$instances = $this->getInstances();
		$this->assign('instances', $instances);
		// For url with params generation:
		$this->assign( 'params', $this->getParam( 'parsed_params' ) );
		$this->assign( 'params_definition', $this->getParamsDefinition() );
	}
942989
public function installPackage()
    {
        try {
            return $this->render('@bolt/extend/_action-modal.twig', $this->getRenderContext());
        } catch (\Exception $e) {
            return $this->getJsonException($e);
        }
    }
413343
public function build()
    {
        $cm = $this->builder->getClassMetadata();

        $cm->mapEmbedded($this->mapping);

        return $this->builder;
    }
117711
public function build()
    {
        switch ($this->provider) {
            default:
            case Provider::RACKSPACE:
                $class = __NAMESPACE__ . '\\RackspaceFactory';
                break;
            case Provider::OPENSTACK:
                $class = __NAMESPACE__ . '\\OpenStackFactory';
                break;
        }

        return $this->buildFactory($class)->buildClient();
    }
1039101
public function run()
	{
		$this->say('Building package');

		// Build language files for the package
		$language = $this->buildLanguage("pkg_" . $this->getExtensionName());
		$language->run();

		// Update XML and script.php
		$this->createInstaller();

		return true;
	}
271449
public function build()
    {
        $mainPart = false;

        // create the text part if there is one
        if ( $this->plainText != '' )
        {
            $mainPart = new ezcMailText( $this->plainText, $this->charset );
        }

        // create the HTML part if there is one
        $htmlPart = false;
        if ( $this->htmlText != '' )
        {
            $htmlPart = $this->generateHtmlPart();

            // create a MultiPartAlternative if a text part exists
            if ( $mainPart != false )
            {
                $mainPart = new ezcMailMultipartAlternative( $mainPart, $htmlPart );
            }
            else
            {
                $mainPart = $htmlPart;
            }
        }

        // build all attachments
        // special case, mail with no text and one attachment.
        // A fix for issue #14220 was added by wrapping the attachment in
        // an ezcMailMultipartMixed part
        if ( $mainPart == false && count( $this->attachments ) == 1 )
        {
            if ( isset( $this->attachments[0][1] ) )
            {
                if ( is_resource( $this->attachments[0][1] ) )
                {
                    $mainPart = new ezcMailMultipartMixed( new ezcMailStreamFile( $this->attachments[0][0], $this->attachments[0][1], $this->attachments[0][2], $this->attachments[0][3] ) );
                }
                else
                {
                    $mainPart = new ezcMailMultipartMixed( new ezcMailVirtualFile( $this->attachments[0][0], $this->attachments[0][1], $this->attachments[0][2], $this->attachments[0][3] ) );
                }
            }
            else
            {
                $mainPart = new ezcMailMultipartMixed( new ezcMailFile( $this->attachments[0][0], $this->attachments[0][2], $this->attachments[0][3] ) );
            }
            $mainPart->contentDisposition = $this->attachments[0][4];
        }
        else if ( count( $this->attachments ) > 0 )
        {
            $mainPart = ( $mainPart == false )
                ? new ezcMailMultipartMixed()
                : new ezcMailMultipartMixed( $mainPart );

            // add the attachments to the mixed part
            foreach ( $this->attachments as $attachment )
            {
                if ( isset( $attachment[1] ) )
                {
                    if ( is_resource( $attachment[1] ) )
                    {
                        $part = new ezcMailStreamFile( $attachment[0], $attachment[1], $attachment[2], $attachment[3] );
                    }
                    else
                    {
                        $part = new ezcMailVirtualFile( $attachment[0], $attachment[1], $attachment[2], $attachment[3] );
                    }
                }
                else
                {
                    $part = new ezcMailFile( $attachment[0], $attachment[2], $attachment[3] );
                }
                $part->contentDisposition = $attachment[4];
                $mainPart->appendPart( $part );
            }
        }

        $this->body = $mainPart;
    }
824200
public function build()
    {
        if(($document = $this->getDocument()) === null) {
            $document = $this->loader->getInstance(NodeLoader::DOCUMENT_NODE);
            $this->setDocument($document);
        }

        if(($header = $document->getHeader()) === null) {
            $header = $this->loader->getInstance(NodeLoader::HEADER_NODE);
            $document->setHeader($header);
        }

        if(($supplier = $header->getSupplier()) === null) {
            $supplier = $this->loader->getInstance(NodeLoader::SUPPLIER_NODE);
            $header->setSupplier($supplier);
        }

        if(($catalog = $header->getCatalog()) === null) {
            $catalog = $this->loader->getInstance(NodeLoader::CATALOG_NODE);
            $header->setCatalog($catalog);
        }

        if(($datetime = $catalog->getDateTime()) === null) {
            $datetime = $this->loader->getInstance(NodeLoader::DATE_TIME_NODE);
            $catalog->setDateTime($datetime);
        }

        if(($newCatalog = $document->getNewCatalog()) === null) {
            $newCatalog = $this->loader->getInstance(NodeLoader::NEW_CATALOG_NODE);
            $document->setNewCatalog($newCatalog);
        }

        return $document;
    }
814149
public function install()
    {
        PackageList::refreshCache();
        $em = $this->app->make(EntityManagerInterface::class);
        $package = new PackageEntity();
        $package->setPackageName($this->getPackageName());
        $package->setPackageDescription($this->getPackageDescription());
        $package->setPackageVersion($this->getPackageVersion());
        $package->setPackageHandle($this->getPackageHandle());
        $em->persist($package);
        $em->flush();

        $this->app->make('cache/overrides')->flush();

        $this->installDatabase();

        Localization::clearCache();

        return $package;
    }
1114085
public static function build()
    {
        $ini = eZINI::instance( 'file.ini' );
        $defaultHandler = eZDFSFileHandlerBackendFactory::buildHandler(
            $ini->variable( 'DispatchableDFS', 'DefaultBackend' )
        );

        $pathHandlers = array();
        foreach ( $ini->variable( 'DispatchableDFS', 'PathBackends' ) as $supportedPath => $backendClass )
        {
            // @todo Make it possible to use a Symfony2 service
            $pathHandlers[$supportedPath] = eZDFSFileHandlerBackendFactory::buildHandler( $backendClass );
        }

        return new static( $defaultHandler, $pathHandlers );
    }
750426
public function build()
    {
        if (!empty($this->build)) {
            return $this->build;
        }
        //root
        $this->build = [[
            'active' => true,
            'name' => '',
            'label' => '',
            'id' => 'root',
            'level' => 0,
            'uri' => '',
            'children' => []
        ]];
        foreach ($this->_data as $element) {
            $this->build[0]['children'][$element->getId()] = $element->build();
        }
        //usuwanie konfiguracji po zbudowaniu
        $this->_data = [];
        return $this->build;
    }
757565
public function build()
    {
        $fixer = new VendorDirectoryFixer();
        // Set up the Translation component
        $translator = new Translator($this->locale);
        $pos        = strpos($this->locale, '_');
        $file       = 'validators.' . ($pos ? substr($this->locale, 0, $pos) : $this->locale) . '.xlf';
        $translator->addLoader('xlf', new XliffFileLoader());
        $translator->addResource(
            'xlf',
            $fixer->getLocation('form', self::FORM_TRANSLATIONS_DIR . $file),
            $this->locale,
            self::TRANSLATION_DOMAIN
        );
        $translator->addResource(
            'xlf',
            $fixer->getLocation('validator', self::VALIDATOR_TRANSLATIONS_DIR . $file),
            $this->locale,
            self::TRANSLATION_DOMAIN
        );
        return $translator;
    }
19253
public function init()
    {
        $paths = Phing::explodeIncludePath();
        foreach ($paths as $path) {
            if (file_exists($path . DIRECTORY_SEPARATOR . 'Net' . DIRECTORY_SEPARATOR . 'FTP.php')) {
                return true;
            }
        }
        throw new BuildException('The FTP Deploy task requires the Net_FTP PEAR package.');
    }
1201443
public function build()
    {
        if (isset($this->component)) {
            return $this->component;
        }

        $this->component = BuildUtil::removeNullElements([
            'type' => ComponentType::SPACER,
            'size' => $this->size,
        ]);

        return $this->component;
    }
927815
public function SetupPackages() {

		$halted = false;

		foreach($this->Packages as $pkg) {
			try { $pkg->Setup($this); }
			catch(Exception $e) {
				$this->ShowMessage($e->getMessage());
				$halted = true;
			}
		}

		if($halted) $this->ShowMessage('Operation aborted.');
		else $this->ShowMessage('Operation complete.');

		return $this;
	}