-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
1441eaa
commit f2f7dc8
Showing
6 changed files
with
82 additions
and
32 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
web/Modules/Microweber/App/Providers/EventServiceProvider.php
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,38 @@ | ||
<?php | ||
|
||
namespace Modules\Microweber\App\Providers; | ||
|
||
use App\Events\DomainIsChanged; | ||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; | ||
use Modules\Microweber\Listeners\DomainIsChangedListener; | ||
|
||
class EventServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* The event to listener mappings for the application. | ||
* | ||
* @var array<class-string, array<int, class-string>> | ||
*/ | ||
|
||
protected $listen = [ | ||
DomainIsChanged::class => [ | ||
DomainIsChangedListener::class, | ||
], | ||
]; | ||
|
||
/** | ||
* Register any events for your application. | ||
*/ | ||
public function boot(): void | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Determine if events and listeners should be automatically discovered. | ||
*/ | ||
public function shouldDiscoverEvents(): bool | ||
{ | ||
return false; | ||
} | ||
} |
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
38 changes: 38 additions & 0 deletions
38
web/Modules/Microweber/Listeners/DomainIsChangedListener.php
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,38 @@ | ||
<?php | ||
|
||
namespace Modules\Microweber\Listeners; | ||
|
||
use App\Events\DomainIsChanged; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Queue\InteractsWithQueue; | ||
use Modules\Microweber\App\Models\MicroweberInstallation; | ||
|
||
class DomainIsChangedListener | ||
{ | ||
|
||
/** | ||
* Create the event listener. | ||
*/ | ||
public function __construct() | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* Handle the event. | ||
*/ | ||
public function handle(DomainIsChanged $event): void | ||
{ | ||
if (!isset($event->domain->id)) { | ||
return; | ||
} | ||
|
||
$findMicroweberInstallation = MicroweberInstallation::where('domain_id', $event->domain->id)->first(); | ||
if (!$findMicroweberInstallation) { | ||
return; | ||
} | ||
|
||
shell_exec('php '. $findMicroweberInstallation->installation_path . '/artisan cache:clear'); | ||
|
||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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