當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。