2 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
4 // +----------------------------------------------------------------------+
5 // | Akelos Framework - http://www.akelos.org |
6 // +----------------------------------------------------------------------+
7 // | Copyright (c) 2002-2006, Akelos Media, S.L. & Bermi Ferrer Martinez |
8 // | Released under the GNU Lesser General Public License, see LICENSE.txt|
9 // +----------------------------------------------------------------------+
12 * @package ActiveSupport
13 * @subpackage Installer
14 * @author Bermi Ferrer <bermi a.t akelos c.om>
15 * @copyright Copyright (c) 2002-2006, Akelos Media, S.L. http://www.akelos.org
16 * @license GNU Lesser General Public License <http://www.gnu.org/copyleft/lesser.html>
19 require_once(AK_LIB_DIR
.DS
.'Ak.php');
25 function AkDbManager($db_connection = null)
27 if(empty($db_connection)){
28 $this->_db
=& Ak
::db();
30 $this->_db
=& $db_connection;
34 function createTable($table_name, $table_fields, $table_options, $add_sequence_table = true, $table_index_fields = null)
36 if(!isset($this->_db
)){
42 $dict = NewDataDictionary($db);
43 $sqlarray = $dict->CreateTableSQL($table_name, $table_fields, $table_options);
44 $dict->ExecuteSQLArray($sqlarray);
45 if(isset($table_index_fields)){
46 $sqlarray = $dict->CreateIndexSQL('idx_'.$table_name, $table_name, $table_index_fields);
47 $dict->ExecuteSQLArray($sqlarray);
49 if($add_sequence_table){
50 $db->CreateSequence('seq_'.$table_name);
60 function loadFromDatabase(){}
61 function loadFromDatabaseTable(){}
62 function loadTableFromXml(){}
63 function loadDatabaseFromXml(){}
65 function updateDatabase(){}
66 function updateDatabaseTable(){}
68 function createDatabase(){}
69 function createDatabaseTable(){}
71 function saveTableSchemaAsXml(){}
72 function saveDatabaseSchemaAsXml(){}