[pLog-svn] r2986 - in plog/trunk/class: action cache
cache/Cache_Lite config controller dao data/forms data/pager
data/validator database file/finder logger/layout
logger/logger net object security template view
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Sun Feb 26 01:42:07 GMT 2006
Author: oscar
Date: 2006-02-26 01:42:07 +0000 (Sun, 26 Feb 2006)
New Revision: 2986
Modified:
plog/trunk/class/action/blogaction.class.php
plog/trunk/class/action/defaultaction.class.php
plog/trunk/class/action/viewarticleaction.class.php
plog/trunk/class/cache/Cache_Lite/Lite.php
plog/trunk/class/cache/bloginfomanager.class.php
plog/trunk/class/cache/cache.class.php
plog/trunk/class/cache/cachemanager.class.php
plog/trunk/class/config/configfilestorage.class.php
plog/trunk/class/controller/resourceclassloader.class.php
plog/trunk/class/dao/article.class.php
plog/trunk/class/dao/blogarticles.class.php
plog/trunk/class/dao/commentscommon.class.php
plog/trunk/class/dao/model.class.php
plog/trunk/class/data/forms/formvalidator.class.php
plog/trunk/class/data/pager/pager.class.php
plog/trunk/class/data/validator/validation.class.php
plog/trunk/class/data/validator/validationlist.class.php
plog/trunk/class/database/db.class.php
plog/trunk/class/file/finder/filefinder.class.php
plog/trunk/class/logger/layout/patternlayout.class.php
plog/trunk/class/logger/logger/loggedmessage.class.php
plog/trunk/class/logger/logger/logger.class.php
plog/trunk/class/net/linkparser.class.php
plog/trunk/class/object/loggable.class.php
plog/trunk/class/security/bayesianfilter.class.php
plog/trunk/class/security/pipelinerequest.class.php
plog/trunk/class/template/templatesandbox.class.php
plog/trunk/class/template/templateservice.class.php
plog/trunk/class/view/blogview.class.php
plog/trunk/class/view/resourceserverview.class.php
plog/trunk/class/view/smartyview.class.php
plog/trunk/class/view/viewarticleview.class.php
Log:
Removed a few references to object.class.php and reorganized some includes so that the total of files needed per request is lower (both in cached and non-cached situations)
Modified: plog/trunk/class/action/blogaction.class.php
===================================================================
--- plog/trunk/class/action/blogaction.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/action/blogaction.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -34,7 +34,6 @@
{
include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
include_once( PLOG_CLASS_PATH."class/security/pipeline.class.php" );
- include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
include_once( PLOG_CLASS_PATH."class/net/http/httpvars.class.php" );
$this->Action( $actionInfo, $request );
@@ -92,8 +91,6 @@
// get the "page" parameter from the request
$this->_page = $this->_getPage();
-
- $this->articles = new Articles();
}
/**
@@ -143,8 +140,6 @@
*/
function _getBlogInfo()
{
- include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
-
// see if we're using subdomains
$config =& Config::getConfig();
if( $config->getValue( "subdomains_enabled" )) {
@@ -199,12 +194,13 @@
// fetch the BlogInfo object
if( $blogId ) {
-
+ include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
$blogs = new Blogs();
$this->_blogInfo = $blogs->getBlogInfo( $blogId );
// $this->_blogInfo = $blogs->getBlogInfo( $blogId );
} else {
+ include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
$blogs = new Blogs();
$this->_blogInfo = $blogs->getBlogInfoByName( $blogName );
}
Modified: plog/trunk/class/action/defaultaction.class.php
===================================================================
--- plog/trunk/class/action/defaultaction.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/action/defaultaction.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -79,6 +79,7 @@
require_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
require_once( PLOG_CLASS_PATH."class/dao/articlecategories.class.php" );
require_once( PLOG_CLASS_PATH."class/data/pager/pager.class.php" );
+ require_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
// if we got a category name instead of a category id, then we
// should first look up this category in the database and see if
@@ -109,6 +110,10 @@
return false;
}
}
+ else {
+ // if only to avoid a warning...
+ $category = null;
+ }
}
// export the category object in case it is needed
@@ -145,6 +150,10 @@
// if everything went fine...
$this->_userId = $user->getId();
}
+ else {
+ // if only to avoid a warning...
+ $user = null;
+ }
if( ($blogSettings->getValue( 'show_future_posts_in_calendar')) && ( $this->_date > -1 )) {
// if posts in the future are to be shown, we shouldn't set a maximum date
@@ -157,7 +166,8 @@
// get the articles...
$this->_postAmount = $blogSettings->getValue( 'show_posts_max' );
- $blogArticles = $this->articles->getBlogArticles(
+ $articles = new Articles();
+ $blogArticles = $articles->getBlogArticles(
$blogId,
$this->_date,
$this->_postAmount,
@@ -168,7 +178,7 @@
$this->_searchTerms,
$this->_page );
// and the total number based on the conditions given
- $numArticles = $this->articles->getNumBlogArticles(
+ $numArticles = $articles->getNumBlogArticles(
$blogId,
$this->_date,
$this->_categoryId,
Modified: plog/trunk/class/action/viewarticleaction.class.php
===================================================================
--- plog/trunk/class/action/viewarticleaction.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/action/viewarticleaction.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -87,9 +87,9 @@
*/
function _updateArticleReferrersByTitle($slug)
{
- include_once( PLOG_CLASS_PATH."class/dao/referers.class.php" );
-
- $id = $this->articles->getBlogArticleByTitle( $slug, $this->_blogInfo->getId());
+ include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
+ $articles = new Articles();
+ $id = $articles->getBlogArticleByTitle( $slug, $this->_blogInfo->getId());
// if the article isn't found, we will save a referrer to
// the main page, since $id will be 0.
$this->_updateArticleReferrersById($id);
@@ -104,7 +104,8 @@
*/
function updateNumArticleReads( $articleId )
{
- $this->articles->updateArticleNumReads( $articleId );
+ $articles = new Articles();
+ $articles->updateArticleNumReads( $articleId );
return( true );
}
@@ -112,8 +113,7 @@
function perform()
{
include_once( PLOG_CLASS_PATH."class/view/viewarticleview.class.php" );
- include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
-
+ include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
$this->_view = new ViewArticleView( $this->_blogInfo,
Array( "articleId" => $this->_articleId,
@@ -126,12 +126,13 @@
if( $this->_view->isCached()) {
if( $this->_config->getValue( 'update_cached_article_reads', false )) {
+ $articles = new Articles();
if( $this->_articleId ){
- $this->articles->updateArticleNumReads( $this->_articleId );
+ $articles->updateArticleNumReads( $this->_articleId );
$this->_updateArticleReferrersById( $this->_articleId );
}
else{
- $this->articles->updateArticleNumReadsByName( $this->_articleName );
+ $articles->updateArticleNumReadsByName( $this->_articleName );
$this->_updateArticleReferrersByTitle($this->_articleName );
}
}
@@ -175,25 +176,25 @@
// fetch the article
// the article identifier can be either its internal id number or its mangled topic
- include_once( PLOG_CLASS_PATH."class/dao/article.class.php" );
+ $articles = new Articles();
if( $this->_articleId ) {
- $article = $this->articles->getBlogArticle( $this->_articleId,
- $this->_blogInfo->getId(),
- false,
- $this->_date,
- $this->_categoryId,
- $this->_userId,
- POST_STATUS_PUBLISHED,
- $this->_maxDate);
+ $article = $articles->getBlogArticle( $this->_articleId,
+ $this->_blogInfo->getId(),
+ false,
+ $this->_date,
+ $this->_categoryId,
+ $this->_userId,
+ POST_STATUS_PUBLISHED,
+ $this->_maxDate);
} else {
- $article = $this->articles->getBlogArticleByTitle( $this->_articleName,
- $this->_blogInfo->getId(),
- false,
- $this->_date,
- $this->_categoryId,
- $this->_userId,
- POST_STATUS_PUBLISHED,
- $this->_maxDate);
+ $article = $articles->getBlogArticleByTitle( $this->_articleName,
+ $this->_blogInfo->getId(),
+ false,
+ $this->_date,
+ $this->_categoryId,
+ $this->_userId,
+ POST_STATUS_PUBLISHED,
+ $this->_maxDate);
}
// if the article id doesn't exist, cancel the whole thing...
Modified: plog/trunk/class/cache/Cache_Lite/Lite.php
===================================================================
--- plog/trunk/class/cache/Cache_Lite/Lite.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/cache/Cache_Lite/Lite.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -23,8 +23,6 @@
* @author Fabien MARTY <fab at php.net>
*/
-require_once( PLOG_CLASS_PATH . 'class/object/object.class.php' );
-
define('CACHE_LITE_ERROR_RETURN', 1);
define('CACHE_LITE_ERROR_DIE', 8);
Modified: plog/trunk/class/cache/bloginfomanager.class.php
===================================================================
--- plog/trunk/class/cache/bloginfomanager.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/cache/bloginfomanager.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,7 +1,5 @@
<?php
- require_once( PLOG_CLASS_PATH . "class/object/object.class.php" );
-
class BlogInfoManager
{
Modified: plog/trunk/class/cache/cache.class.php
===================================================================
--- plog/trunk/class/cache/cache.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/cache/cache.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,7 +1,5 @@
<?php
- require_once( PLOG_CLASS_PATH . "class/object/object.class.php" );
- require_once( PLOG_CLASS_PATH . "class/template/templatesets/templateset.class.php" );
include_once( PLOG_CLASS_PATH . "class/object/loggable.class.php" );
/**
@@ -29,8 +27,7 @@
function setData( $id, $group, $data )
{
if( $this->_cacheCategoryEnabled($group) ) {
- if( DEBUG_ENABLED && DEBUG_CHANNELS & DEBUG_CHANNEL_CACHE )
- $this->debug->log("Caching $id ($group):" . $data , LOGGER_PRIO_INFO );
+ $this->log->debug("Caching $id ($group):" . $data , LOGGER_PRIO_INFO );
return $this->cache->save( $data, $id, "$group" );
} else
@@ -45,8 +42,7 @@
function setMultipleData( $id, $group, $data )
{
if( $this->_cacheCategoryEnabled($group) ) {
- if( DEBUG_ENABLED && DEBUG_CHANNELS & DEBUG_CHANNEL_CACHE )
- $this->debug->log("Multiple Caching $id ($group):" . $data , LOGGER_PRIO_INFO );
+ $this->log->debug("Multiple Caching $id ($group):" . $data , LOGGER_PRIO_INFO );
$currentData = $this->getData( $id, $group );
if( !$currentData ) $currentData = Array();
@@ -69,13 +65,12 @@
$data = $this->cache->get( $id, $group );
- if( DEBUG_ENABLED && DEBUG_CHANNELS & DEBUG_CHANNEL_CACHE )
if ($data) {
- $this->debug->log("Cache hit for $id ($group): $data", LOGGER_PRIO_INFO );
+ $this->log->debug("Cache hit for $id ($group): $data", LOGGER_PRIO_INFO );
$__cache_hits++;
}
else {
- $this->debug->log("Cache miss for $id ($group)", LOGGER_PRIO_WARN );
+ $this->log->debug("Cache miss for $id ($group)", LOGGER_PRIO_WARN );
$__cache_misses++;
}
@@ -89,8 +84,7 @@
function removeData( $id, $group )
{
if( $this->_cacheCategoryEnabled($group) ) {
- if( DEBUG_ENABLED && DEBUG_CHANNELS & DEBUG_CHANNEL_CACHE )
- $this->debug->log("Removing from cache $id ($group)", LOGGER_PRIO_WARN );
+ $this->log->debug("Removing from cache $id ($group)", LOGGER_PRIO_WARN );
return $this->cache->remove( $id, $group );
} else
@@ -100,8 +94,7 @@
function clearCacheByGroup( $group )
{
if( $this->_cacheCategoryEnabled($group) ) {
- if( DEBUG_ENABLED && DEBUG_CHANNELS & DEBUG_CHANNEL_CACHE )
- $this->debug->log("Removing cache group: $group", LOGGER_PRIO_WARN );
+ $this->log->debug("Removing cache group: $group", LOGGER_PRIO_WARN );
return $this->cache->clean( $group );
} else
@@ -110,8 +103,7 @@
function clearCache()
{
- if( DEBUG_ENABLED && DEBUG_CHANNELS & DEBUG_CHANNEL_CACHE )
- $this->debug->log("Cleaning the cache", LOGGER_PRIO_WARN );
+ $this->log->debug("Cleaning the cache", LOGGER_PRIO_WARN );
return $this->cache->clean();
}
@@ -131,8 +123,7 @@
function _cacheCategoryEnabled( $category )
{
if( in_array($category, $this->_disabledCacheCategories) ) {
- if( DEBUG_ENABLED && DEBUG_CHANNELS & DEBUG_CHANNEL_CACHE )
- $this->debug->log("Caching category $group disabled", LOGGER_PRIO_INFO );
+ $this->log->debug("Caching category $group disabled", LOGGER_PRIO_INFO );
return false;
} else
return true;
Modified: plog/trunk/class/cache/cachemanager.class.php
===================================================================
--- plog/trunk/class/cache/cachemanager.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/cache/cachemanager.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,6 +1,4 @@
<?php
-
- require_once( PLOG_CLASS_PATH . "class/object/object.class.php" );
// :TODO: implement a cache-lifetime per cache-category, so e.g. blogInfo or
// locales have a lifetime of several days, whereas articles, comments,
Modified: plog/trunk/class/config/configfilestorage.class.php
===================================================================
--- plog/trunk/class/config/configfilestorage.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/config/configfilestorage.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,7 +1,5 @@
<?php
- include_once( PLOG_CLASS_PATH."class/file/file.class.php" );
- include_once( PLOG_CLASS_PATH."class/config/properties.class.php" );
include_once( PLOG_CLASS_PATH."class/config/configabstractstorage.class.php" );
if (!defined("DEFAULT_CONFIG_FILE")) {
@@ -54,6 +52,8 @@
*/
function reload()
{
+ include_once( PLOG_CLASS_PATH."class/file/file.class.php" );
+ include_once( PLOG_CLASS_PATH."class/config/properties.class.php" );
if( File::isReadable( $this->_configFile )) {
include( $this->_configFile );
$this->_props = new Properties( $config );
@@ -104,6 +104,7 @@
$config["db_prefix"] = "";
?>';
+ include_once( PLOG_CLASS_PATH."class/file/file.class.php" );
$file = new File( $configFileName );
$writable = $file->open( 'w' );
if ($writable) {
@@ -190,6 +191,7 @@
function saveValue( $name, $value )
{
// open the config file
+ include_once( PLOG_CLASS_PATH."class/file/file.class.php" );
$f = new File( $this->_configFile );
// there was a problem opening the file
Modified: plog/trunk/class/controller/resourceclassloader.class.php
===================================================================
--- plog/trunk/class/controller/resourceclassloader.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/controller/resourceclassloader.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,7 +1,5 @@
<?php
- include_once( PLOG_CLASS_PATH.'class/object/object.class.php' );
-
/**
* \ingroup Controller
*
Modified: plog/trunk/class/dao/article.class.php
===================================================================
--- plog/trunk/class/dao/article.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/dao/article.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,8 +1,5 @@
<?php
- include_once( PLOG_CLASS_PATH.'class/dao/articles.class.php' );
- include_once( PLOG_CLASS_PATH.'class/object/object.class.php' );
- include_once( PLOG_CLASS_PATH.'class/dao/userinfo.class.php' );
include_once( PLOG_CLASS_PATH.'class/dao/articlestatus.class.php' );
include_once( PLOG_CLASS_PATH.'class/dao/articlecommentstatus.class.php' );
@@ -376,6 +373,7 @@
{
// load the user if it hasn't been loaded yet
if( is_null($this->_userInfo) ) {
+ include_once( PLOG_CLASS_PATH.'class/dao/users.class.php' );
$users = new Users();
$this->setUserInfo( $users->getUserInfoFromId( $this->getUser()));
}
@@ -932,6 +930,7 @@
function getPrevArticle()
{
if( !isset($this->_prevArticle )) {
+ include_once( PLOG_CLASS_PATH.'class/dao/articles.class.php' );
$articles = new Articles();
$this->_prevArticle = $articles->getBlogPrevArticle( $this );
}
@@ -947,6 +946,7 @@
function getNextArticle()
{
if( !isset($this->_nextArticle )) {
+ include_once( PLOG_CLASS_PATH.'class/dao/articles.class.php' );
$articles = new Articles();
$this->_nextArticle = $articles->getBlogNextArticle( $this );
}
Modified: plog/trunk/class/dao/blogarticles.class.php
===================================================================
--- plog/trunk/class/dao/blogarticles.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/dao/blogarticles.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,5 +1,4 @@
<?php
- require_once( PLOG_CLASS_PATH."class/object/object.class.php" );
/**
* \ingroup DAO
Modified: plog/trunk/class/dao/commentscommon.class.php
===================================================================
--- plog/trunk/class/dao/commentscommon.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/dao/commentscommon.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -479,7 +479,7 @@
{
include_once( PLOG_CLASS_PATH."class/dao/searchengine.class.php" );
- $query = SearchEngine::_adaptSearchString($searchTerms);
+ $query = SearchEngine::adaptSearchString($searchTerms);
// MARKWU: I also need to take care when there are multiplu search term
Modified: plog/trunk/class/dao/model.class.php
===================================================================
--- plog/trunk/class/dao/model.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/dao/model.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -120,8 +120,7 @@
$page = DEFAULT_PAGING_ENABLED,
$itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
{
- if( DEBUG_ENABLED && DEBUG_CHANNELS & DEBUG_CHANNEL_SQL )
- $this->debug->log("Executing SQL Query: $query",
+ $this->log->debug("Executing SQL Query: $query",
LOGGER_PRIO_INFO);
// initialize the db when we have to execute the first query,
Modified: plog/trunk/class/data/forms/formvalidator.class.php
===================================================================
--- plog/trunk/class/data/forms/formvalidator.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/data/forms/formvalidator.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -5,10 +5,7 @@
*
* The Form class helps in data validation.
*/
-
- include_once( PLOG_CLASS_PATH."class/data/validator/emptyvalidator.class.php" );
-
/**
* \ingroup Forms
*
@@ -125,6 +122,7 @@
*/
function registerField( $fieldName )
{
+ include_once( PLOG_CLASS_PATH."class/data/validator/emptyvalidator.class.php" );
$this->registerFieldValidator( $fieldName, new EmptyValidator());
return true;
Modified: plog/trunk/class/data/pager/pager.class.php
===================================================================
--- plog/trunk/class/data/pager/pager.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/data/pager/pager.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,7 +1,5 @@
<?php
- include_once( PLOG_CLASS_PATH."class/object/object.class.php");
-
define("DEFAULT_PAGER_REGS_FOR_PAGE", 25);
define("DEFAULT_PAGER_MAX_PAGES", 1);
Modified: plog/trunk/class/data/validator/validation.class.php
===================================================================
--- plog/trunk/class/data/validator/validation.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/data/validator/validation.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,7 +1,5 @@
<?php
- include_once( PLOG_CLASS_PATH."class/object/object.class.php");
-
/**
* \ingroup Validator
*
Modified: plog/trunk/class/data/validator/validationlist.class.php
===================================================================
--- plog/trunk/class/data/validator/validationlist.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/data/validator/validationlist.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,7 +1,5 @@
<?php
- include_once( PLOG_CLASS_PATH."class/object/object.class.php");
-
define(ERROR_RULE_IS_EMPTY, "error_rule_is_empty");
/**
Modified: plog/trunk/class/database/db.class.php
===================================================================
--- plog/trunk/class/database/db.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/database/db.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -136,8 +136,7 @@
$limit,
$whereGlue );
- if( DEBUG_ENABLED && DEBUG_CHANNELS & DEBUG_CHANNEL_SQL )
- $this->debug->log("SQL Query build: $query", LOGGER_PRIO_INFO );
+ $this->log->debug("SQL Query build: $query", LOGGER_PRIO_INFO );
return $query;
}
Modified: plog/trunk/class/file/finder/filefinder.class.php
===================================================================
--- plog/trunk/class/file/finder/filefinder.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/file/finder/filefinder.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,9 +1,5 @@
<?php
- include_once( PLOG_CLASS_PATH.'class/misc/glob.class.php' );
- include_once( PLOG_CLASS_PATH.'class/object/object.class.php' );
-
-
/**
* \ingroup File
*
@@ -22,8 +18,6 @@
function FileFinder( $folder = '.' )
{
-
-
$this->_folder = $folder;
$this->_removed = Array();
$this->_new = Array();
@@ -56,6 +50,7 @@
*/
function find( $currentList, $fileName = '*' )
{
+ include_once( PLOG_CLASS_PATH.'class/misc/glob.class.php' );
$files = Glob::myGlob( $this->_folder, $fileName );
// create an empty array if we got something else other than an array so that
Modified: plog/trunk/class/logger/layout/patternlayout.class.php
===================================================================
--- plog/trunk/class/logger/layout/patternlayout.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/logger/layout/patternlayout.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -115,7 +115,7 @@
*
* @return string A formatted log message.
*/
- function &format (&$message)
+ function format (&$message)
{
$pattern = str_replace( "%c", $message->class, $this->pattern );
$pattern = str_replace( "%d", strftime("%d-%m-%Y %H:%M:%S", time()), $pattern );
Modified: plog/trunk/class/logger/logger/loggedmessage.class.php
===================================================================
--- plog/trunk/class/logger/logger/loggedmessage.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/logger/logger/loggedmessage.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,7 +1,5 @@
<?php
- include_once(PLOG_CLASS_PATH."class/object/object.class.php");
-
/**
* LoggedMessage contains information about a log message such as priority, text
* etc...
Modified: plog/trunk/class/logger/logger/logger.class.php
===================================================================
--- plog/trunk/class/logger/logger/logger.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/logger/logger/logger.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -153,8 +153,8 @@
// loop through appenders and write to each one
foreach( $this->appenders as $appender ) {
- $layout =& $appender->getLayout();
- $result =& $layout->format( $msgObject );
+ $layout = $appender->getLayout();
+ $result = $layout->format( $msgObject );
$appender->write($result);
}
}
Modified: plog/trunk/class/net/linkparser.class.php
===================================================================
--- plog/trunk/class/net/linkparser.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/net/linkparser.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,7 +1,5 @@
<?php
- require_once( PLOG_CLASS_PATH."class/object/object.class.php" );
-
/**
* \ingroup Net
*
Modified: plog/trunk/class/object/loggable.class.php
===================================================================
--- plog/trunk/class/object/loggable.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/object/loggable.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,6 +1,11 @@
<?php
- class Loggable {
+ /**
+ * Please extend this class if you wish to allow your class to log
+ * data to the logging streams
+ */
+ class Loggable
+ {
var $log;
@@ -9,11 +14,10 @@
*/
function Loggable()
{
+ include_once( PLOG_CLASS_PATH."class/logger/loggermanager.class.php" );
+
// initialize logging -- enable this only for debugging purposes
$this->log =& LoggerManager::getLogger( "default" );
-
- if( DEBUG_ENABLED )
- $this->debug =& LoggerManager::getLogger( "debug" );
}
}
?>
Modified: plog/trunk/class/security/bayesianfilter.class.php
===================================================================
--- plog/trunk/class/security/bayesianfilter.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/security/bayesianfilter.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -41,8 +41,6 @@
*/
function filter()
{
- include_once( PLOG_CLASS_PATH."class/dao/articlecomments.class.php" );
-
$config =& Config::getConfig();
if (!$config->getValue("bayesian_filter_enabled"))
@@ -62,6 +60,8 @@
$result = new PipelineResult();
return $result;
}
+
+ include_once( PLOG_CLASS_PATH."class/dao/articlecomments.class.php" );
// if it's a trackback, the data is in another place...
$isTrackback = ($request->getValue( "op" ) == "AddTrackback");
Modified: plog/trunk/class/security/pipelinerequest.class.php
===================================================================
--- plog/trunk/class/security/pipelinerequest.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/security/pipelinerequest.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,8 +1,5 @@
<?php
-
- include_once( PLOG_CLASS_PATH."class/dao/bloginfo.class.php" );
-
/**
* \ingroup Security
*
Modified: plog/trunk/class/template/templatesandbox.class.php
===================================================================
--- plog/trunk/class/template/templatesandbox.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/template/templatesandbox.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,9 +1,6 @@
<?php
- include_once( PLOG_CLASS_PATH.'class/object/object.class.php' );
include_once( PLOG_CLASS_PATH.'class/config/config.class.php' );
- include_once( PLOG_CLASS_PATH.'class/data/validator/templatevalidator.class.php' );
- include_once( PLOG_CLASS_PATH.'class/misc/glob.class.php' );
define( 'TEMPLATE_SANDBOX_ERROR_UNPACKING', -100 );
define( 'TEMPLATE_SANDBOX_ERROR_FORBIDDEN_EXTENSIONS', -101 );
@@ -48,6 +45,7 @@
return true;
// otherwise, turn the thing into an array and go through all of them
+ include_once( PLOG_CLASS_PATH.'class/misc/glob.class.php' );
foreach( explode( " ", $forbiddenFilesStr ) as $file ) {
$files = Glob::myGlob( $folder, $file );
if( count($files) > 0 )
@@ -129,6 +127,7 @@
if( $templateFolder[strlen($templateFolder)-1] != '/')
$templateFolder .= '/';
+ include_once( PLOG_CLASS_PATH.'class/data/validator/templatevalidator.class.php' );
$tv = new TemplateValidator($templateName, $templateFolder );
if( ($errorCode = $tv->validate()) < 0 ) {
return $errorCode;
Modified: plog/trunk/class/template/templateservice.class.php
===================================================================
--- plog/trunk/class/template/templateservice.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/template/templateservice.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,8 +1,6 @@
<?php
- include_once( PLOG_CLASS_PATH.'class/object/object.class.php' );
include_once( PLOG_CLASS_PATH.'class/config/config.class.php' );
- include_once( PLOG_CLASS_PATH.'class/misc/glob.class.php' );
include_once( PLOG_CLASS_PATH.'class/file/file.class.php' );
/**
Modified: plog/trunk/class/view/blogview.class.php
===================================================================
--- plog/trunk/class/view/blogview.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/view/blogview.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -25,13 +25,9 @@
*/
function BlogView( $blogInfo, $template, $cachingEnabled = SMARTY_VIEW_CACHE_CHECK, $data = Array())
{
- include_once( PLOG_CLASS_PATH.'class/dao/articles.class.php' );
-
// the SmartyView will generate the right Template object for us
$this->SmartyView( $blogInfo, $template, $cachingEnabled, $data );
- $this->articles = new Articles();
-
$this->_pm =& PluginManager::getPluginManager();
$this->_pm->setBlogInfo( $this->_blogInfo );
@@ -82,7 +78,9 @@
include_once( PLOG_CLASS_PATH.'class/dao/archivelink.class.php' );
include_once( PLOG_CLASS_PATH.'class/data/timestamp.class.php' );
- $archiveStats = $this->articles->getNumberPostsPerMonth( $this->_blogInfo->getId());
+ include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
+ $articles = new Articles();
+ $archiveStats = $articles->getNumberPostsPerMonth( $this->_blogInfo->getId());
if( $archiveStats == '' )
return false;
@@ -146,7 +144,9 @@
$month = $this->getValue( 'Month' );
$year = $this->getValue( 'Year' );
- return( $this->articles->getDaysWithPosts( $this->_blogInfo->getId(), $year, $month ));
+ include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
+ $articles = new Articles();
+ return( $articles->getDaysWithPosts( $this->_blogInfo->getId(), $year, $month ));
}
/**
@@ -211,11 +211,10 @@
*/
function render()
{
- include_once( PLOG_CLASS_PATH.'class/misc/version.class.php' );
- include_once( PLOG_CLASS_PATH.'class/xml/rssparser/rssparser.class.php' );
-
if( !$this->isCached() ) {
include_once( PLOG_CLASS_PATH.'class/data/plogcalendar.class.php' );
+ include_once( PLOG_CLASS_PATH.'class/misc/version.class.php' );
+ include_once( PLOG_CLASS_PATH.'class/xml/rssparser/rssparser.class.php' );
// and then add our stuff to the view...
$this->setValue( 'archives', $this->_getArchives());
@@ -227,6 +226,8 @@
$this->setValue( 'url', $this->_blogInfo->getBlogRequestGenerator());
$this->setValue( 'utils', $this->_blogInfo->getBlogRequestGenerator());
+ $this->setValue( 'rss', new RssParser());
+ $this->setValue( 'version', Version::getVersion());
// also, let's not forget about the plugins...
// put the plugins in the context
@@ -241,10 +242,8 @@
//
$this->setValue( 'locale', $this->_blogInfo->getLocale());
- $this->setValue( 'version', Version::getVersion());
$this->setValue( 'blog', $this->_blogInfo );
$this->setValue( 'blogsettings', $this->_blogInfo->getSettings());
- $this->setValue( 'rss', new RssParser());
$this->setValue( 'misctemplatepath', TemplateSetStorage::getMiscTemplateFolder());
// ask the parent to do something, if needed
Modified: plog/trunk/class/view/resourceserverview.class.php
===================================================================
--- plog/trunk/class/view/resourceserverview.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/view/resourceserverview.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,7 +1,6 @@
<?php
include_once( PLOG_CLASS_PATH.'class/view/view.class.php' );
- include_once( PLOG_CLASS_PATH.'class/net/http/httpcache.class.php' );
// the three different modes that a resource can be requested
define( 'RESOURCE_VIEW_MODE_DEFAULT', '' );
@@ -88,6 +87,7 @@
$cacheLifetime = $config->getValue( 'resource_server_http_cache_lifetime', DEFAULT_HTTP_CACHE_LIFETIME );
// check if we have to resent the data and if not, then we're done!
+ include_once( PLOG_CLASS_PATH.'class/net/http/httpcache.class.php' );
if( HttpCache::httpConditional( $lastModified, $cacheLifetime ))
exit();
}
Modified: plog/trunk/class/view/smartyview.class.php
===================================================================
--- plog/trunk/class/view/smartyview.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/view/smartyview.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -2,7 +2,6 @@
include_once( PLOG_CLASS_PATH.'class/view/view.class.php' );
include_once( PLOG_CLASS_PATH.'class/template/templateservice.class.php' );
- include_once( PLOG_CLASS_PATH.'class/net/http/httpcache.class.php' );
/**
* different smarty cache modes that we can use
@@ -205,6 +204,7 @@
$timestamp = $this->_template->getCreationTimestamp();
// and now send the correct headers
+ include_once( PLOG_CLASS_PATH.'class/net/http/httpcache.class.php' );
if( HttpCache::httpConditional( $timestamp, $this->getCacheTimeSeconds()))
$sendOutput = false;
Modified: plog/trunk/class/view/viewarticleview.class.php
===================================================================
--- plog/trunk/class/view/viewarticleview.class.php 2006-02-25 22:51:01 UTC (rev 2985)
+++ plog/trunk/class/view/viewarticleview.class.php 2006-02-26 01:42:07 UTC (rev 2986)
@@ -1,7 +1,6 @@
<?php
include_once( PLOG_CLASS_PATH."class/view/blogview.class.php" );
- include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
define( "VIEW_ARTICLE_TEMPLATE", "postandcomments" );
More information about the pLog-svn
mailing list