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


PHP Config::module方法代码示例

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


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

示例1: init

 protected function init()
 {
     $cfg = Config::module('pnp4nagios')->getSection('pnp4nagios');
     $this->configDir = rtrim($cfg->get('config_dir', $this->configDir), '/');
     $this->baseUrl = rtrim($cfg->get('base_url', $this->baseUrl), '/');
     $this->readPnpConfig();
 }
开发者ID:0svald,项目名称:icingaweb2-module-pnp,代码行数:7,代码来源:Grapher.php

示例2: createElements

 /**
  * (non-PHPDoc)
  * @see \Icinga\Web\Form::createElements() For the method documentation.
  */
 public function createElements(array $formData = array())
 {
     $config = Config::module('monitoring');
     parent::createElements($formData);
     $this->addElements(array(array('checkbox', 'all_services', array('label' => $this->translate('All Services'), 'value' => (bool) $config->get('settings', 'hostcheck_all_services', false), 'description' => $this->translate('Schedule check for all services on the hosts and the hosts themselves.')))));
     return $this;
 }
开发者ID:0svald,项目名称:icingaweb2,代码行数:11,代码来源:ScheduleHostCheckCommandForm.php

示例3: fromConfig

 /**
  * Create menu from the application's menu config file plus the config files from all enabled modules
  *
  * @return  self
  */
 public static function fromConfig()
 {
     $menu = new static('menu');
     $manager = Icinga::app()->getModuleManager();
     try {
         $menuConfigs = array(Config::app('menu'));
     } catch (NotReadableError $e) {
         Logger::error($e);
         $menuConfigs = array();
     }
     try {
         $modules = $manager->listEnabledModules();
     } catch (NotReadableError $e) {
         Logger::error($e);
         $modules = array();
     }
     foreach ($modules as $moduleName) {
         try {
             $moduleMenuConfig = Config::module($moduleName, 'menu');
         } catch (NotReadableError $e) {
             Logger::error($e);
             $moduleMenuConfig = array();
         }
         if (!empty($moduleMenuConfig)) {
             $menuConfigs[] = $moduleMenuConfig;
         }
     }
     return $menu->loadMenuItems($menu->flattenConfigs($menuConfigs));
 }
开发者ID:vbereza,项目名称:icinga2-migration,代码行数:34,代码来源:Menu.php

示例4: db

 protected function db()
 {
     $resourceName = Config::module('director')->get('db', 'resource');
     if (!$resourceName) {
         return false;
     }
     return Db::fromResourceName($resourceName);
 }
开发者ID:plarivee,项目名称:icingaweb2-module-director,代码行数:8,代码来源:ServiceActions.php

示例5: createElements

 /**
  * (non-PHPDoc)
  * @see \Icinga\Web\Form::createElements() For the method documentation.
  */
 public function createElements(array $formData = array())
 {
     $this->addElement('textarea', 'comment', array('required' => true, 'label' => $this->translate('Comment'), 'description' => $this->translate('If you work with other administrators, you may find it useful to share information about the' . ' the host or service that is having problems. Make sure you enter a brief description of' . ' what you are doing.')));
     if (!$this->getBackend()->isIcinga2()) {
         $this->addElement('checkbox', 'persistent', array('label' => $this->translate('Persistent'), 'value' => (bool) Config::module('monitoring')->get('settings', 'comment_persistent', true), 'description' => $this->translate('If you uncheck this option, the comment will automatically be deleted the next time Icinga is' . ' restarted.')));
     }
     return $this;
 }
开发者ID:0svald,项目名称:icingaweb2,代码行数:12,代码来源:AddCommentCommandForm.php

示例6: fromConfig

 /**
  * {@inheritdoc}
  */
 public static function fromConfig()
 {
     $backend = parent::fromConfig();
     // TODO: move this to log types #11636
     $resourceConfig = Config::module('elasticsearch')->getSection('elasticsearch');
     $backend->setIndex($resourceConfig->get('logstash_pattern', 'logstash-*'));
     return $backend;
 }
开发者ID:Icinga,项目名称:icingaweb2-module-elasticsearch,代码行数:11,代码来源:EventBackend.php

示例7: createElements

 /**
  * {@inheritdoc}
  */
 public function createElements(array $formData = array())
 {
     $config = Config::module('monitoring');
     $this->addElements(array(array('textarea', 'comment', array('required' => true, 'label' => $this->translate('Comment'), 'description' => $this->translate('If you work with other administrators, you may find it useful to share information about the' . ' the host or service that is having problems. Make sure you enter a brief description of' . ' what you are doing.'))), array('checkbox', 'forced', array('label' => $this->translate('Forced'), 'value' => (bool) $config->get('settings', 'custom_notification_forced', false), 'description' => $this->translate('If you check this option, the notification is sent out regardless of time restrictions and' . ' whether or not notifications are enabled.')))));
     if (!$this->getBackend()->isIcinga2()) {
         $this->addElement('checkbox', 'broadcast', array('label' => $this->translate('Broadcast'), 'value' => (bool) $config->get('settings', 'custom_notification_broadcast', false), 'description' => $this->translate('If you check this option, the notification is sent out to all normal and escalated contacts.')));
     }
     return $this;
 }
开发者ID:0svald,项目名称:icingaweb2,代码行数:12,代码来源:SendCustomNotificationCommandForm.php

示例8: fetchFiles

 public function fetchFiles()
 {
     $files = array();
     $storage = new LegacyStorage(Config::module('businessprocess')->getSection('global'));
     foreach ($storage->listProcesses() as $name => $title) {
         $files['processes/' . $name . '.bp'] = $storage->getSource($name);
     }
     return $files;
 }
开发者ID:0svald,项目名称:icingaweb2-module-businessprocess,代码行数:9,代码来源:ShipConfigFiles.php

示例9: init

 protected function init()
 {
     $cfg = Config::module('graphite')->getSection('graphite');
     $this->baseUrl = rtrim($cfg->get('base_url', $this->baseUrl), '/');
     $this->metricPrefix = $cfg->get('metric_prefix', $this->metricPrefix);
     $this->serviceMacro = $cfg->get('service_name_template', $this->serviceMacro);
     $this->hostMacro = $cfg->get('host_name_template', $this->hostMacro);
     $this->imageUrlMacro = $cfg->get('graphite_args_template', $this->imageUrlMacro);
     $this->largeImageUrlMacro = $cfg->get('graphite_large_args_template', $this->largeImageUrlMacro);
 }
开发者ID:TheFlyingCorpse,项目名称:icingaweb2-module-graphite,代码行数:10,代码来源:Grapher.php

示例10: getConfig

 /**
  * Get transport configuration
  *
  * @return Config
  * @throws ConfigurationError
  */
 public static function getConfig()
 {
     if (!isset(self::$config)) {
         self::$config = Config::module('monitoring', 'instances');
         if (self::$config->isEmpty()) {
             throw new ConfigurationError('No instances have been configured in \'%s\'.', self::$config->getConfigFile());
         }
     }
     return self::$config;
 }
开发者ID:NerdGZ,项目名称:icingaweb2,代码行数:16,代码来源:CommandTransport.php

示例11: init

 protected function init()
 {
     $cfg = Config::module('graphite')->getSection('graphite');
     $this->baseUrl = rtrim($cfg->get('base_url', $this->baseUrl), '/');
     $this->legacyMode = filter_var($cfg->get('legacy_mode', $this->legacyMode), FILTER_VALIDATE_BOOLEAN);
     $this->serviceMacro = $cfg->get('service_name_template', $this->serviceMacro);
     $this->hostMacro = $cfg->get('host_name_template', $this->hostMacro);
     $this->imageUrlMacro = $cfg->get('graphite_args_template', $this->imageUrlMacro);
     $this->largeImageUrlMacro = $cfg->get('graphite_large_args_template', $this->largeImageUrlMacro);
 }
开发者ID:xert,项目名称:icingaweb2-module-graphite,代码行数:10,代码来源:Grapher.php

示例12: db

 protected function db()
 {
     if ($this->db === null) {
         $resourceName = Config::module('director')->get('db', 'resource');
         if ($resourceName) {
             $this->db = Db::fromResourceName($resourceName);
         }
     }
     return $this->db;
 }
开发者ID:dgoeger,项目名称:icingadirector,代码行数:10,代码来源:ImportSourceCoreApi.php

示例13: getDirectories

 protected function getDirectories()
 {
     return Config::module('fileshipper', 'directories');
     $config = Config::module('fileshipper', 'directories');
     $dirs = array();
     foreach ($config as $key => $c) {
         $dirs[$key] = (object) $c->toArray();
     }
     return $dirs;
 }
开发者ID:Thomas-Gelf,项目名称:icingaweb2-module-fileshipper,代码行数:10,代码来源:ShipConfigFiles.php

示例14: getConfig

 /**
  * Get transport configuration
  *
  * @return  Config
  *
  * @throws  ConfigurationError
  */
 public static function getConfig()
 {
     if (static::$config === null) {
         $config = Config::module('monitoring', 'commandtransports');
         if ($config->isEmpty()) {
             throw new ConfigurationError(mt('monitoring', 'No command transports have been configured in "%s".'), $config->getConfigFile());
         }
         static::$config = $config;
     }
     return static::$config;
 }
开发者ID:trigoesrodrigo,项目名称:icingaweb2,代码行数:18,代码来源:CommandTransport.php

示例15: ssldir

 public function ssldir($subdir = null)
 {
     if ($this->ssldir === null) {
         $this->ssldir = dirname(Config::module('puppetdb')->getConfigFile()) . '/ssl';
     }
     if ($subdir === null) {
         return $this->ssldir;
     } else {
         return $this->ssldir . '/' . $subdir;
     }
 }
开发者ID:Thomas-Gelf,项目名称:icingaweb2-module-puppetdb,代码行数:11,代码来源:PuppetDb.php


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