diff options
author | godzilla80@gmx.net <> | 2009-05-01 09:53:23 +0000 |
---|---|---|
committer | godzilla80@gmx.net <> | 2009-05-01 09:53:23 +0000 |
commit | 9f181be10fb44a768750c2d9fa4cb4d9f66bc836 (patch) | |
tree | 4e4b56f72b34b57ad2f0bde276fc2bf1102ceeaf | |
parent | c6904380ac34536c0f3d65d3c92deaa9fa532f4a (diff) |
Fixed Issue #122 - SqlMap: support for properties in resource filenames, fix sqlmap doc - property "name" instead of "key"
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | docs/sqlmap/latex/ch8.tex | 10 | ||||
-rw-r--r-- | framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php | 6 |
3 files changed, 12 insertions, 5 deletions
@@ -8,6 +8,7 @@ BUG: Issue#99 - TActiveRecord::save(): confusion with order of keys in table/ind BUG: Issue#108 - clientscripts.php: prepending set_time_limit(0) call with an "@" to suppress PHP warning in safe mode (Yves) BUG: Issue#107 - typo in TDbConnection::getCharset() (Christophe) BUG: Issue#120 - TActiveDropDownList PromptText and PromptValue got lost during callback and data rebind (Yves) +BUG: Issue#122 - SqlMap: support for properties in resource filenames, fix sqlmap doc - property "name" instead of "key" (Yves) BUG: Issue#126 - THtmlArea: boolean options output as strings (Christophe) BUG: Issue#127 - TDataSourceConfig::findConnectionByID try to access private var (Cristophe) BUG: Issue#129 - TDbLogRoute::init don't close the sql command (Christophe) diff --git a/docs/sqlmap/latex/ch8.tex b/docs/sqlmap/latex/ch8.tex index 7d7e3576..79ab7418 100644 --- a/docs/sqlmap/latex/ch8.tex +++ b/docs/sqlmap/latex/ch8.tex @@ -166,7 +166,7 @@ elements. For example: <properties>
<property resource="myProperties.config"/>
<property resource="anotherProperties.config"/>
- <property key="host" value="ibatis.com" />
+ <property name="host" value="ibatis.com" />
</properties>
\end{verbatim}
@@ -188,11 +188,11 @@ elements. For example: \\
\hline
%
- \tt{key} &
+ \tt{name} &
\begin{minipage}{0.7\textwidth}\vspace{2mm}
- Defines a property key (variable) name
+ Defines a property name (variable) name
\vspace{-3mm}\begin{verbatim}
- key="username"
+ name="username"
\end{verbatim}\vspace{-5mm}
\end{minipage}
\\
@@ -201,7 +201,7 @@ elements. For example: \tt{value} &
\begin{minipage}{0.7\textwidth}\vspace{2mm}
Defines a value that will be used by the DataMapper in place of the
- the specified property key/variable
+ the specified property name/variable
\vspace{-3mm}\begin{verbatim}
value="mydbuser"
\end{verbatim}\vspace{-5mm}
diff --git a/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php b/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php index ce122f6a..5854b21a 100644 --- a/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php +++ b/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php @@ -89,6 +89,9 @@ abstract class TSqlMapXmlConfigBuilder */
protected function loadXmlDocument($filename,TSqlMapXmlConfiguration $config)
{
+ if( strpos($filename, '${') !== false)
+ $filename = $config->replaceProperties($filename);
+
if(!is_file($filename))
throw new TSqlMapConfigurationException(
'sqlmap_unable_to_find_config', $filename);
@@ -228,6 +231,9 @@ class TSqlMapXmlConfiguration extends TSqlMapXmlConfigBuilder {
if(strlen($resource = (string)$node['resource']) > 0)
{
+ if( strpos($resource, '${') !== false)
+ $resource = $this->replaceProperties($resource);
+
$mapping = new TSqlMapXmlMappingConfiguration($this);
$filename = $this->getAbsoluteFilePath($this->_configFile, $resource);
$mapping->configure($filename);
|