/*!
\private

Install overrides

\param override list
\param install parameters
979153
function installOverrides( $overrideListNode, &$parameters )
    {
        if ( !$overrideListNode )
        {
            return true;
        }

        $overrideINIArray = array();
        foreach( $overrideListNode->getElementsByTagName( 'block' ) as $blockNode )
        {
            if ( isset( $parameters['site_access_map'][$blockNode->getAttribute( 'site-access' )] ) )
            {
                $newSiteAccess = $parameters['site_access_map'][$blockNode->getAttribute( 'site-access' )];
            }
            else
            {
                $newSiteAccess = $parameters['site_access_map']['*'];
            }

            if ( !$newSiteAccess )
            {
                eZDebug::writeError( 'SiteAccess map for : ' . $blockNode->getAttribute( 'site-access' ) . ' not set.', __METHOD__ );
                continue;
            }

            if ( !isset( $overrideINIArray[$newSiteAccess] ) )
            {
                $overrideINIArray[$newSiteAccess] = eZINI::instance( 'override.ini.append.php', "settings/siteaccess/$newSiteAccess", null, null, true );
            }

            $blockArray = array();
            $blockName = $blockNode->getAttribute( 'name' );
            $blockArray[$blockName] = eZContentObjectPackageHandler::createArrayFromDOMNode( $blockNode->getElementsByTagName( $blockName )->item( 0 ) );

            if ( isset( $blockArray[$blockName][$this->OverrideObjectRemoteID] ) )
            {
                $contentObject = eZContentObject::fetchByRemoteID( $blockArray[$blockName][$this->OverrideObjectRemoteID] );
                $blockArray[$blockName]['Match']['object'] = $contentObject->attribute( 'id' );
                unset( $blockArray[$blockName][$this->OverrideObjectRemoteID] );
//                 eZDebug::writeNotice( 'Found object id: "' . $blockArray[$blockName]['Match']['object'] . '" for matchblock "[' . $blockName . '][Match][object]"', __METHOD__ );
            }
            if ( isset( $blockArray[$blockName][$this->OverrideNodeRemoteID] ) )
            {
                $contentNode = eZContentObjectTreeNode::fetchByRemoteID( $blockArray[$blockName][$this->OverrideNodeRemoteID] );
                $blockArray[$blockName]['Match']['node'] = $contentNode->attribute( 'node_id' );
                unset( $blockArray[$blockName][$this->OverrideNodeRemoteID] );
//                 eZDebug::writeNotice( 'Found node id: "' . $blockArray[$blockName]['Match']['node'] . '" for matchblock "[' . $blockName . '][Match][node]"', __METHOD__ );
            }
            if ( isset( $blockArray[$blockName][$this->OverrideParentNodeRemoteID] ) )
            {
                $parentContentNode = eZContentObjectTreeNode::fetchByRemoteID( $blockArray[$blockName][$this->OverrideParentNodeRemoteID] );
                $blockArray[$blockName]['Match']['parent_node'] = $parentContentNode->attribute( 'node_id' );
                unset( $blockArray[$blockName][$this->OverrideParentNodeRemoteID] );
//                 eZDebug::writeNotice( 'Found parent node id: "' . $blockArray[$blockName]['Match']['parent_node'] . '" for matchblock "[' . $blockName . '][Match][parent_node]"', __METHOD__ );
            }
            if ( isset( $blockArray[$blockName][$this->OverrideClassRemoteID] ) )
            {
                $contentClass = eZContentClass::fetchByRemoteID( $blockArray[$blockName][$this->OverrideClassRemoteID] );
                if ( !$contentClass )
                {
                    eZDebug::writeError( 'No content class found for RemoteID: ' . $blockArray[$blockName][$this->OverrideClassRemoteID], __METHOD__ );
                    continue;
                }
                $blockArray[$blockName]['Match']['class'] = $contentClass->attribute( 'id' );
                unset( $blockArray[$blockName][$this->OverrideClassRemoteID] );
//                 eZDebug::writeNotice( 'Found class id: "' . $blockArray[$blockName]['Match']['class'] . '" for matchblock "[' . $blockName . '][Match][class]"', __METHOD__ );
            }

            $overrideINIArray[$newSiteAccess]->setVariables( $blockArray );
        }

        foreach( $overrideINIArray as $siteAccess => $iniArray )
        {
            $overrideINIArray[$siteAccess]->save();
        }

        return true;
    }
1252603
public function add(string $key, $value, bool $override = false)
    {
        if (!$override && $this->exists($key)) {
            return;
        }

        $this->parameters[$key] = $value;
    }
1122819
function isErrorElement( $elementID, &$installParameters )
    {
        if ( $elementID == $installParameters['error']['element_id'] )
        {
            // If action not set - skip this element
            if ( !isset( $installParameters['error']['choosen_action'] ) )
            {
                 $installParameters['error'] = array();
                 return false;
            }
            return true;
        }
        return false;

    }
498273
function inheritParams(currentParams, newParams, $current, $to) {
  var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = [];

  for (var i in parents) {
    if (!parents[i].params) continue;
    // This test allows compatibility with 0.2.x and 0.3.x (optional and object params)
    parentParams = isArray(parents[i].params) ? parents[i].params : objectKeys(parents[i].params);
    if (!parentParams.length) continue;

    for (var j in parentParams) {
      if (arraySearch(inheritList, parentParams[j]) >= 0) continue;
      inheritList.push(parentParams[j]);
      inherited[parentParams[j]] = currentParams[parentParams[j]];
    }
  }
  return extend({}, inherited, newParams);
}
367891
protected function overrideParams($module, $override)
    {
        $params = json_decode($module->params, true);

        if (!is_array($params)) {
            $params = [];
        }

        $params = array_merge($params, $override);
        $module->params = json_encode($params);
    }
1185998
function install( $package, $installType, $parameters,
                      $name, $os, $filename, $subdirectory,
                      $content, &$installParameters,
                      &$installData )
    {
        $path = $package->path();
        $databaseType = false;
        if ( isset( $parameters['database-type'] ) )
        {
            $databaseType = $parameters['database-type'];
        }
        $path .= '/' . eZDBPackageHandler::sqlDirectory();
        if ( $databaseType )
        {
            $path .= '/' . $databaseType;
        }

        if ( file_exists( $path ) )
        {
            $db = eZDB::instance();
            $canInsert = true;
            if ( $databaseType and
                 $databaseType != $db->databaseName() )
            {
                $canInsert = false;
            }

            if ( $canInsert )
            {
                eZDebug::writeDebug( "Installing SQL file $path/$filename" );
                $db->insertFile( $path, $filename, false );
                return true;
            }
            else
            {
                eZDebug::writeDebug( "Skipping SQL file $path/$filename" );
            }
        }
        else
        {
            eZDebug::writeError( "Could not find SQL file $path/$filename" );
        }
        return false;
    }
485628
function installContentObjects( $objectNodes, $topNodeListNode, &$installParameters )
    {
        if ( isset( $installParameters['user_id'] ) )
            $userID = $installParameters['user_id'];
        else
            $userID = eZUser::currentUserID();

        $handlerType = $this->handlerType();
        $firstInstalledID = null;

        foreach( $objectNodes as $objectNode )
        {
            $realObjectNode = $this->getRealObjectNode( $objectNode );

            // Cycle until we reach an element where error has occured.
            // If action has been choosen, try install this item again, else skip it.
            if ( isset( $installParameters['error']['error_code'] ) &&
                 !$this->isErrorElement( $realObjectNode->getAttribute( 'remote_id' ), $installParameters ) )
            {
                continue;
            }

            //we are here, it means we'll try to install some object.
            if ( !$firstInstalledID )
            {
                $firstInstalledID = $realObjectNode->getAttribute( 'remote_id' );
            }

            $newObject = eZContentObject::unserialize( $this->Package, $realObjectNode, $installParameters, $userID, $handlerType );
            if ( !$newObject )
            {
                return false;
            }

            if ( is_object( $newObject ) )
            {
                eZContentObject::clearCache( $newObject->attribute( 'id' ) );
                unset( $newObject );
            }
            unset( $realObjectNode );

            if ( isset( $installParameters['error'] ) && count( $installParameters['error'] ) )
            {
                $installParameters['error'] = array();
            }
        }

        $this->installSuspendedNodeAssignment( $installParameters );
        $this->installSuspendedObjectRelations( $installParameters );

        // Call postUnserialize on all installed objects
        foreach( $objectNodes as $objectNode )
        {
            if ( $objectNode->localName == 'object' )
            {
                $remoteID = $objectNode->getAttribute( 'remote_id' );
            }
            else
            {
                $remoteID = substr( $objectNode->getAttribute( 'filename' ), 7, 32 );
            }

            // Begin from the object that we started from in the previous cycle
            if ( $firstInstalledID && $remoteID != $firstInstalledID )
            {
                continue;
            }
            else
            {
                $firstInstalledID = null;
            }

            $object = eZContentObject::fetchByRemoteID( $remoteID );
            if ( is_object( $object ) )
            {
                $object->postUnserialize( $this->Package );
                eZContentObject::clearCache( $object->attribute( 'id' ) );
            }
            unset( $object );
        }

        return true;
    }
1260123
function (params) {
	var i = params.length, dependencies = [];
	while (i--) {
		dependencies[i] = `"${ params[i].name }"`;
	}

	return dependencies.join(", ");
}
832828
public void addConfiguredParam( Parameter param)
    {
    options_.getTransformParams().put( param.getName(), param.getValue());
    }
1175032
private function executeInstaller()
    {
        $oInput  = $this->oInput;
        $oOutput = $this->oOutput;

        // --------------------------------------------------------------------------

        $oOutput->writeln('');
        $oOutput->writeln('<info>---------------</info>');
        $oOutput->writeln('<info>Nails Installer</info>');
        $oOutput->writeln('<info>---------------</info>');
        $oOutput->writeln('');

        // --------------------------------------------------------------------------

        //  Define app & deploy vars
        $appVars    = $this->defineAppVars();
        $deployVars = $this->defineDeployVars();

        // --------------------------------------------------------------------------

        //  Pre-Install tests
        $preTestErrors = $this->preInstallTests();

        // --------------------------------------------------------------------------

        if (empty($preTestErrors)) {

            if ($oInput->isInteractive()) {
                $oOutput->writeln('');
                $oOutput->writeln('<info>App Settings</info>');
                $this->setVars($appVars);

                // --------------------------------------------------------------------------

                $oOutput->writeln('');
                $oOutput->writeln('<info>Deploy Settings</info>');
                $this->setVars($deployVars);
            }

            // --------------------------------------------------------------------------

            //  Tell user what's about to happen
            $oOutput->writeln('');
            $oOutput->writeln('<info>I\'m about to do the following:</info>');

            //  app.php
            $oOutput->writeln('');
            $oOutput->writeln('1) Write <info>config/app.php</info>');

            foreach ($appVars as &$v) {

                if (is_string($v)) {
                    continue;
                }

                $sValue = $v['value'] ?: '<blank>';
                $oOutput->writeln(' - Set <comment>' . $v['label'] . '</comment> to <comment>' . $sValue . '</comment>');
            }

            //  deploy.php
            $oOutput->writeln('');
            $oOutput->writeln('2) Write <info>config/deploy.php</info>');

            foreach ($deployVars as &$v) {

                if (is_string($v)) {
                    continue;
                }

                $sValue = $v['value'] ?: '<blank>';
                $oOutput->writeln(' - Set <comment>' . $v['label'] . '</comment> to <comment>' . $sValue . '</comment>');
            }

            //  Migrate database and rewrite routes
            $oOutput->writeln('');
            $oOutput->writeln('3) Migrate the database');
            $oOutput->writeln('4) Rewrite app routes');

            $oOutput->writeln('');
            $question  = 'Does this look OK?';
            $doInstall = $this->confirm($question, true);

            if ($doInstall) {

                $curStep  = 1;
                $numSteps = 1;  //  app.php
                $numSteps += 1; //  deploy.php
                $numSteps += 1; //  migrate DB
                $numSteps += 1; //  rewrite routes
                $numSteps += !empty($users) ? 1 : 0;

                $oOutput->writeln('');
                $oOutput->writeln('<info>Installing...</info>');

                //  Write app.php
                $oOutput->write('<comment>[' . $curStep . '/' . $numSteps . ']</comment> Writing <info>config/app.php</info>... ');
                if ($this->writeFile($appVars, 'config/app.php')) {
                    $oOutput->writeln('<info>done!</info>');
                } else {
                    $oOutput->writeln('<error>failed!</error>');
                }
                $curStep++;

                //  Write deploy.php
                $oOutput->write('<comment>[' . $curStep . '/' . $numSteps . ']</comment> Writing <info>config/deploy.php</info>... ');
                if ($this->writeFile($deployVars, 'config/deploy.php')) {
                    $oOutput->writeln('<info>done!</info>');
                } else {
                    $oOutput->writeln('<error>failed!</error>');
                }
                $curStep++;

                /**
                 * Get the current database credential values. If an existing deploy.php is already there then
                 * we can't rely on it having the latest details (as it might have just been updated).
                 */

                $dbHost = $this->getVarValue('DEPLOY_DB_HOST', $deployVars);
                $dbUser = $this->getVarValue('DEPLOY_DB_USERNAME', $deployVars);
                $dbPass = $this->getVarValue('DEPLOY_DB_PASSWORD', $deployVars);
                $dbName = $this->getVarValue('DEPLOY_DB_DATABASE', $deployVars);

                Factory::setProperty('DB_HOST', $dbHost);
                Factory::setProperty('DB_USERNAME', $dbUser);
                Factory::setProperty('DB_PASSWORD', $dbPass);
                Factory::setProperty('DB_DATABASE', $dbName);

                //  Migrate DB
                $oOutput->write('<comment>[' . $curStep . '/' . $numSteps . ']</comment> Migrating database... ');
                $this->migrateDb($dbHost, $dbUser, $dbPass, $dbName);
                $curStep++;

                //  Rewrite routes
                $oOutput->write('<comment>[' . $curStep . '/' . $numSteps . ']</comment> Rewriting routes... ');
                $this->rewriteRoutes();

                // --------------------------------------------------------------------------

                //  Cleaning up
                $oOutput->writeln('');
                $oOutput->writeln('<comment>Cleaning up...</comment>');

                //  And we're done!
                $oOutput->writeln('');
                $oOutput->writeln('Complete!');

                return self::EXIT_CODE_SUCCESS;

            } else {
                return $this->abort();
            }

        } else {

            $exitCode = $this->abort();

            foreach ($preTestErrors as $error) {
                $oOutput->writeln(' - ' . $error);
            }

            return $exitCode;
        }
    }
1203463
public static Optional<ExecutableElement> override(
      DeclaredType type, Types types, String methodName, TypeMirror... params) {
    return override(asElement(type), types, methodName, params);
  }
645675
def _add_cli_param(params, key, value):
    '''
    
    '''
    if value is not None:
        params.append('--{0}={1}'.format(key, value))
1153585
private function sync_installs( $override = array(), $flush = false ) {
            $this->_logger->entrance();

            $result = $this->send_installs_update( $override, $flush );

            if ( false === $result ) {
                // No sync required.
                return;
            }

            if ( ! $this->is_api_result_object( $result, 'installs' ) ) {
                // Failed to sync, don't update locally.
                return;
            }

            $address_to_blog_map = $this->get_address_to_blog_map();

            foreach ( $result->installs as $install ) {
                $this->_site = new FS_Site( $install );

                $address = trailingslashit( fs_strip_url_protocol( $install->url ) );
                $blog_id = $address_to_blog_map[ $address ];

                $this->_store_site( true, $blog_id );
            }
        }
468816
function createInstallTree( $installNode, $dom, $list, $installType )
    {
        foreach ( $list as $installItem )
        {
            $type = $installItem['type'];
            unset( $installItemNode );
            $installItemNode = $dom->createElement( 'item' );
            $installItemNode->setAttribute( 'type', $type );
            $installNode->appendChild( $installItemNode );

            if ( $installItem['os'] )
                $installItemNode->setAttribute( 'os', $installItem['os'] );

            if ( $installItem['name'] )
                $installItemNode->setAttribute( 'name', $installItem['name'] );

            if ( $installItem['filename'] )
            {
                $installItemNode->setAttribute( 'filename', $installItem['filename'] );

                if ( $installItem['sub-directory'] )
                    $installItemNode->setAttribute( 'sub-directory', $installItem['sub-directory'] );
            }
            else if ( isset( $installItem['content'] ) && $installItem['content'] instanceof DOMElement )
            {
                $importedContentNode = $installItemNode->ownerDocument->importNode( $installItem['content'], true );
                $installItemNode->appendChild( $importedContentNode );
            }

            $handler = $this->packageHandler( $type );
            if ( $handler )
            {
                $handler->createInstallNode( $this, $installItemNode, $installItem, $installType );
            }
        }
    }
1286560
private static function installRequest($isUpdate = false)
    {
        self::$id = self::$config['id'];

        $that = self::getInstance();

        $that->install();

        $that->setState($isUpdate ? 'active' : 'inactive');

        $complements = self::getList(self::$config['filter'], self::$config['sort']);

        $complement = $complements[self::$id];

        $response = [
            'complement' => $complement,
            'errors' => self::$errors,
        ];

        echo json_encode($response);
    }
173762
function(helperName, paramSize, params, useRegister) {
                var options = this.objectLiteral(this.setupOptions(helperName, paramSize, params));

                if (useRegister) {
                    this.useRegister('options');
                    params.push('options');
                    return 'options=' + options;
                } else {
                    params.push(options);
                    return '';
                }
            }
939819
private function registerModuleSystemParams()
    {
        if (!count($this->systemParams)) {
            return;
        }
        /*
         * If a system entry already exists, then update it. Otherwise,
         * create a new one.
         */
        $system = $this->systemService->getActiveSystem();

        if (!$system) {
            $system = new System();
            $system->setNavigation([]);

            $this->em->persist($system);
        }

        if (!is_array($system->getNavigation())) {
            $system->setNavigation([]);
        }

        foreach ($this->systemParams as $moduleParams) {
            foreach ($moduleParams as $key => $params) {
                switch ($key) {
                    case 'navigation':
                        // Does the app override the modules' navigation?
                        if(
                            isset($this->appComposerJson['extra']) &&
                            isset($this->appComposerJson['extra']['campaignchain']) &&
                            isset($this->appComposerJson['extra']['campaignchain']['navigation'])
                        ) {
                            $system->setNavigation($this->appComposerJson['extra']['campaignchain']['navigation']);
                        } else {
                            // Merge existing navigations with new modules' navigation.
                            $navigation = array_merge_recursive($system->getNavigation(), $params);

                            $system->setNavigation($navigation);
                        }
                        break;
                }
            }
        }

        $this->em->flush();
    }