[wp-cvs] wordpress/wp-includes functions.php,1.184,1.185
Matthew Mullenweg
saxmatt at users.sourceforge.net
Fri Oct 8 19:50:01 UTC 2004
Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24665/wp-includes
Modified Files:
functions.php
Log Message:
Automatically trigger DB upgrade.
Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.184
retrieving revision 1.185
diff -C2 -d -r1.184 -r1.185
*** functions.php 8 Oct 2004 11:52:23 -0000 1.184
--- functions.php 8 Oct 2004 19:49:58 -0000 1.185
***************
*** 341,357 ****
function get_alloptions() {
! global $wpdb;
! if ($options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'")) {
! foreach ($options as $option) {
! // "When trying to design a foolproof system,
! // never underestimate the ingenuity of the fools :)" -- Dougal
! if ('siteurl' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
! if ('home' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
! if ('category_base' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
! if (@ $value = unserialize($option->option_value) )
! $all_options->{$option->option_name} = $value;
! else $value = $option->option_value;
! $all_options->{$option->option_name} = $value;
! }
}
return $all_options;
--- 341,363 ----
function get_alloptions() {
! global $wpdb, $wp_queries;
! $wpdb->hide_errors();
! if (!$options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'")) {
! include_once(ABSPATH . '/wp-admin/upgrade-functions.php');
! make_db_current_silent();
! $options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options");
! }
! $wpdb->show_errors();
!
! foreach ($options as $option) {
! // "When trying to design a foolproof system,
! // never underestimate the ingenuity of the fools :)" -- Dougal
! if ('siteurl' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
! if ('home' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
! if ('category_base' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
! if (@ $value = unserialize($option->option_value) )
! $all_options->{$option->option_name} = $value;
! else $value = $option->option_value;
! $all_options->{$option->option_name} = $value;
}
return $all_options;
More information about the cvs
mailing list