<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[16142] trunk: Rename class.wp-object-query.php to class-wp-object-query.
php.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/16142">16142</a></dd>
<dt>Author</dt> <dd>scribu</dd>
<dt>Date</dt> <dd>2010-11-01 20:21:29 +0000 (Mon, 01 Nov 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Rename class.wp-object-query.php to class-wp-object-query.php. See <a href="http://trac.wordpress.org/ticket/15032">#15032</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpsettingsphp">trunk/wp-settings.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkwpincludesclasswpobjectqueryphp">trunk/wp-includes/class-wp-object-query.php</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkwpincludesclasswpobjectqueryphp">trunk/wp-includes/class.wp-object-query.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesclasswpobjectqueryphpfromrev16140trunkwpincludesclasswpobjectqueryphp"></a>
<div class="copfile"><h4>Copied: trunk/wp-includes/class-wp-object-query.php (from rev 16140, trunk/wp-includes/class.wp-object-query.php) (0 => 16142)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/class-wp-object-query.php         (rev 0)
+++ trunk/wp-includes/class-wp-object-query.php        2010-11-01 20:21:29 UTC (rev 16142)
</span><span class="lines">@@ -0,0 +1,239 @@
</span><ins>+<?php
+/**
+ * WordPress Query class.
+ *
+ * Abstract class for handling advanced queries
+ *
+ * @package WordPress
+ * @since 3.1.0
+ */
+class WP_Object_Query {
+
+        /**
+         * Query vars, after parsing
+         *
+         * @since 3.1.0
+         * @access public
+         * @var array
+         */
+        var $query_vars;
+
+        /**
+         * Retrieve query variable.
+         *
+         * @since 3.1.0
+         * @access public
+         *
+         * @param string $query_var Query variable key.
+         * @return mixed
+         */
+        function get( $query_var ) {
+                if ( isset( $this->query_vars[$query_var] ) )
+                        return $this->query_vars[$query_var];
+
+                return '';
+        }
+
+        /**
+         * Set query variable.
+         *
+         * @since 3.1.0
+         * @access public
+         *
+         * @param string $query_var Query variable key.
+         * @param mixed $value Query variable value.
+         */
+        function set( $query_var, $value ) {
+                $this->query_vars[ $query_var ] = $value;
+        }
+
+        /*
+         * Populates the $meta_query property
+         *
+         * @access protected
+         * @since 3.1.0
+         *
+         * @param array $qv The query variables
+         */
+        function parse_meta_query( &$qv ) {
+                $meta_query = array();
+
+                // Simple query needs to be first for orderby=meta_value to work correctly
+                foreach ( array( 'key', 'value', 'compare', 'type' ) as $key ) {
+                        if ( !empty( $qv[ "meta_$key" ] ) )
+                                $meta_query[0][ $key ] = $qv[ "meta_$key" ];
+                }
+
+                if ( !empty( $qv['meta_query'] ) && is_array( $qv['meta_query'] ) ) {
+                        $meta_query = array_merge( $meta_query, $qv['meta_query'] );
+                }
+
+                $qv['meta_query'] = $meta_query;
+        }
+
+        /*
+         * Used internally to generate an SQL string for searching across multiple meta key = value pairs
+         *
+         * @access protected
+         * @since 3.1.0
+         *
+         * @param array $meta_query List of metadata queries. A single query is an associative array:
+         * - 'key' string The meta key
+         * - 'value' string|array The meta value
+         * - 'compare' (optional) string How to compare the key to the value.
+         *                Possible values: '=', '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'.
+         *                Default: '='
+         * - 'type' string (optional) The type of the value.
+         *                Possible values: 'NUMERIC', 'BINARY', 'CHAR', 'DATE', 'DATETIME', 'DECIMAL', 'SIGNED', 'TIME', 'UNSIGNED'.
+         *                Default: 'CHAR'
+         *
+         * @param string $primary_table
+         * @param string $primary_id_column
+         * @param string $meta_table
+         * @param string $meta_id_column
+         * @return array( $join_sql, $where_sql )
+         */
+        function get_meta_sql( $meta_query, $primary_table, $primary_id_column, $meta_table, $meta_id_column ) {
+                global $wpdb;
+
+                $clauses = array();
+
+                $join = '';
+                $where = '';
+                $i = 0;
+                foreach ( $meta_query as $q ) {
+                        $meta_key = isset( $q['key'] ) ? trim( $q['key'] ) : '';
+                        $meta_value = isset( $q['value'] ) ? $q['value'] : '';
+                        $meta_compare = isset( $q['compare'] ) ? strtoupper( $q['compare'] ) : '=';
+                        $meta_type = isset( $q['type'] ) ? strtoupper( $q['type'] ) : 'CHAR';
+
+                        if ( ! in_array( $meta_compare, array( '=', '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) )
+                                $meta_compare = '=';
+
+                        if ( 'NUMERIC' == $meta_type )
+                                $meta_type = 'SIGNED';
+                        elseif ( ! in_array( $meta_type, array( 'BINARY', 'CHAR', 'DATE', 'DATETIME', 'DECIMAL', 'SIGNED', 'TIME', 'UNSIGNED' ) ) )
+                                $meta_type = 'CHAR';
+
+                        if ( empty( $meta_key ) && empty( $meta_value ) )
+                                continue;
+
+                        $alias = $i ? 'mt' . $i : $meta_table;
+
+                        $join .= "\nINNER JOIN $meta_table";
+                        $join .= $i ? " AS $alias" : '';
+                        $join .= " ON ($primary_table.$primary_id_column = $alias.$meta_id_column)";
+
+                        $i++;
+
+                        if ( !empty( $meta_key ) )
+                                $where .= $wpdb->prepare( " AND $alias.meta_key = %s", $meta_key );
+
+                        if ( in_array( $meta_compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) ) {
+                                if ( ! is_array( $meta_value ) )
+                                        $meta_value = preg_split( '/[,\s]+/', $meta_value );
+                        } else {
+                                $meta_value = trim( $meta_value );
+                        }
+
+                        if ( empty( $meta_value ) )
+                                continue;
+
+                        if ( 'IN' == substr( $meta_compare, -2) ) {
+                                $meta_field_types = substr( str_repeat( ',%s', count( $meta_value ) ), 1 );
+                                $meta_compare_string = "($meta_field_types)";
+                                unset( $meta_field_types );
+                        } elseif ( 'BETWEEN' == substr( $meta_compare, -7) ) {
+                                $meta_value = array_slice( $meta_value, 0, 2 );
+                                $meta_compare_string = '%s AND %s';
+                        } elseif ( 'LIKE' == substr( $meta_compare, -4 ) ) {
+                                $meta_value = '%' . like_escape( $meta_value ) . '%';
+                                $meta_compare_string = '%s';
+                        } else {
+                                $meta_compare_string = '%s';
+                        }
+                        $where .= $wpdb->prepare( " AND CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$meta_compare_string}", $meta_value );
+
+                        unset( $meta_compare_string );
+                }
+
+                return apply_filters( 'get_meta_sql', compact( 'join', 'where' ), $meta_query, $primary_table, $primary_id_column, $meta_table, $meta_id_column );
+        }
+
+        /*
+         * Used internally to generate an SQL string for searching across multiple taxonomies
+         *
+         * @access protected
+         * @since 3.1.0
+         *
+         * @param array $tax_query List of taxonomy queries. A single taxonomy query is an associative array:
+         * - 'taxonomy' string|array The taxonomy being queried
+         * - 'terms' string|array The list of terms
+         * - 'field' string (optional) Which term field is being used.
+         *                Possible values: 'term_id', 'slug' or 'name'
+         *                Default: 'slug'
+         * - 'operator' string (optional)
+         *                Possible values: 'IN' and 'NOT IN'.
+         *                Default: 'IN'
+         * - 'include_children' bool (optional) Whether to include child terms.
+         *                Default: true
+         *
+         * @param string $object_id_column
+         * @return string
+         */
+        function get_tax_sql( $tax_query, $object_id_column ) {
+                global $wpdb;
+
+                $sql = array();
+                foreach ( $tax_query as $query ) {
+                        if ( !isset( $query['include_children'] ) )
+                                $query['include_children'] = true;
+
+                        $query['do_query'] = false;
+
+                        $sql_single = get_objects_in_term( $query['terms'], $query['taxonomy'], $query );
+
+                        if ( empty( $sql_single ) )
+                                return ' AND 0 = 1';
+
+                        $sql[] = $sql_single;
+                }
+
+                if ( 1 == count( $sql ) ) {
+                        $ids = $wpdb->get_col( $sql[0] );
+                } else {
+                        $r = "SELECT object_id FROM $wpdb->term_relationships WHERE 1=1";
+                        foreach ( $sql as $query )
+                                $r .= " AND object_id IN ($query)";
+
+                        $ids = $wpdb->get_col( $r );
+                }
+
+                if ( !empty( $ids ) )
+                        return " AND $object_id_column IN(" . implode( ', ', $ids ) . ")";
+                else
+                        return ' AND 0 = 1';
+        }
+
+        /*
+         * Used internally to generate an SQL string for searching across multiple columns
+         *
+         * @access protected
+         * @since 3.1.0
+         *
+         * @param string $string
+         * @param array $cols
+         * @return string
+         */
+        function get_search_sql( $string, $cols ) {
+                $string = esc_sql( $string );
+
+                $searches = array();
+                foreach ( $cols as $col )
+                        $searches[] = "$col LIKE '%$string%'";
+
+                return ' AND (' . implode(' OR ', $searches) . ')';
+        }
+}
+
+?>
</ins></span></pre></div>
<a id="trunkwpincludesclasswpobjectqueryphp"></a>
<div class="delfile"><h4>Deleted: trunk/wp-includes/class.wp-object-query.php (16141 => 16142)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/class.wp-object-query.php        2010-11-01 20:08:25 UTC (rev 16141)
+++ trunk/wp-includes/class.wp-object-query.php        2010-11-01 20:21:29 UTC (rev 16142)
</span><span class="lines">@@ -1,239 +0,0 @@
</span><del>-<?php
-/**
- * WordPress Query class.
- *
- * Abstract class for handling advanced queries
- *
- * @package WordPress
- * @since 3.1.0
- */
-class WP_Object_Query {
-
-        /**
-         * Query vars, after parsing
-         *
-         * @since 3.1.0
-         * @access public
-         * @var array
-         */
-        var $query_vars;
-
-        /**
-         * Retrieve query variable.
-         *
-         * @since 3.1.0
-         * @access public
-         *
-         * @param string $query_var Query variable key.
-         * @return mixed
-         */
-        function get( $query_var ) {
-                if ( isset( $this->query_vars[$query_var] ) )
-                        return $this->query_vars[$query_var];
-
-                return '';
-        }
-
-        /**
-         * Set query variable.
-         *
-         * @since 3.1.0
-         * @access public
-         *
-         * @param string $query_var Query variable key.
-         * @param mixed $value Query variable value.
-         */
-        function set( $query_var, $value ) {
-                $this->query_vars[ $query_var ] = $value;
-        }
-
-        /*
-         * Populates the $meta_query property
-         *
-         * @access protected
-         * @since 3.1.0
-         *
-         * @param array $qv The query variables
-         */
-        function parse_meta_query( &$qv ) {
-                $meta_query = array();
-
-                // Simple query needs to be first for orderby=meta_value to work correctly
-                foreach ( array( 'key', 'value', 'compare', 'type' ) as $key ) {
-                        if ( !empty( $qv[ "meta_$key" ] ) )
-                                $meta_query[0][ $key ] = $qv[ "meta_$key" ];
-                }
-
-                if ( !empty( $qv['meta_query'] ) && is_array( $qv['meta_query'] ) ) {
-                        $meta_query = array_merge( $meta_query, $qv['meta_query'] );
-                }
-
-                $qv['meta_query'] = $meta_query;
-        }
-
-        /*
-         * Used internally to generate an SQL string for searching across multiple meta key = value pairs
-         *
-         * @access protected
-         * @since 3.1.0
-         *
-         * @param array $meta_query List of metadata queries. A single query is an associative array:
-         * - 'key' string The meta key
-         * - 'value' string|array The meta value
-         * - 'compare' (optional) string How to compare the key to the value.
-         *                Possible values: '=', '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'.
-         *                Default: '='
-         * - 'type' string (optional) The type of the value.
-         *                Possible values: 'NUMERIC', 'BINARY', 'CHAR', 'DATE', 'DATETIME', 'DECIMAL', 'SIGNED', 'TIME', 'UNSIGNED'.
-         *                Default: 'CHAR'
-         *
-         * @param string $primary_table
-         * @param string $primary_id_column
-         * @param string $meta_table
-         * @param string $meta_id_column
-         * @return array( $join_sql, $where_sql )
-         */
-        function get_meta_sql( $meta_query, $primary_table, $primary_id_column, $meta_table, $meta_id_column ) {
-                global $wpdb;
-
-                $clauses = array();
-
-                $join = '';
-                $where = '';
-                $i = 0;
-                foreach ( $meta_query as $q ) {
-                        $meta_key = isset( $q['key'] ) ? trim( $q['key'] ) : '';
-                        $meta_value = isset( $q['value'] ) ? $q['value'] : '';
-                        $meta_compare = isset( $q['compare'] ) ? strtoupper( $q['compare'] ) : '=';
-                        $meta_type = isset( $q['type'] ) ? strtoupper( $q['type'] ) : 'CHAR';
-
-                        if ( ! in_array( $meta_compare, array( '=', '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) )
-                                $meta_compare = '=';
-
-                        if ( 'NUMERIC' == $meta_type )
-                                $meta_type = 'SIGNED';
-                        elseif ( ! in_array( $meta_type, array( 'BINARY', 'CHAR', 'DATE', 'DATETIME', 'DECIMAL', 'SIGNED', 'TIME', 'UNSIGNED' ) ) )
-                                $meta_type = 'CHAR';
-
-                        if ( empty( $meta_key ) && empty( $meta_value ) )
-                                continue;
-
-                        $alias = $i ? 'mt' . $i : $meta_table;
-
-                        $join .= "\nINNER JOIN $meta_table";
-                        $join .= $i ? " AS $alias" : '';
-                        $join .= " ON ($primary_table.$primary_id_column = $alias.$meta_id_column)";
-
-                        $i++;
-
-                        if ( !empty( $meta_key ) )
-                                $where .= $wpdb->prepare( " AND $alias.meta_key = %s", $meta_key );
-
-                        if ( in_array( $meta_compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) ) {
-                                if ( ! is_array( $meta_value ) )
-                                        $meta_value = preg_split( '/[,\s]+/', $meta_value );
-                        } else {
-                                $meta_value = trim( $meta_value );
-                        }
-
-                        if ( empty( $meta_value ) )
-                                continue;
-
-                        if ( 'IN' == substr( $meta_compare, -2) ) {
-                                $meta_field_types = substr( str_repeat( ',%s', count( $meta_value ) ), 1 );
-                                $meta_compare_string = "($meta_field_types)";
-                                unset( $meta_field_types );
-                        } elseif ( 'BETWEEN' == substr( $meta_compare, -7) ) {
-                                $meta_value = array_slice( $meta_value, 0, 2 );
-                                $meta_compare_string = '%s AND %s';
-                        } elseif ( 'LIKE' == substr( $meta_compare, -4 ) ) {
-                                $meta_value = '%' . like_escape( $meta_value ) . '%';
-                                $meta_compare_string = '%s';
-                        } else {
-                                $meta_compare_string = '%s';
-                        }
-                        $where .= $wpdb->prepare( " AND CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$meta_compare_string}", $meta_value );
-
-                        unset( $meta_compare_string );
-                }
-
-                return apply_filters( 'get_meta_sql', compact( 'join', 'where' ), $meta_query, $primary_table, $primary_id_column, $meta_table, $meta_id_column );
-        }
-
-        /*
-         * Used internally to generate an SQL string for searching across multiple taxonomies
-         *
-         * @access protected
-         * @since 3.1.0
-         *
-         * @param array $tax_query List of taxonomy queries. A single taxonomy query is an associative array:
-         * - 'taxonomy' string|array The taxonomy being queried
-         * - 'terms' string|array The list of terms
-         * - 'field' string (optional) Which term field is being used.
-         *                Possible values: 'term_id', 'slug' or 'name'
-         *                Default: 'slug'
-         * - 'operator' string (optional)
-         *                Possible values: 'IN' and 'NOT IN'.
-         *                Default: 'IN'
-         * - 'include_children' bool (optional) Whether to include child terms.
-         *                Default: true
-         *
-         * @param string $object_id_column
-         * @return string
-         */
-        function get_tax_sql( $tax_query, $object_id_column ) {
-                global $wpdb;
-
-                $sql = array();
-                foreach ( $tax_query as $query ) {
-                        if ( !isset( $query['include_children'] ) )
-                                $query['include_children'] = true;
-
-                        $query['do_query'] = false;
-
-                        $sql_single = get_objects_in_term( $query['terms'], $query['taxonomy'], $query );
-
-                        if ( empty( $sql_single ) )
-                                return ' AND 0 = 1';
-
-                        $sql[] = $sql_single;
-                }
-
-                if ( 1 == count( $sql ) ) {
-                        $ids = $wpdb->get_col( $sql[0] );
-                } else {
-                        $r = "SELECT object_id FROM $wpdb->term_relationships WHERE 1=1";
-                        foreach ( $sql as $query )
-                                $r .= " AND object_id IN ($query)";
-
-                        $ids = $wpdb->get_col( $r );
-                }
-
-                if ( !empty( $ids ) )
-                        return " AND $object_id_column IN(" . implode( ', ', $ids ) . ")";
-                else
-                        return ' AND 0 = 1';
-        }
-
-        /*
-         * Used internally to generate an SQL string for searching across multiple columns
-         *
-         * @access protected
-         * @since 3.1.0
-         *
-         * @param string $string
-         * @param array $cols
-         * @return string
-         */
-        function get_search_sql( $string, $cols ) {
-                $string = esc_sql( $string );
-
-                $searches = array();
-                foreach ( $cols as $col )
-                        $searches[] = "$col LIKE '%$string%'";
-
-                return ' AND (' . implode(' OR ', $searches) . ')';
-        }
-}
-
-?>
</del></span></pre></div>
<a id="trunkwpsettingsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-settings.php (16141 => 16142)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-settings.php        2010-11-01 20:08:25 UTC (rev 16141)
+++ trunk/wp-settings.php        2010-11-01 20:21:29 UTC (rev 16142)
</span><span class="lines">@@ -103,9 +103,9 @@
</span><span class="cx"> // Load most of WordPress.
</span><span class="cx"> require( ABSPATH . WPINC . '/class-wp-walker.php' );
</span><span class="cx"> require( ABSPATH . WPINC . '/class-wp-ajax-response.php' );
</span><ins>+require( ABSPATH . WPINC . '/class-wp-object-query.php' );
</ins><span class="cx"> require( ABSPATH . WPINC . '/formatting.php' );
</span><span class="cx"> require( ABSPATH . WPINC . '/capabilities.php' );
</span><del>-require( ABSPATH . WPINC . '/class.wp-object-query.php' );
</del><span class="cx"> require( ABSPATH . WPINC . '/query.php' );
</span><span class="cx"> require( ABSPATH . WPINC . '/theme.php' );
</span><span class="cx"> require( ABSPATH . WPINC . '/user.php' );
</span></span></pre>
</div>
</div>
</body>
</html>