Changeset 832
- Timestamp:
- 10/16/2007 07:01:30 AM (14 months ago)
- Files:
-
- 1 modified
-
trunk/system/libraries/Database.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/libraries/Database.php
r828 r832 63 63 * 64 64 * @access public 65 * @param array65 * @param mixed 66 66 * @return void 67 67 */ … … 75 75 elseif (is_string($config)) 76 76 { 77 // Group namd 78 $name = $config; 79 80 // This checks to see if the config is DSN string, or a config group name 81 if (strpos($config, '://') === FALSE) 82 { 83 $name = $config; 84 85 // Test the config group name 86 if (($config = Config::item('database.'.$config)) === FALSE) 87 { 88 throw new Kohana_Database_Exception('database.undefined_group', $name); 89 } 90 } 91 else 77 // The config is a DSN string 78 if (strpos($config, '://') !== FALSE) 92 79 { 93 80 $config = array('connection' => $config); 94 81 } 82 // The config is a group name 83 else 84 { 85 $name = $config; 86 87 // Test the config group name 88 if (($config = Config::item('database.'.$config)) === FALSE) 89 throw new Kohana_Database_Exception('database.undefined_group', $name); 90 } 95 91 } 96 92 … … 100 96 // Make sure the connection is valid 101 97 if (strpos($this->config['connection'], '://') === FALSE) 102 {103 98 throw new Kohana_Exception('database.invalid_dsn', $this->config['connection']); 104 }105 99 106 100 // Parse the DSN, creating an array to hold the connection parameters … … 135 129 136 130 // Find the socket 137 if (preg_match('/^unix\( .+\)/', $connection))131 if (preg_match('/^unix\([^)]++\)/', $connection)) 138 132 { 139 133 // This one is a little hairy: we explode based on the end of
