[pLog-svn] r3886 - in plog/trunk: class/action class/cache
class/cache/Cache_Lite class/dao class/database class/locale
class/security class/summary/dao class/template
class/view/admin config
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Tue Aug 15 21:05:12 GMT 2006
Author: oscar
Date: 2006-08-15 21:05:12 +0000 (Tue, 15 Aug 2006)
New Revision: 3886
Modified:
plog/trunk/class/action/viewarticleaction.class.php
plog/trunk/class/cache/Cache_Lite/Lite.php
plog/trunk/class/cache/cache.class.php
plog/trunk/class/dao/articlenotifications.class.php
plog/trunk/class/dao/model.class.php
plog/trunk/class/database/db.class.php
plog/trunk/class/locale/locale.class.php
plog/trunk/class/security/bayesianfilter.class.php
plog/trunk/class/summary/dao/summarystats.class.php
plog/trunk/class/template/cachecontrol.class.php
plog/trunk/class/view/admin/adminsiteblogslistview.class.php
plog/trunk/config/logging.properties.php
Log:
removed all of the unnecessary logging code
Modified: plog/trunk/class/action/viewarticleaction.class.php
===================================================================
--- plog/trunk/class/action/viewarticleaction.class.php 2006-08-15 20:42:10 UTC (rev 3885)
+++ plog/trunk/class/action/viewarticleaction.class.php 2006-08-15 21:05:12 UTC (rev 3886)
@@ -128,7 +128,7 @@
}
function perform()
- {
+ {
include_once( PLOG_CLASS_PATH."class/view/viewarticleview.class.php" );
include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
@@ -155,7 +155,7 @@
}
return true;
- }
+ }
include_once( PLOG_CLASS_PATH."class/dao/articlecategories.class.php" );
@@ -179,6 +179,7 @@
// if there was a user, use his/her id
$this->_userId = $user->getId();
}
+
// ...and categories...
if( $this->_categoryName ) {
$categories = new ArticleCategories();
Modified: plog/trunk/class/cache/Cache_Lite/Lite.php
===================================================================
--- plog/trunk/class/cache/Cache_Lite/Lite.php 2006-08-15 20:42:10 UTC (rev 3885)
+++ plog/trunk/class/cache/Cache_Lite/Lite.php 2006-08-15 21:05:12 UTC (rev 3886)
@@ -522,7 +522,7 @@
function _unlink($file)
{
if (file_exists($file) && !@unlink($file)) {
- $this->log->log('Unable to remove cache !', LOGGER_PRIO_ERROR );
+ $this->log->error('Unable to remove cache !', LOGGER_PRIO_ERROR );
return false;
} else {
return true;
@@ -558,7 +558,7 @@
}
}
if (!($dh = opendir($dir))) {
- $this->log->log('Unable to open cache directory!', LOGGER_PRIO_ERROR );
+ $this->log->error('Unable to open cache directory!', LOGGER_PRIO_ERROR );
return false;
}
$result = true;
@@ -687,7 +687,7 @@
}
return $data;
}
- $this->log->log( 'Unable to read cache !', LOGGER_PRIO_ERROR );
+ $this->log->error( 'Unable to read cache !', LOGGER_PRIO_ERROR );
return false;
}
@@ -721,7 +721,7 @@
@fclose($fp);
return true;
}
- $this->log->log('Unable to write cache file : '.$this->_file, LOGGER_PRIO_ERROR );
+ $this->log->error('Unable to write cache file : '.$this->_file, LOGGER_PRIO_ERROR );
return false;
}
@@ -757,7 +757,7 @@
case 'strlen':
return sprintf('% 32d', strlen($data));
default:
- $this->log->log('Unknown cache controlType! Caching will be disabled
+ $this->log->error('Unknown cache controlType! Caching will be disabled
(available values are only \'md5\', \'crc32\', \'strlen\')',
LOGGER_PRIO_ERROR );
return false;
Modified: plog/trunk/class/cache/cache.class.php
===================================================================
--- plog/trunk/class/cache/cache.class.php 2006-08-15 20:42:10 UTC (rev 3885)
+++ plog/trunk/class/cache/cache.class.php 2006-08-15 21:05:12 UTC (rev 3886)
@@ -8,8 +8,6 @@
* the global.
*/
- include_once( PLOG_CLASS_PATH . "class/object/loggable.class.php" );
-
$__cache_hits = 0;
$__cache_misses = 0;
$__cache_queries = 0;
@@ -27,7 +25,7 @@
* @see CacheManager
* @see Cache_Lite
*/
- class Cache extends Loggable
+ class Cache
{
var $cache;
@@ -41,7 +39,6 @@
function Cache( $cacheProperties )
{
require_once( PLOG_CLASS_PATH . "class/cache/Cache_Lite/Lite.php" );
- $this->Loggable();
$this->cache = new Cache_Lite( $cacheProperties );
}
@@ -60,8 +57,6 @@
function setData( $id, $group, $data )
{
if( $this->_cacheCategoryEnabled($group) ) {
- $this->log->debug("Caching $id ($group):" . $data , LOGGER_PRIO_INFO );
-
return $this->cache->save( $data, $id, "$group" );
} else
return true;
@@ -82,7 +77,6 @@
function setMultipleData( $id, $group, $data )
{
if( $this->_cacheCategoryEnabled($group) ) {
- $this->log->debug("Multiple Caching $id ($group):" . $data , LOGGER_PRIO_INFO );
$currentData = $this->getData( $id, $group );
if( !$currentData ) $currentData = Array();
@@ -122,11 +116,9 @@
$data = $this->cache->get( $id, $group );
if ($data) {
- $this->log->debug("Cache hit for $id ($group): $data", LOGGER_PRIO_INFO );
$__cache_hits++;
}
else {
- $this->log->debug("Cache miss for $id ($group)", LOGGER_PRIO_WARN );
$__cache_misses++;
}
@@ -147,8 +139,6 @@
function removeData( $id, $group )
{
if( $this->_cacheCategoryEnabled($group) ) {
- $this->log->debug("Removing from cache $id ($group)", LOGGER_PRIO_WARN );
-
return $this->cache->remove( $id, $group );
} else
return true;
@@ -163,8 +153,6 @@
function clearCacheByGroup( $group )
{
if( $this->_cacheCategoryEnabled($group) ) {
- $this->log->debug("Removing cache group: $group", LOGGER_PRIO_WARN );
-
return $this->cache->clean( $group );
} else
return true;
@@ -177,8 +165,6 @@
*/
function clearCache()
{
- $this->log->debug("Cleaning the cache", LOGGER_PRIO_WARN );
-
return $this->cache->clean();
}
@@ -217,7 +203,6 @@
function _cacheCategoryEnabled( $category )
{
if( in_array($category, $this->_disabledCacheCategories) ) {
- $this->log->debug("Caching category $group disabled", LOGGER_PRIO_INFO );
return false;
} else
return true;
Modified: plog/trunk/class/dao/articlenotifications.class.php
===================================================================
--- plog/trunk/class/dao/articlenotifications.class.php 2006-08-15 20:42:10 UTC (rev 3885)
+++ plog/trunk/class/dao/articlenotifications.class.php 2006-08-15 21:05:12 UTC (rev 3886)
@@ -82,9 +82,7 @@
{
include_once( PLOG_CLASS_PATH."class/mail/emailservice.class.php" );
include_once( PLOG_CLASS_PATH."class/mail/emailmessage.class.php" );
-
-
- // $this->log->info( "sending notification to ".$userInfo->getEmail());
+
$message = new EmailMessage();
$message->setFrom( $this->_config->getValue( "post_notification_source_address" ));
$message->addTo( $userInfo->getEmail());
Modified: plog/trunk/class/dao/model.class.php
===================================================================
--- plog/trunk/class/dao/model.class.php 2006-08-15 20:42:10 UTC (rev 3885)
+++ plog/trunk/class/dao/model.class.php 2006-08-15 21:05:12 UTC (rev 3886)
@@ -124,9 +124,6 @@
$page = DEFAULT_PAGING_ENABLED,
$itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
{
- $this->log->debug("Executing SQL Query: $query",
- LOGGER_PRIO_INFO);
-
// initialize the db when we have to execute the first query,
// not earlier.
$this->_initializeDb();
@@ -184,7 +181,6 @@
$dbObject = $this->_cache->getData( $value, $cacheId );
if( !$dbObject ) {
- $this->log->debug("get: $field:$value - cache = $cacheId" );
$query = "SELECT * FROM ".$this->table." WHERE {$field} = '".Db::qstr( $value )."'";
$result = $this->Execute( $query );
@@ -228,7 +224,6 @@
$where = "";
foreach( $conds as $cond ) {
- $this->log->debug( "Processing condition = ".$cond );
if( $cond ) {
// only if the condition is not empty...
@@ -300,7 +295,6 @@
$dbObjects = null;
if( !$dbObjects ) {
- $this->log->debug("getMany: $key:$value - cache = $cacheId -- cache miss!");
$query = "SELECT * FROM ".$this->table;
$where = "";
// if $value is 'all' or null, then we are going to cache the whole thing so let's not
Modified: plog/trunk/class/database/db.class.php
===================================================================
--- plog/trunk/class/database/db.class.php 2006-08-15 20:42:10 UTC (rev 3885)
+++ plog/trunk/class/database/db.class.php 2006-08-15 21:05:12 UTC (rev 3886)
@@ -180,8 +180,6 @@
$limit,
$whereGlue );
- $this->log->debug("SQL Query build: $query", LOGGER_PRIO_INFO );
-
return $query;
}
Modified: plog/trunk/class/locale/locale.class.php
===================================================================
--- plog/trunk/class/locale/locale.class.php 2006-08-15 20:42:10 UTC (rev 3885)
+++ plog/trunk/class/locale/locale.class.php 2006-08-15 21:05:12 UTC (rev 3886)
@@ -131,9 +131,6 @@
$this->_messages = $messages;
unset($messages);
-
- /*if( function_exists('memory_get_usage'))
- $this->log->debug('Memory used after loading locale ' . $this->_code . ': ' . memory_get_usage());*/
}
/**
@@ -158,8 +155,6 @@
unset( $this->_messages );
$this->_messages = NULL;
- /*if( function_exists('memory_get_usage'))
- $this->log->debug('Freeing memory for locate ' . $this->_code . ': ' . memory_get_usage());*/
return( true );
}
Modified: plog/trunk/class/security/bayesianfilter.class.php
===================================================================
--- plog/trunk/class/security/bayesianfilter.class.php 2006-08-15 20:42:10 UTC (rev 3885)
+++ plog/trunk/class/security/bayesianfilter.class.php 2006-08-15 21:05:12 UTC (rev 3886)
@@ -115,7 +115,6 @@
// mark it as a trackback instead of a user comment...
if( $isTrackback ) {
-// $this->log->debug("saving the trackback but saving it as spam...");
$comment->setType( COMMENT_TYPE_TRACKBACK );
}
Modified: plog/trunk/class/summary/dao/summarystats.class.php
===================================================================
--- plog/trunk/class/summary/dao/summarystats.class.php 2006-08-15 20:42:10 UTC (rev 3885)
+++ plog/trunk/class/summary/dao/summarystats.class.php 2006-08-15 21:05:12 UTC (rev 3886)
@@ -66,8 +66,6 @@
ORDER BY a.num_nonspam_comments DESC
LIMIT 0, $max";
- $this->log->debug("SummaryStats::getMostCommentedArticles query = ".$query);
-
$result = $this->Execute( $query );
if( !$result ){
@@ -112,8 +110,6 @@
$query .= " LIMIT 0,".$maxPosts;
else
$query .= " LIMIT 0,".$this->_summaryPageShowMax;
-
- $this->log->debug("SummaryStats::getMostReadArticles query = ".$query);
$result = $this->Execute( $query );
@@ -152,8 +148,6 @@
$query .= " LIMIT 0,".$maxBlogs;
else
$query .= " LIMIT 0,".$this->_summaryPageShowMax;
-
- $this->log->debug("SummaryStats::getRecentBlogs query = ".$query);
$result = $this->Execute( $query );
@@ -199,8 +193,6 @@
$query .= " LIMIT 0,".$maxBlogs;
else
$query .= " LIMIT 0,".$this->_summaryPageShowMax;
-
- $this->log->debug("SummaryStats::getMostActiveBlogs query = ".$query);
$result = $this->Execute( $query );
@@ -257,8 +249,6 @@
if( $maxPosts <= 0 )
$maxPosts = $this->_summaryPageShowMax;
$query .= " LIMIT 0,".$maxPosts;
-
- $this->log->debug("SummaryStats::getRecentArticles query = ".$query);
$result = $this->Execute( $query );
Modified: plog/trunk/class/template/cachecontrol.class.php
===================================================================
--- plog/trunk/class/template/cachecontrol.class.php 2006-08-15 20:42:10 UTC (rev 3885)
+++ plog/trunk/class/template/cachecontrol.class.php 2006-08-15 21:05:12 UTC (rev 3886)
@@ -1,6 +1,4 @@
<?php
-
- include_once( PLOG_CLASS_PATH."class/object/loggable.class.php" );
/**
* \ingroup Template
@@ -9,7 +7,7 @@
* whenever you need to clear the contents of the whole site, the summary or just a single
* blog.
*/
- class CacheControl extends Loggable
+ class CacheControl
{
/**
Modified: plog/trunk/class/view/admin/adminsiteblogslistview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminsiteblogslistview.class.php 2006-08-15 20:42:10 UTC (rev 3885)
+++ plog/trunk/class/view/admin/adminsiteblogslistview.class.php 2006-08-15 21:05:12 UTC (rev 3886)
@@ -57,6 +57,7 @@
$this->_searchTerms = HttpVars::getRequestValue( "searchTerms" );
$blogs = new Blogs();
$siteBlogs = $blogs->getAllBlogs( $this->_status, ALL_BLOG_CATEGORIES, $this->_searchTerms, $this->_page, DEFAULT_ITEMS_PER_PAGE );
+ print("search terms = ".$this->_searchTerms);
$numBlogs = $blogs->getNumBlogs( $this->_status, ALL_BLOG_CATEGORIES, $this->_searchTerms );
if( !$siteBlogs ) {
$siteBlogs = Array();
Modified: plog/trunk/config/logging.properties.php
===================================================================
--- plog/trunk/config/logging.properties.php 2006-08-15 20:42:10 UTC (rev 3885)
+++ plog/trunk/config/logging.properties.php 2006-08-15 21:05:12 UTC (rev 3886)
@@ -6,7 +6,7 @@
#
$config["default"] = Array(
"layout" => "%d %N - [%f:%l (%c:%F)] %m%n",
- "appender" => "null",
+ "appender" => "file",
"file" => "tmp/lifetype.log",
"prio" => "debug"
);
More information about the pLog-svn
mailing list