-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to turn Xdebug on and off, easter egg to play nice with L…
…aravel Valet (#95) * Add functionality to turn xdebug on or off with porter php:xdebug on/off * Cheeky addition of functionality to make Porter play nice with Laravel Valet. Sites can co-exist with each other.
- Loading branch information
Showing
31 changed files
with
1,086 additions
and
52 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
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,32 @@ | ||
<?php | ||
|
||
namespace App\Commands\DockerCompose; | ||
|
||
use App\Commands\BaseCommand; | ||
|
||
class SoftRestart extends BaseCommand | ||
{ | ||
/** | ||
* The signature of the command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'soft-restart {service?}'; | ||
|
||
/** | ||
* The description of the command. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Soft restart containers (ignores after config changes)'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return void | ||
*/ | ||
public function handle(): void | ||
{ | ||
$this->porter->softRestart((string) $this->argument('service')); | ||
} | ||
} |
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
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
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,47 @@ | ||
<?php | ||
|
||
namespace App\Commands\Php; | ||
|
||
use App\Commands\BaseCommand; | ||
use App\Support\XDebug\XDebug; | ||
|
||
class XdebugStatus extends BaseCommand | ||
{ | ||
/** | ||
* The signature of the command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'php:xdebug {status}'; | ||
|
||
/** | ||
* The description of the command. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Set XDebug status On/Off'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @throws \Exception | ||
* | ||
* @return void | ||
*/ | ||
public function handle(): void | ||
{ | ||
$status = strtolower(/** @scrutinizer ignore-type */ $this->argument('status')); | ||
|
||
if (!in_array($status, ['on', 'off'])) { | ||
throw new \Exception('Xdebug can only be turned on or off.'); | ||
} | ||
|
||
if ($status === 'on') { | ||
app(XDebug::class)->turnOn(); | ||
|
||
return; | ||
} | ||
|
||
app(XDebug::class)->turnOff(); | ||
} | ||
} |
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,33 @@ | ||
<?php | ||
|
||
namespace App\Commands\Valet; | ||
|
||
use App\Commands\BaseCommand; | ||
use App\Support\Valet\Valet; | ||
|
||
class Off extends BaseCommand | ||
{ | ||
/** | ||
* The signature of the command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'valet:off'; | ||
|
||
/** | ||
* The description of the command. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Let Porter know it is not running alongside Laravel Valet'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return void | ||
*/ | ||
public function handle(): void | ||
{ | ||
app(Valet::class)->turnOff(); | ||
} | ||
} |
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,33 @@ | ||
<?php | ||
|
||
namespace App\Commands\Valet; | ||
|
||
use App\Commands\BaseCommand; | ||
use App\Support\Valet\Valet; | ||
|
||
class On extends BaseCommand | ||
{ | ||
/** | ||
* The signature of the command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'valet:on'; | ||
|
||
/** | ||
* The description of the command. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Let Porter know it is running alongside Laravel Valet'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return void | ||
*/ | ||
public function handle(): void | ||
{ | ||
app(Valet::class)->turnOn(); | ||
} | ||
} |
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,15 @@ | ||
<?php | ||
|
||
namespace App\Events; | ||
|
||
use App\Models\Site; | ||
|
||
class SiteRemoved | ||
{ | ||
public $site; | ||
|
||
public function __construct(Site $site) | ||
{ | ||
$this->site = $site; | ||
} | ||
} |
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,15 @@ | ||
<?php | ||
|
||
namespace App\Events; | ||
|
||
use App\Models\Site; | ||
|
||
class SiteSecured | ||
{ | ||
public $site; | ||
|
||
public function __construct(Site $site) | ||
{ | ||
$this->site = $site; | ||
} | ||
} |
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,15 @@ | ||
<?php | ||
|
||
namespace App\Events; | ||
|
||
use App\Models\Site; | ||
|
||
class SiteUnsecured | ||
{ | ||
public $site; | ||
|
||
public function __construct(Site $site) | ||
{ | ||
$this->site = $site; | ||
} | ||
} |
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
Oops, something went wrong.