Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin committed Jan 7, 2019
1 parent ede6398 commit ef74f3d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .php_cs.cache
@@ -1 +1 @@
{"php":"7.2.10-0ubuntu0.18.04.1","version":"2.13.1","rules":{"array_syntax":{"syntax":"short"}},"hashes":{"src\/Response.php":1111513497,"src\/Helper.php":4165267782,"src\/Request.php":4238921734,"src\/UserAgentTrait.php":3411116384}}
{"php":"7.2.10-0ubuntu0.18.04.1","version":"2.13.1","rules":{"array_syntax":{"syntax":"short"}},"hashes":{"src\/Response.php":3945040232,"src\/Helper.php":1188516494,"src\/Request.php":3518412128,"src\/UserAgentTrait.php":1134166595}}
13 changes: 11 additions & 2 deletions README.md
Expand Up @@ -27,8 +27,17 @@ $ composer require piedweb/curl

Quick Example :
``` php


$url = 'https://piedweb.com';
$request = new Request($url);
$request
->setDefaultSpeedOptions(true)
->setDownloadOnlyIf('text/html')
->setDestkopUserAgent()
;
$result = $request->exec();
if ($result instanceof \PiedWeb\Curl\Response) {
$content = $this->getContent();
}
```

All methods :
Expand Down
2 changes: 1 addition & 1 deletion src/Request.php
Expand Up @@ -211,7 +211,7 @@ public function setEncodingGzip()
* If you want to request the URL with a (http|socks...) proxy (public or private).
*
* @param string $proxy [scheme]IP:PORT[:LOGIN:PASSWORD]
* Eg. : socks5://98.023.023.02:1098:cUrlRequestProxId:SecretPassword
* Eg. : socks5://98.023.023.02:1098:cUrlRequestProxId:SecretPassword
*
* @return self
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Response.php
Expand Up @@ -15,7 +15,7 @@ class Response
/** @var array * */
private $info;

public function get($handle, string $url, int $returnHeader, bool $gzip)
public static function get($handle, string $url, int $returnHeader, bool $gzip)
{
$content = curl_exec($handle);

Expand Down
2 changes: 1 addition & 1 deletion tests/RequestTest.php
Expand Up @@ -11,7 +11,7 @@ class RequestTest extends \PHPUnit\Framework\TestCase

public function testNotDownload()
{
$url = 'https://www.google.fr/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png';//'https://piedweb.com/assets/img/xl/bg.jpg';
$url = 'https://piedweb.com/assets/img/xl/bg.jpg';
$request = new Request($url);
$request
->setDefaultGetOptions()
Expand Down

0 comments on commit ef74f3d

Please sign in to comment.