-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c61873d
commit 3a0bc55
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
|
||
namespace App\Recipes\Laravel\Commands; | ||
|
||
|
||
use App\Exceptions\DockerServiceNotFoundException; | ||
use App\Services\DockerService; | ||
use App\Services\TerminalService; | ||
use Illuminate\Contracts\Container\BindingResolutionException; | ||
use LaravelZero\Framework\Commands\Command; | ||
|
||
class OpcacheStatus extends Command{ | ||
protected $signature = 'opcache:status | ||
{--scripts} : show scripts cache status'; | ||
|
||
protected $description = 'Show OpCache status'; | ||
|
||
/** | ||
* @param DockerService $docker_service | ||
* @param TerminalService $terminal | ||
* @return int | ||
* @throws DockerServiceNotFoundException | ||
* @throws BindingResolutionException | ||
*/ | ||
public function handle(DockerService $docker_service, TerminalService $terminal){ | ||
|
||
$terminal->init($this->output); | ||
|
||
|
||
if($this->option('scripts')){ | ||
return $docker_service->service('php')->execute($terminal, [ | ||
"php", | ||
"/usr/bin/cachetool.phar", | ||
"opcache:status:scripts", | ||
]); | ||
} | ||
|
||
return $docker_service->service('php')->execute($terminal, [ | ||
"php", | ||
"/usr/bin/cachetool.phar", | ||
"opcache:status", | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters