Método que gestiona la configuración de las variables
@GET
@Route /admin/config
@return string|null
@throws \HttpException
422844
public function config()
    {
        Logger::log("Config loaded executed by " . $this->getRequest()->getRequestUri());
        /* @var $form \PSFS\base\config\ConfigForm */
        $form = new ConfigForm(Router::getInstance()->getRoute('admin-config'), Config::$required, Config::$optional, Config::getInstance()->dumpConfig());
        $form->build();
        return $this->render('welcome.html.twig', array(
            'text' => t("Bienvenido a PSFS"),
            'config' => $form,
            'typeahead_data' => array_merge(Config::$required, Config::$optional),
        ));
    }
401402
public function getVariables()
    {
        return $this->variables == null?$this->variables = new SiteVariablesImpl($this->db):$this->variables;
    }
682691
public function getConfiguration(){
        $rest = $this->getService( self::API_DHCP_CONFIG);
        $rest->GET();

        return $rest->getResult( models\DhcpConfig::class);
    }
547221
public static function getTemplateConfig()
	{
		if (self::$_templateConfig === 0) {
			$request = Agl::getRequest();
			$module  = $request->getModule();
			$view    = $request->getView();
			$action  = $request->getAction();

			self::$_templateConfig = Agl::app()->getConfig('core-layout/modules/' . $module . '#' . $view . '#action#' . $action . '/template');

			if (self::$_templateConfig === NULL) {
			    self::$_templateConfig = Agl::app()->getConfig('core-layout/modules/' . $module . '#' . $view . '/template');
			}

			if (self::$_templateConfig === NULL) {
			    self::$_templateConfig = Agl::app()->getConfig('core-layout/modules/' . $module . '/template');
			}

			if (self::$_templateConfig === NULL) {
				self::$_templateConfig = Agl::app()->getConfig('core-layout/template');
			}
		}

		if (! isset(self::$_templateConfig['type'])) {
			self::$_templateConfig['type'] = ViewInterface::TYPE_HTML;
		}

		return self::$_templateConfig;
	}
459024
public function get_config() {
        list($componentname, $varname) = $this->get_config_var_name();

        $config = [];
        $settingnames = self::get_settingnames();
        foreach ($settingnames as $name) {
            $config[$varname . $name] = get_config($componentname, $varname . $name);
        }

        // Search areas are enabled by default.
        if ($config[$varname . '_enabled'] === false) {
            $config[$varname . '_enabled'] = 1;
        }
        return $config;
    }
537523
public function currentConfig(){

        if($this->currentConfig !== false){
            return $this->currentConfig;
        }

        $this->currentConfig = null;

        if(!$pageType = $this->current()){
            return;
        }

        $pageId = null;

        if ($page = $this->getBestMatchingPage($pageType)) {
            $pageId = $page->getIdentifier();
        }

        $this->currentConfig = $this->configRepository->getConfig($pageType, $pageId);

        return $this->currentConfig;
    }
803981
public function view()
		{
		    // default variables
            $finder         = new Finder();
            $finder->start();

            // config
            $config         = app(SketchpadConfig::class);

            // base name
            $basePath       = Paths::fix(base_path('/'));
            $baseSegments   = explode('/', rtrim($basePath, '/'));
            $baseName       = array_pop($baseSegments) . '/';

            // view path
            $viewPaths      = Config::get('view.paths');
            $viewPath       = substr(Paths::fix($viewPaths[0]), strlen($basePath));

			// variables
			$app            = app();
			$data =
			[
				'route'     => $config->route,
				'assets'    => $config->route . 'assets/',
				'settings' =>
				[
					'route'             => $config->route,
					'basepath'          => $basePath,
					'basename'          => $baseName,
                    'viewpath'          => $viewPath,
                    'storagepath'       => Paths::relative($config->settings->src),
                    'controllerpath'    => trim(Paths::relative($finder->path), '/'),
					'namespace'         => method_exists($app, 'getNamespace')
                                            ? trim($app->getNamespace(), '\\')
                                            : 'App\\',
                    'namespaces'        => (new JSON('composer.json'))->get('autoload.psr-4')
				]
			];

			// return view
			return view('sketchpad::setup', $data);
		}
1234041
protected function client()
    {
        $apiKey = $this->config('apiKey');
        if (!$apiKey) {
            return null;
        }

        $endpoint = $this->config('endpoint');
        $defaults = $this->config('defaults');
        if ($defaults === null) {
            $defaults = true;
        }
        $client = Client::make($apiKey, $endpoint, $defaults);

        return $client;
    }
825632
protected function loadConfig()
    {
        /** @var DiagnosticServiceInterface $service */
        $service = $this->getServiceLocator()->get(DiagnosticServiceInterface::SERVICE_ID);
        $config = $service->getDiagnosticJsConfig();
        $config['controller'] = 'CompatibilityChecker';
        return $config;
    }
520437
private function getConfig(): string
    {
        $filePath = $this->app->configPath('app.php');

        if (! File::exists($filePath)) {
            $this->app->abort(400, 'The file config/app.php not found');
        }

        return File::get($filePath);
    }
99670
public function getConfig()
    {
        return [

            'view_manager' => [
                'doctype' => 'HTML5',
                'display_exceptions' => true,
                'display_not_found_reason' => true,
                'not_found_template' => 'error/404',
                'exception_template' => 'error/index',
                'template_map' => [
                    'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
                    'error/404' => __DIR__ . '/../view/error/404.phtml',
                    'error/index' => __DIR__ . '/../view/error/index.phtml',
                ],
                'template_path_stack' => [
                    'btz_zf_base' => __DIR__ . '/../view',
                ],
            ],


            'router' => [ // Register router
                'routes' => [

                    'btzzfbase' => [
                        'type'    => Segment::class,
                        'options' => [
                            'route'    => '/btz-zf-base[/]',
                            'defaults' => [
                                'controller' => Controller\IndexController::class,
                                'action'     => 'index',
                            ],
                        ],
                        'may_terminate' => true,
                        'child_routes' => [
                            'index' => [
                                'type' => Segment::class,
                                'options' => [
                                    'route' => 'index[/:action[/:key]][:suffix]',
                                    'constraints' => [
                                        'action' => '[a-zA-Z][a-zA-Z0-9_-]+',
                                        'key' => '[a-zA-Z0-9_-]+',
                                        'suffix' => '(/|.html|.php)',
                                    ],
                                    'defaults' => [
                                        'controller' => Controller\IndexController::class,
                                        'action' => 'index',
                                    ],
                                ],
                            ],
                        ],
                    ],

                ],
            ],

            'log' => [
                'writers' => [
                    'stream' => [
                        'name' => 'stream',
                        'priority' => 999, //Warning: The priority not the log level. For writers priority.
                        'options' => [
                            'stream' => rtrim(sys_get_temp_dir(), '/|\\') . DIRECTORY_SEPARATOR . 'btz_log.txt',
                            'log_separator' => PHP_EOL,
                            'mode' => 'a',

                            'formatter' => [
                                'name' => 'simple',
                                'options' => [
                                    'dateTimeFormat' => 'Y-m-d H:i:s',
                                    'format' => '%timestamp% %priorityName% (%priority%): %message% %extra%',
                                ],
                            ],

                            'filters' => [
                                'priority' => [
                                    'name' => 'priority',
                                    'options' => [
                                        'operator' => '<=',
                                        'priority' => Logger::ERR,
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ];
    }
574704
public function parseConfig()
    {
        $params = $this->presetValues;
        $exampleFilePath = "{$this->dotenvDirPath}/.env.example";
        if (!is_file($exampleFilePath)) {
            return $params;
        }
        try {
            (new Dotenv($this->dotenvDirPath))->load();
        } catch (InvalidPathException $e) {
        }
        $loader = new Loader(null);
        foreach (array_keys(parse_ini_file($exampleFilePath)) as $envVarName) {
            try {
                $paramName = $this->convertEnvVarNameToParamName($envVarName);
            } catch (\InvalidArgumentException $e) {
                throw new \RuntimeException($e->getMessage());
            }
            if (isset($params[$paramName]) && $params[$paramName] !== null) {
                continue;
            }
            $value = $this->castValue($loader->getEnvironmentVariable($envVarName));
            if ($value === null && isset($this->defaultValues[$paramName])) {
                $value = $this->defaultValues[$paramName];
            }
            $params[$paramName] = $value;
        }

        return $params;
    }
1082041
public static function getSettings()
    {
        if (self::$settings === null) {
            $configuration = self::parseSettings();
            self::$settings = new EmConfiguration($configuration);
        }

        return self::$settings;
    }
1240471
function &get_config_vars($name=null)
	{
		if(!isset($name) && is_array($this->_config[0])) {
			return $this->_config[0]['vars'];
		} else if(isset($this->_config[0]['vars'][$name])) {
			return $this->_config[0]['vars'][$name];
		} else {
			// var non-existant, return valid reference
			$_tmp = null;
			return $_tmp;
		}
	}
1163495
public function getClientConfig()
    {
        // Allows the section name to be overridden in config
        $name = $this->config()->get('section_name');

        if (!$name) {
            $name = static::class;
        }

        $clientConfig = [
            // Trim leading/trailing slash to make it easier to concatenate URL
            // and use in routing definitions.
            'name' => $name,
            'url' => trim($this->Link(), '/'),
            'form' => [
                'EditorExternalLink' => [
                    'schemaUrl' => $this->Link('methodSchema/Modals/EditorExternalLink'),
                ],
                'EditorEmailLink' => [
                    'schemaUrl' => $this->Link('methodSchema/Modals/EditorEmailLink'),
                ],
            ],
        ];

        $this->extend('updateClientConfig', $clientConfig);

        return $clientConfig;
    }
1367791
public function getConfig()
    {
        if ($this->config === null) {
            $path = $this->getInputDirectory() . '/makedocs.json';
            if (!is_file($path)) {
                throw new \RuntimeException('The input directory does not contain a makedocs.json file.');
            }

            $data = json_decode(file_get_contents($path));
            if (!$data) {
                throw new \RuntimeException('The JSON could not be loaded.');
            }

            $this->config = new Config((array)$data);
        }
        return $this->config;
    }
1367261
public static function get_public_config() {
        global $CFG, $SITE, $PAGE, $OUTPUT;
        require_once($CFG->libdir . '/authlib.php');

        $context = context_system::instance();
        // We need this to make work the format text functions.
        $PAGE->set_context($context);

        list($authinstructions, $notusedformat) = external_format_text($CFG->auth_instructions, FORMAT_MOODLE, $context->id);
        list($maintenancemessage, $notusedformat) = external_format_text($CFG->maintenance_message, FORMAT_MOODLE, $context->id);
        $settings = array(
            'wwwroot' => $CFG->wwwroot,
            'httpswwwroot' => $CFG->wwwroot,
            'sitename' => external_format_string($SITE->fullname, $context->id, true),
            'guestlogin' => $CFG->guestloginbutton,
            'rememberusername' => $CFG->rememberusername,
            'authloginviaemail' => $CFG->authloginviaemail,
            'registerauth' => $CFG->registerauth,
            'forgottenpasswordurl' => clean_param($CFG->forgottenpasswordurl, PARAM_URL), // We may expect a mailto: here.
            'authinstructions' => $authinstructions,
            'authnoneenabled' => (int) is_enabled_auth('none'),
            'enablewebservices' => $CFG->enablewebservices,
            'enablemobilewebservice' => $CFG->enablemobilewebservice,
            'maintenanceenabled' => $CFG->maintenance_enabled,
            'maintenancemessage' => $maintenancemessage,
            'mobilecssurl' => !empty($CFG->mobilecssurl) ? $CFG->mobilecssurl : '',
            'tool_mobile_disabledfeatures' => get_config('tool_mobile', 'disabledfeatures'),
            'country' => clean_param($CFG->country, PARAM_NOTAGS),
            'agedigitalconsentverification' => \core_auth\digital_consent::is_age_digital_consent_verification_enabled(),
            'autolang' => $CFG->autolang,
            'lang' => clean_param($CFG->lang, PARAM_LANG),  // Avoid breaking WS because of incorrect package langs.
            'langmenu' => $CFG->langmenu,
            'langlist' => $CFG->langlist,
            'locale' => $CFG->locale,
        );

        $typeoflogin = get_config('tool_mobile', 'typeoflogin');
        // Not found, edge case.
        if ($typeoflogin === false) {
            $typeoflogin = self::LOGIN_VIA_APP; // Defaults to via app.
        }
        $settings['typeoflogin'] = $typeoflogin;

        // Check if the user can sign-up to return the launch URL in that case.
        $cansignup = signup_is_enabled();

        $url = new moodle_url("/$CFG->admin/tool/mobile/launch.php");
        $settings['launchurl'] = $url->out(false);

        // Check that we are receiving a moodle_url object, themes can override get_logo_url and may return incorrect values.
        if (($logourl = $OUTPUT->get_logo_url()) && $logourl instanceof moodle_url) {
            $settings['logourl'] = clean_param($logourl->out(false), PARAM_URL);
        }
        if (($compactlogourl = $OUTPUT->get_compact_logo_url()) && $compactlogourl instanceof moodle_url) {
            $settings['compactlogourl'] = clean_param($compactlogourl->out(false), PARAM_URL);
        }

        // Identity providers.
        $authsequence = get_enabled_auth_plugins(true);
        $identityproviders = \auth_plugin_base::get_identity_providers($authsequence);
        $identityprovidersdata = \auth_plugin_base::prepare_identity_providers_for_output($identityproviders, $OUTPUT);
        if (!empty($identityprovidersdata)) {
            $settings['identityproviders'] = $identityprovidersdata;
        }

        // If age is verified, return also the admin contact details.
        if ($settings['agedigitalconsentverification']) {
            $settings['supportname'] = clean_param($CFG->supportname, PARAM_NOTAGS);
            $settings['supportemail'] = clean_param($CFG->supportemail, PARAM_EMAIL);
        }

        return $settings;
    }