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


PHP mt函数代码示例

本文整理汇总了PHP中mt函数的典型用法代码示例。如果您正苦于以下问题:PHP mt函数的具体用法?PHP mt怎么用?PHP mt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: evaluate

 protected function evaluate()
 {
     $phpVersion = Platform::getPhpVersion();
     $this->setStateText(sprintf(mt('setup', 'You are running PHP version %s.'), $phpVersion));
     list($operator, $requiredVersion) = $this->getCondition();
     return version_compare($phpVersion, $requiredVersion, $operator);
 }
开发者ID:kobmaki,项目名称:icingaweb2,代码行数:7,代码来源:PhpVersionRequirement.php

示例2: getCount

 /**
  * {@inheritdoc}
  */
 public function getCount()
 {
     if ($this->count === null) {
         try {
             $count = 0;
             $programStatus = $this->isCurrentlyRunning();
             $titles = array();
             if (!(bool) $programStatus->notifications_enabled) {
                 $count = 1;
                 $this->state = static::STATE_WARNING;
                 $titles[] = mt('monitoring', 'Notifications are disabled');
             }
             if (!(bool) $programStatus->is_currently_running) {
                 $count = 1;
                 $this->state = static::STATE_CRITICAL;
                 array_unshift($titles, sprintf(mt('monitoring', 'Monitoring backend %s is not running'), MonitoringBackend::instance()->getName()));
             }
             $this->count = $count;
             $this->title = implode('. ', $titles);
         } catch (Exception $_) {
             $this->count = 1;
         }
     }
     return $this->count;
 }
开发者ID:0svald,项目名称:icingaweb2,代码行数:28,代码来源:BackendAvailabilityNavigationItemRenderer.php

示例3: getSummary

 /**
  * Get the problem data for the summary
  *
  * @return array|null
  */
 public function getSummary()
 {
     if (!$this->isCurrentlyRunning()) {
         return array('problems' => 1, 'title' => sprintf(mt('monitoring', 'Monitoring backend %s is not running'), MonitoringBackend::instance()->getName()));
     }
     return null;
 }
开发者ID:scibi,项目名称:icingaweb2,代码行数:12,代码来源:BackendAvailabilityMenuItemRenderer.php

示例4: evaluate

 protected function evaluate()
 {
     list($configDirective, $value) = $this->getCondition();
     $configValue = Platform::getPhpConfig($configDirective);
     $this->setStateText($configValue ? sprintf(mt('setup', 'The PHP config `%s\' is set to "%s".'), $configDirective, $configValue) : sprintf(mt('setup', 'The PHP config `%s\' is not defined.'), $configDirective));
     return is_bool($value) ? $configValue == $value : $configValue === $value;
 }
开发者ID:0svald,项目名称:icingaweb2,代码行数:7,代码来源:PhpConfigRequirement.php

示例5: render

 /**
  * {@inheritdoc}
  */
 public function render()
 {
     if ($this->getInnerIterator()->isEmpty()) {
         return '<p>' . mt('doc', 'Documentation is empty.') . '</p>';
     }
     $view = $this->getView();
     $zendUrlHelper = $view->getHelper('Url');
     foreach ($this as $section) {
         $path = $zendUrlHelper->url(array_merge($this->urlParams, array('chapter' => $this->encodeUrlParam($section->getChapter()->getId()))), $this->url, false, false);
         $url = $view->url($path);
         /** @var \Icinga\Web\Url $url */
         if ($this->getDepth() > 0) {
             $url->setAnchor($this->encodeAnchor($section->getId()));
         }
         $urlAttributes = array('data-base-target' => '_next', 'title' => $section->getId() === $section->getChapter()->getId() ? sprintf($view->translate('Show the chapter "%s"', 'toc.render.section.link'), $section->getChapter()->getTitle()) : sprintf($view->translate('Show the section "%s" of the chapter "%s"', 'toc.render.section.link'), $section->getTitle(), $section->getChapter()->getTitle()));
         if ($section->getNoFollow()) {
             $urlAttributes['rel'] = 'nofollow';
         }
         $this->content[] = '<li>' . $this->getView()->qlink($section->getTitle(), $url->getAbsoluteUrl(), null, $urlAttributes);
         if (!$section->hasChildren()) {
             $this->content[] = '</li>';
         }
     }
     return implode("\n", $this->content);
 }
开发者ID:0svald,项目名称:icingaweb2,代码行数:28,代码来源:DocTocRenderer.php

示例6: getSummary

 /**
  * Get the problem data for the summary
  *
  * @return array|null
  */
 public function getSummary()
 {
     if (!(bool) $this->isCurrentlyRunning()) {
         return array('problems' => 1, 'title' => mt('monitoring', 'monitoring backend is not running'));
     }
     return null;
 }
开发者ID:hsanjuan,项目名称:icingaweb2,代码行数:12,代码来源:BackendAvailabilityMenuItemRenderer.php

示例7: getReport

 public function getReport()
 {
     if ($this->error === false) {
         return array(sprintf(mt('monitoring', 'Command transport configuration has been successfully created: %s'), Config::resolvePath('modules/monitoring/commandtransports.ini')));
     } elseif ($this->error !== null) {
         return array(sprintf(mt('monitoring', 'Command transport configuration could not be written to: %s. An error occured:'), Config::resolvePath('modules/monitoring/commandtransports.ini')), sprintf(mt('setup', 'ERROR: %s'), IcingaException::describe($this->error)));
     }
 }
开发者ID:kobmaki,项目名称:icingaweb2,代码行数:8,代码来源:TransportStep.php

示例8: __construct

 /**
  * Create a new documentation parser for the given path
  *
  * @param   string $path        Path to the documentation
  *
  * @throws  DocException        If the documentation directory does not exist
  * @throws  NotReadableError    If the documentation directory is not readable
  */
 public function __construct($path)
 {
     if (!DirectoryIterator::isReadable($path)) {
         throw new DocException(mt('doc', 'Documentation directory \'%s\' is not readable'), $path);
     }
     $this->path = $path;
     $this->docIterator = new DirectoryIterator($path, 'md', DirectoryIterator::FILES_FIRST);
 }
开发者ID:0svald,项目名称:icingaweb2,代码行数:16,代码来源:DocParser.php

示例9: getReport

 public function getReport()
 {
     if ($this->error === false) {
         return array(sprintf(mt('monitoring', 'Monitoring instance configuration has been successfully created: %s'), Config::resolvePath('modules/monitoring/instances.ini')));
     } elseif ($this->error !== null) {
         return array(sprintf(mt('monitoring', 'Monitoring instance configuration could not be written to: %s. An error occured:'), Config::resolvePath('modules/monitoring/instances.ini')), sprintf(mt('setup', 'ERROR: %s'), $this->error->getMessage()));
     }
 }
开发者ID:hsanjuan,项目名称:icingaweb2,代码行数:8,代码来源:InstanceStep.php

示例10: getReport

 public function getReport()
 {
     if ($this->error === false) {
         $message = mt('setup', 'General configuration has been successfully written to: %s');
         return '<p>' . sprintf($message, Config::resolvePath('config.ini')) . '</p>';
     } elseif ($this->error !== null) {
         $message = mt('setup', 'General configuration could not be written to: %s; An error occured:');
         return '<p class="error">' . sprintf($message, Config::resolvePath('config.ini')) . '</p>' . '<p>' . $this->error->getMessage() . '</p>';
     }
 }
开发者ID:xert,项目名称:icingaweb2,代码行数:10,代码来源:GeneralConfigStep.php

示例11: getReport

 public function getReport()
 {
     if ($this->error === false) {
         $message = mt('monitoring', 'Monitoring instance configuration has been successfully created: %s');
         return '<p>' . sprintf($message, Config::resolvePath('modules/monitoring/instances.ini')) . '</p>';
     } elseif ($this->error !== null) {
         $message = mt('monitoring', 'Monitoring instance configuration could not be written to: %s; An error occured:');
         return '<p class="error">' . sprintf($message, Config::resolvePath('modules/monitoring/instances.ini')) . '</p><p>' . $this->error->getMessage() . '</p>';
     }
 }
开发者ID:xert,项目名称:icingaweb2,代码行数:10,代码来源:InstanceStep.php

示例12: getActionsForService

 public function getActionsForService(Service $service)
 {
     if ($service->check_command == "logstash_events") {
         // TODO: add icon when Icingaweb2 supports it
         // <i class="icon-doc-text"></i>
         return array(mt('logstash', 'Logstash events') => Url::fromPath('elasticsearch/event/list', array('host' => $service->getHost()->getName(), 'service' => $service->getName())));
     } else {
         return array();
     }
 }
开发者ID:Icinga,项目名称:icingaweb2-module-elasticsearch,代码行数:10,代码来源:ServiceActions.php

示例13: evaluate

 protected function evaluate()
 {
     $moduleName = $this->getCondition();
     if (Platform::extensionLoaded($moduleName)) {
         $this->setStateText(sprintf(mt('setup', 'The PHP module %s is available.'), $this->getAlias() ?: $moduleName));
         return true;
     } else {
         $this->setStateText(sprintf(mt('setup', 'The PHP module %s is missing.'), $this->getAlias() ?: $moduleName));
         return false;
     }
 }
开发者ID:kobmaki,项目名称:icingaweb2,代码行数:11,代码来源:PhpModuleRequirement.php

示例14: evaluate

 protected function evaluate()
 {
     $classNameOrPath = $this->getCondition();
     if (Platform::classExists($classNameOrPath)) {
         $this->setStateText(sprintf(mt('setup', 'The %s is available.', 'setup.requirement.class'), $this->getAlias() ?: $classNameOrPath . ' ' . mt('setup', 'class', 'setup.requirement.class')));
         return true;
     } else {
         $this->setStateText(sprintf(mt('setup', 'The %s is missing.', 'setup.requirement.class'), $this->getAlias() ?: $classNameOrPath . ' ' . mt('setup', 'class', 'setup.requirement.class')));
         return false;
     }
 }
开发者ID:kobmaki,项目名称:icingaweb2,代码行数:11,代码来源:ClassRequirement.php

示例15: getBadgeTitle

 protected function getBadgeTitle()
 {
     $translations = array('hosts_down_unhandled' => mt('monitoring', '%d unhandled hosts down'), 'services_critical_unhandled' => mt('monitoring', '%d unhandled services critical'));
     $titles = array();
     $sum = $this->summary();
     foreach ($this->columns as $col) {
         if (isset($sum->{$col}) && $sum->{$col} > 0) {
             $titles[] = sprintf($translations[$col], $sum->{$col});
         }
     }
     return implode(', ', $titles);
 }
开发者ID:hsanjuan,项目名称:icingaweb2,代码行数:12,代码来源:MonitoringMenuItemRenderer.php


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