Closed (fixed)
Project:
Chaos Tool Suite (ctools)
Version:
6.x-1.0-beta3
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Jul 2009 at 02:52 UTC
Updated:
4 Aug 2009 at 19:10 UTC
I've been playing around with Drupal6 using SQLite database layer, as per this page.
http://coolsoft.altervista.org/en/drupal-sqlite
I found that the ctools file includes/css.inc invokes SQL TRUNCATE command, which is not supported by SQLite, so I added a conditional statement to check for database type:
/**
* Delegated implementation of hook_flush_caches()
*/
function ctools_css_flush_caches() {
global $db_type;
file_scan_directory(file_create_path('ctools/css'), '.*', array('.', '..', 'CVS'), 'file_delete', TRUE);
if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'pgsql' ) {
db_query("TRUNCATE {ctools_css_cache}");
}
elseif ($db_type == 'sqlite') {
db_query("DELETE FROM {ctools_css_cache}");
}
}
Please respond if you would like for me to create patch against the HEAD version of ctools. AFAIK, SQLite support is already planned for D7, but this could be useful for backporting.
Comments
Comment #1
merlinofchaos commentedDELETE FROM is supported by all databases, so it would be preferable to use that rather than have a conditional in there. I can accept that patch.
Comment #2
merlinofchaos commentedFixed in -dev.