diff options
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);
+ }
}
/**
|