src/Protocol/Version.php
public function getProtocol($clientId, $default = 'ActiveMQ/5.11.1')
    {
        $server = trim($this->frame['server']) ?: $default;
        $version = $this->getVersion();
        if (stristr($server, 'rabbitmq') !== false) {
            return new RabbitMq($clientId, $version, $server);
        }
        if (stristr($server, 'apache-apollo') !== false) {
            return new Apollo($clientId, $version, $server);
        }
        if (stristr($server, 'activemq') !== false) {
            return new ActiveMq($clientId, $version, $server);
        }
        if (stristr($server, 'open message queue') !== false) {
            return new OpenMq($clientId, $version, $server);
        }
        return new Protocol($clientId, $version, $server);
    }
public function getProtocol($clientId, $default = 'ActiveMQ/5.11.1')
    {
        $server = trim($this->frame['server']) ?: $default;
        $version = $this->getVersion();
        if (stristr($server, 'rabbitmq') !== false) {
            return new RabbitMq($clientId, $version, $server);
        }
        if (stristr($server, 'apache-apollo') !== false) {
            return new Apollo($clientId, $version, $server);
        }
        if (stristr($server, 'activemq') !== false) {
            return new ActiveMq($clientId, $version, $server);
        }
        if (stristr($server, 'open message queue') !== false) {
            return new OpenMq($clientId, $version, $server);
        }
        return new Protocol($clientId, $version, $server);
    }
public function getProtocol ( $ clientId , $ default = 'ActiveMQ/5.11.1' ) { $ server = trim ( $ this -> frame [ 'server' ] ) ? : $ default ; $ version = $ this -> getVersion ( ) ; if ( stristr ( $ server , 'rabbitmq' ) !== false ) { return new RabbitMq ( $ clientId , $ version , $ server ) ; } if ( stristr ( $ server , 'apache-apollo' ) !== false ) { return new Apollo ( $ clientId , $ version , $ server ) ; } if ( stristr ( $ server , 'activemq' ) !== false ) { return new ActiveMq ( $ clientId , $ version , $ server ) ; } if ( stristr ( $ server , 'open message queue' ) !== false ) { return new OpenMq ( $ clientId , $ version , $ server ) ; } return new Protocol ( $ clientId , $ version , $ server ) ; }
Returns the protocol to use.

@param string $clientId
@param string $default server to use of no server detected
@return ActiveMq|Apollo|Protocol|RabbitMq
Returns the protocol to use .