Check if the module variables have the content that is expected
@throws InvalidConfigException
326928
private function _checkVariableConfiguration() {
		// Check if the canUploadImage is boolean
		if (!is_bool($this->canUploadImage)) {
			throw new InvalidConfigException('$canUploadImage variable only supports a boolean value, if you have a custom function you must return a boolean.');
		}
		// Check if the canRemoveImage is boolean
		if (!is_bool($this->canRemoveImage)) {
			throw new InvalidConfigException('$removeImageAllowed variable only supports a boolean value, if you have a custom function you must return a boolean.');
		}
		// Check if the setBlamableBehavior is boolean
        if (! is_bool($this->setBlameableBehavior))
            throw new InvalidConfigException('$setBlameableBehavior only supports a boolean value, if you have a custom function make sure that you return a boolean.');
        // Check if the deleteOriginalAfterEdit is boolean
        if (! is_bool($this->deleteOriginalAfterEdit))
            throw new InvalidConfigException('$deleteOriginalAfterEdit only supports boolean value, if you have a custom function make sure that your return a boolean.');

		// Check if the blameable behavior is set to true
        if ($this->setBlameableBehavior) {
            // Get the migration record
            $mRecordMigrationRun = Yii::$app->db->createCommand('SELECT * FROM {{%migration}} WHERE `version` = \'m170223_113221_addBlameableBehavior\'')->queryOne();
            if ($mRecordMigrationRun === false) {
                throw new InvalidConfigException('Image Manager: You have not run the latest migration, see the documentation how to do this.');
            }
        }
	}
600372
public function init(): void
    {
        parent::init();

        if ($this->name === null || !\is_string($this->name) || $this->name === '') {
            throw new InvalidConfigException('Formatter name must be defined');
        }
        if ($this->path === null) {
            throw new InvalidConfigException('File path property must be defined and be not empty');
        }
        foreach ($this->formatAdapterArray as $i => $formatAdapter) {
            $this->formatAdapterArray[$i] = Container::createObject($formatAdapter);

            if (!($this->formatAdapterArray[$i] instanceof IFormatAdapter)) {
                throw new InvalidConfigException(sprintf('Format adapter must be instance of %s.', IFormatAdapter::class));
            }
        }
    }
542727
public function checkSetConfigInput()
    {
        
        $availableParameters = array('loaded', 'loadAtStartup', 'ghost');
        $defaults = array('extension' => null,
                          'configParameter' => null,
                          'configValue' => null);
                          
        $this->options = array_merge($defaults, $this->options);
        
        if ($this->options['configParameter'] == null){
            $this->error("Please provide the 'configParam' parameter.", true);
        }
        else if (!in_array($this->options['configParameter'], $availableParameters)){
            $this->error("Please provide a valid 'configParam' parameter value (" . implode("|", $availableParameters) . ").", true);
        }
        else if ($this->options['configValue'] === null){
            $this->error("Please provide the 'configValue' parameter.", true);
        }
        else if ($this->options['extension'] == null){
            $this->error("Please provide the 'extension' parameter.", true);
        }
    }
180730
protected function assertConfigIsValid(): void
    {
        foreach ($this->configProperties as $property) {
            if (empty(self::$config[$this->configSectionName][$property])) {
                throw new InvalidConfigException(
                    sprintf(
                        "Config section does not exist or is not filled properly: %s (\"%s\" is missing)",
                        $this->configSectionName,
                        $property
                    )
                );
            }
        }

        $this->assertApiClassImplementsInterface($this->apiInterface);
    }
70816
public function init()
    {
        if ($this->pagination === null) {
            throw new InvalidConfigException('The "pagination" property must be set.');
        }

        if ($this->widgetId === null) {
            throw new InvalidConfigException('The "widgetId" property must be set.');
        }

        // Publish assets and register main plugin code
        InfiniteScrollAsset::register($this->view);

        // Register configured behavior, if any
        $behavior = ArrayHelper::getValue($this->pluginOptions, 'behavior', null);
        if (!is_null($behavior)) {
            switch ($behavior) {
                case self::BEHAVIOR_TWITTER:
                    $behaviorAsset = 'manual-trigger.js';
                    break;
                case self::BEHAVIOR_LOCAL:
                    $behaviorAsset = 'local.js';
                    break;
                case self::BEHAVIOR_MASONRY:
                    $behaviorAsset = 'masonry-isotope.js';
                    break;
                case self::BEHAVIOR_CUFON:
                    $behaviorAsset = 'cufon.js';
                    break;
                default:
                    $behaviorAsset = false;
            }
            if ($behaviorAsset) {
                $assetManager = $this->view->getAssetManager();
                $assetBundle = $assetManager->getBundle(InfiniteScrollAsset::className());
                $behaviorUrl = $assetManager->getAssetUrl($assetBundle, 'behaviors/' . $behaviorAsset);
                $this->view->registerJsFile($behaviorUrl, [
                    'depends' => [InfiniteScrollAsset::className()]
                ]);
            }
        }

        $widgetSelector = '#' . $this->widgetId;

        // Set default plugin selectors / options if not configured
        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'maxPage', null)))
            $this->pluginOptions['maxPage'] = $this->pagination->getPageCount();

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'contentSelector', null)))
            $this->pluginOptions['contentSelector'] = $widgetSelector . ' .' . $this->itemsCssClass;

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'itemSelector', null)))
            $this->pluginOptions['itemSelector'] = $this->pluginOptions['contentSelector'] . ' >';

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'navSelector', null)))
            $this->pluginOptions['navSelector'] = $widgetSelector . " ul." . $this->options['class'];

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'nextSelector', null)))
            $this->pluginOptions['nextSelector'] = $this->pluginOptions['navSelector'] . ' li.' . $this->nextPageCssClass . " a:first";

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'loading', null)))
            $this->pluginOptions['loading'] = [];
        if (is_null(ArrayHelper::getValue($this->pluginOptions['loading'], 'img', null))) {
            $assetManager = $this->view->getAssetManager();     // Publish loader img
            list ($imgPath, $imgUrl) = $assetManager->publish('@vendor/nirvana-msu/yii2-infinite-scroll/assets/images/ajax-loader.gif');
            $this->pluginOptions['loading']['img'] = $imgUrl;
        }
    }
199140
private function getContxtualModule(AbstractAppMeta $appMeta, $contexts)
    {
        $contextsArray = array_reverse(explode('-', $contexts));
        $module = null;
        foreach ($contextsArray as $context) {
            $class = $appMeta->name . '\Module\\' . ucwords($context) . 'Module';
            if (! class_exists($class)) {
                $class = 'BEAR\Package\Context\\' . ucwords($context) . 'Module';
            }
            if (! is_a($class, AbstractModule::class, true)) {
                throw new InvalidContextException($context);
            }
            $module = new $class($module);
        }

        return $module;
    }
259743
private function assertString($key, $value)
    {
        if (!is_string($value) && null !== $value) {
            throw new InvalidConfigException(sprintf(
                'The config key "%s" must be a string. Got: %s',
                $key,
                is_object($value) ? get_class($value) : gettype($value)
            ));
        }
    }
503455
function checkConfig()
    {
        //for joomla_int check to see if the source_url does not equal the default
	    try {
		    $db = Factory::getDatabase($this->getJname());
	    } catch (Exception $e) {
		    throw new RuntimeException(Text::_('NO_DATABASE') . ' : ' . $e->getMessage());
	    }

	    try {
		    $jdb = Factory::getDBO();
	    } catch (Exception $e) {
		    throw new RuntimeException($this->getJname() . ' -> joomla_int ' . Text::_('NO_DATABASE') . ' : ' . $e->getMessage());
	    }

	    if (!$db->connected()) {
		    throw new RuntimeException(Text::_('NO_DATABASE'));
	    } elseif (!$jdb->connected()) {
		    throw new RuntimeException($this->getJname() . ' -> joomla_int ' . Text::_('NO_DATABASE'));
	    } else {
		    //added check for missing files of copied plugins after upgrade
		    $admin = Factory::getAdmin($this->getJname());
		    $adminclass = 'JFusion\\Plugins\\' . $this->getJname(). '\\Admin';

		    $user = Factory::getUser($this->getJname());
		    $userclass = 'JFusion\\Plugins\\' . $this->getJname(). '\\User';
		    if (!$admin instanceof $adminclass) {
			    throw new RuntimeException(Text::_('NO_FILES') . ' '. $adminclass);
		    } else if (!$user instanceof $userclass) {
			    throw new RuntimeException(Text::_('NO_FILES') . ' '. $userclass);
		    } else {
			    $cookie_domain = $this->params->get('cookie_domain');
			    $jfc = Factory::getCookies();
			    list($url) = $jfc->getApiUrl($cookie_domain);
			    if ($url) {
				    $api = new Api($url, Factory::getParams('joomla_int')->get('secret'));
				    if (!$api->ping()) {
					    list ($message) = $api->getError();

					    throw new RuntimeException($api->url . ' ' . $message);
				    }
			    }
			    $source_path = $this->params->get('source_path');
			    if ($source_path && (strpos($source_path, 'http://') === 0 || strpos($source_path, 'https://') === 0)) {
				    throw new RuntimeException(Text::_('ERROR_SOURCE_PATH') . ' : ' . $source_path);
			    } else {
				    //get the user table name
				    $tablename = $this->getTablename();
				    // lets check if the table exists, now using the Joomla API
				    $table_list = $db->getTableList();
				    $table_prefix = $db->getPrefix();
				    if (!is_array($table_list)) {
					    throw new RuntimeException($table_prefix . $tablename . ': ' . Text::_('NO_TABLE'));
				    } else {
					    if (array_search($table_prefix . $tablename, $table_list) === false) {
						    //do a final check for case insensitive windows servers
						    if (array_search(strtolower($table_prefix . $tablename), $table_list) === false) {
							    throw new RuntimeException($table_prefix . $tablename . ': ' . Text::_('NO_TABLE'));
						    }
					    }
				    }
			    }
		    }
	    }
        return true;
    }
1249947
private function _checkUnusedVariables() {
		if ($this->_isActive('checkUnusedVariables')) {

			foreach ($this->_variables as $variable) {

				if ((!$variable->isUsed) && !($this->_isClass || $this->_isView) && !$this->_config->isException('checkUnusedVariables', $variable->name)) {
					$msg = $this->_getMessage('UNUSED_VARIABLE', $variable->name);
					$this->_writeError('checkUnusedVariables', $msg, $variable->line, $this->_config->getTestLevel('checkUnusedVariables'));
				}
			}
		}
	}
957079
public function getContextConfigValue($varName, $defaultValue = null)
    {
        if ($this->type == InternalBaseBlock::INJECTOR_VAR) {
            return $this->context->getVarValue($varName, $defaultValue);
        }
        
        if ($this->type == InternalBaseBlock::INJECTOR_CFG) {
            return $this->context->getCfgValue($varName, $defaultValue);
        }
            
        throw new InvalidConfigException("The type '{$this->type}' is not supported.");
    }
53187
private function initializeConfig()
    {
        if (empty($this->config['url'])) {
            $this->config['url'] = static::$url;
        }

        $this->config['url'] = rtrim($this->config['url'], '/');

        if (filter_var($this->config['url'], FILTER_VALIDATE_URL) === false) {
            throw new InvalidConfigException('You must provide a valid URL in the config.');
        }
    }
685225
public function init()
    {
        parent::init();

        if (!isset($this->options['name'])) {
            if($this->hasModel()) {
                $this->options['name'] = Html::getInputName($this->model, $this->attribute);
            } else {
                throw new InvalidConfigException("'Name' property must be specified.");
            }
        }
        if (!isset($this->value) && $this->hasModel()) {
            $this->value = $this->model->{$this->attribute};
        }
    }
259149
final public function isConfigured()
	{
		$jname = $this->getJname();
		$result = false;

		if (!empty($jname)) {
			if (!isset(static::$status[$jname])) {
				$db = Factory::getDBO();
				$query = $db->getQuery(true)
					->select('status')
					->from('#__jfusion')
					->where('name = ' . $db->quote($jname));

				$db->setQuery($query);
				$result = $db->loadResult();
				if ($result >= 1) {
					$result = true;
				} else {
					$result = false;
				}
				static::$status[$jname] = $result;
			} else {
				$result = static::$status[$jname];
			}
		}
		return $result;
	}
167565
async function loadModulesConfig()
{
    if(!modulesLoaded)
    {
		for (let i = 0; i < modules.length; i++) {
			await applyBotDataSource(modules[i]);
        }
        
        modulesLoaded = true;
    }
}
1183632
private synchronized static void initConfigs() {
        for (int i = 0; i < moduleIDs.length; i++) {
            // add module configs one by one
            //addModuleInfo(moduleIDs[i] + modulePrefix);
            // don't do validation since in pre-defined module
            getConfigFromXMLFile(getXmlFileName(modulePrefix + moduleIDs[i]), true, false);
        }
    }
653027
protected function checkContent()
    {
        if (is_array($this->content) && count($this->content)) {
            foreach ($this->content as $name => $value) {
                switch ($name) {
                    case 'category':
                    case 'mainMessage':
                    case 'buttonMessage':
                    case 'language':
                        $this->addContentOption($name, $value);
                        break;
                    case 'mainParams':
                    case 'buttonParams':
                        $this->addParamsOption($name, $value);
                        break;
                }
            }
        }
    }
813233
public function hasModule($module)
    {
        foreach ($this->data as $index => $row) {
            if ($row[ConstProviderInterface::CONFIG_PARAM_MODULE] == $module) {
                return true;
            }
        }

        return false;
    }