diff --git a/lib/db/mysql.php b/lib/db/mysql.php index 710672f4c86..db4f9d4dddb 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -643,8 +643,8 @@ function main_upgrade($oldversion=0) { table_column("course", "", "lang", "varchar", "5", "", "", "", "groupmodeforce"); } - if ($oldversion < 2004020902) { - modify_database("", "CREATE TABLE `prefix_text_cache` ( + if ($oldversion < 2004020903) { + modify_database("", "CREATE TABLE `prefix_cache_text` ( `id` int(10) unsigned NOT NULL auto_increment, `md5key` varchar(32) NOT NULL default '', `formattedtext` longtext NOT NULL, diff --git a/lib/db/mysql.sql b/lib/db/mysql.sql index 651b38c7db5..92c62186eee 100644 --- a/lib/db/mysql.sql +++ b/lib/db/mysql.sql @@ -158,10 +158,10 @@ CREATE TABLE `prefix_event` ( # -------------------------------------------------------- # -# Table structure for table `text_cache` +# Table structure for table `cache_text` # -CREATE TABLE `prefix_text_cache` ( +CREATE TABLE `prefix_cache_text` ( `id` int(10) unsigned NOT NULL auto_increment, `md5key` varchar(32) NOT NULL default '', `formattedtext` longtext NOT NULL, diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index 173fa09a5b0..4f10dcc3066 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -389,8 +389,8 @@ function main_upgrade($oldversion=0) { table_column("course", "", "lang", "varchar", "5", "", "", "", "groupmodeforce"); } - if ($oldversion < 2004020902) { - modify_database("", "CREATE TABLE prefix_text_cache ( + if ($oldversion < 2004020903) { + modify_database("", "CREATE TABLE prefix_cache_text ( id SERIAL PRIMARY KEY, md5key varchar(32) NOT NULL default '', formattedtext text, diff --git a/lib/db/postgres7.sql b/lib/db/postgres7.sql index 1a57c320db0..3538f4b389c 100644 --- a/lib/db/postgres7.sql +++ b/lib/db/postgres7.sql @@ -165,7 +165,7 @@ CREATE TABLE prefix_scale ( timemodified integer NOT NULL default '0' ); -CREATE TABLE prefix_text_cache ( +CREATE TABLE prefix_cache_text ( id SERIAL PRIMARY KEY, md5key varchar(32) NOT NULL default '', formattedtext text, diff --git a/lib/weblib.php b/lib/weblib.php index 8120fbd1efd..301e5df4a43 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -494,7 +494,7 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL if (!empty($CFG->cachetext)) { $time = time() - $CFG->cachetext; $md5key = md5($text); - if ($cacheitem = get_record_select('text_cache', "md5key = '$md5key' AND timemodified > '$time'")) { + if ($cacheitem = get_record_select('cache_text', "md5key = '$md5key' AND timemodified > '$time'")) { return $cacheitem->formattedtext; } } @@ -539,7 +539,7 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL $newrecord->md5key = $md5key; $newrecord->formattedtext = addslashes($text); $newrecord->timemodified = time(); - insert_record('text_cache', $newrecord); + insert_record('cache_text', $newrecord); } return $text; diff --git a/version.php b/version.php index 1637f4c9e3b..e6683c20c69 100644 --- a/version.php +++ b/version.php @@ -5,7 +5,7 @@ // database to determine whether upgrades should // be performed (see lib/db/*.php) -$version = 2004020902; // The current version is a date (YYYYMMDDXX) +$version = 2004020903; // The current version is a date (YYYYMMDDXX) $release = "1.2 development"; // User-friendly version number