2020-12-25 01:45:30 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Jobs\Install;
|
|
|
|
|
|
|
|
use App\Abstracts\Job;
|
|
|
|
use App\Utilities\Console;
|
|
|
|
|
|
|
|
class DownloadModule extends Job
|
|
|
|
{
|
|
|
|
protected $alias;
|
|
|
|
|
|
|
|
protected $company_id;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new job instance.
|
|
|
|
*
|
|
|
|
* @param $alias
|
|
|
|
* @param $company_id
|
|
|
|
*/
|
2020-12-25 12:08:15 +03:00
|
|
|
public function __construct($alias, $company_id)
|
2020-12-25 01:45:30 +03:00
|
|
|
{
|
|
|
|
$this->alias = $alias;
|
2020-12-25 12:08:15 +03:00
|
|
|
$this->company_id = $company_id;
|
2020-12-25 01:45:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Execute the job.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function handle()
|
|
|
|
{
|
|
|
|
$command = "module:download {$this->alias} {$this->company_id}";
|
|
|
|
|
|
|
|
$result = Console::run($command);
|
|
|
|
|
|
|
|
if ($result !== true) {
|
|
|
|
throw new \Exception($result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|