~canonical-sysadmins/wordpress/3.9.x

« back to all changes in this revision

Viewing changes to wp-admin/includes/schema.php

  • Committer: Chris Jones
  • Date: 2010-01-19 13:17:33 UTC
  • Revision ID: cmsj@tenshu.net-20100119131733-rf31jv9k1v0xzo2h
[CJ] Import wordpress 2.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
// Declare these as global in case schema.php is included from a function.
20
20
global $wpdb, $wp_queries;
21
21
 
22
 
if ( $wpdb->has_cap( 'collation' ) ) {
23
 
        if ( ! empty($wpdb->charset) )
24
 
                $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
25
 
        if ( ! empty($wpdb->collate) )
26
 
                $charset_collate .= " COLLATE $wpdb->collate";
27
 
}
 
22
if ( ! empty($wpdb->charset) )
 
23
        $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
 
24
if ( ! empty($wpdb->collate) )
 
25
        $charset_collate .= " COLLATE $wpdb->collate";
28
26
 
29
27
/** Create WordPress database tables SQL */
30
28
$wp_queries = "CREATE TABLE $wpdb->terms (
54
52
 PRIMARY KEY  (object_id,term_taxonomy_id),
55
53
 KEY term_taxonomy_id (term_taxonomy_id)
56
54
) $charset_collate;
 
55
CREATE TABLE $wpdb->commentmeta (
 
56
  meta_id bigint(20) unsigned NOT NULL auto_increment,
 
57
  comment_id bigint(20) unsigned NOT NULL default '0',
 
58
  meta_key varchar(255) default NULL,
 
59
  meta_value longtext,
 
60
  PRIMARY KEY  (meta_id),
 
61
  KEY comment_id (comment_id),
 
62
  KEY meta_key (meta_key)
 
63
) $charset_collate;
57
64
CREATE TABLE $wpdb->comments (
58
65
  comment_ID bigint(20) unsigned NOT NULL auto_increment,
59
66
  comment_post_ID bigint(20) unsigned NOT NULL default '0',
99
106
  option_name varchar(64) NOT NULL default '',
100
107
  option_value longtext NOT NULL,
101
108
  autoload varchar(20) NOT NULL default 'yes',
102
 
  PRIMARY KEY  (option_id,blog_id,option_name),
103
 
  KEY option_name (option_name)
 
109
  PRIMARY KEY  (option_id),
 
110
  UNIQUE KEY option_name (option_name)
104
111
) $charset_collate;
105
112
CREATE TABLE $wpdb->postmeta (
106
113
  meta_id bigint(20) unsigned NOT NULL auto_increment,
180
187
        do_action('populate_options');
181
188
 
182
189
        if ( ini_get('safe_mode') ) {
183
 
                // Safe mode screws up mkdir(), so we must use a flat structure.
 
190
                // Safe mode can break mkdir() so use a flat structure by default.
184
191
                $uploads_use_yearmonth_folders = 0;
185
 
                $upload_path = WP_CONTENT_DIR;
186
192
        } else {
187
193
                $uploads_use_yearmonth_folders = 1;
188
 
                $upload_path = WP_CONTENT_DIR . '/uploads';
189
194
        }
190
195
 
191
196
        $options = array(
200
205
        'require_name_email' => 1,
201
206
        'comments_notify' => 1,
202
207
        'posts_per_rss' => 10,
203
 
        'rss_excerpt_length' => 50,
204
208
        'rss_use_excerpt' => 0,
205
209
        'mailserver_url' => 'mail.example.com',
206
210
        'mailserver_login' => 'login@example.com',
257
261
 
258
262
        // 2.0.1
259
263
        'uploads_use_yearmonth_folders' => $uploads_use_yearmonth_folders,
260
 
        'upload_path' => $upload_path,
 
264
        'upload_path' => '',
261
265
 
262
266
        // 2.0.3
263
267
        'secret' => wp_generate_password(64),
305
309
        'widget_rss' => array(),
306
310
 
307
311
        // 2.8
308
 
        'timezone_string' => ''
 
312
        'timezone_string' => '',
 
313
 
 
314
        // 2.9
 
315
        'embed_autourls' => 1,
 
316
        'embed_size_w' => '',
 
317
        'embed_size_h' => 600,
309
318
        );
310
319
 
311
320
        // Set autoload to no for these options
339
348
 
340
349
        // Delete unused options
341
350
        $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins', 'can_compress_scripts',
342
 
                'page_uris', 'rewrite_rules', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed');
 
351
                'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed', 'rss_excerpt_length');
343
352
        foreach ($unusedoptions as $option)
344
353
                delete_option($option);
 
354
        
 
355
        // delete obsolete magpie stuff
 
356
        $wpdb->query("DELETE FROM $wpdb->options WHERE option_name REGEXP '^rss_[0-9a-f]{32}(_ts)?$'");
345
357
}
346
358
 
347
359
/**