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


PHP Pimcore_Tool::getHostUrl方法代码示例

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


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

示例1: checkErrorLogsDb

 public function checkErrorLogsDb()
 {
     $conf = Config::getSystemConfig();
     $config = $conf->applicationlog;
     if ($config->mail_notification->send_log_summary) {
         $receivers = preg_split("/,|;/", $config->mail_notification->mail_receiver);
         array_walk($receivers, function (&$value) {
             $value = trim($value);
         });
         $logLevel = (int) $config->mail_notification->filter_priority;
         $db = \Pimcore\Db::get()->getResource();
         $query = "SELECT * FROM " . \Pimcore\Log\Handler\ApplicationLoggerDb::TABLE_NAME . " WHERE maintenanceChecked IS NULL AND priority <= {$logLevel} order by id desc";
         $rows = $db->fetchAll($query);
         $limit = 100;
         $rowsProcessed = 0;
         $rowCount = count($rows);
         if ($rowCount) {
             while ($rowsProcessed < $rowCount) {
                 $entries = array();
                 if ($rowCount <= $limit) {
                     $entries = $rows;
                 } else {
                     for ($i = $rowsProcessed; $i < $rowCount && count($entries) < $limit; $i++) {
                         $entries[] = $rows[$i];
                     }
                 }
                 $rowsProcessed += count($entries);
                 $html = var_export($entries, true);
                 $html = "<pre>{$html}</pre>";
                 $mail = new \Pimcore\Mail();
                 $mail->setIgnoreDebugMode(true);
                 $mail->setBodyHtml($html);
                 $mail->addTo($receivers);
                 $mail->setSubject('Error Log ' . \Pimcore_Tool::getHostUrl());
                 $mail->send();
             }
         }
         $db->query("UPDATE " . \Pimcore\Log\Handler\ApplicationLoggerDb::TABLE_NAME . " set maintenanceChecked = 1");
     }
 }
开发者ID:cannonerd,项目名称:pimcore,代码行数:40,代码来源:Maintenance.php

示例2: getNormalizedFileInfo

 /**
  * Gets file information for replacement
  *
  * @static
  * @param string $path
  * @param Document | null $document
  * @return array
  * @throws Exception
  */
 public static function getNormalizedFileInfo($path, $document = null)
 {
     if ($document && $document instanceof Document == false) {
         throw new Exception('$document has to be an instance of Document');
     }
     $fileInfo = array();
     $hostUrl = Pimcore_Tool::getHostUrl();
     if ($path[0] != '/') {
         $fileInfo['fileUrl'] = $hostUrl . $document . "/{$path}";
         //relative eg. ../file.css
     } else {
         $fileInfo['fileUrl'] = $hostUrl . $path;
     }
     $fileInfo['fileExtension'] = substr($path, strrpos($path, '.') + 1);
     $netUrl = new Net_URL2($fileInfo['fileUrl']);
     $fileInfo['fileUrlNormalized'] = $netUrl->getNormalizedURL();
     $fileInfo['filePathNormalized'] = PIMCORE_DOCUMENT_ROOT . str_replace($hostUrl, '', $fileInfo['fileUrlNormalized']);
     return $fileInfo;
 }
开发者ID:shanky0110,项目名称:pimcore-custom,代码行数:28,代码来源:Mail.php


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