Determine if Valet's custom DnsMasq configuration is being imported.

@param  string  $customConfigPath
@return bool
355787
function customConfigIsBeingImported($customConfigPath)
    {
        return strpos($this->files->get($this->configPath), $customConfigPath) !== false;
    }
376087
public static function init($configPath = null)
    {
        if (!$configPath) {
            return new self();
        }
        if (!isset(self::$instances[$configPath])) {
            if (!file_exists($configPath) || !is_readable($configPath)) {
                throw new \InvalidArgumentException("Invalid config path '$configPath'");
            }
            self::$instances[$configPath] = new static(parse_ini_file($configPath, true));
        }

        return self::$instances[$configPath];
    }
405089
private function getDestinationPath($configPath, $modelName = null, $frontend = false)
    {
        $path = $frontend ? '' : $this->folder . DIRECTORY_SEPARATOR;
        $path = $path . config('scaffold.templates.' . $configPath)[1];
        $path = Utils::fillTemplate([
            'MODEL_NAME'  => $modelName,
            'MODULE_NAME' => $this->starter->getModuleName()
        ], $path);
        return $path;
    }
82292
private function getDestinationPath($configPath, $modelName = null)
    {
        $path = $this->folder . DIRECTORY_SEPARATOR . config('zgldh-scaffold.templates.' . $configPath)[1];
        $path = Utils::fillTemplate(['MODEL_NAME' => $modelName], $path);
        return $path;
    }
51038
private function isConfigured() : bool
    {
        if (!is_readable($this->settings['sp_key_file'])) {
            return false;
        }
        if (!is_readable($this->settings['sp_cert_file'])) {
            return false;
        }
        $key = file_get_contents($this->settings['sp_key_file']);
        if (!openssl_get_privatekey($key)) {
            return false;
        }
        $cert = file_get_contents($this->settings['sp_cert_file']);
        if (!openssl_get_publickey($cert)) {
            return false;
        }
        if (!SignatureUtils::certDNEquals($cert, $this->settings)) {
            return false;
        }
        return true;
    }
1030433
public static boolean isProvider(String templatePath) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(templatePath)) {
            return false;
        }
        templatePath = templatePath.trim();
        return templatePath.startsWith(DYNAMIC_TEMPLATE_LEGACY_PREFIX)
            || templatePath.startsWith(DYNAMIC_TEMPLATE_PREFIX);
    }
1259840
public function loadPaths($basePath = null, $configPath = null)
    {
        if ($basePath) {
            $this->basePath = realpath($basePath);
        }

        $this->paths = $this->loadConfig($configPath);

        return $this;
    }
7145
function isConfigurationParametersDefinedCorrectly(config) {
		if (!config) {
			gutil.log('license-check', gutil.colors.red('Config must be defined to run the plugin'));
			return false;
		}

		if (!config.path) {
			gutil.log('license-check', gutil.colors.red('License header property {path} must be defined to run the plugin'));
			return false;
		}

		return true;
	}
1200777
def ImportDNS(self, config, token=None):
        
        if not token:
            raise Exception("You must have the dns token set first.")
        self.dns = CotendoDNS([token, config])
        return True
342745
protected function loadConfig($customConfigPath = null)
    {
        if (is_null($customConfigPath)) {
            $customConfigPath = $this->basePath . DIRECTORY_SEPARATOR . 'config';
        }

        $beverageConfigPath = realpath(__DIR__ . '/../../config');
        $beverageConfigFile = $beverageConfigPath . DIRECTORY_SEPARATOR . 'caffeinated.beverage.php';
        $customConfigFile   = realpath($customConfigPath) . DIRECTORY_SEPARATOR . 'caffeinated.beverage.php';

        $customConfig   = [ ];
        $beverageConfig = require($beverageConfigFile);

        if (file_exists($customConfigFile)) {
            $customConfig = require($customConfigFile);
        }

        $config = array_replace_recursive($beverageConfig, $customConfig);

        return $config[ 'custom_paths' ];
    }
745821
public function setupServiceManager($configPath)
    {
        try {
            $this->getServiceManager();
        } catch (InvalidServiceManagerException $e) {
            if (! \helpers_File::emptyDirectory($configPath, true)) {
                throw new \common_exception_Error('Unable to empty ' . $configPath . ' folder.');
            }
            $driver = new ServiceConfigDriver();
            $configService = $driver->connect('config', array(
                'dir' => $configPath,
                'humanReadable' => true
            ));

            $this->setServiceManager(new ServiceManager($configService));
        }

        return $this->getServiceManager();
    }
942178
private function isAuthorizeCustomDomain($website = 0)
    {
        $website = $this->storeManager->getWebsite($website);
        $customDomain = $website->getConfig(
            self::XML_PATH_CONNECTOR_CUSTOM_DOMAIN
        );

        return (bool)$customDomain;
    }
840481
public function checkLocaleAccess($configKey)
    {
        $config = $this->app->make('community_translation/config');
        $level = $config->get('options.api.access.' . $configKey);
        switch ($level) {
            case self::ACCESSOPTION_EVERYBODY:
                return $this->getApprovedLocales();
            case self::ACCESSOPTION_REGISTEREDUSERS:
                $this->getRequestUser();

                return $this->getApprovedLocales();
            case self::ACCESSOPTION_TRANSLATORS_ALLLOCALES:
                $requiredLevel = Access::TRANSLATE;
                $ownLocalesOnly = false;
                break;
            case self::ACCESSOPTION_TRANSLATORS_OWNLOCALES:
                $requiredLevel = Access::TRANSLATE;
                $ownLocalesOnly = true;
                break;
            case self::ACCESSOPTION_LOCALEADMINS_ALLLOCALES:
                $requiredLevel = Access::ADMIN;
                $ownLocalesOnly = false;
                break;
            case self::ACCESSOPTION_LOCALEADMINS_OWNLOCALES:
                $requiredLevel = Access::ADMIN;
                $ownLocalesOnly = true;
                break;
            case self::ACCESSOPTION_GLOBALADMINS:
                $requiredLevel = Access::GLOBAL_ADMIN;
                $ownLocalesOnly = false;
                break;
            case self::ACCESSOPTION_SITEADMINS:
                $user = $this->getRequestUser();
                if ($user->getUserID() != USER_SUPER_ID) {
                    $admins = Group::getByID(ADMIN_GROUP_ID);
                    if (!$admins || !$user->inGroup($admins)) {
                        throw AccessDeniedException::create();
                    }
                }

                return;
            case self::ACCESSOPTION_ROOT:
                $user = $this->getRequestUser();
                if ($user->getUserID() != USER_SUPER_ID) {
                    throw AccessDeniedException::create();
                }

                return;
            case self::ACCESSOPTION_NOBODY:
            default:
                throw AccessDeniedException::create();
        }
        $user = $this->getRequestUser();
        $ownLocales = [];
        foreach ($this->getApprovedLocales() as $locale) {
            if ($this->getAccessHelper()->getLocaleAccess($locale, $user) >= $requiredLevel) {
                $ownLocales[] = $locale;
                if ($ownLocalesOnly === false) {
                    break;
                }
            } elseif ($requiredLevel >= Access::GLOBAL_ADMIN) {
                break;
            }
        }
        if (empty($ownLocales)) {
            throw AccessDeniedException::create();
        }

        return $ownLocalesOnly ? $ownLocales : $this->getApprovedLocales();
    }
1033892
protected function _checkLdapConfig()
    {
        if (!isset($this->_config['bindDN'])) {
            throw new RuntimeException('Config `bindDN` is not set.');
        }
        if (!is_callable($this->_config['bindDN'])) {
            throw new InvalidArgumentException(sprintf(
                'The `bindDN` config is not a callable. Got `%s` instead.',
                gettype($this->_config['bindDN'])
            ));
        }
        if (!isset($this->_config['host'])) {
            throw new RuntimeException('Config `host` is not set.');
        }
    }
108133
public function isModuleEnabled($modulePath)
    {
        $modulePathSegments = explode('/', $modulePath);
        $moduleConfiguration = Arrays::getValueByPath($this->settings['modules'], implode('.submodules.', $modulePathSegments));
        if (isset($moduleConfiguration['enabled']) && $moduleConfiguration['enabled'] !== true) {
            return false;
        }
        array_pop($modulePathSegments);
        if ($modulePathSegments === []) {
            return true;
        }
        return $this->isModuleEnabled(implode('/', $modulePathSegments));
    }
1211619
public function isEnabled($modulePath)
    {
        $modulePathSegments = explode('/', $modulePath);
        $moduleConfiguration = Arrays::getValueByPath($this->modules, implode('.submodules.', $modulePathSegments));

        if (isset($moduleConfiguration['enabled']) && $moduleConfiguration['enabled'] !== true) {
            return false;
        }

        array_pop($modulePathSegments);

        if ($modulePathSegments === []) {
            return true;
        }

        return $this->isEnabled(implode('/', $modulePathSegments));
    }
1330246
function is_system_configured() {
        global $CFG;
        return (!empty($CFG->jabberhost) && !empty($CFG->jabberport) && !empty($CFG->jabberusername) && !empty($CFG->jabberpassword));
    }