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

Commit

Permalink
Upgrade to Laravel 5.7
Browse files Browse the repository at this point in the history
Close #35  (outdated laravel passport version)
  • Loading branch information
hedii committed Jan 24, 2019
1 parent 44bb5be commit 91764a7
Show file tree
Hide file tree
Showing 54 changed files with 7,247 additions and 10,977 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
Expand Down
12 changes: 7 additions & 5 deletions app/Jobs/CrawlJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Support\Facades\App;
use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\Process;

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

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

$this->search->update(['pid' => $pid]);
$process->run();
}
}
}
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"fideloper/proxy": "~4.0",
"guzzlehttp/guzzle": "^6.3",
"hedii/extractors": "^2.0",
"laravel/framework": "5.6.*",
"laravel/passport": "~5.0",
"laravel/framework": "5.7.*",
"laravel/passport": "^7.0",
"laravel/tinker": "~1.0"
},
"require-dev": {
Expand All @@ -28,8 +28,7 @@
"fzaninotto/faker": "~1.4",
"mockery/mockery": "~1.0",
"nunomaduro/collision": "~1.1",
"phpunit/phpunit": "~7.0",
"symfony/thanks": "^1.0"
"phpunit/phpunit": "~7.0"
},
"autoload": {
"classmap": [
Expand Down
Loading

0 comments on commit 91764a7

Please sign in to comment.