<commit_before><?php
/**
 * Vorpal Bunny is a publishing client for RabbitMQ's JSON-RPC Channel Plugin
 *
 * The goal is to be a light-weight tool for higher throughput with smaller
 * protocol overhead for calling Basic.Publish from PHP applications.
 *
 * PHP Version 5
 *
 * @package VorpalBunny
 * @author <NAME> <<EMAIL>>
 * @copyright 2011 Insider Guides, Inc.
 * @license http://opensource.org/licenses/bsd-license.php BSD License
 * @link http://github.com/myYearbook/VorpalBunny
 * @since 2011-02-24
 * @version 0.4
 *
 * Usage:
 *
 *  $vb = new VorpalBunny('localhost');
 *  $vb->publish( $exchange, $routing_key, $message, $mimeType, $deliveryType);
 */
class VorpalBunny
{
  protected static $apcPrefix = 'VorpalBunny:';
  protected static $apcIDKey = 'VorpalBunny:id';
  protected static $jsonRPCVersion = 1.1;
  protected static $jsonRPCTimeout = 3;
  protected static $validMethods = array( 'call', 'cast', 'open', 'poll' );
  protected static $maxRetries = 3;
  protected static $version = 0.4;

  private $id = 0;
  private $sessionToken = null;

  /**
   * Initialize the VorpalBunny Class
   *
   * @param string $host RabbitMQ server to use
   * @param int $port RabbitMQ Server HTTP port to use
   * @param string $user Username to pass to RabbitMQ when starting a session
   * @param string $pass Password to send to RabbitMQ when starting a session
   * @param string $vhost RabbitMQ VHost to use
   * @param int $timeout Timeout to set on the RabbitMQ JSONRPC Channel side
   * @throws Exception when missing APC
   */
  function __construct( $host, $port = 55672, $user = 'guest', $pass = '<PASSWORD>', $vhost = '/', $timeout = 300 )
  {
    // Do we have APC support for caching session token?
    if ( ! is_callable( 'apc_fetch' ) )
    {
      throw new Exception( "APC is not available, please install APC" );
    }

    // Construct the APC cache key we'll use in init and elsewhere<commit_msg>Update default port to 5672<commit_after><?php
/**
 * Vorpal Bunny is a publishing client for RabbitMQ's JSON-RPC Channel Plugin
 *
 * The goal is to be a light-weight tool for higher throughput with smaller
 * protocol overhead for calling Basic.Publish from PHP applications.
 *
 * PHP Version 5
 *
 * @package VorpalBunny
 * @author <NAME> <<EMAIL>>
 * @copyright 2011 Insider Guides, Inc.
 * @license http://opensource.org/licenses/bsd-license.php BSD License
 * @link http://github.com/myYearbook/VorpalBunny
 * @since 2011-02-24
 * @version 0.4
 *
 * Usage:
 *
 *  $vb = new VorpalBunny('localhost');
 *  $vb->publish( $exchange, $routing_key, $message, $mimeType, $deliveryType);
 */
class VorpalBunny
{
  protected static $apcPrefix = 'VorpalBunny:';
  protected static $apcIDKey = 'VorpalBunny:id';
  protected static $jsonRPCVersion = 1.1;
  protected static $jsonRPCTimeout = 3;
  protected static $validMethods = array( 'call', 'cast', 'open', 'poll' );
  protected static $maxRetries = 3;
  protected static $version = 0.4;

  private $id = 0;
  private $sessionToken = null;

  /**
   * Initialize the VorpalBunny Class
   *
   * @param string $host RabbitMQ server to use
   * @param int $port RabbitMQ Server HTTP port to use
   * @param string $user Username to pass to RabbitMQ when starting a session
   * @param string $pass Password to send to RabbitMQ when starting a session
   * @param string $vhost RabbitMQ VHost to use
   * @param int $timeout Timeout to set on the RabbitMQ JSONRPC Channel side
   * @throws Exception when missing APC
   */
  function __construct( $host, $port = 5672, $user = 'guest', $pass = '<PASSWORD>', $vhost = '/', $timeout = 300 )
  {
    // Do we have APC support for caching session token?
    if ( ! is_callable( 'apc_fetch' ) )
    {
      throw new Exception( "APC is not available, please install APC" );
    }

    // Construct the APC cache key we'll use in init and elsewhere
{'fraction_non_alphanumeric': 0.11085211085211086, 'fraction_numerical': 0.016317016317016316, 'mean_word_length': 3.6140979689366786, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6225230', 'n_tokens_mistral': 1298, 'n_tokens_neox': 1177, 'n_words': 441}