[pLog-svn] r4913 - in plog/trunk: . config

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Fri Mar 2 10:00:35 EST 2007


Author: jondaley
Date: 2007-03-02 10:00:35 -0500 (Fri, 02 Mar 2007)
New Revision: 4913

Modified:
   plog/trunk/.htaccess
   plog/trunk/config/config.properties.php
   plog/trunk/wizard.php
Log:
don't fail during gallery upgrade if destination exists.  Use WizardTools::cleanTmpFolder whenever we want to erase the tmp directory.  Exclude .svn and .htaccess from the cleanTmpFolder function

Modified: plog/trunk/.htaccess
===================================================================
--- plog/trunk/.htaccess	2007-03-02 14:59:13 UTC (rev 4912)
+++ plog/trunk/.htaccess	2007-03-02 15:00:35 UTC (rev 4913)
@@ -6,70 +6,44 @@
 deny from all 
 </Files>
 
-Options -Indexes
-Options +FollowSymLinks
-
-<IfModule mod_rewrite.c>
-
 RewriteEngine On
-RewriteBase /
+RewriteBase /plog
 
-# Permalink to the blog entry (i.e. /1_userfoo/archive/3_title-foo-bar.html)
-RewriteRule ^([0-9]+)_[^/]+/archive/([0-9]+)_[^.]+\.html$ index.php?op=ViewArticle&blogId=$1&articleId=$2 [L,NC]
+RewriteCond %{REMOTE_HOST} !orange.limedaley.com
+RewriteRule .* /temporary_failure.html [L]
 
-# Monthly archive (i.e. /1_userfoo/archive/200401.html) 
-RewriteRule ^([0-9]+)_[^/]+/archive/([0-9]{6})\.html$ index.php?blogId=$1&Date=$2 [L,NC]
-# -- same as above but with paging included
-RewriteRule ^([0-9]+)_[^/]+/archive/([0-9]{6})\.html\.page\.([1-9]+)$ index.php?blogId=$1&Date=$2&page=$3 [L,NC]
+# old category name
+RewriteRule ^category/internet(-|_)stuff(.*)  /plog/category/internet$2 [R=permanent,L]
 
-# Daily archive (i.e. /1_blogfoo/archive/20040101.html)
-RewriteRule ^([0-9]+)_[^/]+/archive/([0-9]{8})\.html$ index.php?blogId=$1&Date=$2 [L,NC]
-# -- same as above but with paging included
-RewriteRule ^([0-9]+)_[^/]+/archive/([0-9]{8})\.html\.page\.([1-9]+)$ index.php?blogId=$1&Date=$2&page=$3 [L,NC]
+# old links
+RewriteRule ^content(.*)  /plog/static$1 [R=permanent,L]
 
-# Album (i.e. /88_userfoo/albums/34_title-foo-bar.html)
-RewriteRule ^([0-9]+)_[^/]+/albums/([0-9]+)_[^.]+\.html$ index.php?op=ViewAlbum&blogId=$1&albumId=$2 [L,NC]
-# -- same as above but with paging included
-RewriteRule ^([0-9]+)_[^/]+/albums/([0-9]+)_[^.]+\.html\.page\.([1-9]+)$ index.php?op=ViewAlbum&blogId=$1&albumId=$2&page=$3 [L,NC]
+RewriteCond %{REQUEST_URI} ^/plog/(category|archives)/[^_]+_
+RewriteRule ^([^_]+)_(.*)$  $1-$2 [R=permanent,L]
 
-# Albums (i.e. /88_userfoo/albums/)
-RewriteRule ^([0-9]+)_[^/]+/albums/$ index.php?op=ViewAlbum&blogId=$1&albumId=0 [L,NC]
+RewriteRule ^jonathan/?$ /plog/category/jonathan [R,L]
+RewriteRule ^isaac/?$ /plog/category/isaac [R,L]
+RewriteRule ^(1|jondaley)/?$ /plog/ [R,L]
 
-# Category view (i.e. /88_userfoo/categories/4_cat-foobar.html)
-RewriteRule ^([0-9]+)_[^/]+/categories/([0-9]+)_[^.]+\.html$ index.php?blogId=$1&postCategoryId=$2 [L,NC]
-# -- same as above but with paging included
-RewriteRule ^([0-9]+)_[^/]+/categories/([0-9]+)_[^.]+\.html\.page\.([1-9]+)$ index.php?blogId=$1&postCategoryId=$2&page=$3 [L,NC]
+#############################################################################
+## My query string gets 
+# Static Pages (i.e /page/userfoo[.template])
+#RewriteRule ^page/(.+)$ index.php?op=Template&show=$1&%{QUERY_STRING} [L]
 
-# Category-Feeds (i.e. /3_userfoo/feeds/categories/2_category/atom)
-RewriteRule ^([0-9]+)_[^/]+/feeds/categories/([0-9]+)_[^.]+/(.*)$ rss.php?blogId=$1&categoryId=$2&profile=$3 [L,NC]
+###############################
+## catch all to avoid errors in the error.log
+#RewriteCond %{REQUEST_URI} !^/plog/error.php
+#RewriteCond %{REQUEST_URI} !^/plog/admin.php
+#RewriteCond %{REQUEST_URI} !^/plog/index.php
+#RewriteCond %{REQUEST_URI} !^/plog/templates
+#RewriteCond %{REQUEST_URI} !^/plog/files
+#RewriteRule (.*) /plog/error.php [L]
+###############################
 
-# Feeds (i.e. /3_userfoo/feeds/atom)
-RewriteRule ^([0-9]+)_[^/]+/feeds/(.*)$ rss.php?blogId=$1&profile=$2 [L,NC]
+<Files *.php>
+ ForceType application/x-httpd-php
+</Files>
 
-# Trackbacks (i.e. /3_userfoo/trackbacks/34_title-foo-bar.html)
-RewriteRule ^([0-9]+)_[^/]+/trackbacks/([0-9]+)_[^.]+\.html$ index.php?op=Trackbacks&blogId=$1&articleId=$2 [L,NC]
-
-# Comment form (i.e. /88_userfoo/comment/34_title-foo-bar.html)
-RewriteRule ^([0-9]+)_[^/]+/comment/([0-9]+)_[^.]+\.html$ index.php?op=Comment&blogId=$1&articleId=$2 [L,NC]
-
-# Resources (i.e. /88_userfoo/resources/this-is-a-resource-name.pdf.html)
-RewriteRule ^([0-9]+)_[^/]+/resources/([^.]+)\.([^.]+)\.html$ index.php?op=ViewResource&blogId=$1&resource=$2.$3 [L,NC]
-
-# Download a resource (i.e. /88_userfoo/get/this-is-a-resource-name.pdf)
-RewriteRule ^([0-9]+)_[^/]+/get/(.+)$ resserver.php?blogId=$1&resource=$2 [L,NC]
-
-# A non-default blog (i.e. /88_userfoo)
-RewriteRule ^([0-9]+)(_[^/]+)?$ index.php?blogId=$1 [L,NC]
-# -- same as above but with paging included
-RewriteRule ^([0-9]+)(_[^/]+)\.page\.([1-9]+)$ index.php?blogId=$1&page=$3 [L,NC]
-
-# Static Pages (i.e /3_userfoo/demosites)
-RewriteRule ^([0-9]+)_[^/]+/(.+)$ index.php?op=Template&blogId=$1&show=$2 [NC]
-
-</IfModule>
-
-
-
 <Files post>
  ForceType application/x-httpd-php
 </Files>
@@ -122,6 +96,6 @@
  ForceType application/x-httpd-php
 </Files>
 
-ErrorDocument 401 /error.php
-ErrorDocument 403 /error.php
-ErrorDocument 404 /error.php
+ErrorDocument 401 /plog/error.php
+ErrorDocument 403 /plog/error.php
+ErrorDocument 404 /plog/error.php

Modified: plog/trunk/config/config.properties.php
===================================================================
--- plog/trunk/config/config.properties.php	2007-03-02 14:59:13 UTC (rev 4912)
+++ plog/trunk/config/config.properties.php	2007-03-02 15:00:35 UTC (rev 4913)
@@ -26,10 +26,10 @@
 #   (note, if upgrading between minor releases:
 #   1.0 to 1.0.1, etc. you shouldn't run the wizard)
 
-$config['db_host'] = '';
-$config['db_username'] = '';
-$config['db_password'] = '';
-$config['db_database'] = '';
+$config['db_host'] = 'localhost';
+$config['db_username'] = 'jondaley';
+$config['db_password'] = 'plo!GGy4';
+$config['db_database'] = 'jondaley';
 $config["db_persistent"] = true;
 $config['db_character_set'] = 'latin1';
 
@@ -40,5 +40,5 @@
 # coexist in the same unique database. If you change this after the initial configuration done
 # with the installation wizard, please make sure that you also rename the tables.
 #
-$config['db_prefix'] = '';
+$config['db_prefix'] = 'plog_';
 ?>
\ No newline at end of file

Modified: plog/trunk/wizard.php
===================================================================
--- plog/trunk/wizard.php	2007-03-02 14:59:13 UTC (rev 4912)
+++ plog/trunk/wizard.php	2007-03-02 15:00:35 UTC (rev 4913)
@@ -158,7 +158,7 @@
 		function cleanTmpFolder()
 		{
 			// remove the files recursively, but only files, do not do anything to directories
-			File::deleteDir( TEMP_FOLDER, true, true );
+			File::deleteDir( TEMP_FOLDER, true, true, array(".svn", ".htaccess") );
 		}
     }
 
@@ -1293,8 +1293,7 @@
             $cache =& CacheManager::getCache();
             $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 );
@@ -1775,11 +1774,13 @@
 				$destFileName = $galleryFolder.$row["owner_id"]."/".$row["file_name"];
 				
                     //print( "Renaming file: $fileName --- $destFileName<br/>" );
-				
-				if( !File::rename( $fileName, $destFileName )) {
-					$this->message .= "Error updating resource file with id ".$row["id"].", while attempting to rename file from $fileName to $destFileName<br/>";
+
+                    // skip the rename if we already did it
+                if( !File::exists( $destFileName)) {
+                    if( !File::rename( $fileName, $destFileName )) {
+                        $this->message .= "Error updating resource file with id ".$row["id"].", while attempting to rename file from $fileName to $destFileName<br/>";
+                    }
 				}
-				
 
 				
 				// if it's an image, we also need to process the previews
@@ -1806,8 +1807,12 @@
 					//print(" -- renaming preview: $previewFileName -- $destPreviewFileName<br/>");
 					//print(" -- renaming medium preview: $medPreviewFileName -- $destMedPreviewFileName<br/>");					
 					
-					File::rename( $previewFileName, $destPreviewFileName );
-					File::rename( $medPreviewFileName, $destMedPreviewFileName );
+                    if( !File::exists( $destPreviewFileName)) {
+                        File::rename( $previewFileName, $destPreviewFileName );
+                    }
+                    if( !File::exists( $destMedPreviewFileName)) {
+                        File::rename( $medPreviewFileName, $destMedPreviewFileName );
+                    }
 				}
 				
 				
@@ -1950,7 +1955,7 @@
 						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