Skip to content
Snippets Groups Projects
Select Git revision
  • noblogs default
  • noblogs-5.7.1
  • upstream
  • noblogs-5.7
  • noblogs-5.6new
  • upstream5.5.1
  • noblogs28dic
  • upstream28dic
  • noblogs-5.5.1
  • noblogs-5.4.2
  • noblogs-5.4_seconda
  • noblogs-5.4
  • noblogs-7c
  • wp5.2.3p3
  • mergedbconf
  • noblogs-5.7.1
  • noblogs.5.7.0p1
  • noblogs-5.7.0
  • noblogs-5.6p3
  • noblogs5.6p2
  • noblogs-5.6p1
  • noblogs-5.6
  • noblogs-5.4.2p1
  • noblogs-5.4.2
  • noblogs-5.4.1
  • noblogs-5.4
  • noblogs-p5.4
  • noblogs-5.3.2p2
  • noblogs-5.3.2p1
  • noblogs-5.3.2
  • noblogs-5.3
  • noblogs-5.2.3p4
  • noblogs-5.2.3p3
  • noblogs-5.2.3p2
  • noblogs-5.2.3p1
35 results

db-hash.php

Blame
  • db-hash.php 486 B
    <?php
    
    require_once(dirname(__FILE__) . '/flexihash.php');
    
    $wpdb->hash_map = new Flexihash();
    
    /* Hashing function to map blogs to databases.
     *
     * Implements a consistent hashing scheme using Flexihash.
     */
    function noblogs_db_callback($query, $wpdb) {
      $wpdb_hash = $wpdb->hash_map;
      if (preg_match("/^{$wpdb->base_prefix}(\d+)_/", $wpdb->table, $matches)) {
        $blog_id = $matches[1];
        return $wpdb_hash->lookup($blog_id);
      }
    }
    $wpdb->add_callback('noblogs_db_callback');