for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PressCLI\Command;
use PressCLI\Option\Configuration;
class PostInstall
{
/**
* Executes the post install commands.
*/
public static function executeCommands()
$config = Configuration::get();
// Run commands.
foreach ($config['commands']['postInstall'] as $command) {
system($command);
}
* Executes the post install theme commands.
public static function executeThemeCommands()
$themeName = isset($config['theme']['name']) ? $config['theme']['name'] : '';
$commands = isset($config['commands']['postInstallTheme']) ? $config['commands']['postInstallTheme'] : [];
if ( ! $themeName || ! $commands ) {
return;
$rootDir = getcwd();
$themeDir = "{$rootDir}/wp-content/themes/{$themeName}";
// Change into the theme directory.
chdir($themeDir);
foreach ($commands as $command) {
// Change back to root directory.
chdir($rootDir);