leaseweb / lswguzzlebundle Goto Github PK
View Code? Open in Web Editor NEWSymfony2 bundle that adds Guzzle API call functionality with full Web Debug Toolbar integration
Symfony2 bundle that adds Guzzle API call functionality with full Web Debug Toolbar integration
Nice bundle but is it working? In my first attempt of using it I get fatal:
Error: Call to a member function getInfo() on a non-object in (...)vendor/leaseweb/guzzle-bundle/Lsw/GuzzleBundle/DataCollector/GuzzleDataCollector.php line 50
Bundle crashes when response object is Null.
It happens, for example, in case of curl timeout.
There is a clone of bundle with a fix https://github.com/hanikesn/LswGuzzleBundle
but as i see author didn't made pull request.
Probably solution is not best, but it works.
Other question is Guzzle dependency is "*" means bundle will fail on big update.
Probably should be fixed.
Please add a warning that this bundle is not maintained anymore.
There are other bundles for Guzzle.
Hello,
I have tried to install the bundle, but there seem to be multiple problems..
I have installed the bundle like so:
composer require "leaseweb/guzzle-bundle" "*"
I have initiated an update just to be on the safe side:
composer update "leaseweb/guzzle-bundle"
I have set the configuration as shown in the readme, but the following errors appear:
PHP Notice: Undefined index: base_url in /projects/feed-engine/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php on line 75
PHP Warning: call_user_func() expects parameter 1 to be a valid callback, class 'Guzzle\Service\Description\ServiceDescription' does not have a method 'factory' in /projects/feed-engine/app/cache/dev/appDevDebugProjectContainer.php on line 1398
PHP Catchable fatal error: Argument 1 passed to Guzzle\Service\Client::setDescription() must be an instance of Guzzle\Service\Description\ServiceDescription, null given, called in /projects/feed-engine/app/cache/dev/appDevDebugProjectContainer.php on line 1317 and defined in /projects/feed-engine/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php on line 358
I am using the master branch, as indicated on the top, but I have also tried to use some of the presumably stable branches - v1.0.2, and the very same error message is shown.
Inside composer.json you are not indicating a strict version of guzzle to be used.
I think this is the problem. Isn't guzzle 1.0.4 very old?
vagrant@ubuntu-14:/projects/feed-engine$ composer require "leaseweb/guzzle-bundle" "*"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing guzzle/guzzle (v1.0.4)
Loading from cache
- Installing leaseweb/guzzle-bundle (v1.0.2)
Loading from cache
P.S Yes, three years old to be exact. https://github.com/guzzle/guzzle/tree/v1.0.4
I have been investigating why our system workers are dying after a given amount of jobs are processed.
I was able to track the memory leak to this bundle.
Using the guzzle library itself does fix the issue, so it is definitely in the bundle itself.
I have even tried the case with more than 10,000 objects created, as this seem to be the limit after which the garbage collector becomes active, but the issue persists. Reference: https://bugs.php.net/bug.php?id=68132
My use case is as follows:
class SomeClass()
{
public function someMethod()
{
/* @var $response Guzzle\Service\Command\CommandInterface */
$command = $this->client->getCommand('get_item_by_id', $params);
/* @var $response Guzzle\Http\Message\Response */
$response = $command->getResponse();
return $this->transformResponse($response->getBody(true));
}
protected function transformResponce($response)
{
/** some code that transforms json to an object */
}
Replacing some parts of the code by avoiding the bundle seems to fix the case for me:
$client = new \Guzzle\Http\Client('https://baseurl.com/api');
$request = $client->get('url.php?id=' . $id);
$response = $request->send();
http://guzzle.readthedocs.org/en/latest/docs.html
From readme.md
how to register this service in services.yml?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.