diff options
5 files changed, 35 insertions, 5 deletions
diff --git a/framework/Data/Common/Mysql/TMysqlMetaData.php b/framework/Data/Common/Mysql/TMysqlMetaData.php index 15a75ae5..89e9e3ca 100644 --- a/framework/Data/Common/Mysql/TMysqlMetaData.php +++ b/framework/Data/Common/Mysql/TMysqlMetaData.php @@ -1,14 +1,31 @@ <?php
/**
+ * TMysqlMetaData class file.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright © 2005-2007 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @package System.Data.Common.Mysql
+ */
+
+/**
* Load the base TDbMetaData class.
*/
Prado::using('System.Data.Common.TDbMetaData');
Prado::using('System.Data.Common.Mysql.TMysqlTableInfo');
/**
- * Requires PHP 5.1.3 due to problem with mysql and PDO.
+ * TMysqlMetaData loads Mysql version 4.1.x and 5.x database table and column information.
+ *
+ * For Mysql version 4.1.x, PHP 5.1.3 or later is required.
* See http://netevil.org/node.php?nid=795&SC=1
*
+ * @author Wei Zhuo <weizho[at]gmail[dot]com>
+ * @version $Id$
+ * @package System.Data.Commom.Sqlite
+ * @since 3.1
*/
class TMysqlMetaData extends TDbMetaData
{
@@ -125,7 +142,6 @@ class TMysqlMetaData extends TDbMetaData return $type==='set' || $type==='enum';
}
-
/**
* @param string table name, may be quoted with back-ticks and may contain database name.
* @return array tuple ($schema,$table), $schema may be null.
@@ -268,9 +284,13 @@ EOD; * @param string database name
* @param string table name
* @return string SQL command to create the table.
+ * @throws TDbException if PHP version is less than 5.1.3
*/
protected function getShowCreateTable($schemaName, $tableName)
{
+ if(version_compare(PHP_VERSION,'5.1.3','<'))
+ throw new TDbException('dbmetadata_requires_php_version', 'Mysql 4.1.x', '5.1.3');
+
//See http://netevil.org/node.php?nid=795&SC=1
$this->getDbConnection()->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
if($schemaName!==null)
diff --git a/framework/Data/Common/Sqlite/TSqliteMetaData.php b/framework/Data/Common/Sqlite/TSqliteMetaData.php index ef33f968..f9b49488 100644 --- a/framework/Data/Common/Sqlite/TSqliteMetaData.php +++ b/framework/Data/Common/Sqlite/TSqliteMetaData.php @@ -1,4 +1,4 @@ -<?php +<?php
/**
* TSqliteMetaData class file.
*
@@ -17,7 +17,7 @@ Prado::using('System.Data.Common.TDbMetaData'); Prado::using('System.Data.Common.Sqlite.TSqliteTableInfo');
/**
- * TSqliteMetaData loads PostgreSQL database table and column information.
+ * TSqliteMetaData loads SQLite database table and column information.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
* @version $Id: TSqliteMetaData.php 1861 2007-04-12 08:05:03Z wei $
diff --git a/framework/Exceptions/messages.txt b/framework/Exceptions/messages.txt index b3074ad6..bd54d1cf 100644 --- a/framework/Exceptions/messages.txt +++ b/framework/Exceptions/messages.txt @@ -372,6 +372,7 @@ dbcommon_invalid_table_name = Database table '{0}' not found. Error Msg: {1}. dbcommon_invalid_identifier_name = Invalid database identifier name '{0}', see {1} for details.
dbtableinfo_invalid_column_name = Invalid column name '{0}' for database table '{1}'.
dbmetadata_invalid_table_view = Invalid table/view name '{0}', or that table/view '{0}' contains no accessible column/field definitions.
+dbmetadata_requires_php_version = PHP version {1} or later is required for using {0} database.
dbtablegateway_invalid_criteria = Invalid criteria object, must be a string or instance of TSqlCriteria.
dbtablegateway_no_primary_key_found = Table '{0}' does not contain any primary key fields.
diff --git a/framework/Web/UI/ActiveControls/TAutoComplete.php b/framework/Web/UI/ActiveControls/TAutoComplete.php index bde7d811..aaa14920 100644 --- a/framework/Web/UI/ActiveControls/TAutoComplete.php +++ b/framework/Web/UI/ActiveControls/TAutoComplete.php @@ -340,7 +340,7 @@ class TAutoComplete extends TActiveTextBox implements INamingContainer $options['ID'] = $this->getClientID();
$options['EventTarget'] = $this->getUniqueID();
if(($minchars=$this->getMinChars())!=='')
- $options['minchars'] = $minchars;
+ $options['minChars'] = $minchars;
if(($frequency=$this->getFrequency())!=='')
$options['frequency'] = $frequency;
return $options;
diff --git a/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page index 85bc2716..477764c3 100644 --- a/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page @@ -73,6 +73,15 @@ <p><br /></p> <com:TActiveLabel ID="label1" Text="Label 1" /> + + <com:TAutoComplete Style="width: 10em" + id="textbox4" + OnSuggest="suggestCountries" + OnCallback="callback_requested" + OnSuggestionSelected="suggestion_selected" + ResultPanel.CssClass="autocomplete" + MinChars="4" Frequency="2" /> + <p><br /></p> <p><br /></p> <p><br /></p> |