[floe] r409 committed - tidying up storage plugin loading

0 views
Skip to first unread message

fl...@googlecode.com

unread,
May 23, 2010, 2:48:26 PM5/23/10
to floe-c...@googlegroups.com
Revision: 409
Author: coretxt
Date: Sun May 23 11:47:11 2010
Log: tidying up storage plugin loading
http://code.google.com/p/floe/source/detail?r=409

Modified:
/trunk/src/repository/store/StorageAdaptor.class.php

=======================================
--- /trunk/src/repository/store/StorageAdaptor.class.php Thu May 20
13:33:53 2010
+++ /trunk/src/repository/store/StorageAdaptor.class.php Sun May 23
11:47:11 2010
@@ -28,7 +28,7 @@
/**
* Access a singleton instance of the StorageAdaptor
*/
- static function instance($plugin = false) {
+ static function instance($adaptor = 'Mysql') {
if (!self::$adaptor) self::$adaptor = new
StorageAdaptor(self::gateway());
return self::$adaptor;
}
@@ -36,11 +36,12 @@
/**
* Returns a default instance
*/
- static function gateway($adaptor = false) {
- $queryAdaptor = (($adaptor) ? $adaptor :
StorageAdaptor_DefaultInstance)."Gateway";
- $queryConnection = (($adaptor) ? $adaptor :
StorageAdaptor_DefaultInstance)."Connection";
- require_once 'store/'. strtolower($adaptor) .'/'.
$queryAdaptor .'.class.php';
- require_once 'store/'. strtolower($adaptor) .'/'.
$queryConnection .'.class.php';
+ static function gateway($adaptor = 'Mysql') {
+ $adaptor = (($adaptor) ? $adaptor : StorageAdaptor_DefaultInstance)
+ $queryAdaptor = $adaptor.'Gateway';
+ $queryConnection = $adaptor."Connection";
+ require_once 'store/'. strtolower($adaptor) .'/'.
$adaptor .'.class.php';
+ require_once 'store/'. strtolower($adaptor) .'/'.
$adaptor .'.class.php';
if (!self::$implementation) self::$implementation = new
$queryAdaptor(new $queryConnection());
return self::$implementation;
}

--
You received this message because you are subscribed to the Google Groups "Floe Commits" group.
To post to this group, send email to floe-c...@googlegroups.com.
To unsubscribe from this group, send email to floe-commits...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/floe-commits?hl=en.

Reply all
Reply to author
Forward
0 new messages