private function validateAndDetermineStrategy()
    {
        if (extension_loaded('grpc')) {
            return;
        }

        require_once dirname(__FILE__) . '/grpc.stubs.php';

        // force the h2proxy strategy
        $strategy = $this->config->getStrategy();
        if (!is_a($strategy, H2ProxyStrategy::class)) {
            $h2ProxyConfig = new H2ProxyConfig();
            $h2ProxyStrategy = (new H2ProxyStrategyFactory($h2ProxyConfig))->build();
            $this->config->setStrategy($h2ProxyStrategy);
        }
    }
private function validateAndDetermineStrategy()
    {
        if (extension_loaded('grpc')) {
            return;
        }

        require_once dirname(__FILE__) . '/grpc.stubs.php';

        // force the h2proxy strategy
        $strategy = $this->config->getStrategy();
        if (!is_a($strategy, H2ProxyStrategy::class)) {
            $h2ProxyConfig = new H2ProxyConfig();
            $h2ProxyStrategy = (new H2ProxyStrategyFactory($h2ProxyConfig))->build();
            $this->config->setStrategy($h2ProxyStrategy);
        }
    }
private function validateAndDetermineStrategy ( ) { if ( extension_loaded ( 'grpc' ) ) { return ; } require_once dirname ( __FILE__ ) . '/grpc.stubs.php' ; // force the h2proxy strategy $ strategy = $ this -> config -> getStrategy ( ) ; if ( ! is_a ( $ strategy , H2ProxyStrategy :: class ) ) { $ h2ProxyConfig = new H2ProxyConfig ( ) ; $ h2ProxyStrategy = ( new H2ProxyStrategyFactory ( $ h2ProxyConfig ) ) -> build ( ) ; $ this -> config -> setStrategy ( $ h2ProxyStrategy ) ; } }
Load stubs and use h2proxy strategy if the C extension is not loaded
Load stubs and use h2proxy strategy if the C extension is not loaded