[Phpfreechat-svn] SF.net SVN: phpfreechat: [1194] trunk/src
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2007-09-26 06:03:43
|
Revision: 1194 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1194&view=rev Author: kerphi Date: 2007-09-25 23:03:43 -0700 (Tue, 25 Sep 2007) Log Message: ----------- Code cleanup around 'debug' parameter (thanks to sappheiros) Modified Paths: -------------- trunk/src/commands/send.class.php trunk/src/containers/file.class.php trunk/src/containers/mysql.class.php trunk/src/phpfreechat.class.php Modified: trunk/src/commands/send.class.php =================================================================== --- trunk/src/commands/send.class.php 2007-09-22 17:32:00 UTC (rev 1193) +++ trunk/src/commands/send.class.php 2007-09-26 06:03:43 UTC (rev 1194) @@ -74,7 +74,6 @@ $cmd->run($xml_reponse, $cmdp); return; } - if ($c->debug) pxlog("/send ".$text." (a user just sent a message -> nick=".$nick.")", "chat", $c->getId()); // a message has been posted so : // - clear errors Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2007-09-22 17:32:00 UTC (rev 1193) +++ trunk/src/containers/file.class.php 2007-09-26 06:03:43 UTC (rev 1194) @@ -71,9 +71,6 @@ { $c =& pfcGlobalConfig::Instance(); - if ($c->debug) - file_put_contents("/tmp/debug", "\nsetMeta(".$group.",".$subgroup.",".$leaf.",".$leafvalue.")", FILE_APPEND | LOCK_EX); - // create directories $dir_base = $c->container_cfg_server_dir; $dir = $dir_base.'/'.$group.'/'.$subgroup; @@ -104,8 +101,6 @@ function getMeta($group, $subgroup = null, $leaf = null, $withleafvalue = false) { $c =& pfcGlobalConfig::Instance(); - if ($c->debug) - file_put_contents("/tmp/debug", "\ngetMeta(".$group.",".$subgroup.",".$leaf.",".$withleafvalue.")", FILE_APPEND | LOCK_EX); // read data from metadata file $ret = array(); @@ -164,8 +159,6 @@ function incMeta($group, $subgroup, $leaf) { $c =& pfcGlobalConfig::Instance(); - if ($c->debug) - file_put_contents("/tmp/debug", "\nincMeta(".$group.",".$subgroup.",".$leaf.")", FILE_APPEND | LOCK_EX); // create directories $dir_base = $c->container_cfg_server_dir; @@ -219,8 +212,6 @@ function rmMeta($group, $subgroup = null, $leaf = null) { $c =& pfcGlobalConfig::Instance(); - if ($c->debug) - file_put_contents("/tmp/debug", "\nrmMeta(".$group.",".$subgroup.",".$leaf.")", FILE_APPEND | LOCK_EX); $dir = $c->container_cfg_server_dir; Modified: trunk/src/containers/mysql.class.php =================================================================== --- trunk/src/containers/mysql.class.php 2007-09-22 17:32:00 UTC (rev 1193) +++ trunk/src/containers/mysql.class.php 2007-09-26 06:03:43 UTC (rev 1194) @@ -157,9 +157,6 @@ { $c =& pfcGlobalConfig::Instance(); - if ($c->debug) - file_put_contents("/tmp/debug.txt", "\nsetMeta(".$group.",".$subgroup.",".$leaf.",".$leafvalue.")", FILE_APPEND | LOCK_EX); - $server = $c->serverid; $db = $this->_connect(); @@ -173,9 +170,6 @@ $row = mysql_fetch_array($res, MYSQL_ASSOC); if( $row['C'] == 0 ) { - if ($c->debug) - file_put_contents("/tmp/debug.txt", "\nsetSQL(".$sql_insert.")", FILE_APPEND | LOCK_EX); - mysql_query($sql_insert, $db); return 0; // value created } @@ -183,9 +177,6 @@ { if ($sql_update != "") { - if ($c->debug) - file_put_contents("/tmp/debug.txt", "\nsetSQL(".$sql_update.")", FILE_APPEND | LOCK_EX); - mysql_query($sql_update, $db); } return 1; // value overwritten @@ -197,9 +188,6 @@ { $c =& pfcGlobalConfig::Instance(); - if ($c->debug) - file_put_contents("/tmp/debug.txt", "\ngetMeta(".$group.",".$subgroup.",".$leaf.",".$withleafvalue.")", FILE_APPEND | LOCK_EX); - $ret = array(); $ret["timestamp"] = array(); $ret["value"] = array(); @@ -233,10 +221,6 @@ } $sql_select="SELECT `$value`, `timestamp` FROM ".$c->container_cfg_mysql_table." WHERE `server`='$server' $sql_where $sql_group_by ORDER BY timestamp"; - - if ($c->debug) - file_put_contents("/tmp/debug.txt", "\ngetSQL(".$sql_select.")", FILE_APPEND | LOCK_EX); - if ($sql_select != "") { $thisresult = mysql_query($sql_select, $db); @@ -268,9 +252,6 @@ { $c =& pfcGlobalConfig::Instance(); - if ($c->debug) - file_put_contents("/tmp/debug.txt", "\nsetMeta(".$group.",".$subgroup.",".$leaf.",".$leafvalue.")", FILE_APPEND | LOCK_EX); - $server = $c->serverid; $db = $this->_connect(); $time = time(); @@ -281,16 +262,12 @@ $row = mysql_fetch_array($res, MYSQL_ASSOC); if( $row['C'] == 0 ) { - if ($c->debug) - file_put_contents("/tmp/debug.txt", "\nsetSQL(".$sql_insert.")", FILE_APPEND | LOCK_EX); $leafvalue = 1; $sql_insert="REPLACE INTO ".$c->container_cfg_mysql_table." (`server`, `group`, `subgroup`, `leaf`, `leafvalue`, `timestamp`) VALUES('$server', '$group', '$subgroup', '$leaf', '".$leafvalue."', '".$time."')"; mysql_query($sql_insert, $db); } else { - if ($c->debug) - file_put_contents("/tmp/debug.txt", "\nsetSQL(".$sql_update.")", FILE_APPEND | LOCK_EX); $sql_update="UPDATE ".$c->container_cfg_mysql_table." SET `leafvalue`= LAST_INSERT_ID( leafvalue + 1 ), `timestamp`='".$time."' WHERE `server`='$server' AND `group`='$group' AND `subgroup`='$subgroup' AND `leaf`='$leaf'"; mysql_query($sql_update, $db); $res = mysql_query('SELECT LAST_INSERT_ID();', $db); @@ -308,8 +285,6 @@ function rmMeta($group, $subgroup = null, $leaf = null) { $c =& pfcGlobalConfig::Instance(); - if ($c->debug) - file_put_contents("/tmp/debug.txt", "\nrmMeta(".$group.",".$subgroup.",".$leaf.")", FILE_APPEND | LOCK_EX); $server = $c->serverid; $db = $this->_connect(); @@ -325,9 +300,6 @@ if ($leaf != NULL) $sql_delete .= " AND `leaf`='$leaf'"; - if ($c->debug) - file_put_contents("/tmp/debug.txt", "\nrmSQL(".$sql_delete.")", FILE_APPEND | LOCK_EX); - mysql_query($sql_delete, $db); return true; } Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2007-09-22 17:32:00 UTC (rev 1193) +++ trunk/src/phpfreechat.class.php 2007-09-26 06:03:43 UTC (rev 1194) @@ -40,9 +40,6 @@ if (!is_array($params)) die('phpFreeChat parameters must be an array'); - if ( isset($params["debug"]) && $params["debug"] ) - require_once dirname(__FILE__)."/../debug/log.php"; - // initialize the global config object $c =& pfcGlobalConfig::Instance( $params ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |