Get the pre-configuration preconditions.

@param bool $includeWebPreconditions

@return PreconditionInterface[]
345531
public function getPreconditions($includeWebPreconditions = true)
    {
        $result = [];
        foreach ($this->getAllPreconditions() as $instance) {
            if (!$instance instanceof OptionsPreconditionInterface) {
                if ($includeWebPreconditions || !$instance instanceof WebPreconditionInterface) {
                    $result[] = $instance;
                }
            }
        }

        return $result;
    }
1216298
private function getRenderContext()
    {
        $bundled = array_filter(
            $this->app['extensions']->all(),
            function (ResolvedExtension $ext) {
                return $ext->isBundled();
            }
        );

        return [
            'messages'       => $this->app['extend.ping']->getMessages(),
            'enabled'        => $this->app['extend.enabled'],
            'writeable'      => $this->app['extend.writeable'],
            'online'         => $this->app['extend.online'],
            'extensionsPath' => $this->app['path_resolver']->resolve('extensions'),
            'site'           => $this->app['extend.site'],
            'extendVersion'  => Bolt\Version::forComposer(),
            'bundled'        => $bundled,
        ];
    }
1315499
private function getPluginConfig($pluginId) {
    if (!array_key_exists(static::CONFIG_KEY, $this->installState)) {
      return [];
    }

    if (!array_key_exists($pluginId, $this->installState[static::CONFIG_KEY])) {
      return [];
    }

    return $this->installState[static::CONFIG_KEY][$pluginId];
  }
277216
public static String[] getExcludePatterns() {
        Configuration config = ConfigUtils.getCurrentConfig();
        if (config != null) {
            return config.getStringArray(EXCLUDE_PATTERNS_CONFIG_KEY);
        } else {
            return null;
        }
    }
1331331
public function getPredefinedCommands()
    {
        $tasks = [
            'check' => 'Check',
            'cleanup' => 'Cleanup',
            'current' => 'CurrentRelease',
            'deploy' => 'Deploy',
            'flush' => 'Flush',
            'ignite' => 'Ignite',
            'ignite-stubs' => 'Ignite\Stubs',
            'rollback' => 'Rollback',
            'setup' => 'Setup',
            'strategies' => 'Strategies',
            'teardown' => 'Teardown',
            'test' => 'Test',
            'update' => 'Update',
            'debug-tinker' => 'Development\Tinker',
            'debug-config' => 'Development\Configuration',
            'self-update' => 'Development\SelfUpdate',
            'plugin-publish' => 'Plugins\Publish',
            'plugin-list' => 'Plugins\List',
            'plugin-install' => 'Plugins\Install',
            'plugin-update' => 'Plugins\Updater',
        ];

        // Add user commands
        $userTasks = (array) $this->config->get('hooks.custom');
        $userTasks = array_filter($userTasks);
        $tasks = array_merge($tasks, $userTasks);

        return $tasks;
    }
168472
public static function getStringOperands($includeSelector = false)
    {
        $values = array(
            self::STRING_STARTS,
            self::STRING_ENDS,
            self::STRING_EQUALS,
            self::STRING_CONTAINS,
        );

        if ($includeSelector) {
            $values[] = self::OPERAND_SELECTOR;
        }

        return $values;
    }
818898
public static function optionsRestrictions($include_empty): array
    {
        $options = [
            'none'         => I18N::translate('Show to visitors'),
            'privacy'      => I18N::translate('Show to members'),
            'confidential' => I18N::translate('Show to managers'),
            'locked'       => I18N::translate('Only managers can edit'),
        ];

        if ($include_empty) {
            $options = ['' => ''] + $options;
        }

        return $options;
    }
1302468
public static function getUnassignedBlockTypes($includeInternalBlockTypes = false)
    {
        $result = [];
        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);
        $rs = $db->executeQuery(<<<EOT
select BlockTypes.btID
from BlockTypes
left join BlockTypeSetBlockTypes on BlockTypes.btID = BlockTypeSetBlockTypes.btID
left join BlockTypeSets on BlockTypeSetBlockTypes.btsID = BlockTypeSets.btsID
where BlockTypeSets.btsID is null
order by BlockTypes.btDisplayOrder asc
EOT
        );
        while (($btID = $rs->fetchColumn()) !== false) {
            $bt = BlockType::getByID($btID);
            if ($bt !== null) {
                if ($includeInternalBlockTypes || !$bt->isBlockTypeInternal()) {
                    $result[] = $bt;
                }
            }
        }

        return $result;
    }
208963
public function resolvedIncludeKeys(): array
    {
        $availableIncludeKeys = $this->availableIncludeKeys();

        return array_filter($this->includeKeys(), function ($includeKey) use ($availableIncludeKeys) {
            return \in_array($includeKey, $availableIncludeKeys, true);
        });
    }
68925
function getPresets(category) {
    const categoryConfig = configs.find(conf => conf.name === category)
    if (!categoryConfig) {
        return []
    }

    const presets = [categoryConfig.configId]
    const subTargets = configs.filter(conf =>
        conf.extends.find(ext => ext.name === category)
    )
    for (const sub of subTargets) {
        for (const name of getPresets(sub.name)) {
            presets.push(name)
        }
    }
    return presets
}
930858
protected function getModuleConfig(): array
    {
        $merged = [];
        $merger = $this->getMerger();
        foreach ($this->getModules() as $module) {
            if ($module instanceof ConditionProviderInterface && $module->isConditioned() === true) {
                continue;
            }

            if ($module instanceof ConfigProviderInterface) {
                $merged = $merger->merge(
                    $merged,
                    $module->getConfig()->load()
                );
            }
        }

        return $merged;
    }
239197
private function checkOptionPreconditions(\Concrete\Core\Application\Application $app, Installer $installer, InputInterface $input, OutputInterface $output)
    {
        $connection = $installer->createConnection();
        $result = true;
        $someWarnings = false;
        $service = $app->make(PreconditionService::class);
        $requiredPreconditions = [];
        $optionalPreconditions = [];
        foreach ($service->getOptionsPreconditions() as $precondition) {
            if ($precondition->isOptional()) {
                $optionalPreconditions[] = $precondition;
            } else {
                $requiredPreconditions[] = $precondition;
            }
        }
        foreach ([
            'Checking required configuration preconditions:' => $requiredPreconditions,
            'Checking optional configuration preconditions:' => $optionalPreconditions,
        ] as $text => $preconditions) {
            if (empty($preconditions)) {
                continue;
            }
            if ($output->getVerbosity() >= OutputInterface::VERBOSITY_NORMAL) {
                $output->writeln($text);
            }
            foreach ($preconditions as $precondition) {
                if ($precondition instanceof ConnectionOptionsPreconditionInterface) {
                    $precondition->setConnection($connection);
                }
                $precondition->setInstallerOptions($installer->getOptions());
                if ($output->getVerbosity() >= OutputInterface::VERBOSITY_NORMAL) {
                    $output->write(sprintf('- %s... ', $precondition->getName()));
                } elseif ($precondition->isOptional()) {
                    continue;
                }
                $preconditionResult = $precondition->performCheck();
                switch ($preconditionResult->getState()) {
                    case PreconditionResult::STATE_PASSED:
                        if ($output->getVerbosity() >= OutputInterface::VERBOSITY_NORMAL) {
                            $message = $preconditionResult->getMessage();
                            $message = $message ? sprintf('passed (%s).', $message) : 'passed.';
                            $output->writeln(sprintf('<info>%s</info>', $message));
                        }
                        break;
                    case PreconditionResult::STATE_WARNING:
                        $someWarnings = true;
                        if ($output->getVerbosity() >= OutputInterface::VERBOSITY_NORMAL) {
                            $output->writeln(sprintf('<comment>%s</comment>', $preconditionResult->getMessage()));
                        }
                        break;
                    case PreconditionResult::STATE_SKIPPED:
                        if ($output->getVerbosity() >= OutputInterface::VERBOSITY_NORMAL) {
                            $output->writeln(sprintf('<comment>%s</comment>', $preconditionResult->getMessage() ?: 'skipped.'));
                        }
                        break;
                    case PreconditionResult::STATE_FAILED:
                    default:
                        if ($output->getVerbosity() >= OutputInterface::VERBOSITY_NORMAL) {
                            $output->writeln(sprintf('<error>%s</error>', $preconditionResult->getMessage()));
                        }
                        if (!$precondition->isOptional()) {
                            $result = false;
                        } else {
                            $someWarnings = true;
                        }
                        break;
                }
            }
        }

        if ($result === false) {
            return self::OPTIONPRECONDITIONS_ERROR;
        } elseif ($someWarnings === true) {
            return self::OPTIONPRECONDITIONS_WARNINGS;
        } else {
            return self::OPTIONPRECONDITIONS_SUCCESS;
        }
    }
193399
protected function getIncluded(ElementInterface $element, $includeParent = false)
    {
        $included = [];

        foreach ($element->getResources() as $resource) {
            if ($resource->isIdentifier()) {
                continue;
            }

            if ($includeParent) {
                $included = $this->mergeResource($included, $resource);
            } else {
                $type = $resource->getType();
                $id = $resource->getId();
            }

            foreach ($resource->getUnfilteredRelationships() as $relationship) {
                $includedElement = $relationship->getData();

                if (! $includedElement instanceof ElementInterface) {
                    continue;
                }

                foreach ($this->getIncluded($includedElement, true) as $child) {
                    // If this resource is the same as the top-level "data"
                    // resource, then we don't want it to show up again in the
                    // "included" array.
                    if (! $includeParent && $child->getType() === $type && $child->getId() === $id) {
                        continue;
                    }

                    $included = $this->mergeResource($included, $child);
                }
            }
        }

        $flattened = [];

        array_walk_recursive($included, function ($a) use (&$flattened) {
            $flattened[] = $a;
        });

        return $flattened;
    }
689561
public function get_parent_contexts($includeself = false) {
        if (!$contextids = $this->get_parent_context_ids($includeself)) {
            return array();
        }

        // Preload the contexts to reduce DB calls.
        context_helper::preload_contexts_by_id($contextids);

        $result = array();
        foreach ($contextids as $contextid) {
            $parent = context::instance_by_id($contextid, MUST_EXIST);
            $result[$parent->id] = $parent;
        }

        return $result;
    }
51128
protected function getConditions()
    {
        $conditionLoader = $this->loader->getConditions();
        $conditions = [];
        for ($number = 1; $number <= 4; $number++) {
            $element = 'gcon_condition_text' . $number;
            $conditionId = (int) $this->_data[$element];
            if ($conditionId >0) {
                $conditions[] = $conditionLoader->loadCondition($conditionId);
            }
        }

        return $conditions;
    }
104354
public function getRoles($includeAbstract = false)
    {
        $this->initialize();
        if (!$includeAbstract) {
            return array_filter($this->roles, function (Role $role) {
                return $role->isAbstract() !== true;
            });
        }
        return $this->roles;
    }
1373395
public function getLinksArray($includeOnlyVisited = false){
        $links = $this->getLinks();
        
        if($includeOnlyVisited === true){
            $links = array_filter($links, function (Link $linkObj) {
                /*@var $linkObj Link */
                return $linkObj->isVisited() === true;
            });
        }
        
        return array_map(function(Link $link){
            return [
              'fullUrl' => $link->getAbsoluteUrl(),
              'uri' => $link->getPath(),
              'metaInfo' => $link->getMetaInfoArray(),
              'parentLink' => $link->getParentUrl(),
              'statusCode' => $link->getStatusCode(), 
              'status' => $link->getStatus(), 
              'contentType' => $link->getContentType(), 
              'errorInfo' => $link->getErrorInfo(),
              'crawlDepth' => $link->getCrawlDepth(),              
            ];
        },$links);
    }