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


PHP VmConfig::getMemoryLimit方法代碼示例

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


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

示例1: __construct

 /**
  * constructs a VmModel
  * setMainTable defines the maintable of the model
  *
  * @author Max Milbers
  */
 function __construct()
 {
     parent::__construct('virtuemart_product_id');
     $this->setMainTable('products');
     $this->starttime = microtime(TRUE);
     $this->maxScriptTime = VmConfig::getExecutionTime() * 0.95 - 1;
     $this->memory_limit = VmConfig::getMemoryLimit() - 4;
     // 	$this->addvalidOrderingFieldName(array('m.mf_name','pp.product_price'));
     $app = JFactory::getApplication();
     if ($app->isSite()) {
         $this->_validOrderingFieldName = array();
         $browseOrderByFields = VmConfig::get('browse_orderby_fields', array('product_sku', 'category_name', 'mf_name', 'product_name'));
     } else {
         if (!class_exists('shopFunctions')) {
             require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'shopfunctions.php';
         }
         $browseOrderByFields = ShopFunctions::getValidProductFilterArray();
         $this->addvalidOrderingFieldName(array('product_price', 'product_sales'));
         //$this->addvalidOrderingFieldName (array('product_price'));
         // 	vmdebug('$browseOrderByFields',$browseOrderByFields);
     }
     $this->addvalidOrderingFieldName((array) $browseOrderByFields);
     $this->removevalidOrderingFieldName('virtuemart_product_id');
     //$this->removevalidOrderingFieldName ('product_sales');
     //unset($this->_validOrderingFieldName[0]);//virtuemart_product_id
     array_unshift($this->_validOrderingFieldName, 'p.virtuemart_product_id');
     $this->_selectedOrdering = VmConfig::get('browse_orderby_field', '`p`.virtuemart_product_id');
     $this->setToggleName('product_special');
     $this->initialiseRequests();
     //This is just done now for the moment for developing, the idea is of course todo this only when needed.
     $this->updateRequests();
 }
開發者ID:aldegtyarev,項目名稱:stelsvelo,代碼行數:38,代碼來源:product.php

示例2: ensureMemoryLimit

 /**
  * Ensures a certain Memory limit for php (if server supports it)
  * @author Max Milbers
  * @param int $minMemory
  */
 static function ensureMemoryLimit($minMemory = 0)
 {
     if ($minMemory === 0) {
         $minMemory = VmConfig::get('minMemory', '128M');
     }
     $memory_limit = VmConfig::getMemoryLimit();
     if ($memory_limit < $minMemory) {
         @ini_set('memory_limit', $minMemory . 'M');
     }
 }
開發者ID:brenot,項目名稱:forumdesenvolvimento,代碼行數:15,代碼來源:config.php


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