[pLog-svn] r4216 - plog/branches/lifetype-1.1.2

oscar at devel.lifetype.net oscar at devel.lifetype.net
Mon Oct 30 22:12:08 GMT 2006


Author: oscar
Date: 2006-10-30 22:12:07 +0000 (Mon, 30 Oct 2006)
New Revision: 4216

Modified:
   plog/branches/lifetype-1.1.2/wizard.php
Log:
implemented feature request 1102 (http://bugs.lifetype.net/view.php?id=1102) -- clean tmp folder on upgrade


Modified: plog/branches/lifetype-1.1.2/wizard.php
===================================================================
--- plog/branches/lifetype-1.1.2/wizard.php	2006-10-30 17:32:26 UTC (rev 4215)
+++ plog/branches/lifetype-1.1.2/wizard.php	2006-10-30 22:12:07 UTC (rev 4216)
@@ -148,6 +148,15 @@
 
            return( $isNew );
        }
+
+		/**
+		 * Clean up the default temporary folder
+		 */
+		function cleanTmpFolder()
+		{
+			// remove the files recursively, but only files, do not do anything to directories
+			File::deleteDir( TEMP_FOLDER, true, true );
+		}
     }
 
     /**
@@ -1250,6 +1259,9 @@
             $cache =& CacheManager::getCache();
             $cache->clearCache();
 
+			// clean up the tmp/ folder
+			File::deleteDir( TEMP_FOLDER, true, true );
+
             $this->_view = new WizardView( "step5" );
             $this->_view->setValue( "message", $message );
             return true;
@@ -2429,11 +2441,17 @@
                     }
                     else {
                         // no more data to transform, we can finalize the installation!
+						// delete the contents of the temporary folder
+						include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
+						$config =& Config::getConfig();
+						$tmpFolder = $config->getValue( "temp_folder", TEMP_FOLDER );
+						File::deleteDir( $tmpFolder, true, true );
+
                         $this->_view = new WizardView( "update4" );
                     }
                 }
             }
-            
+
             $this->_view->setValue( "message", $message );            
 
             return true;



More information about the pLog-svn mailing list