[pLog-svn] r4643 - plog/branches/lifetype-1.1.5

oscar at devel.lifetype.net oscar at devel.lifetype.net
Thu Feb 1 06:20:02 EST 2007


Author: oscar
Date: 2007-02-01 06:20:02 -0500 (Thu, 01 Feb 2007)
New Revision: 4643

Modified:
   plog/branches/lifetype-1.1.5/wizard.php
Log:
Fix for issue 1165 (http://bugs.lifetype.net/view.php?id=1165) -- wizard.php removing tmp/.htaccess upon completion of new installation or upgrade

Modified: plog/branches/lifetype-1.1.5/wizard.php
===================================================================
--- plog/branches/lifetype-1.1.5/wizard.php	2007-02-01 09:34:44 UTC (rev 4642)
+++ plog/branches/lifetype-1.1.5/wizard.php	2007-02-01 11:20:02 UTC (rev 4643)
@@ -151,12 +151,28 @@
 
 		/**
 		 * Clean up the default temporary folder
+		 * @static
 		 */
-		function cleanTmpFolder()
-		{
-			// remove the files recursively, but only files, do not do anything to directories
-			File::deleteDir( TEMP_FOLDER, true, true );
+		function cleanTmpFolder( $file = '' )
+		{			
+			if( $file == '' )
+				$file = TEMP_FOLDER;
+
+			$files = Glob::myGlob( $file, "*" );
+			foreach( $files as $file ) {
+				if( File::isDir( $file )) {
+					WizardTools::cleanTmpFolder( $file );
+				}
+
+				// delete the file as long as it's not called .htaccess
+				if(( File::isReadable( $file )) && (basename( $file ) != ".htaccess" )) {
+					File::delete( $file );
+				}
+			}
+
+			return true;
 		}
+
     }
 
     /**
@@ -1261,7 +1277,7 @@
             $cache->clearCache();
 
 			// clean up the tmp/ folder
-			File::deleteDir( TEMP_FOLDER, true, true );
+			WizardTools::cleanTmpFolder();
 
             $this->_view = new WizardView( "step5" );
             $this->_view->setValue( "message", $message );
@@ -2441,12 +2457,7 @@
                         $this->_view->setValue( "transformerId", $this->currentTransformerId+1 );
                     }
                     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 );
+                        WizardTools::cleanTmpFolder();
 
                         $this->_view = new WizardView( "update4" );
                     }



More information about the pLog-svn mailing list