當前位置: 首頁>>代碼示例>>PHP>>正文


PHP IPSText::sizeFormat方法代碼示例

本文整理匯總了PHP中IPSText::sizeFormat方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSText::sizeFormat方法的具體用法?PHP IPSText::sizeFormat怎麽用?PHP IPSText::sizeFormat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在IPSText的用法示例。


在下文中一共展示了IPSText::sizeFormat方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: sendOutput


//.........這裏部分代碼省略.........
     if (count($navigation) > 0) {
         $html = str_replace("<%NAV%>", $this->global_template->wrap_nav("<li>" . implode("&nbsp; &gt; &nbsp;</li><li>", $navigation) . "</li>"), $html);
     } else {
         $html = str_replace("<%NAV%>", '', $html);
     }
     //-----------------------------------------
     // Last thing, the nav element...
     //-----------------------------------------
     $html = str_replace("<%PAGE_NAV%>", $_last_nav['title'], $html);
     $query_html = "";
     //-----------------------------------------
     // Show SQL queries
     //-----------------------------------------
     if (IN_DEV and count($this->DB->obj['cached_queries'])) {
         $queries = "";
         foreach ($this->DB->obj['cached_queries'] as $q) {
             $queries .= "<div style='padding:6px; border-bottom:1px solid #000'>" . htmlspecialchars($q) . '</div>';
         }
         $query_html .= $this->global_template->global_query_output($queries);
         /* Included Files */
         if (function_exists('get_included_files')) {
             $__files = get_included_files();
             $query_html .= "<br />\n<div class='tableborder'>\n<div class='subtitle'>(" . count($__files) . ") Included Files</div><div class='row1' style='padding:6px'>\n";
             foreach ($__files as $__f) {
                 $query_html .= "<strong>{$__f}</strong><br />";
             }
             $query_html .= '</div></div>';
         }
     }
     $html = str_replace("<%QUERIES%>", $query_html, $html);
     //-----------------------------------------
     // Got BODY EXTRA?
     //-----------------------------------------
     if ($this->body_extra) {
         $html = str_replace("<body", "<body " . $this->body_extra, $html);
     }
     //-----------------------------------------
     // Lang Replace
     //-----------------------------------------
     $html = preg_replace("#{txt\\.(.+?)}#e", "\$this->lang->words['\\1']", $html);
     //-----------------------------------------
     // Emoticons fix
     //-----------------------------------------
     $html = str_replace("<#EMO_DIR#>", 'default', $html);
     //-----------------------------------------
     // Gzip?
     //-----------------------------------------
     if (IPB_ACP_USE_GZIP) {
         $buffer = "";
         if (count(ob_list_handlers())) {
             $buffer = ob_get_contents();
             ob_end_clean();
         }
         ob_start('ob_gzhandler');
         print $buffer;
     }
     @header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
     @header("Cache-Control: no-cache, must-revalidate");
     @header("Pragma: no-cache");
     @header("Content-type: text/html; charset=" . IPS_DOC_CHAR_SET);
     //-----------------------------------------
     // OUTPUT
     //-----------------------------------------
     print $html;
     //-----------------------------------------
     // Memory usage
     //-----------------------------------------
     if (IPS_MEMORY_DEBUG_MODE and defined('IPS_MEMORY_START') and IN_DEV) {
         if (is_array(IPSDebug::$memory_debug)) {
             $memory .= "<br />\n<div align='center' style='margin-left:auto;margin-right:auto'><div class='tableborder' style='width:75%'>\n<div class='tableheaderalt'>MEMORY USAGE</div><div class='tablerow1' style='padding:6px'>\n";
             $memory .= "<table cellpadding='4' cellspacing='0' border='0' width='100%'>\n";
             $_c = 0;
             foreach (IPSDebug::$memory_debug as $usage) {
                 $_col = $_c % 2 ? '#eee' : '#ddd';
                 $_c++;
                 if ($usage[1] > 500 * 1024) {
                     $_col .= ";color:#D00000";
                 } else {
                     if ($usage[1] < 10 * 1024) {
                         $_col .= ";color:darkgreen";
                     } else {
                         if ($usage[1] < 100 * 1024) {
                             $_col .= ";color:darkorange";
                         }
                     }
                 }
                 $memory .= "<tr><td width='60%' style='background-color:{$_col}' align='left'>{$usage[0]}</td><td style='background-color:{$_col}' align='left'><strong>" . IPSLib::sizeFormat($usage[1]) . "</strong></td></tr>";
             }
             $memory .= "</table></div></div></div>";
         }
         $end = memory_get_usage();
         $peak_end = memory_get_peak_usage();
         $_used = $end - IPS_MEMORY_START;
         $peak_used = $peak_end - IPS_MEMORY_START;
         print $memory;
         print "Total Memory Used: " . IPSLib::sizeFormat($_used) . " (Peak:" . IPSText::sizeFormat($peak_used) . ")";
     }
     $this->_IS_PRINTED = 1;
     exit;
 }
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:101,代碼來源:adminOutput.php


注:本文中的IPSText::sizeFormat方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。