本文整理汇总了PHP中Kurogo::getOptionalSiteSection方法的典型用法代码示例。如果您正苦于以下问题:PHP Kurogo::getOptionalSiteSection方法的具体用法?PHP Kurogo::getOptionalSiteSection怎么用?PHP Kurogo::getOptionalSiteSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kurogo
的用法示例。
在下文中一共展示了Kurogo::getOptionalSiteSection方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
protected function init($args)
{
parent::init($args);
//get global options from the site soap section
$args = array_merge(Kurogo::getOptionalSiteSection('soap'), $args);
if (isset($args['WSDL']) && $args['WSDL']) {
$this->setWSDL($args['WSDL']);
}
if (isset($args['BASE_URL'])) {
$this->location = $args['BASE_URL'];
$this->setSoapOption('location', $args['BASE_URL']);
if (isset($args['URI'])) {
$this->setSoapOption('uri', $args['URI']);
} else {
$this->setSoapOption('uri', FULL_URL_BASE);
}
}
if (isset($args['METHOD'])) {
$this->setMethod($args['METHOD']);
}
if (isset($args['PARAMETERS'])) {
if (!is_array($args['PARAMETERS'])) {
throw new KurogoConfigurationException("Parameters must be an array");
}
$this->setParameters($args['PARAMETERS']);
}
if (isset($args['SSL_VERIFY'])) {
$this->setSoapOption('ssl_verify', $args['SSL_VERIFY']);
}
}
示例2: factory
/**
* Public factory method. This is the designated way to instantiated data controllers. Takes a string
* for the classname to load and an array of arguments. Subclasses should generally not override this
* method, but instead override init() to provide initialization behavior
* @param string $controllerClass the classname to instantiate
* @param array $args an associative array of arguments that get passed to init() and the data parser
* @return DataController a data controller object
*/
public static function factory($controllerClass, $args = array())
{
$args = is_array($args) ? $args : array();
Kurogo::log(LOG_DEBUG, "Initializing DataController {$controllerClass}", "data");
if (!class_exists($controllerClass)) {
throw new KurogoConfigurationException("Controller class {$controllerClass} not defined");
}
$controller = new $controllerClass();
if (!$controller instanceof DataController) {
throw new KurogoConfigurationException("{$controllerClass} is not a subclass of DataController");
}
$controller->setDebugMode(Kurogo::getSiteVar('DATA_DEBUG'));
//get global options from the site data_controller section
$args = array_merge(Kurogo::getOptionalSiteSection('data_controller'), $args);
$controller->init($args);
return $controller;
}
示例3: messagingEnabled
public function messagingEnabled()
{
// if module doesn't specify messaging parameter, use site value
$siteConfig = Kurogo::getOptionalSiteSection('notifications');
$siteEnabled = Kurogo::arrayVal($siteConfig, 'ENABLED_BY_DEFAULT', false);
return $this->getOptionalModuleVar('messaging', $siteEnabled, null, 'module');
}
示例4: init
protected function init($args)
{
//get global options from the site data_retriever section
$args = array_merge(Kurogo::getOptionalSiteSection('data_retriever'), $args);
$this->initArgs = $args;
if (isset($args['DEBUG_MODE'])) {
$this->setDebugMode($args['DEBUG_MODE']);
}
if (isset($args['DEFAULT_CACHE_LIFETIME'])) {
$this->DEFAULT_CACHE_LIFETIME = $args['DEFAULT_CACHE_LIFETIME'];
}
if (isset($args['OPTIONS']) && is_array($args['OPTIONS'])) {
$this->setOptions($args['OPTIONS']);
}
if (isset($args['AUTHORITY'])) {
if ($authority = AuthenticationAuthority::getAuthenticationAuthority($args['AUTHORITY'])) {
$this->setAuthority($authority);
}
}
if (!isset($args['PARSER_CLASS'])) {
if ($this->DEFAULT_PARSER_CLASS) {
$args['PARSER_CLASS'] = $this->DEFAULT_PARSER_CLASS;
} elseif (isset($args['DEFAULT_PARSER_CLASS']) && strlen($args['DEFAULT_PARSER_CLASS'])) {
$args['PARSER_CLASS'] = $args['DEFAULT_PARSER_CLASS'];
} else {
$args['PARSER_CLASS'] = 'PassthroughDataParser';
}
}
if (isset($args['CACHE_LIFETIME'])) {
$this->cacheLifetime = $args['CACHE_LIFETIME'];
} else {
$args['CACHE_LIFETIME'] = $this->DEFAULT_CACHE_LIFETIME;
}
if (isset($args['SHOW_WARNINGS'])) {
$this->showWarnings = (bool) $args['SHOW_WARNINGS'];
}
// instantiate the parser class
$parser = DataParser::factory($args['PARSER_CLASS'], $args);
$this->setParser($parser);
$cacheClass = isset($args['CACHE_CLASS']) ? $args['CACHE_CLASS'] : 'DataCache';
$this->cache = DataCache::factory($cacheClass, $args);
}
示例5: getPlatformConfig
protected function getPlatformConfig()
{
$config = Kurogo::getOptionalSiteSection('apps');
$config['CLEAR_WEB_CACHES_ON_SUSPEND'] = (bool) Kurogo::arrayVal($config, 'CLEAR_WEB_CACHES_ON_SUSPEND', false);
return $config;
}