当前位置: 首页>>代码示例>>PHP>>正文


PHP ResourceFactory::setConfig方法代码示例

本文整理汇总了PHP中Icinga\Data\ResourceFactory::setConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP ResourceFactory::setConfig方法的具体用法?PHP ResourceFactory::setConfig怎么用?PHP ResourceFactory::setConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Icinga\Data\ResourceFactory的用法示例。


在下文中一共展示了ResourceFactory::setConfig方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setResourceConfig

 /**
  * Set the resource configuration to use
  *
  * @param   array   $config
  *
  * @return  $this
  */
 public function setResourceConfig(array $config)
 {
     $resourceConfig = new Config();
     $resourceConfig->setSection($config['name'], $config);
     ResourceFactory::setConfig($resourceConfig);
     $this->config = $config;
     return $this;
 }
开发者ID:kobmaki,项目名称:icingaweb2,代码行数:15,代码来源:AuthBackendPage.php

示例2: createElements

 /**
  * Create and add elements to this form
  *
  * @param   array   $formData
  */
 public function createElements(array $formData)
 {
     // LdapUserGroupBackendForm requires these factories to provide valid configurations
     ResourceFactory::setConfig($this->createResourceConfiguration());
     UserBackend::setConfig($this->createBackendConfiguration());
     $backendForm = new LdapUserGroupBackendForm();
     $formData['type'] = 'ldap';
     $backendForm->create($formData);
     $backendForm->getElement('name')->setValue('icingaweb2');
     $this->addSubForm($backendForm, 'backend_form');
     $backendForm->addElement('hidden', 'resource', array('required' => true, 'value' => $this->resourceConfig['name'], 'decorators' => array('ViewHelper')));
     $backendForm->addElement('hidden', 'user_backend', array('required' => true, 'value' => $this->backendConfig['name'], 'decorators' => array('ViewHelper')));
 }
开发者ID:kobmaki,项目名称:icingaweb2,代码行数:18,代码来源:UserGroupBackendPage.php

示例3: setupResourceFactory

 /**
  * Set up the resource factory
  *
  * @return $this
  */
 protected function setupResourceFactory()
 {
     try {
         $config = Config::app('resources');
         ResourceFactory::setConfig($config);
     } catch (NotReadableError $e) {
         Logger::error(new IcingaException('Cannot load resource configuration. An exception was thrown:', $e));
     }
     return $this;
 }
开发者ID:kobmaki,项目名称:icingaweb2,代码行数:15,代码来源:ApplicationBootstrap.php

示例4: createUserGroupBackend

 /**
  * Create and return the user group backend
  *
  * @return  LdapUserGroupBackend
  */
 protected function createUserGroupBackend()
 {
     $resourceConfig = new Config();
     $resourceConfig->setSection($this->resourceConfig['name'], $this->resourceConfig);
     ResourceFactory::setConfig($resourceConfig);
     $backendConfig = new Config();
     $backendConfig->setSection($this->backendConfig['name'], array_merge($this->backendConfig, array('resource' => $this->resourceConfig['name'])));
     UserBackend::setConfig($backendConfig);
     if (empty($this->groupConfig)) {
         $groupConfig = new ConfigObject(array('backend' => $this->backendConfig['backend'], 'resource' => $this->resourceConfig['name'], 'user_backend' => $this->backendConfig['name']));
     } else {
         $groupConfig = new ConfigObject($this->groupConfig);
     }
     $backend = UserGroupBackend::create(null, $groupConfig);
     if (!$backend instanceof Selectable) {
         throw new NotImplementedError('Unsupported, until #9772 has been resolved');
     }
     return $backend;
 }
开发者ID:trigoesrodrigo,项目名称:icingaweb2,代码行数:24,代码来源:AdminAccountPage.php


注:本文中的Icinga\Data\ResourceFactory::setConfig方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。