<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -61,6 +61,11 @@ class DAOFactory {
         return TRUE;
     }
 
+    /**
+     * Gets a connector object based on a connection string
+     * @param {str} Connection string in parse_url format
+     * @return {obj} New instance of connector class
+     **/
     public static function getConnector($connection_string) {
 
         if (empty($connection_string)) {
@@ -90,6 +95,8 @@ class DAOFactory {
      * Creates a connection to a data resource
      * @param {str} daonut resource string in format DB.Table
      * @param {str} Query type (default: 'select')
+     * @return {obj} Instance of a DynamicDao class
+     * @todo Reuse a DynamicDao if it already exists
      **/
     public static function create($resource, $type = 'select') {
         
@@ -151,7 +158,8 @@ class DAOFactory {
      * Gets the connection string for a DSN alias
      * Loads the DSN mapping information and returns the connection string for the given
      * DSN alias.
-     * @param  {str} DSN Alias (e.g. 'foo')
+     * @param  {str} DSN Alias
+     * @param  {str} Mapping file name
      * @return {str} Connection string in parse_url format
      **/
     public static function getConnectionString($alias, $file = 'dsn2connector.inc.php') {
@@ -163,7 +171,13 @@ class DAOFactory {
         }
         
         if (empty(self::$dsn)) {
-            @include dirname(__FILE__) . DIRECTORY_SEPARATOR . $file ;
+            if (substr($file, 0, 1) == '/') {
+                @include $file;
+            }
+            else {
+                @include dirname(__FILE__) . DIRECTORY_SEPARATOR . $file ;
+            }
+            
             if (!isset($map)) {
                 return FALSE;
             }
@@ -180,10 +194,17 @@ class DAOFactory {
      * Gets the DSN alias for a database
      * Loads the database mapping information and returns the DSN alias
      * for the given database.
+     * @param {str} Database name
+     * @param {str} 
      **/
-    public static function getDSN($alias, $file = 'db2dsn.inc.php') {
+    public static function getDSN($db, $file = 'db2dsn.inc.php') {
         if (empty(self::$db2dsn)) {
-            @include dirname(__FILE__) . DIRECTORY_SEPARATOR . $file ;
+            if (substr($file, 0, 1) == '/') {
+                @include $file;
+            }
+            else {
+                @include dirname(__FILE__) . DIRECTORY_SEPARATOR . $file ;
+            }
             if (!isset($map)) {
                 return FALSE;
             }
@@ -191,8 +212,8 @@ class DAOFactory {
             unset($map);
         }
         
-        return isset(self::$db2dsn[$alias])
-            ? self::$db2dsn[$alias]
+        return isset(self::$db2dsn[$db])
+            ? self::$db2dsn[$db]
             : FALSE;
     }
     
@@ -269,4 +290,4 @@ class DynamicDao {
     
 }
 
-class DynamicDaoException extends Exception {}
\ No newline at end of file
+class DynamicDaoException extends Exception {}</diff>
      <filename>daonut.inc.php</filename>
    </modified>
    <modified>
      <diff>@@ -164,8 +164,8 @@ class DaoFactory_getConnectionString_Test extends Snap_UnitTestCase {
     protected $map;
     
     public function setUp() {
-        $this-&gt;test_map_file = basename(realpath('.')) . DIRECTORY_SEPARATOR . 'test_dsn2connector.inc.php';
-        @include dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . $this-&gt;test_map_file;
+        $this-&gt;test_map_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test_dsn2connector.inc.php';
+        @include $this-&gt;test_map_file;
         $this-&gt;map = $map;
     }
     
@@ -176,7 +176,7 @@ class DaoFactory_getConnectionString_Test extends Snap_UnitTestCase {
     public function testNoConnectionStringFoundReturnsFalse() {
         return $this-&gt;assertFalse(DaoFactory::getConnectionString('no_matching_dsn', $this-&gt;test_map_file));
     }
-    
+
     // Success case
     public function testFoundAliasReturnsConnectionString() {
         return $this-&gt;assertIdentical($this-&gt;map['test_mysql'], DaoFactory::getConnectionString('test_mysql', $this-&gt;test_map_file));
@@ -193,8 +193,8 @@ class DaoFactory_getDSN_Test extends Snap_UnitTestCase {
     protected $test_map_file;
 
     public function setUp() {
-        $this-&gt;test_map_file = basename(realpath('.')) . DIRECTORY_SEPARATOR . 'test_db2dsn.inc.php';
-        @include dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . $this-&gt;test_map_file;
+        $this-&gt;test_map_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test_db2dsn.inc.php';
+        @include $this-&gt;test_map_file;
         $this-&gt;map = $map;
     }
     
@@ -261,8 +261,8 @@ class DaoFactory_create_connector_Test extends Snap_UnitTestCase {
     protected $test_map_file;
     
     public function setUp() {
-        $this-&gt;test_map_file = basename(realpath('.')) . DIRECTORY_SEPARATOR . 'test_db2dsn.inc.php';
-        @include dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . $this-&gt;test_map_file;
+        $this-&gt;test_map_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test_db2dsn.inc.php';
+        @include $this-&gt;test_map_file;
         $this-&gt;mock_method = $this-&gt;mock('DaoFactory')
             -&gt;setReturnValue('connect', FALSE)
             -&gt;construct();
@@ -278,4 +278,4 @@ class DaoFactory_create_connector_Test extends Snap_UnitTestCase {
         return $this-&gt;assertFalse(DaoFactory::create('testdb.testtable', $this-&gt;test_map_file));
     }
         
-}
\ No newline at end of file
+}</diff>
      <filename>tests/daofactory.stest.php</filename>
    </modified>
    <modified>
      <diff>@@ -30,20 +30,6 @@ class DynamicDao_Test extends Snap_UnitTestCase {
     }
 }
 
-class DynamicDao_setConnector_Test extends Snap_UnitTestCase {
-
-    public function setUp() {
-        $this-&gt;dao = new DAO_Test();
-    }
-
-    public function tearDown() {}
-
-    public function testParamIsNotInstanceOfConnectorReturnsFalse() {
-        $this-&gt;willError();
-        return $this-&gt;assertFalse($this-&gt;dao-&gt;setConnector());
-    }
-}
-
 class DynamicDao_query_Test extends Snap_UnitTestCase {
 
     public function setUp() {
@@ -68,4 +54,4 @@ class DynamicDao_execute_Test extends Snap_UnitTestCase {
 
     public function tearDown() {}
 
-}
\ No newline at end of file
+}</diff>
      <filename>tests/dynamicdao.stest.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>877fbf19023dac9ef3ae1dfd4a1190a95c3f0944</id>
    </parent>
  </parents>
  <author>
    <name>Karen Ziv</name>
    <email>karen@perlessence.com</email>
  </author>
  <url>http://github.com/foobarbazquux/daonut/commit/08536bb0016da605854da945edbaff2466ffdf82</url>
  <id>08536bb0016da605854da945edbaff2466ffdf82</id>
  <committed-date>2008-04-05T09:32:54-07:00</committed-date>
  <authored-date>2008-04-05T09:32:54-07:00</authored-date>
  <message>- getDSN and getConnectionString do not prepend if an absolute path is given for the file parameter
- Tests fixed to adjust for changes to getDSN and getConnectionString
- Added more documentation</message>
  <tree>0b11fe6330b46456410a0f28ff402a9158b44bed</tree>
  <committer>
    <name>Karen Ziv</name>
    <email>karen@perlessence.com</email>
  </committer>
</commit>
