[pLog-svn] r3086 - in plog/trunk/class: action/admin cache

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sun Mar 19 22:13:54 GMT 2006


Author: oscar
Date: 2006-03-19 22:13:53 +0000 (Sun, 19 Mar 2006)
New Revision: 3086

Removed:
   plog/trunk/class/cache/bloginfomanager.class.php
Modified:
   plog/trunk/class/action/admin/adminmainaction.class.php
   plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php
Log:
removed an unnecessary class

Modified: plog/trunk/class/action/admin/adminmainaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminmainaction.class.php	2006-03-19 15:10:54 UTC (rev 3085)
+++ plog/trunk/class/action/admin/adminmainaction.class.php	2006-03-19 22:13:53 UTC (rev 3086)
@@ -52,9 +52,9 @@
             }
 
 			// load the blog
-            require_once( PLOG_CLASS_PATH . "class/cache/bloginfomanager.class.php" );
-            $blogInfoManager = BlogInfoManager::getBlogInfoManager();
-            $this->_blogInfo = $blogInfoManager->getBlogInfo( $this->_blogId );
+            require_once( PLOG_CLASS_PATH . "class/dao/blogs.class.php" );
+			$blogs = new Blogs();
+            $this->_blogInfo = $blogs->getBlogInfo( $this->_blogId );
 			 
 			// check if the blog really exists
 			if( !$this->_blogInfo ) {

Modified: plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php	2006-03-19 15:10:54 UTC (rev 3085)
+++ plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php	2006-03-19 22:13:53 UTC (rev 3086)
@@ -54,8 +54,6 @@
          */
         function perform()
         {
-            require_once( PLOG_CLASS_PATH . "class/cache/bloginfomanager.class.php" );
-
         	// fetch the settings from the db and update them accordingly
             $blogs = new Blogs();
             $blogSettings = $this->_blogInfo->getSettings();
@@ -85,8 +83,8 @@
                         
             // and now we can proceed...
 			$this->notifyEvent( EVENT_PRE_BLOG_UPDATE, Array( "blog" => &$this->_blogInfo ));						
-            $blogInfoManager = BlogInfoManager::getBlogInfoManager();
-            if( !$blogInfoManager->updateBlogInfo( $this->_blogInfo )) {
+			$blogs = new Blogs();
+            if( !$blogs->updateBlog( $this->_blogInfo )) {
             	$this->_view = new AdminBlogSettingsView( $this->_blogInfo );
                 $this->_view->setErrorMessage( $this->_locale->tr("error_updating_settings"));
                	$this->setCommonData();

Deleted: plog/trunk/class/cache/bloginfomanager.class.php
===================================================================
--- plog/trunk/class/cache/bloginfomanager.class.php	2006-03-19 15:10:54 UTC (rev 3085)
+++ plog/trunk/class/cache/bloginfomanager.class.php	2006-03-19 22:13:53 UTC (rev 3086)
@@ -1,60 +0,0 @@
-<?php
-
-    class BlogInfoManager 
-    {
-
-        var $_knownBlogs = array();
-
-        function getBlogInfo( $blogId )
-        {
-            $blogs = new Blogs();
-            $blogInfo = $blogs->getBlogInfo( $blogId );
-            return $blogInfo;
-
-            // not executed
-            if( array_key_exists( $blogId, $this->_knownBlogs) )
-                return $this->_knownBlogs[$blogId];
-
-            require_once( PLOG_CLASS_PATH . "class/cache/cachemanager.class.php" );
-            require_once( PLOG_CLASS_PATH . "class/dao/blogsettings.class.php" );
-
-            $cache =& CacheManager::getCache();
-            $blogInfo = $cache->getData( $blogId, CACHE_BLOGINFOS );
-
-            if( !$blogInfo ) {
-                require_once( PLOG_CLASS_PATH . "class/dao/blogs.class.php" );
-                $blogs = new Blogs();
-                $blogInfo = $blogs->getBlogInfo( $blogId );
-                $cache->setData( $blogId, CACHE_BLOGINFOS, $blogInfo );
-            }
-
-            $this->_knownBlogs[ $blogId ] = $blogInfo;
-            return $blogInfo;
-        }
-
-        function updateBlogInfo( $blogInfo )
-        {
-            require_once( PLOG_CLASS_PATH . "class/dao/blogs.class.php" );
-            $blogs = new Blogs(); 
-            return $blogs->updateBlog( $blogInfo );
-
-            // remove all cached info
-            $cache =& CacheManager::getCache();
-            $cache->removeData( $blogId, CACHE_BLOGINFOS );
-
-            // save the new blogInfo
-            // this is slow right now, but we don't care at this point
-        }
-
-        function &getBlogInfoManager()
-        {
-            static $manager;
-
-            if( !is_object($manager) ) {
-                $manager = new BlogInfoManager();
-            }
-
-            return $manager;
-        }
-    }
-?>



More information about the pLog-svn mailing list