Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveorevo committed Aug 9, 2023
1 parent e100f5d commit 9942e79
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion hooks/pluginable.php
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ function str_starts_with($haystack, $needle) {
case 'yes':
if ( file_exists( "/usr/local/hestia/plugins/$plugin.disabled") ) {
rename( "/usr/local/hestia/plugins/$plugin.disabled", "/usr/local/hestia/plugins/$plugin" );
$hcpp->do_action( 'hcpp_plugin_enabled', $plugin );
$hcpp->run( 'invoke-plugin hcpp_plugin_enabled ' . escapeshellarg( $plugin ) );
}
$hcpp->run_install_scripts();
break;
Expand Down Expand Up @@ -848,6 +848,16 @@ function str_starts_with($haystack, $needle) {
return $args;
});

// Invoke plugin enabled after plugin is renamed and loaded
$hcpp->add_action( 'hcpp_invoke_plugin', function( $args ) ) {
if ( $args[0] == 'hcpp_plugin_enabled' ) {
$plugin = $args[1];
global $hcpp;
$hcpp->do_action( 'hcpp_plugin_enabled', $plugin );
}
return $args;
}

// List plugins in HestiaCP's Configure Server UI
$hcpp->add_action( 'hcpp_render_page', function( $args ) {
global $hcpp;
Expand Down

0 comments on commit 9942e79

Please sign in to comment.