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


PHP VmConfig::getExecutionTime方法代码示例

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


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

	public function __construct(){

// 		JTable::addIncludePath(VMPATH_ADMIN . DS . 'tables');

		$this->_app = JFactory::getApplication();
		$this->_db = JFactory::getDBO();
		// 		$this->_oldToNew = new stdClass();
		$this->starttime = microtime(true);

		$max_execution_time = VmConfig::getExecutionTime();
		$jrmax_execution_time= vRequest::getInt('max_execution_time',300);

		if(!empty($jrmax_execution_time)){
			// 			vmdebug('$jrmax_execution_time',$jrmax_execution_time);
			if($max_execution_time!==$jrmax_execution_time) @ini_set( 'max_execution_time', $jrmax_execution_time );
		}

		$this->maxScriptTime = VmConfig::getExecutionTime() * 0.90-1;	//Lets use 10% of the execution time as reserve to store the progress

		VmConfig::ensureMemoryLimit(128);

		$this->maxMemoryLimit = $this->return_bytes(ini_get('memory_limit')) * 0.85;

		$config = JFactory::getConfig();
		$this->_prefix = $config->get('dbprefix');

		$this->reCreaPri = VmConfig::get('reCreaPri',0);
		$this->reCreaKey = VmConfig::get('reCreaKey',1);
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:29,代码来源:tableupdater.php

示例3: __construct

	public function __construct(){

// 		JTable::addIncludePath(VMPATH_ADMIN . DS . 'tables');

		$this->_app = JFactory::getApplication();
		$this->_db = JFactory::getDBO();
		$this->_oldToNew = new stdClass();
		$this->starttime = microtime(true);

		$max_execution_time = VmConfig::getExecutionTime();
		$jrmax_execution_time= vRequest::getInt('max_execution_time');

		if(!empty($jrmax_execution_time)){
			// 			vmdebug('$jrmax_execution_time',$jrmax_execution_time);
			if($max_execution_time!=$jrmax_execution_time) @ini_set( 'max_execution_time', $jrmax_execution_time );
		} else if($max_execution_time<60) {
			@ini_set( 'max_execution_time', 60 );
		}

		$this->maxScriptTime = VmConfig::getExecutionTime()*0.80-1;	//Lets use 30% of the execution time as reserve to store the progress

		$jrmemory_limit= vRequest::getInt('memory_limit');
		if(!empty($jrmemory_limit)){
			@ini_set( 'memory_limit', $jrmemory_limit.'M' );
		} else {
			VmConfig::ensureMemoryLimit(128);
		}

		$this->maxMemoryLimit = $this->return_bytes(ini_get('memory_limit')) - (14 * 1024 * 1024)  ;		//Lets use 11MB for joomla
		// 		vmdebug('$this->maxMemoryLimit',$this->maxMemoryLimit); //134217728
		//$this->maxMemoryLimit = $this -> return_bytes('20M');

		// 		ini_set('memory_limit','35M');
		$q = 'SELECT `id` FROM `#__virtuemart_migration_oldtonew_ids` ';
		$this->_db->setQuery($q);
		$res = $this->_db->loadResult();
		if(empty($res)){
			$q = 'INSERT INTO `#__virtuemart_migration_oldtonew_ids` (`id`) VALUES ("1")';
			$this->_db->setQuery($q);
			$this->_db->execute();
			$this->_app->enqueueMessage('Start with a new migration process and setup log maxScriptTime '.$this->maxScriptTime.' maxMemoryLimit '.$this->maxMemoryLimit/(1024*1024));
		} else {
			$this->_app->enqueueMessage('Found prior migration process, resume migration maxScriptTime '.$this->maxScriptTime.' maxMemoryLimit '.$this->maxMemoryLimit/(1024*1024));
		}

		$this->_keepOldProductIds = VmConfig::get('keepOldProductIds',FALSE);
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:47,代码来源:migrator.php


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