Remove tunaabutbul/cloudflare-middleware

This commit is contained in:
DariusIII
2019-09-27 10:29:25 +02:00
parent a9cf944c8c
commit 314f4ece09
3 changed files with 2 additions and 79 deletions
+1 -35
View File
@@ -54,40 +54,6 @@ if (! function_exists('getRawHtml')) {
}
}
if (! function_exists('getRawHtmlThroughCF')) {
/**
* @param $url
*
* @return bool|mixed|string
*/
function getRawHtmlThroughCF($url)
{
$client = new Client(['cookies' => new FileCookieJar('cookies.txt'), 'headers' => ['User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246']]);
$client->getConfig('handler')->push(CloudflareMiddleware::create());
try {
$response = $client->get($url)->getBody()->getContents();
$jsonResponse = json_decode($response, true, 512, JSON_THROW_ON_ERROR);
if (json_last_error() === JSON_ERROR_NONE) {
$response = $jsonResponse;
}
} catch (RequestException $e) {
if (config('app.debug') === true) {
Log::error($e->getMessage());
}
$response = false;
} catch (\RuntimeException $e) {
if (config('app.debug') === true) {
Log::error($e->getMessage());
}
$response = false;
}
return $response;
}
}
if (! function_exists('makeFieldLinks')) {
/**
@@ -347,7 +313,7 @@ if (! function_exists('is_it_json')) {
if (is_array($isIt)) {
return false;
}
json_decode($isIt);
json_decode($isIt, true, 512, JSON_THROW_ON_ERROR);
return json_last_error() === JSON_ERROR_NONE;
}
-1
View File
@@ -140,7 +140,6 @@
"spatie/laravel-directory-cleanup": "^1.2",
"spatie/laravel-fractal": "^5.3",
"spatie/laravel-permission": "^3.0",
"tunaabutbul/cloudflare-middleware": "^1.2",
"vlucas/phpdotenv": "^3.3",
"voku/simple_html_dom": "^4.3",
"wandersonwhcr/illuminate-romans": "^1.0",
Generated
+1 -43
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "46c2cfd7678ac84d327f05a623765e5f",
"content-hash": "383df6c4c5140bd8e3873605539ba2af",
"packages": [
{
"name": "aharen/omdbapi",
@@ -8138,48 +8138,6 @@
"homepage": "https://github.com/tijsverkoyen/CssToInlineStyles",
"time": "2017-11-27T11:13:29+00:00"
},
{
"name": "tunaabutbul/cloudflare-middleware",
"version": "v1.2",
"source": {
"type": "git",
"url": "https://github.com/tunaabutbul/cloudflare-middleware.git",
"reference": "05a88cf070f041d501a2d8fc3c01bb66ffc63b15"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/tunaabutbul/cloudflare-middleware/zipball/05a88cf070f041d501a2d8fc3c01bb66ffc63b15",
"reference": "05a88cf070f041d501a2d8fc3c01bb66ffc63b15",
"shasum": ""
},
"require": {
"guzzlehttp/guzzle": "6.3.*",
"php": ">=5.6"
},
"type": "library",
"autoload": {
"psr-4": {
"Tuna\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Tuna Abutbul",
"email": "tuna.abutbul+github@gmail.com"
}
],
"description": "Cloudflare Middleware For Guzzle",
"keywords": [
"Guzzle",
"cloudflare",
"middleware"
],
"time": "2018-02-07T09:18:26+00:00"
},
{
"name": "vlucas/phpdotenv",
"version": "v3.6.0",