-
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
Showing
4 changed files
with
98 additions
and
1 deletion.
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,30 @@ | ||
<?php | ||
|
||
namespace Local\ComposerScript; | ||
|
||
use Composer\Script\Event; | ||
|
||
/** | ||
* Class CacheWarmerHandler | ||
* @package Local\ComposerScript | ||
* | ||
* @since 04.08.2021 | ||
*/ | ||
class CacheWarmerHandler | ||
{ | ||
/** | ||
* @param Event $event | ||
* | ||
* @return void | ||
*/ | ||
public static function doInstall(Event $event): void | ||
{ | ||
$io = $event->getIO(); | ||
|
||
$output = shell_exec('php bin/console cache:clear'); | ||
$io->write($output); | ||
|
||
$output = shell_exec('php bin/console cache:warm'); | ||
$io->write($output); | ||
} | ||
} |
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,25 @@ | ||
<?php | ||
|
||
namespace Local\ComposerScript; | ||
|
||
use Composer\Script\Event; | ||
|
||
/** | ||
* Class RunMigrationsHandler | ||
* @package Local\ComposerScript | ||
*/ | ||
class RunMigrationsHandler | ||
{ | ||
/** | ||
* @param Event $event | ||
* | ||
* @return void | ||
*/ | ||
public static function doInstall(Event $event): void | ||
{ | ||
$io = $event->getIO(); | ||
|
||
$output = shell_exec('php migrator migrate'); | ||
$io->write($output); | ||
} | ||
} |
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