• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP mt函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: getStateText

 /**
  * {@inheritdoc}
  */
 public function getStateText()
 {
     $stateText = parent::getStateText();
     if ($stateText === null) {
         $alias = $this->getAlias();
         if ($this->getState()) {
             $stateText = $alias === null ? sprintf(mt('setup', 'The %s class is available.', 'setup.requirement.class'), $this->getCondition()) : sprintf(mt('setup', 'The %s is available.', 'setup.requirement.class'), $alias);
         } else {
             $stateText = $alias === null ? sprintf(mt('setup', 'The %s class is missing.', 'setup.requirement.class'), $this->getCondition()) : sprintf(mt('setup', 'The %s is missing.', 'setup.requirement.class'), $alias);
         }
     }
     return $stateText;
 }
开发者ID:0svald,项目名称:icingaweb2,代码行数:16,代码来源:ClassRequirement.php


示例17: __construct

 /**
  * Create a new section renderer
  *
  * @param   SimpleTree  $tree           The documentation tree
  * @param   string|null $chapter        If not null, the chapter to filter for
  *
  * @throws  ChapterNotFoundException    If the chapter to filter for was not found
  */
 public function __construct(SimpleTree $tree, $chapter = null)
 {
     if ($chapter !== null) {
         $filter = new DocSectionFilterIterator($tree->getIterator(), $chapter);
         if ($filter->isEmpty()) {
             throw new ChapterNotFoundException(mt('doc', 'Chapter %s not found'), $chapter);
         }
         parent::__construct($filter, RecursiveIteratorIterator::SELF_FIRST);
     } else {
         parent::__construct($tree->getIterator(), RecursiveIteratorIterator::SELF_FIRST);
     }
     $this->tree = $tree;
     $this->parsedown = Parsedown::instance();
 }
开发者ID:thorebahr,项目名称:icingaweb2,代码行数:22,代码来源:DocSectionRenderer.php


示例18: getReport

 public function getReport()
 {
     $okMessage = mt('setup', 'Module "%s" has been successfully enabled.');
     $failMessage = mt('setup', 'Module "%s" could not be enabled. An error occured:');
     $report = '';
     foreach ($this->moduleNames as $moduleName) {
         if (isset($this->errors[$moduleName])) {
             $report .= '<p class="error">' . sprintf($failMessage, $moduleName) . '</p>' . '<p>' . $this->errors[$moduleName]->getMessage() . '</p>';
         } else {
             $report .= '<p>' . sprintf($okMessage, $moduleName) . '</p>';
         }
     }
     return $report;
 }
开发者ID:xert,项目名称:icingaweb2,代码行数:14,代码来源:EnableModuleStep.php


示例19: getTransport

 /**
  * Get the transport used to send commands
  *
  * @param   Request     $request
  *
  * @return  CommandTransportInterface
  *
  * @throws  ConfigurationError
  */
 public function getTransport(Request $request)
 {
     if (($transportName = $request->getParam('transport')) !== null) {
         $config = CommandTransport::getConfig();
         if ($config->hasSection($transportName)) {
             $transport = CommandTransport::createTransport($config->getSection($transportName));
         } else {
             throw new ConfigurationError(sprintf(mt('monitoring', 'Command transport "%s" not found.'), $transportName));
         }
     } else {
         $transport = new CommandTransport();
     }
     return $transport;
 }
开发者ID:trigoesrodrigo,项目名称:icingaweb2,代码行数:23,代码来源:CommandForm.php


示例20: getReport

 public function getReport()
 {
     $okMessage = mt('setup', 'Module "%s" has been successfully enabled.');
     $failMessage = mt('setup', 'Module "%s" could not be enabled. An error occured:');
     $report = array();
     foreach ($this->moduleNames as $moduleName) {
         if (isset($this->errors[$moduleName])) {
             $report[] = sprintf($failMessage, $moduleName);
             $report[] = sprintf(mt('setup', 'ERROR: %s'), $this->errors[$moduleName]->getMessage());
         } else {
             $report[] = sprintf($okMessage, $moduleName);
         }
     }
     return $report;
 }
开发者ID:hsanjuan,项目名称:icingaweb2,代码行数:15,代码来源:EnableModuleStep.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP mt_getrandmax函数代码示例发布时间:2022-05-15
下一篇:
PHP mswSpecialChars函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap