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


PHP tsmConfig::getExecutionTime方法代碼示例

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


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

示例1: __construct

 public function __construct()
 {
     $this->_app = JFactory::getApplication();
     $this->_db = JFactory::getDBO();
     $this->_oldToNew = new stdClass();
     $this->starttime = microtime(true);
     $max_execution_time = tsmConfig::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 = tsmConfig::getExecutionTime() * 0.95 - 3;
     //Lets use 3 seconds 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 {
         tsmConfig::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 `#__tsmart_migration_oldtonew_ids` ';
     $this->_db->setQuery($q);
     $res = $this->_db->loadResult();
     if (empty($res)) {
         $q = 'INSERT INTO `#__tsmart_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 = tsmConfig::get('keepOldProductIds', FALSE);
 }
開發者ID:cuongnd,項目名稱:etravelservice,代碼行數:44,代碼來源:migrator.php

示例2: __construct

 public function __construct()
 {
     $this->_app = JFactory::getApplication();
     $this->_db = JFactory::getDBO();
     // 		$this->_oldToNew = new stdClass();
     $this->starttime = microtime(true);
     $max_execution_time = tsmConfig::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 = tsmConfig::getExecutionTime() * 0.9 - 1;
     //Lets use 10% of the execution time as reserve to store the progress
     tsmConfig::ensureMemoryLimit(128);
     $this->maxMemoryLimit = $this->return_bytes(ini_get('memory_limit')) * 0.85;
     $config = JFactory::getConfig();
     $this->_prefix = $config->get('dbprefix');
     $this->reCreaPri = tsmConfig::get('reCreaPri', 0);
     $this->reCreaKey = tsmConfig::get('reCreaKey', 1);
 }
開發者ID:cuongnd,項目名稱:etravelservice,代碼行數:23,代碼來源:tableupdater.php


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