Stichoza / google-translate-php

🔤 Free Google Translate API PHP Package. Translates totally free of charge.
MIT License
1.82k stars 382 forks source link

Guzzle http error #22

Closed aferriss closed 9 years ago

aferriss commented 9 years ago

I'm getting an error from guzzle

Fatal error: Class GuzzleHttp\Client contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (GuzzleHttp\Event\HasEmitterInterface::getEmitter) in /Applications/MAMP/htdocs/translate/vendor/guzzlehttp/guzzle/src/Client.php on line 403

That line is the very last line of the guzzle src file. My php is pretty straightforward I think

    <?php
        require 'vendor/autoload.php';
        ini_set('display_errors', 'On');

        use Stichoza\GoogleTranslate\TranslateClient;

        $tr = new TranslateClient('en', 'ka'); 

        echo $tr->translate('hello');

    ?>

Any ideas? Is this a environment specific thing I'm experiencing maybe?

Stichoza commented 9 years ago

It's probably a Guzzle problem, but it works fine for me. I don't think there might be any bugs in Guzzle. Have you tried to re-download composer dependencies?

screen shot 2015-04-27 at 21 09 09

aferriss commented 9 years ago

Yes I tried that also. I got it working by using the localhost native to my machine rather than through MAMP as I was trying before. Not sure why it wasn't working that way but seems to be ok now.

Thanks!

screen shot 2015-04-27 at 12 21 00 pm

Stichoza commented 9 years ago

Cool. as you see in my screenshot (lower left pane) the code works fine using native localhost. It's probably an environment specific issue as described in https://github.com/guzzle/guzzle/issues/992