I wish I could remember why I did this... If I remember, it was the same kind of thing that 1.30 is giving me. Something in the adodb lite core was relying on a piece that was in the transaction module. I think it was the same kind of thing... they're not testing properly without all of the modules turned off.
And I agree, we shouldn't need transaction code. We're not using it anywhere.... though maybe we should.
But to use it the tables must bei InnoDB and not Myisam and this only a few providers have enabled it.
And here the text of the Adodb Lite Handbook
Transaction functions for the mssql, mssqlpo, mysqli, mysqlt, odbc, postgres, postgres64, postgres7, postgres8, sqlite, sqlitepo, sybase and sybase_ase Drivers. The Transaction Module will add 10-12k to the libraries memory overhead.
Mysql is not supported AND you have no need for transactions because never in use.
if (ini_get("safe_mode") != "1")
$this->use_sub_dirs = true;
//$this->caching = false; this is smarty default
//$this->compile_check = true; this is smarty default
$this->assign('app_name','CMS');
//$this->debugging = false; this is smarty default
//$this->force_compile = false; this is smarty default
$this->cache_plugins = false;
if ($config["debug"] == true)
{
//$this->caching = false; this is smarty default
$this->force_compile = true;
$this->debugging = true;
}
i find this echo $sql_queries; here ( and in several scripts)
All fixed. Though $sql_queries stuff isn't even used anymore, so I just took it out.
Piratos wrote:
Some little things:
if (ini_get("safe_mode") != "1")
$this->use_sub_dirs = true;
//$this->caching = false; this is smarty default
//$this->compile_check = true; this is smarty default
$this->assign('app_name','CMS');
//$this->debugging = false; this is smarty default
//$this->force_compile = false; this is smarty default
$this->cache_plugins = false;
if ($config["debug"] == true)
{
//$this->caching = false; this is smarty default
$this->force_compile = true;
$this->debugging = true;
}
i find this echo $sql_queries; here ( and in several scripts)
this
/*
$query = "SELECT * from ".cms_db_prefix()."modules";
$result = $db->Execute($query);
while ($result && $row = $result->FetchRow()) {
$dbm[$row['module_name']]['Status'] = $row['status'];
$dbm[$row['module_name']]['Version'] = $row['version'];
$dbm[$row['module_name']]['Active'] = ($row['active'] == 1?true:false);
}
*/
should be changed to this because faster, less memory and the resultset was closed by GetArray
$result = $db->GetArray("SELECT * from ".cms_db_prefix()."modules");
if ($result !=false)
{ foreach ($result as $row )
{
$dbm[$row['module_name']]['Status'] = $row['status'];
$dbm[$row['module_name']]['Version'] = $row['version'];
$dbm[$row['module_name']]['Active'] = ($row['active'] == 1?true:false);
}
}
$result = $db->GetArray("SELECT * FROM ".cms_db_prefix()."templates ORDER BY template_name");
if ($result != false) foreach ($result as $row) $templates[$row['template_id']] = $row['template_name'];
function cms_mapi_create_permission($cms, $permission_name, $permission_text)
{
global $gCms;
$db = &$gCms->GetDb();
$query = "SELECT permission_id FROM ".cms_db_prefix()."permissions WHERE permission_name =" . $db->qstr($permission_name);
$result = $db->Execute($query);
if ($result && $result->RecordCount() GenID(cms_db_prefix()."permissions_seq");
$query = "INSERT INTO ".cms_db_prefix()."permissions (permission_id, permission_name, permission_text, create_date, modified_date) VALUES ($new_id, ".$db->qstr($permission_name).",".$db->qstr($permission_text).",".$db->DBTimeStamp(time()).",".$db->DBTimeStamp(time()).")";
$db->Execute($query);
}
if ($result) $result->Close();
}
should changed to this because
GetOne automatically closing the resultset
inputar automatically using qstr if the value has the type string.
less code, less memory and a little bit more speed
function cms_mapi_create_permission($cms, $permission_name, $permission_text)
{
global $gCms;
$db = &$gCms->GetDb();
$result = $db->GetOne("SELECT permission_id FROM ".cms_db_prefix()."permissions WHERE permission_name = ?",array($permission_name));
if ($result == false)
{
$new_id = $db->GenID(cms_db_prefix()."permissions_seq");
$query = "INSERT INTO ".cms_db_prefix()."permissions (permission_id, permission_name, permission_text, create_date, modified_date) VALUES ( ?,?,?,?,?)";
$db->Execute($query,array(new_id,$permission_name,$permission_text,$db->DBTimeStamp(time()),$db->DBTimeStamp(time())));
}
}
the function cms_mapi_create_permission exists twice see module.function.php
Last edited by Piratos on Sun Sep 10, 2006 5:26 pm, edited 1 time in total.