Project

General

Profile

Feature #19513 » 9657v3.diff

Administrator Admin, 2009-09-02 13:12

View differences:

t3lib/class.t3lib_timetrack.php (Arbeitskopie)
*
* @return void
*/
function start() {
public function start() {
$this->wrapError = array(
0 => array('',''),
1 => array('<strong>','</strong>'),
......
* @return void
* @see tslib_cObj::cObjGetSingle(), pull()
*/
function push($tslabel, $value='') {
public function push($tslabel, $value = '') {
array_push($this->tsStack[$this->tsStackPointer], $tslabel);
array_push($this->currentHashPointer, 'timetracker_'.$this->uniqueCounter++);
......
* @return void
* @see tslib_cObj::cObjGetSingle(), push()
*/
function pull($content='') {
public function pull($content = '') {
$k = end($this->currentHashPointer);
$this->tsStackLog[$k]['endtime'] = microtime(true);
$this->tsStackLog[$k]['content'] = $content;
......
* @return void
* @see tslib_cObj::CONTENT()
*/
function setTSlogMessage($content,$num=0) {
public function setTSlogMessage($content, $num = 0) {
end($this->currentHashPointer);
$k = current($this->currentHashPointer);
......
* @param string Message/Label to attach
* @return void
*/
function setTSselectQuery(array $data,$msg='') {
public function setTSselectQuery(array $data, $msg = '') {
end($this->currentHashPointer);
$k = current($this->currentHashPointer);
......
* @return void
* @see decStackPointer(), TSpagegen::renderContent(), tslib_cObj::cObjGetSingle()
*/
function incStackPointer() {
public function incStackPointer() {
$this->tsStackPointer++;
$this->tsStack[$this->tsStackPointer]=array();
}
......
* @return void
* @see incStackPointer(), TSpagegen::renderContent(), tslib_cObj::cObjGetSingle()
*/
function decStackPointer() {
public function decStackPointer() {
unset($this->tsStack[$this->tsStackPointer]);
$this->tsStackPointer--;
}
......
* @return integer
* @deprecated since TYPO3 4.3 - use getDifferenceToStarttime() instead
*/
function mtime() {
protected function mtime() {
return $this->getDifferenceToStarttime();
}
......
* @return integer
* @deprecated since TYPO3 4.3 - use getMilliseconds() instead that expects microtime as float instead of a string
*/
function convertMicrotime($microtime) {
public function convertMicrotime($microtime) {
t3lib_div::logDeprecatedFunction();
$parts = explode(' ',$microtime);
......
* @return string HTML table with the information about parsing times.
* @see t3lib_tsfeBeUserAuth::extGetCategory_tsdebug()
*/
function printTSlog() {
public function printTSlog() {
// Calculate times and keys for the tsStackLog
foreach ($this->tsStackLog as $uniqueId => &$data) {
$data['endtime'] = $this->getDifferenceToStarttime($data['endtime']);
......
* @param string Seems to be the previous tsStackLog key
* @return string Returns the $content string generated/modified. Also the $arr array is modified!
*/
function fixContent(&$arr, $content, $depthData='', $first=0, $vKey='') {
protected function fixContent(&$arr, $content, $depthData = '', $first = 0, $vKey = '') {
$ac=0;
$c=0;
// First, find number of entries
......
* @param string Command: If "FILE" then $this->printConf['contentLength_FILE'] is used for content length comparison, otherwise $this->printConf['contentLength']
* @return string
*/
function fixCLen($c,$v) {
protected function fixCLen($c, $v) {
$len = $v=='FILE'?$this->printConf['contentLength_FILE']:$this->printConf['contentLength'];
if (strlen($c)>$len) {
$c = '<span style="color:green;">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($c,$len)).'</span>';
......
* @param string The string to be wrapped
* @return string
*/
function fw($str) {
protected function fw($str) {
return '<span style="font-family:Verdana,Arial,Helvetica,sans-serif; font-size:10px; color:black; vertical-align:top;">'.$str.'&nbsp;</span>';
}
......
* @access private
* @see printTSlog()
*/
function createHierarchyArray(&$arr,$pointer,$uniqueId) {
protected function createHierarchyArray(&$arr, $pointer, $uniqueId) {
if (!is_array($arr)) {
$arr = array();
}
......
* @param string URL for the <base> tag (if you want it)
* @return string
*/
function debug_typo3PrintError($header,$text,$js,$baseUrl='') {
public function debug_typo3PrintError($header, $text, $js, $baseUrl = '') {
if ($js) {
$errorMessage = 'alert(\'' . t3lib_div::slashJS($header . '\n' . $text) . '\');';
} else {
......
// XCLASSing is not possible for this class
?>
?>
t3lib/class.t3lib_timetracknull.php (Revision 0)
<?php
/***************************************************************
* Copyright notice
*
* (c) 2008 Ingo Renner <ingo@typo3.org>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* A fake time tracker that does nothing but providing the methods of the real time tracker.
* This is done to save some performance over the real time tracker.
*
* @author Ingo Renner <ingo@typo3.org>
* @package TYPO3
* @subpackage t3lib
*/
class t3lib_TimeTrackNull {
/**
* "Constructor"
* Sets the starting time
*
* does nothing
*
* @return void
*/
public function start() {}
/**
* Pushes an element to the TypoScript tracking array
*
* does nothing
*
* @param string Label string for the entry, eg. TypoScript property name
* @param string Additional value(?)
* @return void
*/
public function push($tslabel, $value = '') {}
/**
* Pulls an element from the TypoScript tracking array
*
* does nothing
*
* @param string The content string generated within the push/pull part.
* @return void
*/
public function pull($content = '') {}
/**
* Set TSselectQuery - for messages in TypoScript debugger.
*
* does nothing
*
* @param array Query array
* @param string Message/Label to attach
* @return void
*/
public function setTSselectQuery(array $data, $msg = '') {}
/**
* Logs the TypoScript entry
*
* does nothing
*
* @param string The message string
* @param integer Message type: 0: information, 1: message, 2: warning, 3: error
* @return void
*/
public function setTSlogMessage($content, $num = 0) {}
/**
* Print TypoScript parsing log
*
* does nothing
*
* @return string HTML table with the information about parsing times.
*/
public function printTSlog() {}
/**
* Increases the stack pointer
*
* does nothing
*
* @return void
*/
public function incStackPointer() {}
/**
* Decreases the stack pointer
*
* does nothing
*
* @return void
*/
public function decStackPointer() {}
/**
* Returns microtime input to milliseconds
*
* does nothing
*
* @param string PHP microtime string
* @return integer
*/
public function convertMicrotime($microtime) {}
/**
* Gets a microtime value as milliseconds value.
*
* @param float $microtime: The microtime value - if not set the current time is used
* @return integer The microtime value as milliseconds value
*/
public function getMilliseconds($microtime = NULL) {}
}
// XCLASSing is not possible for this class
?>
typo3/sysext/cms/tslib/index_ts.php (Arbeitskopie)
// *********************
// Timetracking started
// *********************
require_once(PATH_t3lib.'class.t3lib_timetrack.php');
$TT = new t3lib_timeTrack;
if ($_COOKIE['be_typo_user']) {
require_once(PATH_t3lib.'class.t3lib_timetrack.php');
$TT = new t3lib_timeTrack;
} else {
require_once(PATH_t3lib.'class.t3lib_timetracknull.php');
$TT = new t3lib_timeTrackNull;
}
$TT->start();
$TT->push('','Script start');
(4-4/4)