Skip to content
This repository was archived by the owner on May 21, 2021. It is now read-only.

Commit 91764a7

Browse files
committed
Upgrade to Laravel 5.7
Close #35 (outdated laravel passport version)
1 parent 44bb5be commit 91764a7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+7247
-10977
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ DB_PASSWORD=
1515

1616
BROADCAST_DRIVER=log
1717
CACHE_DRIVER=file
18+
QUEUE_CONNECTION=sync
1819
SESSION_DRIVER=file
1920
SESSION_LIFETIME=120
20-
QUEUE_DRIVER=sync
2121

2222
REDIS_HOST=127.0.0.1
2323
REDIS_PASSWORD=null

app/Jobs/CrawlJob.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Illuminate\Contracts\Queue\ShouldQueue;
1010
use Illuminate\Foundation\Bus\Dispatchable;
1111
use Illuminate\Support\Facades\App;
12+
use Symfony\Component\Process\PhpExecutableFinder;
1213
use Symfony\Component\Process\Process;
1314

1415
class CrawlJob implements ShouldQueue
@@ -38,13 +39,14 @@ public function __construct(Search $search)
3839
public function handle(): void
3940
{
4041
if (! App::environment('testing')) {
41-
$basePath = base_path();
42-
$process = new Process("cd {$basePath} && php artisan crawler:crawl {$this->search->id} > /dev/null 2>&1 &");
43-
$process->start();
42+
$php = (new PhpExecutableFinder())->find();
4443

45-
$pid = $process->getPid();
44+
$process = Process::fromShellCommandline(
45+
"{$php} artisan crawler:crawl {$this->search->id} > /dev/null 2>&1 &",
46+
realpath(base_path())
47+
);
4648

47-
$this->search->update(['pid' => $pid]);
49+
$process->run();
4850
}
4951
}
5052
}

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"fideloper/proxy": "~4.0",
1919
"guzzlehttp/guzzle": "^6.3",
2020
"hedii/extractors": "^2.0",
21-
"laravel/framework": "5.6.*",
22-
"laravel/passport": "~5.0",
21+
"laravel/framework": "5.7.*",
22+
"laravel/passport": "^7.0",
2323
"laravel/tinker": "~1.0"
2424
},
2525
"require-dev": {
@@ -28,8 +28,7 @@
2828
"fzaninotto/faker": "~1.4",
2929
"mockery/mockery": "~1.0",
3030
"nunomaduro/collision": "~1.1",
31-
"phpunit/phpunit": "~7.0",
32-
"symfony/thanks": "^1.0"
31+
"phpunit/phpunit": "~7.0"
3332
},
3433
"autoload": {
3534
"classmap": [

0 commit comments

Comments
 (0)