Making WordPress.org

Changeset 4356


Ignore:
Timestamp:
11/15/2016 12:26:57 AM (9 years ago)
Author:
iandunn
Message:

WordCamp Logger: Use appropriate ID seeds when calling via CLI

REMOTE_ADDR and REMOTE_PORT don't exist during requests initiated from the command line.

Location:
sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/0-logger.php

    r4314 r4356  
    8383 */
    8484function get_unique_request_id() {
    85     return hash( 'crc32b', $_SERVER['REMOTE_ADDR'] . $_SERVER['REMOTE_PORT'] . $_SERVER['REQUEST_TIME_FLOAT'] );
     85    if ( 'cli' === php_sapi_name() ) {
     86        $caller = $_SERVER['USER'] . $_SERVER['SSH_CONNECTION'];
     87    } else {
     88        $caller = $_SERVER['REMOTE_ADDR'] . $_SERVER['REMOTE_PORT'];
     89    }
     90
     91    return hash( 'crc32b', $caller . $_SERVER['REQUEST_TIME_FLOAT'] );
    8692}
    8793
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/camptix-tweaks.php

    r4314 r4356  
    401401 * Extend the introduction message for each camp in the tshirt report
    402402 *
     403 * @todo It'd probably be better to pull estimates from the tickets, rather than the wcpt post. Count total # of
     404 * tickets, remove any that have "live" or "stream" in the name, then say "Expecting up to N attendees"
     405 *
    403406 * @param string $message
    404407 * @param int    $site_id
Note: See TracChangeset for help on using the changeset viewer.