diff -r 5b37998e522e -r 162c1de6545a web/lib/Zend/Amf/Adobe/DbInspector.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Amf/Adobe/DbInspector.php Fri Mar 11 15:05:35 2011 +0100 @@ -0,0 +1,103 @@ +describeTable('Pdo_Mysql', + * array( + * 'host' => '127.0.0.1', + * 'username' => 'webuser', + * 'password' => 'xxxxxxxx', + * 'dbname' => 'test' + * ), + * 'mytable' + * ); + * + * @param string $dbType Database adapter type for Zend_Db + * @param array|object $dbDescription Adapter-specific connection settings + * @param string $tableName Table name + * @return array Table description + * @see Zend_Db::describeTable() + * @see Zend_Db::factory() + */ + public function describeTable($dbType, $dbDescription, $tableName) + { + $db = $this->_connect($dbType, $dbDescription); + return $db->describeTable($tableName); + } + + /** + * Test database connection + * + * @param string $dbType Database adapter type for Zend_Db + * @param array|object $dbDescription Adapter-specific connection settings + * @return bool + * @see Zend_Db::factory() + */ + public function connect($dbType, $dbDescription) + { + $db = $this->_connect($dbType, $dbDescription); + $db->listTables(); + return true; + } + + /** + * Get the list of database tables + * + * @param string $dbType Database adapter type for Zend_Db + * @param array|object $dbDescription Adapter-specific connection settings + * @return array List of the tables + */ + public function getTables($dbType, $dbDescription) + { + $db = $this->_connect($dbType, $dbDescription); + return $db->listTables(); + } +}