<commit_before><?php

/*
 * This file is part of Ratchet for CakePHP.
 *
 ** (c) 2012 - 2013 <NAME>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

App::uses('RatchetMessageQueueTransportInterface', 'Ratchet.Lib/MessageQueue/Interfaces');
App::uses('RatchetMessageQueuePredis', 'Ratchet.Lib/MessageQueue/Transports');
App::uses('RatchetMessageQueueZmq', 'Ratchet.Lib/MessageQueue/Transports');

class TransportProxy implements RatchetMessageQueueTransportInterface {
    
    /**
     * Singleton self reference trick
     * @var TransportProxy 
     */
    protected static $_generalMessageQueueProxy = null;
    
    /**
     *
     * @var RatchetMessageQueueTransportInterface
     */
    private $transport;
    
    /**
     * Construct the proxy
     * 
     * @param array $serverConfiguration
     */
    public function __construct($serverConfiguration) {
        list($plugin, $transporter) = pluginSplit(Configure::read('Ratchet.Queue.transporter'), true);
        App::uses($transporter, $plugin . 'Lib/MessageQueue/Transports');
        $this->transport = new $transporter($serverConfiguration);
    }
    
    /**
     * Singleton constructor
     * 
     * @return TransportProxy<commit_msg>No need to 'use' at the top of the file when the transport used will be 'use'ed duing initialization<commit_after><?php

/*
 * This file is part of Ratchet for CakePHP.
 *
 ** (c) 2012 - 2013 <NAME>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

App::uses('RatchetMessageQueueTransportInterface', 'Ratchet.Lib/MessageQueue/Interfaces');

class TransportProxy implements RatchetMessageQueueTransportInterface {
    
    /**
     * Singleton self reference trick
     * @var TransportProxy 
     */
    protected static $_generalMessageQueueProxy = null;
    
    /**
     *
     * @var RatchetMessageQueueTransportInterface
     */
    private $transport;
    
    /**
     * Construct the proxy
     * 
     * @param array $serverConfiguration
     */
    public function __construct($serverConfiguration) {
        list($plugin, $transporter) = pluginSplit(Configure::read('Ratchet.Queue.transporter'), true);
        App::uses($transporter, $plugin . 'Lib/MessageQueue/Transports');
        $this->transport = new $transporter($serverConfiguration);
    }
    
    /**
     * Singleton constructor
     * 
     * @return TransportProxy
{'fraction_non_alphanumeric': 0.10802223987291501, 'fraction_numerical': 0.006354249404289118, 'mean_word_length': 3.247892074198988, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6638044', 'n_tokens_mistral': 695, 'n_tokens_neox': 662, 'n_words': 171}