mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 04:10:38 +02:00
Support cpu-usage rendertime
This commit is contained in:
39
class2.php
39
class2.php
@@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
+ ----------------------------------------------------------------------------+
|
+ ----------------------------------------------------------------------------+
|
||||||
| e107 website system
|
| e107 website system
|
||||||
@@ -11,9 +11,9 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/class2.php,v $
|
| $Source: /cvs_backup/e107_0.8/class2.php,v $
|
||||||
| $Revision: 1.15 $
|
| $Revision: 1.16 $
|
||||||
| $Date: 2007-02-12 20:04:46 $
|
| $Date: 2007-03-04 21:47:15 $
|
||||||
| $Author: e107steved $
|
| $Author: mrpete $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
//
|
//
|
||||||
@@ -43,6 +43,7 @@
|
|||||||
// A: Honest global beginning point for processing time
|
// A: Honest global beginning point for processing time
|
||||||
//
|
//
|
||||||
$eTimingStart = microtime(); // preserve these when destroying globals in step C
|
$eTimingStart = microtime(); // preserve these when destroying globals in step C
|
||||||
|
if ( function_exists( 'getrusage' ) ) { $eTimingStartCPU = getrusage(); }
|
||||||
$oblev_before_start = ob_get_level();
|
$oblev_before_start = ob_get_level();
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -64,7 +65,7 @@ if(function_exists('ini_get')) {
|
|||||||
// Destroy! (if we need to)
|
// Destroy! (if we need to)
|
||||||
if($register_globals == true){
|
if($register_globals == true){
|
||||||
while (list($global) = each($GLOBALS)) {
|
while (list($global) = each($GLOBALS)) {
|
||||||
if (!preg_match('/^(_POST|_GET|_COOKIE|_SERVER|_FILES|GLOBALS|HTTP.*|_REQUEST|retrieve_prefs|eplug_admin|eTimingStart)|oblev_.*$/', $global)) {
|
if (!preg_match('/^(_POST|_GET|_COOKIE|_SERVER|_FILES|_SESSION|GLOBALS|HTTP.*|_REQUEST|retrieve_prefs|eplug_admin|eTimingStart.*|oblev_.*)$/', $global)) {
|
||||||
unset($$global);
|
unset($$global);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1017,24 +1018,24 @@ function save_prefs($table = 'core', $uid = USERID, $row_val = '')
|
|||||||
global $pref, $user_pref, $tp, $PrefCache, $sql, $eArrayStorage;
|
global $pref, $user_pref, $tp, $PrefCache, $sql, $eArrayStorage;
|
||||||
if ($table == 'core')
|
if ($table == 'core')
|
||||||
{
|
{
|
||||||
if ($row_val == '')
|
if ($row_val == '')
|
||||||
{ // Save old version as a backup first
|
{ // Save old version as a backup first
|
||||||
$sql->db_Select_gen("REPLACE INTO #core (e107_name,e107_value) values ('SitePrefs_Backup', '".addslashes($PrefCache)."') ");
|
$sql->db_Select_gen("REPLACE INTO #core (e107_name,e107_value) values ('SitePrefs_Backup', '".addslashes($PrefCache)."') ");
|
||||||
|
|
||||||
// Now save the updated values
|
// Now save the updated values
|
||||||
// traverse the pref array, with toDB on everything
|
// traverse the pref array, with toDB on everything
|
||||||
$_pref = $tp -> toDB($pref, true, true);
|
$_pref = $tp -> toDB($pref, true, true);
|
||||||
// Create the data to be stored
|
// Create the data to be stored
|
||||||
$sql->db_Select_gen("REPLACE INTO #core (e107_name,e107_value) values ('SitePrefs', '".$eArrayStorage->WriteArray($_pref)."') ");
|
$sql->db_Select_gen("REPLACE INTO #core (e107_name,e107_value) values ('SitePrefs', '".$eArrayStorage->WriteArray($_pref)."') ");
|
||||||
ecache::clear('SitePrefs');
|
ecache::clear('SitePrefs');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$_user_pref = $tp -> toDB($user_pref);
|
$_user_pref = $tp -> toDB($user_pref);
|
||||||
$tmp=addslashes(serialize($_user_pref));
|
$tmp=addslashes(serialize($_user_pref));
|
||||||
$sql->db_Update("user", "user_prefs='$tmp' WHERE user_id=".intval($uid));
|
$sql->db_Update("user", "user_prefs='$tmp' WHERE user_id=".intval($uid));
|
||||||
return $tmp;
|
return $tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user