-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#111] Move VigetWP Composer Install to ddev post-start hook
- Loading branch information
Showing
2 changed files
with
16 additions
and
26 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 |
---|---|---|
|
@@ -92,7 +92,7 @@ public static function init( Event $event, bool $fromExecute = false ): void { | |
// Give database population options | ||
self::populateDatabase(); | ||
} else { | ||
// Pre-populate Site Info | ||
// Pre-configure the Setup | ||
self::$info = [ | ||
'title' => 'WordPress Site Starter', | ||
'description' => 'A project developed by Viget.', | ||
|
@@ -101,6 +101,10 @@ public static function init( Event $event, bool $fromExecute = false ): void { | |
'email' => '[email protected]', | ||
]; | ||
|
||
// Do not activate Project Plugins | ||
unset( self::$activatePlugins['seo-by-rank-math'] ); | ||
unset( self::$activatePlugins['wordfence'] ); | ||
|
||
// Automatically install WordPress | ||
self::doFreshInstall(); | ||
} | ||
|
@@ -110,10 +114,10 @@ public static function init( Event $event, bool $fromExecute = false ): void { | |
|
||
// Remove Hello Dolly. | ||
self::deleteCorePlugins(); | ||
} | ||
|
||
// Run the Viget WP Composer Install | ||
self::vigetWPComposerInstall(); | ||
// Show the success message. | ||
self::renderSuccessMessage(); | ||
} | ||
} | ||
|
||
/** | ||
|
@@ -322,9 +326,6 @@ private static function doFreshInstall(): void { | |
|
||
// Configure plugins. | ||
self::configurePlugins(); | ||
|
||
// Show the success message. | ||
self::renderSuccessMessage(); | ||
} | ||
|
||
/** | ||
|
@@ -569,8 +570,13 @@ private static function activatePlugins(): void { | |
private static function configurePlugins(): void { | ||
self::writeComment( 'Configuring plugins...' ); | ||
|
||
self::configureRankMath(); | ||
self::configureWordfence(); | ||
if( ! empty( self::$activatePlugins['seo-by-rank-math'] ) ) { | ||
self::configureRankMath(); | ||
} | ||
|
||
if( ! empty( self::$activatePlugins['wordfence'] ) ) { | ||
self::configureWordfence(); | ||
} | ||
|
||
self::writeInfo( 'Plugins configured.' ); | ||
} | ||
|
@@ -695,21 +701,4 @@ public static function renderSuccessMessage(): void { | |
|
||
self::writeLine( $success ); | ||
} | ||
|
||
/** | ||
* Run the Viget WP Composer Installer. | ||
* | ||
* @return void | ||
*/ | ||
private static function vigetWPComposerInstall(): void { | ||
self::writeInfo( 'Running Viget WP Composer Install...' ); | ||
|
||
// Run composer install from the viget-wp directory | ||
$directory = self::translatePath( './wp-content/mu-plugins/viget-wp' ); | ||
$cmd = 'composer install -d ' . escapeshellarg( $directory ); | ||
|
||
self::runCommand( $cmd ); | ||
|
||
self::writeInfo( 'VigetWP Composer Install complete.' ); | ||
} | ||
} |