app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php
static public function getFromSocket($socket) {
        try {
            $version = $socket->getVersion();
        } catch (Mage_Core_Exception $e) {
            Mage::getSingleton('core/session')
                ->addError('Error determining Varnish version: '.
                    $e->getMessage());
            return null;
        }
        switch ($version) {
            case '4.0':
            case '4.1':
                return Mage::getModel(
                    'turpentine/varnish_configurator_version4',
                    array('socket' => $socket) );

            case '3.0':
                return Mage::getModel(
                    'turpentine/varnish_configurator_version3',
                        array('socket' => $socket) );
            case '2.1':
                return Mage::getModel(
                    'turpentine/varnish_configurator_version2',
                        array('socket' => $socket) );
            default:
                Mage::throwException('Unsupported Varnish version');
        }
    }
static public function getFromSocket($socket) {
        try {
            $version = $socket->getVersion();
        } catch (Mage_Core_Exception $e) {
            Mage::getSingleton('core/session')
                ->addError('Error determining Varnish version: '.
                    $e->getMessage());
            return null;
        }
        switch ($version) {
            case '4.0':
            case '4.1':
                return Mage::getModel(
                    'turpentine/varnish_configurator_version4',
                    array('socket' => $socket) );

            case '3.0':
                return Mage::getModel(
                    'turpentine/varnish_configurator_version3',
                        array('socket' => $socket) );
            case '2.1':
                return Mage::getModel(
                    'turpentine/varnish_configurator_version2',
                        array('socket' => $socket) );
            default:
                Mage::throwException('Unsupported Varnish version');
        }
    }
static public function getFromSocket ( $ socket ) { try { $ version = $ socket -> getVersion ( ) ; } catch ( Mage_Core_Exception $ e ) { Mage :: getSingleton ( 'core/session' ) -> addError ( 'Error determining Varnish version: ' . $ e -> getMessage ( ) ) ; return null ; } switch ( $ version ) { case '4.0' : case '4.1' : return Mage :: getModel ( 'turpentine/varnish_configurator_version4' , array ( 'socket' => $ socket ) ) ; case '3.0' : return Mage :: getModel ( 'turpentine/varnish_configurator_version3' , array ( 'socket' => $ socket ) ) ; case '2.1' : return Mage :: getModel ( 'turpentine/varnish_configurator_version2' , array ( 'socket' => $ socket ) ) ; default : Mage :: throwException ( 'Unsupported Varnish version' ) ; } }
Get the correct version of a configurator from a socket

@param  Nexcessnet_Turpentine_Model_Varnish_Admin_Socket $socket
@return Nexcessnet_Turpentine_Model_Varnish_Configurator_Abstract
Get the correct version of a configurator from a socket