[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gallery-checkins
Subject:    [Gallery-checkins] gallery2/lib/tools/test/TestCase InstallModule.class,1.2,1.3
From:       Bharat Mediratta <bharat () users ! sourceforge ! net>
Date:       2004-10-28 8:24:47
Message-ID: E1CN5av-0001Qy-Pw () sc8-pr-cvs1 ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/gallery/gallery2/lib/tools/test/TestCase
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5455/lib/tools/test/TestCase

Modified Files:
	InstallModule.class 
Log Message:
Converted our module install logic to do the preliminary work on
supporting upgrades.  Now all install/upgrade framework logic is 
centralized in GalleryModule::installOrUpgrade() which calls
GalleryModule::upgrade() as appropriate so that modules can perform
whatever upgrade steps they wish.  This removed a lot of duplicate
code from our modules (yay).

At install time so that we were making requests to tables that didn't
exist yet, blowing up Postgres's transaction.  This used to work
because the core was expecting to potentially have to roll back and
create a new connection which was a legacy from the old days when the
core would auto install itself upon first load .  I removed that code
a few days ago so the installer started failing.  I cleaned all this
up so that now we do a clean install the first time around and never
make requests to the database if it doesn't exist yet.

* Fixed an issue with the way that we were handling bit values in the
  BITAND function in Postgres that was causing the bitwise "& ~" logic
  in GalleryPermissionHelper_advanced::_removePermissionsFromAllItems
  to fail on Postgres.  The fix is to always cast arguments to BITAND
  to be the 'bit' type.

* Added a new flag to the GalleryInitFirstPass() parameters to specify
  that you don't want to do anything that might load the database.
  Right now this disables the translator, which makes a DB request.

* Removed the install() method from any module where it was totally
  boilerplate.  For the ones where they set module parameters, I
  changed this to upgrade()

* Rolled the code that creates permissions into a loop so that it's
  tighter.  Not sure if this is easier to read, though.

* Added GalleryStorage::isInstalled() which tells us if there's
  already database tables in the designated location.  Useful for the
  installer since it wants to know if this is the first run or not.

* Fixed an issue in DatabaseStorage where UPDATE on Postgres doesn't
  want the updated columns to have the table name.  Made it so that
  [::member] resolves properly (to just 'g_member').



Index: InstallModule.class
===================================================================
RCS file: /cvsroot/gallery/gallery2/lib/tools/test/TestCase/InstallModule.class,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- InstallModule.class	7 Aug 2004 06:43:48 -0000	1.2
+++ InstallModule.class	28 Oct 2004 08:24:45 -0000	1.3
@@ -19,7 +19,7 @@
 	    return $ret->wrap(__FILE__, __LINE__);
 	}
 
-	$ret = $module->install();
+	$ret = $module->installOrUpgrade();
 	if ($ret->isError()) {
 	    return $ret->wrap(__FILE__, __LINE__);
 	}



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
__[ g a l l e r y - c h e c k i n s ]_________________________

[ list info/archive --> http://gallery.sf.net/lists.php ]
[ gallery info/FAQ/download --> http://gallery.sf.net ]
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic