diff options
author | wei <> | 2006-12-17 22:20:50 +0000 |
---|---|---|
committer | wei <> | 2006-12-17 22:20:50 +0000 |
commit | 2570226fbac3e26b1e94896b50d1db4bc1aa3308 (patch) | |
tree | 421108ccbdc0ef021e6af4fa35b1d6bcbc352b37 /framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php | |
parent | ddc0de38f64e5834ce04f0407a8416172b596655 (diff) |
Add TDataSourceConfig, TSqlMapConfig, TActiveRecordConfig
Diffstat (limited to 'framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php')
-rw-r--r-- | framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php b/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php index eccf4f6e..d92a0f07 100644 --- a/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php +++ b/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php @@ -180,6 +180,10 @@ class TSqlMapXmlConfiguration extends TSqlMapXmlConfigBuilder foreach($document->xpath('//connection[last()]') as $conn)
$this->loadDatabaseConnection($conn);
+ //try to load configuration in the current config file.
+ $mapping = new TSqlMapXmlMappingConfiguration($this);
+ $mapping->configure($filename);
+
foreach($document->xpath('//sqlMap') as $sqlmap)
$this->loadSqlMappingFiles($sqlmap);
@@ -222,9 +226,12 @@ class TSqlMapXmlConfiguration extends TSqlMapXmlConfigBuilder */
protected function loadSqlMappingFiles($node)
{
- $mapping = new TSqlMapXmlMappingConfiguration($this);
- $filename = $this->getAbsoluteFilePath($this->_configFile, (string)$node['resource']);
- $mapping->configure($filename);
+ if(strlen($resource = (string)$node['resource']) > 0)
+ {
+ $mapping = new TSqlMapXmlMappingConfiguration($this);
+ $filename = $this->getAbsoluteFilePath($this->_configFile, $resource);
+ $mapping->configure($filename);
+ }
}
/**
|