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


PHP t3lib_div::milliseconds方法代码示例

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


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

示例1:

// *********************
if ($TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionHandler'] !== '') {
    if ($TYPO3_CONF_VARS['SYS']['errorHandler'] !== '') {
        // 	register an error handler for the given errorHandlerErrors
        $errorHandler = t3lib_div::makeInstance($TYPO3_CONF_VARS['SYS']['errorHandler'], $TYPO3_CONF_VARS['SYS']['errorHandlerErrors']);
        // set errors which will be converted in an exception
        $errorHandler->setExceptionalErrors($TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionalErrors']);
    }
    $exceptionHandler = t3lib_div::makeInstance($TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionHandler']);
}
/** @var TYPO3_DB t3lib_db */
$TYPO3_DB = t3lib_div::makeInstance('t3lib_DB');
$TYPO3_DB->debugOutput = $TYPO3_CONF_VARS['SYS']['sqlDebug'];
$CLIENT = t3lib_div::clientInfo();
// $CLIENT includes information about the browser/user-agent
$PARSETIME_START = t3lib_div::milliseconds();
// Is set to the system time in milliseconds. This could be used to output script parsetime in the end of the script
// ***********************************
// Initializing the Caching System
// ***********************************
if (TYPO3_UseCachingFramework) {
    $typo3CacheManager = t3lib_div::makeInstance('t3lib_cache_Manager');
    $typo3CacheFactory = t3lib_div::makeInstance('t3lib_cache_Factory');
    $typo3CacheFactory->setCacheManager($typo3CacheManager);
    t3lib_cache::initPageCache();
    t3lib_cache::initPageSectionCache();
    t3lib_cache::initContentHashCache();
}
// *************************
// CLI dispatch processing
// *************************
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:31,代码来源:init.php

示例2: parseTime

    /**
     * Returns script parsetime IF ->parseTimeFlag is set and user is "admin"
     * Automatically outputted in page end
     *
     * @return	string
     */
    function parseTime()
    {
        if ($this->parseTimeFlag && $GLOBALS['BE_USER']->isAdmin()) {
            return '<p>(ParseTime: ' . (t3lib_div::milliseconds() - $GLOBALS['PARSETIME_START']) . ' ms</p>
					<p>REQUEST_URI-length: ' . strlen(t3lib_div::getIndpEnv('REQUEST_URI')) . ')</p>';
        }
    }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:13,代码来源:template.php

示例3: indexRegularDocument

 /**
  * Indexing a regular document given as $file (relative to PATH_site, local file)
  *
  * @param	string		Relative Filename, relative to PATH_site. It can also be an absolute path as long as it is inside the lockRootPath (validated with t3lib_div::isAbsPath()). Finally, if $contentTmpFile is set, this value can be anything, most likely a URL
  * @param	boolean		If set, indexing is forced (despite content hashes, mtime etc).
  * @param	string		Temporary file with the content to read it from (instead of $file). Used when the $file is a URL.
  * @param	string		File extension for temporary file.
  * @return	void
  */
 function indexRegularDocument($file, $force = FALSE, $contentTmpFile = '', $altExtension = '')
 {
     // Init
     $fI = pathinfo($file);
     $ext = $altExtension ? $altExtension : strtolower($fI['extension']);
     // Create abs-path:
     if (!$contentTmpFile) {
         if (!t3lib_div::isAbsPath($file)) {
             // Relative, prepend PATH_site:
             $absFile = t3lib_div::getFileAbsFileName(PATH_site . $file);
         } else {
             // Absolute, pass-through:
             $absFile = $file;
         }
         $absFile = t3lib_div::isAllowedAbsPath($absFile) ? $absFile : '';
     } else {
         $absFile = $contentTmpFile;
     }
     // Indexing the document:
     if ($absFile && @is_file($absFile)) {
         if ($this->external_parsers[$ext]) {
             $mtime = filemtime($absFile);
             $cParts = $this->fileContentParts($ext, $absFile);
             foreach ($cParts as $cPKey) {
                 $this->internal_log = array();
                 $this->log_push('Index: ' . str_replace('.', '_', basename($file)) . ($cPKey ? '#' . $cPKey : ''), '');
                 $Pstart = t3lib_div::milliseconds();
                 $subinfo = array('key' => $cPKey);
                 // Setting page range. This is "0" (zero) when no division is made, otherwise a range like "1-3"
                 $phash_arr = $this->file_phash_arr = $this->setExtHashes($file, $subinfo);
                 $check = $this->checkMtimeTstamp($mtime, $phash_arr['phash']);
                 if ($check > 0 || $force) {
                     if ($check > 0) {
                         $this->log_setTSlogMessage('Indexing needed, reason: ' . $this->reasons[$check], 1);
                     } else {
                         $this->log_setTSlogMessage('Indexing forced by flag', 1);
                     }
                     // Check external file counter:
                     if ($this->externalFileCounter < $this->maxExternalFiles || $force) {
                         // Divide into title,keywords,description and body:
                         $this->log_push('Split content', '');
                         $contentParts = $this->readFileContent($ext, $absFile, $cPKey);
                         $this->log_pull();
                         if (is_array($contentParts)) {
                             // Calculating a hash over what is to be the actual content. (see indexTypo3PageContent())
                             $content_md5h = $this->md5inthash(implode($contentParts, ''));
                             if ($this->checkExternalDocContentHash($phash_arr['phash_grouping'], $content_md5h) || $force) {
                                 // Increment counter:
                                 $this->externalFileCounter++;
                                 // Splitting words
                                 $this->log_push('Extract words from content', '');
                                 $splitInWords = $this->processWordsInArrays($contentParts);
                                 $this->log_pull();
                                 // Analyse the indexed words.
                                 $this->log_push('Analyse the extracted words', '');
                                 $indexArr = $this->indexAnalyze($splitInWords);
                                 $this->log_pull();
                                 // Submitting page (phash) record
                                 $this->log_push('Submitting page', '');
                                 $size = filesize($absFile);
                                 $ctime = filemtime($absFile);
                                 // Unfortunately I cannot determine WHEN a file is originally made - so I must return the modification time...
                                 $this->submitFilePage($phash_arr, $file, $subinfo, $ext, $mtime, $ctime, $size, $content_md5h, $contentParts);
                                 $this->log_pull();
                                 // Check words and submit to word list if not there
                                 $this->log_push('Check word list and submit words', '');
                                 $this->checkWordList($indexArr);
                                 $this->submitWords($indexArr, $phash_arr['phash']);
                                 $this->log_pull();
                                 // Set parsetime
                                 $this->updateParsetime($phash_arr['phash'], t3lib_div::milliseconds() - $Pstart);
                             } else {
                                 $this->updateTstamp($phash_arr['phash'], $mtime);
                                 // Update the timestamp
                                 $this->log_setTSlogMessage('Indexing not needed, the contentHash, ' . $content_md5h . ', has not changed. Timestamp updated.');
                             }
                         } else {
                             $this->log_setTSlogMessage('Could not index file! Unsupported extension.');
                         }
                     } else {
                         $this->log_setTSlogMessage('The limit of ' . $this->maxExternalFiles . ' has already been exceeded, so no indexing will take place this time.');
                     }
                 } else {
                     $this->log_setTSlogMessage('Indexing not needed, reason: ' . $this->reasons[$check]);
                 }
                 // Checking and setting sections:
                 #			$this->submitFile_grlist($phash_arr['phash']);	// Setting a gr_list record if there is none already (set for default fe_group)
                 $this->submitFile_section($phash_arr['phash']);
                 // Setting a section-record for the file. This is done also if the file is not indexed. Notice that section records are deleted when the page is indexed.
                 $this->log_pull();
             }
//.........这里部分代码省略.........
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:101,代码来源:class.indexer.php

示例4: doSearch

 /**
  * Performs the search, the display and writing stats
  *
  * @param	array		Search words in array, see ->getSearchWords() for details
  * @return	string		HTML for result display.
  */
 function doSearch($sWArr)
 {
     // Find free index uid:
     $freeIndexUid = $this->piVars['freeIndexUid'];
     if ($freeIndexUid == -2) {
         $freeIndexUid = $this->conf['search.']['defaultFreeIndexUidList'];
     }
     $indexCfgs = t3lib_div::intExplode(',', $freeIndexUid);
     $accumulatedContent = '';
     foreach ($indexCfgs as $freeIndexUid) {
         // Get result rows:
         $pt1 = t3lib_div::milliseconds();
         if ($hookObj = $this->hookRequest('getResultRows')) {
             $resData = $hookObj->getResultRows($sWArr, $freeIndexUid);
         } else {
             $resData = $this->getResultRows($sWArr, $freeIndexUid);
         }
         // Display search results:
         $pt2 = t3lib_div::milliseconds();
         if ($hookObj = $this->hookRequest('getDisplayResults')) {
             $content = $hookObj->getDisplayResults($sWArr, $resData, $freeIndexUid);
         } else {
             $content = $this->getDisplayResults($sWArr, $resData, $freeIndexUid);
         }
         $pt3 = t3lib_div::milliseconds();
         // Create header if we are searching more than one indexing configuration:
         if (count($indexCfgs) > 1) {
             if ($freeIndexUid > 0) {
                 list($indexCfgRec) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('title', 'index_config', 'uid=' . intval($freeIndexUid) . $this->cObj->enableFields('index_config'));
                 $titleString = $indexCfgRec['title'];
             } else {
                 $titleString = $this->pi_getLL('opt_freeIndexUid_header_' . $freeIndexUid);
             }
             $content = '<h1 class="tx-indexedsearch-category">' . htmlspecialchars($titleString) . '</h1>' . $content;
         }
         $accumulatedContent .= $content;
     }
     // Write search statistics
     $this->writeSearchStat($sWArr, $resData['count'], array($pt1, $pt2, $pt3));
     // Return content:
     return $accumulatedContent;
 }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:48,代码来源:class.tx_indexedsearch.php

示例5: genTree_traverse

 /**
  * Recursive traversal of page tree:
  *
  * @param	integer		Page root id (must be online, valid page record - or zero for page tree root)
  * @param	integer		Depth
  * @param	integer		Echo Level
  * @param	string		Call back function (from this class or subclass)
  * @param	string		DON'T set from outside, internal. (indicates we are inside a version of a page)
  * @param	integer		DON'T set from outside, internal. (1: Indicates that rootID is a version of a page, 2: ...that it is even a version of a version (which triggers a warning!)
  * @param	string		Internal string that accumulates the path
  * @return	void
  * @access private
  */
 function genTree_traverse($rootID, $depth, $echoLevel = 0, $callBack = '', $versionSwapmode = '', $rootIsVersion = 0, $accumulatedPath = '')
 {
     // Register page:
     $this->recStats['all']['pages'][$rootID] = $rootID;
     $pageRecord = t3lib_BEfunc::getRecordRaw('pages', 'uid=' . intval($rootID), 'deleted,title,t3ver_count,t3ver_wsid');
     $accumulatedPath .= '/' . $pageRecord['title'];
     // Register if page is deleted:
     if ($pageRecord['deleted']) {
         $this->recStats['deleted']['pages'][$rootID] = $rootID;
     }
     // If rootIsVersion is set it means that the input rootID is that of a version of a page. See below where the recursive call is made.
     if ($rootIsVersion) {
         $this->recStats['versions']['pages'][$rootID] = $rootID;
         if ($pageRecord['t3ver_count'] >= 1 && $pageRecord['t3ver_wsid'] == 0) {
             // If it has been published and is in archive now...
             $this->recStats['versions_published']['pages'][$rootID] = $rootID;
         }
         if ($pageRecord['t3ver_wsid'] == 0) {
             // If it has been published and is in archive now...
             $this->recStats['versions_liveWS']['pages'][$rootID] = $rootID;
         }
         if (!isset($this->workspaceIndex[$pageRecord['t3ver_wsid']])) {
             // If it doesn't belong to a workspace...
             $this->recStats['versions_lost_workspace']['pages'][$rootID] = $rootID;
         }
         if ($rootIsVersion == 2) {
             // In case the rootID is a version inside a versioned page
             $this->recStats['versions_inside_versioned_page']['pages'][$rootID] = $rootID;
         }
     }
     if ($echoLevel > 0) {
         echo LF . $accumulatedPath . ' [' . $rootID . ']' . ($pageRecord['deleted'] ? ' (DELETED)' : '') . ($this->recStats['versions_published']['pages'][$rootID] ? ' (PUBLISHED)' : '');
     }
     if ($echoLevel > 1 && $this->recStats['versions_lost_workspace']['pages'][$rootID]) {
         echo LF . '	ERROR! This version belongs to non-existing workspace (' . $pageRecord['t3ver_wsid'] . ')!';
     }
     if ($echoLevel > 1 && $this->recStats['versions_inside_versioned_page']['pages'][$rootID]) {
         echo LF . '	WARNING! This version is inside an already versioned page or branch!';
     }
     // Call back:
     if ($callBack) {
         $this->{$callBack}('pages', $rootID, $echoLevel, $versionSwapmode, $rootIsVersion);
     }
     $pt3 = t3lib_div::milliseconds();
     // Traverse tables of records that belongs to page:
     foreach ($GLOBALS['TCA'] as $tableName => $cfg) {
         if ($tableName != 'pages') {
             // Select all records belonging to page:
             $pt4 = t3lib_div::milliseconds();
             $resSub = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid' . ($GLOBALS['TCA'][$tableName]['ctrl']['delete'] ? ',' . $GLOBALS['TCA'][$tableName]['ctrl']['delete'] : ''), $tableName, 'pid=' . intval($rootID) . ($this->genTree_traverseDeleted ? '' : t3lib_BEfunc::deleteClause($tableName)));
             $this->performanceStatistics['genTree_traverse():TraverseTables:']['MySQL']['(ALL)'] += t3lib_div::milliseconds() - $pt4;
             $this->performanceStatistics['genTree_traverse():TraverseTables:']['MySQL'][$tableName] += t3lib_div::milliseconds() - $pt4;
             $pt5 = t3lib_div::milliseconds();
             $count = $GLOBALS['TYPO3_DB']->sql_num_rows($resSub);
             if ($count) {
                 if ($echoLevel == 2) {
                     echo LF . '	\\-' . $tableName . ' (' . $count . ')';
                 }
             }
             while ($rowSub = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resSub)) {
                 if ($echoLevel == 3) {
                     echo LF . '	\\-' . $tableName . ':' . $rowSub['uid'];
                 }
                 // If the rootID represents an "element" or "page" version type, we must check if the record from this table is allowed to belong to this:
                 if ($versionSwapmode == 'SWAPMODE:-1' || $versionSwapmode == 'SWAPMODE:0' && !$GLOBALS['TCA'][$tableName]['ctrl']['versioning_followPages']) {
                     // This is illegal records under a versioned page - therefore not registered in $this->recStats['all'] so they should be orphaned:
                     $this->recStats['illegal_record_under_versioned_page'][$tableName][$rowSub['uid']] = $rowSub['uid'];
                     if ($echoLevel > 1) {
                         echo LF . '		ERROR! Illegal record (' . $tableName . ':' . $rowSub['uid'] . ') under versioned page!';
                     }
                 } else {
                     $this->recStats['all'][$tableName][$rowSub['uid']] = $rowSub['uid'];
                     // Register deleted:
                     if ($GLOBALS['TCA'][$tableName]['ctrl']['delete'] && $rowSub[$GLOBALS['TCA'][$tableName]['ctrl']['delete']]) {
                         $this->recStats['deleted'][$tableName][$rowSub['uid']] = $rowSub['uid'];
                         if ($echoLevel == 3) {
                             echo ' (DELETED)';
                         }
                     }
                     // Check location of records regarding tree root:
                     if (!$GLOBALS['TCA'][$tableName]['ctrl']['rootLevel'] && $rootID == 0) {
                         $this->recStats['misplaced_at_rootlevel'][$tableName][$rowSub['uid']] = $rowSub['uid'];
                         if ($echoLevel > 1) {
                             echo LF . '		ERROR! Misplaced record (' . $tableName . ':' . $rowSub['uid'] . ') on rootlevel!';
                         }
                     }
                     if ($GLOBALS['TCA'][$tableName]['ctrl']['rootLevel'] == 1 && $rootID > 0) {
//.........这里部分代码省略.........
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:101,代码来源:class.tx_lowlevel_cleaner_core.php

示例6: main

 /**
  * Find orphan records
  * VERY CPU and memory intensive since it will look up the whole page tree!
  *
  * @return	array
  */
 function main()
 {
     global $TYPO3_DB;
     // Initialize result array:
     $resultArray = array('message' => $this->cli_help['name'] . LF . LF . $this->cli_help['description'], 'headers' => array('orphans' => array('Index of orphaned records', '', 3), 'misplaced_at_rootlevel' => array('Records that should not be at root level but are.', 'Fix manually by moving record into page tree', 2), 'misplaced_inside_tree' => array('Records that should be at root level but are not.', 'Fix manually by moving record to tree root', 2), 'illegal_record_under_versioned_page' => array('Records that cannot be attached to a versioned page', '(Listed under orphaned records so is fixed along with orphans.)', 2)), 'orphans' => array(), 'misplaced_at_rootlevel' => array(), 'misplaced_inside_tree' => array(), 'illegal_record_under_versioned_page' => array());
     $startingPoint = 0;
     // zero = tree root, must use tree root if you wish to reverse selection to find orphans!
     $pt = t3lib_div::milliseconds();
     $this->genTree($startingPoint, 1000, (int) $this->cli_argValue('--echotree'));
     $resultArray['misplaced_at_rootlevel'] = $this->recStats['misplaced_at_rootlevel'];
     $resultArray['misplaced_inside_tree'] = $this->recStats['misplaced_inside_tree'];
     $resultArray['illegal_record_under_versioned_page'] = $this->recStats['illegal_record_under_versioned_page'];
     // Find orphans:
     foreach ($GLOBALS['TCA'] as $tableName => $cfg) {
         $idList = is_array($this->recStats['all'][$tableName]) && count($this->recStats['all'][$tableName]) ? implode(',', $this->recStats['all'][$tableName]) : 0;
         // Select all records belonging to page:
         $orphanRecords = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid', $tableName, 'uid NOT IN (' . $idList . ')', '', 'uid', '', 'uid');
         if (count($orphanRecords)) {
             $resultArray['orphans'][$tableName] = array();
             foreach ($orphanRecords as $oR) {
                 $resultArray['orphans'][$tableName][$oR['uid']] = $oR['uid'];
             }
         }
     }
     return $resultArray;
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:32,代码来源:class.orphan_records.php

示例7: execute

 /**
  * Function executed from the Scheduler.
  *
  * @return boolean	Returns true on successful execution, false on error
  */
 public function execute()
 {
     /* beispiel für das logging array.
     		$devLog = array('message' => '', 'extKey' => 'mklib', 'dataVar' => FALSE);
     		$devLog = array(
     			tx_rnbase_util_Logger::LOGLEVEL_DEBUG => $devLog,
     			tx_rnbase_util_Logger::LOGLEVEL_INFO => $devLog,
     			tx_rnbase_util_Logger::LOGLEVEL_NOTICE => $devLog,
     			tx_rnbase_util_Logger::LOGLEVEL_WARN => $devLog,
     			tx_rnbase_util_Logger::LOGLEVEL_FATAL => $devLog
     		);
     		*/
     $devLog = array();
     $options = $this->getOptions();
     $startTimeInMilliseconds = t3lib_div::milliseconds();
     $memoryUsageAtStart = memory_get_usage();
     tx_rnbase_util_Logger::info('[' . get_class($this) . ']: Scheduler starts', $this->getExtKey());
     try {
         $message = $this->executeTask($options, $devLog);
         $this->setLastRunTime();
         // devlog
         if (t3lib_extMgm::isLoaded('devlog')) {
             if (empty($devLog) || isset($devLog[tx_rnbase_util_Logger::LOGLEVEL_INFO]) && empty($devLog[tx_rnbase_util_Logger::LOGLEVEL_INFO]['message'])) {
                 $devLog[tx_rnbase_util_Logger::LOGLEVEL_INFO]['message'] = $message;
             }
             foreach ($devLog as $logLevel => $logData) {
                 if (empty($logData['message'])) {
                     continue;
                 }
                 t3lib_div::devLog('[' . get_class($this) . ']: ' . $logData['message'], isset($logData['extKey']) ? $logData['extKey'] : $this->getExtKey(), $logLevel, isset($logData['dataVar']) ? $logData['dataVar'] : FALSE);
             }
         }
     } catch (Exception $exception) {
         $dataVar = array('errorcode' => $exception->getCode(), 'errormsg' => $exception->getMessage(), 'trace' => $exception->getTraceAsString(), 'options' => $options, 'devlog' => $devLog);
         if ($exception instanceof tx_rnbase_util_Exception) {
             $dataVar['exception_data'] = $exception->getAdditional(FALSE);
         }
         if (tx_rnbase_util_Logger::isFatalEnabled()) {
             tx_rnbase_util_Logger::fatal('Task [' . get_class($this) . '] failed.' . ' Error(' . $exception->getCode() . '):' . $exception->getMessage(), $this->getExtKey(), $dataVar);
         }
         // Exception Mail an die Entwicker senden
         $mail = tx_rnbase_configurations::getExtensionCfgValue('rn_base', 'sendEmailOnException');
         if (!empty($mail)) {
             $this->sendErrorMail($mail, tx_rnbase::makeInstance('tx_rnbase_util_Exception', get_class($exception) . ': ' . $exception->getMessage(), $exception->getCode(), $dataVar, $exception));
         }
         // Wir geben die Exception weiter,
         // damit der Scheduler eine entsprechende Meldung ausgeben kann.
         throw $exception;
     }
     $memoryUsageAtEnd = memory_get_usage();
     tx_rnbase_util_Logger::info('[' . get_class($this) . ']: Scheduler ends successful ', $this->getExtKey(), array('Execution Time' => t3lib_div::milliseconds() - $startTimeInMilliseconds . ' ms', 'Memory Start' => $memoryUsageAtStart . ' Bytes', 'Memory End' => $memoryUsageAtEnd . ' Bytes', 'Memory Consumed' => $memoryUsageAtEnd - $memoryUsageAtStart . ' Bytes'));
     return true;
 }
开发者ID:RocKordier,项目名称:typo3-mklib,代码行数:58,代码来源:class.tx_mklib_scheduler_Generic.php

示例8: exec_PREPAREDquery

 /**
  * Executes a prepared query.
  *
  * @param string $query The query to execute
  * @param array $queryComponents The components of the query to execute
  * @return pointer MySQL result pointer / DBAL object
  * @access protected This method may only be called by t3lib_db_PreparedStatement
  */
 public function exec_PREPAREDquery($query, array $precompiledParts)
 {
     if ($this->debug) {
         $pt = t3lib_div::milliseconds();
     }
     // Get handler key and select API:
     switch ($precompiledParts['handler']) {
         case 'native':
             $this->lastQuery = $query;
             $sqlResult = mysql_query($this->lastQuery, $this->handlerInstance[$this->lastHandlerKey]['link']);
             $this->resourceIdToTableNameMap[(string) $sqlResult] = $precompiledParts['ORIG_tableName'];
             break;
         case 'adodb':
             $limit = $precompiledParts['LIMIT'];
             if ($this->runningADOdbDriver('postgres')) {
                 // Possibly rewrite the LIMIT to be PostgreSQL-compatible
                 $splitLimit = t3lib_div::intExplode(',', $limit);
                 // Splitting the limit values:
                 if ($splitLimit[1]) {
                     // If there are two parameters, do mapping differently than otherwise:
                     $numrows = $splitLimit[1];
                     $offset = $splitLimit[0];
                     $limit = $numrows . ' OFFSET ' . $offset;
                 }
             }
             if ($limit != '') {
                 $splitLimit = t3lib_div::intExplode(',', $limit);
                 // Splitting the limit values:
                 if ($splitLimit[1]) {
                     // If there are two parameters, do mapping differently than otherwise:
                     $numrows = $splitLimit[1];
                     $offset = $splitLimit[0];
                 } else {
                     $numrows = $splitLimit[0];
                     $offset = 0;
                 }
                 $sqlResult = $this->handlerInstance[$this->lastHandlerKey]->SelectLimit($query, $numrows, $offset);
                 $this->lastQuery = $sqlResult->sql;
             } else {
                 $this->lastQuery = $query;
                 $sqlResult = $this->handlerInstance[$this->lastHandlerKey]->_Execute($this->lastQuery);
             }
             $sqlResult->TYPO3_DBAL_handlerType = 'adodb';
             // Setting handler type in result object (for later recognition!)
             $sqlResult->TYPO3_DBAL_tableList = $precompiledParts['ORIG_tableName'];
             break;
         case 'userdefined':
             $queryParts = $precompiledParts['queryParts'];
             $sqlResult = $this->handlerInstance[$this->lastHandlerKey]->exec_SELECTquery($queryParts['SELECT'], $queryParts['FROM'], $queryParts['WHERE'], $queryParts['GROUPBY'], $queryParts['ORDERBY'], $queryParts['LIMIT']);
             if (is_object($sqlResult)) {
                 $sqlResult->TYPO3_DBAL_handlerType = 'userdefined';
                 // Setting handler type in result object (for later recognition!)
                 $sqlResult->TYPO3_DBAL_tableList = $precompiledParts['ORIG_tableName'];
             }
             break;
     }
     if ($this->printErrors && $this->sql_error()) {
         debug(array($this->lastQuery, $this->sql_error()));
     }
     if ($this->debug) {
         $data = array('handlerType' => $precompiledParts['handler'], 'args' => $precompiledParts, 'ORIG_from_table' => $precompiledParts['ORIG_tableName']);
         if ($this->conf['debugOptions']['numberRows']) {
             $data['numberRows'] = $this->sql_num_rows($sqlResult);
         }
         $this->debugHandler('exec_PREPAREDquery', t3lib_div::milliseconds() - $pt, $data);
     }
     // Return result handler.
     return $sqlResult;
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:77,代码来源:class.ux_t3lib_db.php

示例9: main

 /**
  * The main method of the PlugIn
  *
  * @param	string		$content: The PlugIn content
  * @param	array		$conf: The PlugIn configuration
  * @return	The content that is displayed on the website
  */
 function main($content, $conf)
 {
     if (TYPO3_VERSION_INTEGER >= 7000000) {
         $this->ms = TYPO3\CMS\Core\Utility\GeneralUtility::milliseconds();
     } else {
         $this->ms = t3lib_div::milliseconds();
     }
     $this->conf = $conf;
     $this->pi_setPiVarDefaults();
     $this->pi_loadLL();
     $this->pi_USER_INT_obj = 1;
     // Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!
     // initializes plugin configuration
     $this->init();
     // init domReady action
     $this->initDomReadyAction();
     // add header parts when in searchbox mode
     $this->addHeaderParts();
     // init XAJAX?
     if ($this->conf['renderMethod'] != 'static') {
         if (TYPO3_VERSION_INTEGER < 6002000) {
             $xajaxIsLoaded = t3lib_extMgm::isLoaded('xajax');
         } else {
             $xajaxIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('xajax');
         }
         if (!$xajaxIsLoaded) {
             return '<span style="color: red;"><b>ke_search error:</b>"XAJAX" must be installed for this mode.</span>';
         } else {
             $this->initXajax();
         }
     }
     // Spinner Image
     if ($this->conf['spinnerImageFile']) {
         $spinnerSrc = $this->conf['spinnerImageFile'];
     } else {
         if (TYPO3_VERSION_INTEGER < 6002000) {
             $spinnerSrc = t3lib_extMgm::siteRelPath($this->extKey) . 'res/img/spinner.gif';
         } else {
             $spinnerSrc = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'res/img/spinner.gif';
         }
     }
     $this->spinnerImageFilters = '<img id="kesearch_spinner_filters" src="' . $spinnerSrc . '" alt="' . $this->pi_getLL('loading') . '" />';
     $this->spinnerImageResults = '<img id="kesearch_spinner_results" src="' . $spinnerSrc . '" alt="' . $this->pi_getLL('loading') . '" />';
     // get javascript onclick actions
     $this->initOnclickActions();
     // hook for initials
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['initials'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['initials'] as $_classRef) {
             if (TYPO3_VERSION_INTEGER >= 7000000) {
                 $_procObj =& TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef);
             } else {
                 $_procObj =& t3lib_div::getUserObj($_classRef);
             }
             $_procObj->addInitials($this);
         }
     }
     // get content
     $content = $this->getSearchboxContent();
     $subpart = $this->cObj->getSubpart($content, '###SHOW_SPINNER###');
     if ($this->conf['renderMethod'] == 'static') {
         $content = $this->cObj->substituteSubpart($content, '###SHOW_SPINNER###', '');
     } else {
         $subpart = $this->cObj->substituteMarker($subpart, '###SPINNER###', $this->spinnerImageFilters);
         $content = $this->cObj->substituteSubpart($content, '###SHOW_SPINNER###', $subpart);
     }
     $content = $this->cObj->substituteMarker($content, '###LOADING###', $this->pi_getLL('loading'));
     // hook for additional searchbox markers
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['additionalSearchboxContent'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['additionalSearchboxContent'] as $_classRef) {
             if (TYPO3_VERSION_INTEGER >= 7000000) {
                 $_procObj =& TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef);
             } else {
                 $_procObj =& t3lib_div::getUserObj($_classRef);
             }
             $_procObj->additionalSearchboxContent($content, $this);
         }
     }
     return $this->pi_wrapInBaseClass($content);
 }
开发者ID:brainformatik,项目名称:ke_search,代码行数:86,代码来源:class.tx_kesearch_pi1.php

示例10: main

 /**
  * The main method of the PlugIn
  *
  * @param	string		$content: The PlugIn content
  * @param	array		$conf: The PlugIn configuration
  * @return	The content that is displayed on the website
  */
 function main($content, $conf)
 {
     if (TYPO3_VERSION_INTEGER >= 7000000) {
         $this->ms = TYPO3\CMS\Core\Utility\GeneralUtility::milliseconds();
     } else {
         $this->ms = t3lib_div::milliseconds();
     }
     $this->conf = $conf;
     $this->pi_setPiVarDefaults();
     $this->pi_loadLL();
     $this->pi_USER_INT_obj = 1;
     // Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!
     // initializes plugin configuration
     $this->init();
     // init XAJAX?
     if ($this->conf['renderMethod'] != 'static') {
         if (TYPO3_VERSION_INTEGER < 6002000) {
             $xajaxIsLoaded = t3lib_extMgm::isLoaded('xajax');
         } else {
             $xajaxIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('xajax');
         }
         if (!$xajaxIsLoaded) {
             return '<span style="color: red;"><b>ke_search error:</b>"XAJAX" must be installed for this mode.</span>';
         } else {
             $this->initXajax();
         }
     }
     // hook for initials
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['initials'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['initials'] as $_classRef) {
             if (TYPO3_VERSION_INTEGER >= 7000000) {
                 $_procObj =& TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef);
             } else {
                 $_procObj =& t3lib_div::getUserObj($_classRef);
             }
             $_procObj->addInitials($this);
         }
     }
     // get templates
     $template['multiselect'] = $this->cObj->getSubpart($this->templateCode, '###SUB_FILTER_MULTISELECT###');
     $template['multihidden'] = $this->cObj->getSubpart($template['multiselect'], '###SUB_FILTER_MULTISELECT_HIDDEN###');
     $template['multifilter'] = $this->cObj->getSubpart($template['multiselect'], '###SUB_FILTER_MULTISELECT_FILTER###');
     $template['multioption'] = $this->cObj->getSubpart($template['multifilter'], '###SUB_FILTER_MULTISELECT_OPTION###');
     // get current filter
     $filters = $this->filters->getFilters();
     foreach ($filters as $filter) {
         if ($filter['target_pid'] == intval($GLOBALS['TSFE']->id)) {
             break;
         }
     }
     // hook for modifying content
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyMultiselectContent'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyMultiselectContent'] as $_classRef) {
             if (TYPO3_VERSION_INTEGER >= 7000000) {
                 $_procObj =& TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef);
             } else {
                 $_procObj =& t3lib_div::getUserObj($_classRef);
             }
             $content = $_procObj->modifyMultiselectContent($template['multiselect'], $filter, $this);
         }
     }
     if (is_array($filter) && count($filter)) {
         $contentOptions = '';
         $optionsAmountArray = $GLOBALS['TSFE']->fe_user->getKey('ses', 'ke_search.tagsInSearchResults');
         $countLoops = 1;
         if (is_array($this->piVars['filter'][$filter['uid']]) && count($this->piVars['filter'][$filter['uid']])) {
             $this->piVars['filter'][$filter['uid']] = array_unique($this->piVars['filter'][$filter['uid']]);
         }
         foreach ($filter['options'] as $optionKey => $option) {
             $option['title'] = htmlspecialchars($option['title']);
             $option['tag'] = htmlspecialchars($option['tag']);
             if ($optionsAmountArray[$option['tag']]) {
                 $optionCounter = $optionsAmountArray[$option['tag']];
             } else {
                 $optionCounter = 0;
             }
             $selected = $this->piVars['filter'][$filter['uid']][$optionKey] ? 'checked="checked"' : '';
             $markerArray['###ADDCLASS###'] = $countLoops % 3 ? '' : ' last';
             $markerArray['###FILTERNAME###'] = 'tx_kesearch_pi1[filter][' . $filter['uid'] . ']';
             $markerArray['###OPTIONID###'] = $option['uid'];
             $markerArray['###OPTIONKEY###'] = $optionKey;
             $markerArray['###OPTIONTITLE###'] = $option['title'] . ' (' . $optionCounter . ')';
             $markerArray['###OPTIONTAG###'] = $option['tag'];
             $markerArray['###SELECTED###'] = $selected;
             $countLoops++;
             $contentOptions .= $this->cObj->substituteMarkerArray($template['multioption'], $markerArray);
         }
         $content .= $this->cObj->substituteSubpart($template['multifilter'], '###SUB_FILTER_MULTISELECT_OPTION###', $contentOptions);
         $content = $this->cObj->substituteMarker($content, '###TITLE###', $filter['title']);
     }
     $content = $this->cObj->substituteSubpart($template['multiselect'], '###SUB_FILTER_MULTISELECT_FILTER###', $content);
     $content = $this->cObj->substituteMarker($content, '###FORM_ACTION###', $this->pi_getPageLink($this->conf['resultPage']));
     $content = $this->cObj->substituteMarker($content, '###SHOW_RESULTS###', $this->pi_getLL('show_results'));
//.........这里部分代码省略.........
开发者ID:brainformatik,项目名称:ke_search,代码行数:101,代码来源:class.tx_kesearch_pi3.php

示例11: countFunctionUsage

 /**
  * Counts the usage of a function/class in all files related to the extension!
  *
  * @param	string		Function or class header, eg. "function blablabla() {"
  * @param	array		Array of files in the extension to search
  * @param	string		Absolute directory prefix for files in $extPhpFiles
  * @return	array		Count statistics in an array.
  */
 function countFunctionUsage($functionHeader, $extPhpFiles, $extDir)
 {
     $reg = array();
     $counter = array();
     // Search for class/function .
     if (preg_match('/(class|function)[[:space:]]+([[:alnum:]_]+)[[:space:]]*/i', $functionHeader, $reg)) {
         $pt = t3lib_div::milliseconds();
         // Reset counter array:
         $counter = array();
         // For each file found in the extension, search for the function/class usage:
         foreach ($extPhpFiles as $fileName) {
             // File MD5 for array keys:
             $lFile_MD5 = 'MD5_' . t3lib_div::shortMD5($fileName);
             // Detect function/class:
             switch (strtolower($reg[1])) {
                 case 'class':
                     // If it's a class:
                     $res = $this->searchFile('t3lib_div::makeinstance[[:space:]]*\\(["\']' . strtolower($reg[2]) . '["\']\\)', $fileName, $extDir);
                     if ($res[0]) {
                         $counter['ALL']['makeinstance'] += $res[0];
                         $counter['ALL']['TOTAL'] += $res[0];
                         $counter[$lFile_MD5]['fileName'] = $fileName;
                         $counter[$lFile_MD5]['makeinstance'] += $res[0];
                         $counter[$lFile_MD5]['TOTAL'] += $res[0];
                     }
                     break;
                 case 'function':
                     // If it's a function:
                     // Instantiated usage:
                     $res = $this->searchFile('->' . strtolower($reg[2]) . '[[:space:]]*\\(', $fileName, $extDir);
                     if ($res[0]) {
                         $counter['ALL']['objectUsage'] += $res[0];
                         $counter['ALL']['TOTAL'] += $res[0];
                         $counter[$lFile_MD5]['fileName'] = $fileName;
                         $counter[$lFile_MD5]['objectUsage'] += $res[0];
                         $counter[$lFile_MD5]['TOTAL'] += $res[0];
                     }
                     // Non-instantiated usage:
                     $res = $this->searchFile('::' . strtolower($reg[2]) . '[[:space:]]*\\(', $fileName, $extDir);
                     if ($res[0]) {
                         $counter['ALL']['nonObjectUsage'] += $res[0];
                         $counter['ALL']['TOTAL'] += $res[0];
                         $counter[$lFile_MD5]['fileName'] = $fileName;
                         $counter[$lFile_MD5]['nonObjectUsage'] += $res[0];
                         $counter[$lFile_MD5]['TOTAL'] += $res[0];
                     }
                     break;
             }
         }
         $counter['_searchtime_milliseconds'] = t3lib_div::milliseconds() - $pt;
         $counter['_functionHeader'] = $functionHeader;
     }
     return $counter;
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:62,代码来源:class.tx_extdeveval_phpdoc.php

示例12: mayday

    /**
     * Stops Formidable and PHP execution : die() if some critical error appeared
     *
     * @param	string		$msg: the error message
     * @return	void
     */
    function mayday($msg)
    {
        if ($this->__getEnvExecMode() === "EID") {
            die("Formidable::Mayday\n\n" . trim(strip_tags($msg)));
        }
        $aTrace = debug_backtrace();
        $aLocation = array_shift($aTrace);
        $aTrace1 = array_shift($aTrace);
        $aTrace2 = array_shift($aTrace);
        $aTrace3 = array_shift($aTrace);
        $aTrace4 = array_shift($aTrace);
        $aDebug = array();
        $aDebug[] = "<span class='notice'><b>XML: </b> " . $this->_xmlPath . "</span>";
        $aDebug[] = "<br/>";
        $aDebug[] = "<span class='notice'><b>Formidable: </b>v" . $this->sApiVersion . "</span>";
        $aDebug[] = "<br/>";
        $aDebug[] = "<span class='notice'><b>Total exec. time: </b>" . round(t3lib_div::milliseconds() - $this->start_tstamp, 4) / 1000 . " sec</span>";
        $aDebug[] = "<br/>";
        $aDebug[] = "<h2 id='backtracetitle'>Call stack</h2>";
        $aDebug[] = "<div class='backtrace'>";
        $aDebug[] = "<span class='notice'><b>Call 0: </b>" . str_replace(PATH_site, "/", $aLocation["file"]) . ":" . $aLocation["line"] . " | <b>" . $aTrace1["class"] . $aTrace1["type"] . $aTrace1["function"] . "</b></span><br/>With parameters: " . (!empty($aTrace1["args"]) ? $this->_viewMixed($aTrace1["args"]) : " no parameters");
        $aDebug[] = "<hr/>";
        $aDebug[] = "<span class='notice'><b>Call -1: </b>" . str_replace(PATH_site, "/", $aTrace1["file"]) . ":" . $aTrace1["line"] . " | <b>" . $aTrace2["class"] . $aTrace2["type"] . $aTrace2["function"] . "</b></span><br />With parameters: " . (!empty($aTrace2["args"]) ? $this->_viewMixed($aTrace2["args"]) : " no parameters");
        $aDebug[] = "<hr/>";
        $aDebug[] = "<span class='notice'><b>Call -2: </b>" . str_replace(PATH_site, "/", $aTrace2["file"]) . ":" . $aTrace2["line"] . " | <b>" . $aTrace3["class"] . $aTrace3["type"] . $aTrace3["function"] . "</b></span><br />With parameters: " . (!empty($aTrace3["args"]) ? $this->_viewMixed($aTrace3["args"]) : " no parameters");
        $aDebug[] = "<hr/>";
        $aDebug[] = "<span class='notice'><b>Call -3: </b>" . str_replace(PATH_site, "/", $aTrace3["file"]) . ":" . $aTrace3["line"] . " | <b>" . $aTrace4["class"] . $aTrace4["type"] . $aTrace4["function"] . "</b></span><br />With parameters: " . (!empty($aTrace4["args"]) ? $this->_viewMixed($aTrace4["args"]) : " no parameters");
        $aDebug[] = "<hr/>";
        if (is_callable(array("t3lib_div", "debug_trail"))) {
            $aDebug[] = "<span class='notice'>" . t3lib_div::debug_trail() . "</span>";
            $aDebug[] = "<hr/>";
        }
        $aDebug[] = "</div>";
        $aDebug[] = "<br/>";
        $sContent = "<h1 id='title'>Formidable::Mayday</h1>";
        $sContent .= "<div id='errormessage'>" . $msg . "</div>";
        $sContent .= "<hr />";
        $sContent .= implode("", $aDebug);
        //$sContent .= $this->debug(TRUE);
        $sPage = <<<MAYDAYPAGE
<!DOCTYPE html
\tPUBLIC "-//W3C//DTD XHTML 1.1//EN"
\t"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
\t<head>
\t\t<title>Formidable::Mayday</title>
\t\t<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
\t\t<meta name="robots" content="noindex, nofollow" />
\t\t<style type="text/css">

\t\t\t#title {
\t\t\t\tcolor: red;
\t\t\t\tfont-family: Verdana;
\t\t\t}

\t\t\t#errormessage {
\t\t\t\tborder: 2px solid red;
\t\t\t\tpadding: 10px;
\t\t\t\tcolor: white;
\t\t\t\tbackground-color: red;
\t\t\t\tfont-family: Verdana;
\t\t\t\tfont-size: 12px;
\t\t\t}

\t\t\t.notice {
\t\t\t\tfont-family: Verdana;
\t\t\t\tfont-size: 9px;
\t\t\t\tfont-style: italic;
\t\t\t}

\t\t\t#backtracetitle {
\t\t\t}

\t\t\t.backtrace {
\t\t\t\tbackground-color: #FFFFCC;
\t\t\t}

\t\t\tHR {
\t\t\t\tborder: 1px solid silver;
\t\t\t}
\t\t</style>
\t</head>
\t<body>
\t\t{$sContent}
\t</body>
</html>

MAYDAYPAGE;
        /*		if($this->bDebug) {
        			die($sPage);
        		} elseif($this->bDebugIP) {
        			$sPage = "<h4 style='color: red'>This full detail error-message is displayed because your IP(" . t3lib_div::getIndpEnv('REMOTE_ADDR') . ") matches the TYPO3 devIPMask</h4>" . $sPage;
        			die($sPage);
        		} elseif($GLOBALS["TSFE"]->TYPO3_CONF_VARS['FE']['pageNotFound_handling']) {
//.........这里部分代码省略.........
开发者ID:preinboth,项目名称:formidable,代码行数:101,代码来源:class.tx_ameosformidable.php

示例13: statEnd

 /**
  * End statistics
  *
  * @return	void
  */
 function statEnd()
 {
     $this->stat['totalTime'] = t3lib_div::milliseconds() - $this->stat['totalStartTime'];
     if ($this->writeDevLog) {
         t3lib_div::devLog('statMeta(): ' . $this->stat['totalTime'], 'tx_dam_indexing', 0, $this->stat);
     }
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:12,代码来源:class.tx_dam_indexing.php

示例14: exec_TRUNCATEquery

 /**
  * Truncates a table.
  *
  * @param	string		Database tablename
  * @return	mixed		Result from handler
  */
 public function exec_TRUNCATEquery($table)
 {
     if ($this->debug) {
         $pt = t3lib_div::milliseconds();
     }
     // Do table/field mapping:
     $ORIG_tableName = $table;
     if ($tableArray = $this->map_needMapping($table)) {
         // Table name:
         if ($this->mapping[$table]['mapTableName']) {
             $table = $this->mapping[$table]['mapTableName'];
         }
     }
     // Select API
     $this->lastHandlerKey = $this->handler_getFromTableList($ORIG_tableName);
     switch ((string) $this->handlerCfg[$this->lastHandlerKey]['type']) {
         case 'native':
             $this->lastQuery = $this->TRUNCATEquery($table);
             $sqlResult = mysql_query($this->lastQuery, $this->handlerInstance[$this->lastHandlerKey]['link']);
             break;
         case 'adodb':
             $this->lastQuery = $this->TRUNCATEquery($table);
             $sqlResult = $this->handlerInstance[$this->lastHandlerKey]->_query($this->lastQuery, FALSE);
             break;
         case 'userdefined':
             $sqlResult = $this->handlerInstance[$this->lastHandlerKey]->exec_TRUNCATEquery($table, $where);
             break;
     }
     if ($this->printErrors && $this->sql_error()) {
         debug(array($this->lastQuery, $this->sql_error()));
     }
     if ($this->debug) {
         $this->debugHandler('exec_TRUNCATEquery', t3lib_div::milliseconds() - $pt, array('handlerType' => $hType, 'args' => array($table), 'ORIG_from_table' => $ORIG_tableName));
     }
     // Return result:
     return $sqlResult;
 }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:43,代码来源:class.ux_t3lib_db.php

示例15: main

 /**
  * The main method of the PlugIn
  *
  * @param	string		$content: The PlugIn content
  * @param	array		$conf: The PlugIn configuration
  * @return	The content that is displayed on the website
  */
 function main($content, $conf)
 {
     if (TYPO3_VERSION_INTEGER >= 7000000) {
         $this->ms = TYPO3\CMS\Core\Utility\GeneralUtility::milliseconds();
     } else {
         $this->ms = t3lib_div::milliseconds();
     }
     $this->conf = $conf;
     $this->pi_setPiVarDefaults();
     $this->pi_loadLL();
     $this->pi_USER_INT_obj = 1;
     // Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!
     // initializes plugin configuration
     $this->init();
     if ($this->conf['resultPage'] != $GLOBALS['TSFE']->id) {
         $content = '<div id="textmessage">' . $this->pi_getLL('error_resultPage') . '</div>';
         return $this->pi_wrapInBaseClass($content);
     }
     // init XAJAX?
     if ($this->conf['renderMethod'] != 'static') {
         if (TYPO3_VERSION_INTEGER < 6002000) {
             $xajaxIsLoaded = t3lib_extMgm::isLoaded('xajax');
         } else {
             $xajaxIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('xajax');
         }
         if (!$xajaxIsLoaded) {
             return;
         } else {
             $this->initXajax();
         }
     }
     // Spinner Image
     if ($this->conf['spinnerImageFile']) {
         $spinnerSrc = $this->conf['spinnerImageFile'];
     } else {
         if (TYPO3_VERSION_INTEGER < 6002000) {
             $spinnerSrc = t3lib_extMgm::siteRelPath($this->extKey) . 'res/img/spinner.gif';
         } else {
             $spinnerSrc = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'res/img/spinner.gif';
         }
     }
     $this->spinnerImageFilters = '<img id="kesearch_spinner_filters" src="' . $spinnerSrc . '" alt="' . $this->pi_getLL('loading') . '" />';
     $this->spinnerImageResults = '<img id="kesearch_spinner_results" src="' . $spinnerSrc . '" alt="' . $this->pi_getLL('loading') . '" />';
     // get javascript onclick actions
     $this->initOnclickActions();
     // hook for initials
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['initials'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['initials'] as $_classRef) {
             if (TYPO3_VERSION_INTEGER >= 7000000) {
                 $_procObj =& TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef);
             } else {
                 $_procObj =& t3lib_div::getUserObj($_classRef);
             }
             $_procObj->addInitials($this);
         }
     }
     $content = $this->cObj->getSubpart($this->templateCode, '###RESULT_LIST###');
     // hook: modifyResultList
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyResultList'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyResultList'] as $_classRef) {
             if (TYPO3_VERSION_INTEGER >= 7000000) {
                 $_procObj =& TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef);
             } else {
                 $_procObj =& t3lib_div::getUserObj($_classRef);
             }
             $_procObj->modifyResultList($content, $this);
         }
     }
     // show text instead of results if no searchparams set and activated in ff
     if ($this->isEmptySearch && $this->conf['showTextInsteadOfResults']) {
         // Don't replace the following with substituteMarker
         // this is used to be valid against JavaScript calls
         $content = '<div id="textmessage">' . $this->pi_RTEcssText($this->conf['textForResults']) . '</div>';
         $content .= '<div id="kesearch_results"></div>';
         $content .= '<div id="kesearch_updating_results"></div>';
         $content .= '<div id="kesearch_pagebrowser_top"></div>';
         $content .= '<div id="kesearch_pagebrowser_bottom"></div>';
         $content .= '<div id="kesearch_query_time"></div>';
         return $content;
     }
     if ($this->conf['renderMethod'] == 'ajax_after_reload') {
         $content = $this->cObj->substituteMarker($content, '###MESSAGE###', '');
         $content = $this->cObj->substituteMarker($content, '###QUERY_TIME###', '');
         $content = $this->cObj->substituteMarker($content, '###PAGEBROWSER_TOP###', '');
         $content = $this->cObj->substituteMarker($content, '###PAGEBROWSER_BOTTOM###', '');
         $content = $this->cObj->substituteMarker($content, '###NUMBER_OF_RESULTS###', '');
         $content = $this->cObj->substituteMarker($content, '###ORDERING###', '');
         $content = $this->cObj->substituteMarker($content, '###SPINNER###', '');
         $content = $this->cObj->substituteMarker($content, '###LOADING###', '');
         return $this->pi_wrapInBaseClass($content);
     }
     $content = $this->cObj->substituteMarker($content, '###MESSAGE###', $this->getSearchResults());
     $content = $this->cObj->substituteMarker($content, '###NUMBER_OF_RESULTS###', sprintf($this->pi_getLL('num_results'), $this->numberOfResults));
//.........这里部分代码省略.........
开发者ID:brainformatik,项目名称:ke_search,代码行数:101,代码来源:class.tx_kesearch_pi2.php


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