-// $table_prefix is deprecated as of 2.1
-$wpdb->prefix = $table_prefix;
-
-if ( preg_match('|[^a-z0-9_]|i', $wpdb->prefix) && !file_exists(ABSPATH . 'wp-content/db.php') )
- wp_die("<strong>ERROR</strong>: <code>$table_prefix</code> in <code>wp-config.php</code> can only contain numbers, letters, and underscores.");
-
-// Table names
-$wpdb->posts = $wpdb->prefix . 'posts';
-$wpdb->users = $wpdb->prefix . 'users';
-$wpdb->categories = $wpdb->prefix . 'categories';
-$wpdb->post2cat = $wpdb->prefix . 'post2cat';
-$wpdb->comments = $wpdb->prefix . 'comments';
-$wpdb->link2cat = $wpdb->prefix . 'link2cat';
-$wpdb->links = $wpdb->prefix . 'links';
-$wpdb->options = $wpdb->prefix . 'options';
-$wpdb->postmeta = $wpdb->prefix . 'postmeta';
-$wpdb->usermeta = $wpdb->prefix . 'usermeta';
-$wpdb->terms = $wpdb->prefix . 'terms';
-$wpdb->term_taxonomy = $wpdb->prefix . 'term_taxonomy';
-$wpdb->term_relationships = $wpdb->prefix . 'term_relationships';
-
-if ( defined('CUSTOM_USER_TABLE') )
- $wpdb->users = CUSTOM_USER_TABLE;
-if ( defined('CUSTOM_USER_META_TABLE') )
- $wpdb->usermeta = CUSTOM_USER_META_TABLE;
-
-if ( file_exists(ABSPATH . 'wp-content/object-cache.php') )
- require_once (ABSPATH . 'wp-content/object-cache.php');
-else
+/**
+ * Format specifiers for DB columns. Columns not listed here default to %s.
+ * @since 2.8.0
+ * @see wpdb:$field_types
+ * @see wpdb:prepare()
+ * @see wpdb:insert()
+ * @see wpdb:update()
+ */
+$wpdb->field_types = array( 'post_author' => '%d', 'post_parent' => '%d', 'menu_order' => '%d', 'term_id' => '%d', 'term_group' => '%d', 'term_taxonomy_id' => '%d',
+ 'parent' => '%d', 'count' => '%d','object_id' => '%d', 'term_order' => '%d', 'ID' => '%d', 'commment_ID' => '%d', 'comment_post_ID' => '%d', 'comment_parent' => '%d',
+ 'user_id' => '%d', 'link_id' => '%d', 'link_owner' => '%d', 'link_rating' => '%d', 'option_id' => '%d', 'blog_id' => '%d', 'meta_id' => '%d', 'post_id' => '%d',
+ 'user_status' => '%d', 'umeta_id' => '%d', 'comment_karma' => '%d', 'comment_count' => '%d');
+
+$prefix = $wpdb->set_prefix($table_prefix);
+
+if ( is_wp_error($prefix) )
+ wp_die(/*WP_I18N_BAD_PREFIX*/'<strong>ERROR</strong>: <code>$table_prefix</code> in <code>wp-config.php</code> can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/);
+
+/**
+ * Copy an object.
+ *
+ * Returns a cloned copy of an object.
+ *
+ * @since 2.7.0
+ *
+ * @param object $object The object to clone
+ * @return object The cloned object
+ */
+function wp_clone( $object ) {
+ static $can_clone;
+ if ( !isset( $can_clone ) ) {
+ $can_clone = version_compare( phpversion(), '5.0', '>=' );
+ }
+ return $can_clone ? clone( $object ) : $object;
+}
+
+/**
+ * Whether the current request is in WordPress admin Panel
+ *
+ * Does not inform on whether the user is an admin! Use capability checks to
+ * tell if the user should be accessing a section or not.
+ *
+ * @since 1.5.1
+ *
+ * @return bool True if inside WordPress administration pages.
+ */
+function is_admin() {
+ if ( defined('WP_ADMIN') )
+ return WP_ADMIN;
+ return false;
+}
+
+if ( file_exists(WP_CONTENT_DIR . '/object-cache.php') ) {
+ require_once (WP_CONTENT_DIR . '/object-cache.php');
+ $_wp_using_ext_object_cache = true;
+} else {