Comments (4)
Guzzle has support for async requests if you'd rather use their library instead of building it yourself. (There might be other lighter libraries too, I'm just not familiar with any.)
from magescan.
I've been checking out Guzzle recently to see if we could try and eliminate the use of curl in our own codebases where it makes sense, but hadn't found a small enough sample to dig in yet.
It looks like it would be a pretty solid alternative and also a simpler solution to stay native php as the syntax for streams looks pretty easy to grok first glance.
// Send an asynchronous request.
$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org');
$promise = $client->sendAsync($request)->then(function ($response) {
echo 'I completed! ' . $response;
});
$promise->wait();
There do seem to be some minor requirements to address depending on which route you want to go. None are deal breakers for me, but before i start digging into this do any of these limitations matter or do were you thinking you might prefer curl as the first attempt?
Requirements
* PHP 5.5.0
* To use the PHP stream handler, allow_url_fopen must be enabled in your system's php.ini.
* To use the cURL handler, you must have a recent version of cURL >= 7.19.4 compiled with OpenSSL and zlib.
* Note : Guzzle no longer requires cURL in order to send HTTP requests. Guzzle will use the PHP stream wrapper to send HTTP requests if cURL is not installed. Alternatively, you can provide your own HTTP handler used to send requests.
from magescan.
Given that PHP 5.4 only has a couple month until EOL I'm okay with dropping it's support. All the other requirements are reasonable.
from magescan.
This has been added in version 1.12.0
from magescan.
Related Issues (20)
- Requests timeing out
- Multiple errors in OS X HOT 3
- add a new release with support for v1.3.6 of magento-version-identification-php
- magescan.phar vs magescan.com on patch results HOT 1
- Patches scanning is not working HOT 2
- hang while scan website for magento version HOT 1
- Extra space between "Sitemap:" and (url) in robots.txt causes a crash HOT 2
- 1.12.6 Release has no .phar file attached HOT 1
- satooshi/php-coveralls does not have a master
- Your requirements could not be resolved to an installable set of packages.
- Parameter and value are unknown HOT 4
- self-update failing HOT 2
- 1.12.8 release has no .phar file attached HOT 1
- This scan might be exploited, please help. HOT 1
- php issues on kali HOT 1
- Subdirectories in URL not properly handled
- Uncaught Error: Class 'GuzzleHttp\Client' HOT 1
- Docs: Fix command for magerun
- Enhancement : Content Length
- proxy url
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magescan.