Plugin Directory

Changeset 800681


Ignore:
Timestamp:
11/07/2013 09:56:39 PM (12 years ago)
Author:
DH-Shredder
Message:

Whitespace cleanup; Increasing version number for easier beta testing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • memcached-redux/trunk/object-cache.php

    r611610 r800681  
    33Plugin Name: Memcached Redux
    44Description: The real Memcached (not Memcache) backend for the WP Object Cache.
    5 Version: 0.1.1
     5Version: 0.1.1b
    66Plugin URI: http://wordpress.org/extend/plugins/memcached/
    77Author: Scott Taylor - uses code from Ryan Boren, Denis de Bernardy, Matt Martz
     
    5959 *      array( 'key' )
    6060 * );
    61  * 
     61 *
    6262 */
    6363function wp_cache_get_multi( $key_and_groups, $bucket = 'default' ) {
     
    7272 *      array( 'key', 'data' )
    7373 * );
    74  * 
     74 *
    7575 */
    7676function wp_cache_set_multi( $items, $expire = 0, $group = 'default' ) {
     
    171171        $key = $this->key( $id, $group );
    172172        $mc =& $this->get_mc( $group );
    173         $this->cache[ $key ] = $mc->increment( $key, $n ); 
     173        $this->cache[ $key ] = $mc->increment( $key, $n );
    174174        return $this->cache[ $key ];
    175175    }
     
    183183
    184184    function close() {
    185         // Silence is Golden.
     185        // Silence is Golden.
    186186    }
    187187
     
    204204            unset( $this->cache[$key] );
    205205
    206         return $result; 
     206        return $result;
    207207    }
    208208
     
    224224        if ( isset( $this->cache[$key] ) ) {
    225225            if ( is_object( $this->cache[$key] ) )
    226                 $value = clone $this->cache[$key];
     226                $value = clone $this->cache[$key];
    227227            else
    228228                $value = $this->cache[$key];
     
    231231        } else {
    232232            $value = $mc->get( $key );
    233             if ( empty( $value ) || ( is_integer( $value ) && -1 == $value ) )
    234                 $value = false;
     233            if ( empty( $value ) || ( is_integer( $value ) && -1 == $value ) )
     234                $value = false;
    235235            $this->cache[$key] = $value;
    236236        }
     
    286286    }
    287287
    288     function key( $key, $group ) { 
     288    function key( $key, $group ) {
    289289        if ( empty( $group ) )
    290290            $group = 'default';
     
    361361            $mc->setMulti( $sets, $expire );
    362362    }
    363    
     363
    364364    function colorize_debug_line( $line ) {
    365365        $colors = array(
     
    367367            'set'   => 'purple',
    368368            'add'   => 'blue',
    369             'delete'=> 'red' 
    370         );
     369            'delete'=> 'red'
     370        );
    371371
    372372        $cmd = substr( $line, 0, strpos( $line, ' ' ) );
     
    386386        echo "<h3>Memcached:</h3>";
    387387        foreach ( $this->group_ops as $group => $ops ) {
    388             if ( !isset( $_GET['debug_queries'] ) && 500 < count( $ops ) ) { 
    389                 $ops = array_slice( $ops, 0, 500 ); 
     388            if ( !isset( $_GET['debug_queries'] ) && 500 < count( $ops ) ) {
     389                $ops = array_slice( $ops, 0, 500 );
    390390                echo "<big>Too many to show! <a href='" . add_query_arg( 'debug_queries', 'true' ) . "'>Show them anyway</a>.</big>\n";
    391             } 
     391            }
    392392            echo "<h4>$group commands</h4>";
    393393            echo "<pre>\n";
    394394            $lines = array();
    395395            foreach ( $ops as $op ) {
    396                 $lines[] = $this->colorize_debug_line( $op ); 
     396                $lines[] = $this->colorize_debug_line( $op );
    397397            }
    398398            print_r( $lines );
     
    424424        foreach ( $buckets as $bucket => $servers ) {
    425425            $this->mc[$bucket] = new Memcached();
    426            
    427             $instances = array();
    428             foreach ( $servers as $server  ) {
     426
     427            $instances = array();
     428            foreach ( $servers as $server ) {
    429429                @list( $node, $port ) = explode( ':', $server );
    430430                if ( empty( $port ) )
     
    433433                if ( !$port )
    434434                    $port = 11211;
    435                
    436                 $instances[] = array( $node, $port, 1 );
     435
     436                $instances[] = array( $node, $port, 1 );
    437437            }
    438             $this->mc[$bucket]->addServers( $instances );
     438            $this->mc[$bucket]->addServers( $instances );
    439439        }
    440440
Note: See TracChangeset for help on using the changeset viewer.