<commit_before><?php

class WampHelper extends AppHelper {
    
    public $helpers = array(
        'Html',
    );
    
    public function init() {
        
        $this->Html->scriptBlock('WEB_SOCKET_SWF_LOCATION = "' . $this->Html->url('/Ratchet/swf/WebSocketMain.swf', true) . '"', array(
            'inline' => false,
        ));
        $this->Html->script('cache/Ratchet.wamp', array('block' => 'script'));
        $this->Html->script('/Ratchet/js/cake-wamp', array('block' => 'script'));
        
    }
    
}<commit_msg>Moved the wsuri definition to the helper to use the configuration options provided in bootstrap<commit_after><?php

class WampHelper extends AppHelper {
    
    public $helpers = array(
        'Html',
    );
    
    public function init() {
        $block = '';
        $block .= 'WEB_SOCKET_SWF_LOCATION = "' . $this->Html->url('/Ratchet/swf/WebSocketMain.swf', true) . '";' . PHP_EOL;
        $block .= 'var cakeWamp = window.cakeWamp || {};' . PHP_EOL;
        $block .= 'cakeWamp.options = {';
        $block .= 'retryDelay: ' . (int) Configure::read('Ratchet.Client.retryDelay') . ',';
        $block .= 'maxRetries: ' . (int) Configure::read('Ratchet.Client.maxRetries') . '';
        $block .= '};' . PHP_EOL;
        $block .= 'var wsuri = "';
        $block .= ((Configure::read('Ratchet.Connection.external.secure')) ? 'wss' : 'ws') . '://';
        $block .= Configure::read('Ratchet.Connection.external.hostname');
        $block .= ':' . Configure::read('Ratchet.Connection.external.port');
        $block .= '/' . Configure::read('Ratchet.Connection.external.path') . '";';
        $this->Html->scriptBlock($block, array(
            'inline' => false,
        ));
        $this->Html->script('cache/Ratchet.wamp', array('block' => 'script'));
        $this->Html->script('/Ratchet/js/cake-wamp', array('block' => 'script'));
        
    }
    
}
{'fraction_non_alphanumeric': 0.19557385486361298, 'fraction_numerical': 0.0, 'mean_word_length': 2.306122448979592, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '5417913', 'n_tokens_mistral': 643, 'n_tokens_neox': 614, 'n_words': 96}