From 88cd3c98dfc2051649b6b484d6683725000a4f5e Mon Sep 17 00:00:00 2001 From: Simon Wheatley Date: Wed, 2 Jul 2014 21:54:34 +0100 Subject: [PATCH 1/8] An installer to create require files for everything in mu-plugins --- ComposerScript/Installer.php | 119 +++++++++++++++++++++++++ composer.json | 20 ++++- composer.lock | 163 +++++++++++++++++++++++++++++++++++ 3 files changed, 301 insertions(+), 1 deletion(-) create mode 100644 ComposerScript/Installer.php create mode 100644 composer.lock diff --git a/ComposerScript/Installer.php b/ComposerScript/Installer.php new file mode 100644 index 0000000..3fbdeb5 --- /dev/null +++ b/ComposerScript/Installer.php @@ -0,0 +1,119 @@ +getComposer(); + $io = $event->getIO(); + $operation = $event->getOperation(); + $package = $operation->getPackage(); + $im = $composer->getInstallationManager(); + + $install_path = $im->getInstallPath( $package ); + + if ( 'htdocs/wp-content/mu-plugins' == dirname( $install_path ) ) { + $plugin_files = self::get_plugin_files( $install_path ); + $plugin_name = $package->getPrettyName(); + $plugin_name = $package->getName(); + $plugin_description = $package->getDescription(); + self::write_plugin_require( $io, $plugin_files, $install_path ); + } + } + + /** + * Delete existing auto-generated require plugin files + * from mu-plugins. + * + * @return void + * @author Simon Wheatley + **/ + protected static function delete_auto_requires() { + $files = array(); + foreach ( glob( "htdocs/wp-content/mu-plugins/auto-require-*.php" ) as $file ) { + unlink( $file ); + } + return $files; + } + + /** + * Get all the plugin files within the package, and their plugin names. + * + * @param strong $install_path The path to the Composer package (a mu-plugins subdirectory) + * @return array An array of plugin paths (key) and plugin names (value) + * @author Simon Wheatley + **/ + protected static function get_plugin_files( $install_path ) { + $files = array(); + foreach ( glob( "{$install_path}*.php" ) as $file ) { + $file_contents = file_get_contents( $file, false, null, -1, 8192 ); + if ( preg_match( '/^[ \t\/*#@]*Plugin Name:(.*)$/mi', $file_contents, $matches ) ) { + $files[ $file ] = trim( $matches[1] ); + } + } + return $files; + } + + /** + * Write a basic plugin file, which requires the relevant file + * inside mu-plugins/[folder]. + * + * @param array $plugin_files An array of plugin paths (key) and plugin names (value) + * @param strong $install_path The path to the Composer package (a mu-plugins subdirectory) + * @return void + * @author Simon Wheatley + **/ + protected static function write_plugin_require( $io, $plugin_files, $install_path ) { + foreach ( $plugin_files as $plugin_file => $plugin_name ) { + $lines = array(); + $lines[] = 'write( sprintf( 'Created auto-require file for "%s" at %s', $plugin_name, $require_plugin_file ) ); + + } + } +} diff --git a/composer.json b/composer.json index db07715..913121d 100644 --- a/composer.json +++ b/composer.json @@ -20,14 +20,32 @@ }, "require" : { "wpackagist-plugin/query-monitor" : "dev-master", + "wpackagist-plugin/responsible" : "@stable", "php" : ">=5.2.4" }, "require-dev" : { }, "extra" : { "installer-paths": { + "htdocs/wp-content/mu-plugins/{$name}/": [ + "wpackagist-plugin/responsible" + ], "htdocs/wp-content/plugins/{$name}/" : ["type:wordpress-plugin"], "htdocs/wp-content/themes/{$name}/" : ["type:wordpress-theme"] } - } + }, + "autoload": { + "psr-0": { + "ComposerScript\\Installer" : "" + } + }, + "scripts": { + "post-package-update": [ + "ComposerScript\\Installer::post_package_update" + ], + "post-package-install": [ + "ComposerScript\\Installer::post_package_install" + ] + } + } \ No newline at end of file diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..3455de9 --- /dev/null +++ b/composer.lock @@ -0,0 +1,163 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "6b3f44afdcf696bde25a7fb5a0d00d50", + "packages": [ + { + "name": "composer/installers", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "9eb391bcafef76503d0bd4e585756391efc8740f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/9eb391bcafef76503d0bd4e585756391efc8740f", + "reference": "9eb391bcafef76503d0bd4e585756391efc8740f", + "shasum": "" + }, + "replace": { + "roundcube/plugin-installer": "*", + "shama/baton": "*" + }, + "require-dev": { + "composer/composer": "1.0.*@dev", + "phpunit/phpunit": "4.1.*" + }, + "type": "composer-installer", + "extra": { + "class": "Composer\\Installers\\Installer", + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Composer\\Installers\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama", + "role": "Developer" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "http://composer.github.com/installers/", + "keywords": [ + "Craft", + "Dolibarr", + "Hurad", + "MODX Evo", + "OXID", + "WolfCMS", + "agl", + "annotatecms", + "bitrix", + "cakephp", + "codeigniter", + "concrete5", + "croogo", + "drupal", + "elgg", + "fuelphp", + "installer", + "joomla", + "kohana", + "laravel", + "lithium", + "magento", + "mako", + "mediawiki", + "modulework", + "moodle", + "phpbb", + "piwik", + "ppi", + "roundcube", + "shopware", + "silverstripe", + "symfony", + "typo3", + "wordpress", + "zend", + "zikula" + ], + "time": "2014-06-27 16:11:39" + }, + { + "name": "wpackagist-plugin/query-monitor", + "version": "dev-trunk", + "source": { + "type": "svn", + "url": "http://plugins.svn.wordpress.org/query-monitor/", + "reference": "trunk" + }, + "dist": { + "type": "zip", + "url": "http://downloads.wordpress.org/plugin/query-monitor.zip", + "reference": null, + "shasum": null + }, + "require": { + "composer/installers": "~1.0" + }, + "replace": { + "wpackagist/query-monitor": "self.version" + }, + "type": "wordpress-plugin", + "homepage": "http://wordpress.org/plugins/query-monitor/", + "time": "2014-05-03 02:59:35" + }, + { + "name": "wpackagist-plugin/responsible", + "version": "1.1", + "source": { + "type": "svn", + "url": "http://plugins.svn.wordpress.org/responsible/", + "reference": "trunk" + }, + "dist": { + "type": "zip", + "url": "http://downloads.wordpress.org/plugin/responsible.zip", + "reference": null, + "shasum": null + }, + "require": { + "composer/installers": "~1.0" + }, + "replace": { + "wpackagist/responsible": "self.version" + }, + "type": "wordpress-plugin", + "homepage": "http://wordpress.org/plugins/responsible/" + } + ], + "packages-dev": [ + + ], + "aliases": [ + + ], + "minimum-stability": "dev", + "stability-flags": { + "wpackagist-plugin/query-monitor": 20, + "wpackagist-plugin/responsible": 0 + }, + "platform": { + "php": ">=5.2.4" + }, + "platform-dev": [ + + ] +} From bb1748e41c85a1259d88d739c09e3136310fa0fa Mon Sep 17 00:00:00 2001 From: Simon Wheatley Date: Wed, 2 Jul 2014 22:33:38 +0100 Subject: [PATCH 2/8] Init script tweaks --- vvv-init.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/vvv-init.sh b/vvv-init.sh index 499e82f..0411731 100755 --- a/vvv-init.sh +++ b/vvv-init.sh @@ -58,24 +58,26 @@ done service ssh force-reload # Clone the repo, if it's not there already -if [ ! -d htdocs ] -then - ssh-agent bash -c "ssh-add ssh/cftp_deploy_id_rsa; git clone $REPO_SSH_URL htdocs;" - echo "Cloning the repo" -else - echo "The htdocs directory already exists, and should contain the repo. If not, delete it and run Vagrant provisioning again." -fi +# Optional step +# if [ ! -d htdocs ] +# then +# ssh-agent bash -c "ssh-add ssh/cftp_deploy_id_rsa; git clone $REPO_SSH_URL htdocs;" +# echo "Cloning the repo" +# else +# echo "The htdocs directory already exists, and should contain the repo. If not, delete it and run Vagrant provisioning again." +# fi # Make a database, if we don't already have one mysql -u root --password=root -e "CREATE DATABASE IF NOT EXISTS $DB_NAME; GRANT ALL PRIVILEGES ON $DB_NAME.* TO wp@localhost IDENTIFIED BY 'wp';" -# Let's get some config in the house +# Let's get some WordPress config in the house if [ ! -f htdocs/wp-config.php ]; then + wp core download --path=htdocs echo "Creating wp-config.php" wp core config --dbname="$DB_NAME" --dbuser=wp --dbpass=wp --dbhost="localhost" --extra-php < Date: Wed, 2 Jul 2014 22:41:11 +0100 Subject: [PATCH 3/8] Stop being so gung-ho with removing auto-require files --- ComposerScript/Installer.php | 23 +++++++++++++++-------- composer.json | 3 +++ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/ComposerScript/Installer.php b/ComposerScript/Installer.php index 3fbdeb5..e681876 100644 --- a/ComposerScript/Installer.php +++ b/ComposerScript/Installer.php @@ -28,6 +28,17 @@ public static function post_package_update( Event $event ) { self::handle_mu_plugin( $event ); } + /** + * Hooks the pre-package-uninstall Composer event + * + * @param Event $event A Composer Event object + * @return void + * @author Simon Wheatley + **/ + public static function post_package_install( Event $event ) { + self::remove_require_file( $event ); + } + /** * Process a mu-plugins installed package, creating the relevant * require file(s). @@ -55,18 +66,14 @@ protected static function handle_mu_plugin( Event $event ) { } /** - * Delete existing auto-generated require plugin files - * from mu-plugins. + * Remove the require file for a mu-plugins installed package. * + * @param Event $event A Composer Event object * @return void * @author Simon Wheatley **/ - protected static function delete_auto_requires() { - $files = array(); - foreach ( glob( "htdocs/wp-content/mu-plugins/auto-require-*.php" ) as $file ) { - unlink( $file ); - } - return $files; + protected static function remove_require_file( Event $event ) { + // @TODO: Remove the related auto-generated require plugin file } /** diff --git a/composer.json b/composer.json index 913121d..8d88623 100644 --- a/composer.json +++ b/composer.json @@ -40,6 +40,9 @@ } }, "scripts": { + "pre-package-uninstall" : [ + "ComposerScript\\Installer::pre_package_uninstall" + ], "post-package-update": [ "ComposerScript\\Installer::post_package_update" ], From d052f5440378afc61381792549f3eedecac8ad24 Mon Sep 17 00:00:00 2001 From: Simon Wheatley Date: Thu, 3 Jul 2014 10:43:34 +0100 Subject: [PATCH 4/8] Remove require before the package is uninstalled. --- ComposerScript/Installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ComposerScript/Installer.php b/ComposerScript/Installer.php index e681876..4efa3ef 100644 --- a/ComposerScript/Installer.php +++ b/ComposerScript/Installer.php @@ -35,7 +35,7 @@ public static function post_package_update( Event $event ) { * @return void * @author Simon Wheatley **/ - public static function post_package_install( Event $event ) { + public static function pre_package_uninstall( Event $event ) { self::remove_require_file( $event ); } From f83b186d44215550e6147f8197240247c83d730a Mon Sep 17 00:00:00 2001 From: Simon Wheatley Date: Tue, 15 Jul 2014 19:45:45 +0100 Subject: [PATCH 5/8] Tidy up the write and remove require methods. --- ComposerScript/Installer.php | 88 ++++++++++++++++++++++++++---------- 1 file changed, 63 insertions(+), 25 deletions(-) diff --git a/ComposerScript/Installer.php b/ComposerScript/Installer.php index 4efa3ef..55563a1 100644 --- a/ComposerScript/Installer.php +++ b/ComposerScript/Installer.php @@ -58,10 +58,9 @@ protected static function handle_mu_plugin( Event $event ) { if ( 'htdocs/wp-content/mu-plugins' == dirname( $install_path ) ) { $plugin_files = self::get_plugin_files( $install_path ); - $plugin_name = $package->getPrettyName(); - $plugin_name = $package->getName(); - $plugin_description = $package->getDescription(); - self::write_plugin_require( $io, $plugin_files, $install_path ); + foreach ( $plugin_files as $plugin_file => $plugin_name ) { + self::write_plugin_require( $io, $plugin_name, $plugin_file, $install_path ); + } } } @@ -73,7 +72,21 @@ protected static function handle_mu_plugin( Event $event ) { * @author Simon Wheatley **/ protected static function remove_require_file( Event $event ) { - // @TODO: Remove the related auto-generated require plugin file + $composer = $event->getComposer(); + $io = $event->getIO(); + $operation = $event->getOperation(); + $package = $operation->getPackage(); + $im = $composer->getInstallationManager(); + + $install_path = $im->getInstallPath( $package ); + + if ( 'htdocs/wp-content/mu-plugins' == dirname( $install_path ) ) { + $plugin_files = self::get_plugin_files( $install_path ); + foreach ( $plugin_files as $plugin_file => $plugin_name ) { + self::remove_plugin_require( $io, $plugin_name, $plugin_file, $install_path ); + } + } + } /** @@ -98,29 +111,54 @@ protected static function get_plugin_files( $install_path ) { * Write a basic plugin file, which requires the relevant file * inside mu-plugins/[folder]. * - * @param array $plugin_files An array of plugin paths (key) and plugin names (value) - * @param strong $install_path The path to the Composer package (a mu-plugins subdirectory) + * @param array $plugin_name A plugin name + * @param array $plugin_file A plugin file path + * @param string $install_path The path to the Composer package (a mu-plugins subdirectory) * @return void * @author Simon Wheatley **/ - protected static function write_plugin_require( $io, $plugin_files, $install_path ) { - foreach ( $plugin_files as $plugin_file => $plugin_name ) { - $lines = array(); - $lines[] = 'write( sprintf( 'Created auto-require file for "%s" at %s', $plugin_name, $require_plugin_file ) ); + protected static function write_plugin_require( $io, $plugin_name, $plugin_file, $install_path ) { + $lines = array(); + $lines[] = 'write( sprintf( 'Created auto-require file for "%s" at %s', $plugin_name, $require_plugin_file ) ); + } - } + /** + * Remove the basic plugin file, which requires the relevant file + * inside mu-plugins/[folder]. + * + * @param array $plugin_file A plugin file path + * @param string $install_path The path to the Composer package (a mu-plugins subdirectory) + * @return void + * @author Simon Wheatley + **/ + protected static function remove_plugin_require( $io, $plugin_name, $plugin_file, $install_path ) { + $require_plugin_file = self::require_plugin_file_path( $install_path, $plugin_file ); + unlink( $require_plugin_file ); + $io->write( sprintf( 'Removed auto-require file for "%s" at %s', $plugin_name, $require_plugin_file ) ); + } + + /** + * Provide the file path for a file within the mu-plugins folder. + * + * @param string $install_path The path to the Composer package (a mu-plugins subdirectory) + * @param string $plugin_file The path to the plugin file within the Composer package + * @return string A file path + * @author Simon Wheatley + **/ + static function require_plugin_file_path( $install_path, $plugin_file ) { + return sprintf( '%s/auto-require-%s', dirname( $install_path ), basename( $plugin_file ) ); } } From 5e827a369b0b1e23fbbeacb988d8e0179cff25d3 Mon Sep 17 00:00:00 2001 From: Simon Wheatley Date: Tue, 15 Jul 2014 20:54:07 +0100 Subject: [PATCH 6/8] Handle updates (delete the auto require before updating, then recreate). Some inline doc tidying. --- ComposerScript/Installer.php | 73 ++++++++++++++++++++++++++---------- composer.json | 5 ++- 2 files changed, 57 insertions(+), 21 deletions(-) diff --git a/ComposerScript/Installer.php b/ComposerScript/Installer.php index 55563a1..2676af5 100644 --- a/ComposerScript/Installer.php +++ b/ComposerScript/Installer.php @@ -14,40 +14,63 @@ class Installer { * @author Simon Wheatley **/ public static function post_package_install( Event $event ) { - self::handle_mu_plugin( $event ); + $composer = $event->getComposer(); + $io = $event->getIO(); + $operation = $event->getOperation(); + $package = $operation->getPackage(); + $im = $composer->getInstallationManager(); + + $install_path = $im->getInstallPath( $package ); + + self::write_plugin_requires( $install_path, $io ); } /** - * Hooks the post-package-update Composer event + * Hooks the pre-package-update Composer event * * @param Event $event A Composer Event object * @return void * @author Simon Wheatley **/ - public static function post_package_update( Event $event ) { - self::handle_mu_plugin( $event ); + public static function pre_package_update( Event $event ) { + $composer = $event->getComposer(); + $io = $event->getIO(); + $operation = $event->getOperation(); + $package = $operation->getTargetPackage(); + $im = $composer->getInstallationManager(); + + $install_path = $im->getInstallPath( $package ); + + self::remove_require_files( $install_path, $io ); } /** - * Hooks the pre-package-uninstall Composer event + * Hooks the post-package-update Composer event * * @param Event $event A Composer Event object * @return void * @author Simon Wheatley **/ - public static function pre_package_uninstall( Event $event ) { - self::remove_require_file( $event ); + public static function post_package_update( Event $event ) { + $composer = $event->getComposer(); + $io = $event->getIO(); + $operation = $event->getOperation(); + $package = $operation->getTargetPackage(); + $im = $composer->getInstallationManager(); + + $install_path = $im->getInstallPath( $package ); + + self::write_plugin_requires( $install_path, $io ); } /** - * Process a mu-plugins installed package, creating the relevant - * require file(s). + * Hooks the pre-package-uninstall Composer event * * @param Event $event A Composer Event object * @return void * @author Simon Wheatley **/ - protected static function handle_mu_plugin( Event $event ) { + public static function pre_package_uninstall( Event $event ) { $composer = $event->getComposer(); $io = $event->getIO(); $operation = $event->getOperation(); @@ -56,6 +79,19 @@ protected static function handle_mu_plugin( Event $event ) { $install_path = $im->getInstallPath( $package ); + self::remove_require_files( $install_path, $io ); + } + + /** + * Process a mu-plugins installed package, creating the relevant + * require file(s). + * + * @param string $install_path The path to the package + * @param IOInterface $io The Composer IOInterface, for writing messages + * @return void + * @author Simon Wheatley + **/ + protected static function write_plugin_requires( $install_path, $io ) { if ( 'htdocs/wp-content/mu-plugins' == dirname( $install_path ) ) { $plugin_files = self::get_plugin_files( $install_path ); foreach ( $plugin_files as $plugin_file => $plugin_name ) { @@ -67,19 +103,12 @@ protected static function handle_mu_plugin( Event $event ) { /** * Remove the require file for a mu-plugins installed package. * - * @param Event $event A Composer Event object + * @param string $install_path The path to the package + * @param IOInterface $io The Composer IOInterface, for writing messages * @return void * @author Simon Wheatley **/ - protected static function remove_require_file( Event $event ) { - $composer = $event->getComposer(); - $io = $event->getIO(); - $operation = $event->getOperation(); - $package = $operation->getPackage(); - $im = $composer->getInstallationManager(); - - $install_path = $im->getInstallPath( $package ); - + protected static function remove_require_files( $install_path, $io ) { if ( 'htdocs/wp-content/mu-plugins' == dirname( $install_path ) ) { $plugin_files = self::get_plugin_files( $install_path ); foreach ( $plugin_files as $plugin_file => $plugin_name ) { @@ -111,6 +140,7 @@ protected static function get_plugin_files( $install_path ) { * Write a basic plugin file, which requires the relevant file * inside mu-plugins/[folder]. * + * @param IOInterface $io The Composer IOInterface, for writing messages * @param array $plugin_name A plugin name * @param array $plugin_file A plugin file path * @param string $install_path The path to the Composer package (a mu-plugins subdirectory) @@ -139,6 +169,8 @@ protected static function write_plugin_require( $io, $plugin_name, $plugin_file, * Remove the basic plugin file, which requires the relevant file * inside mu-plugins/[folder]. * + * @param IOInterface $io The Composer IOInterface, for writing messages + * @param array $plugin_name A plugin name * @param array $plugin_file A plugin file path * @param string $install_path The path to the Composer package (a mu-plugins subdirectory) * @return void @@ -150,6 +182,7 @@ protected static function remove_plugin_require( $io, $plugin_name, $plugin_file $io->write( sprintf( 'Removed auto-require file for "%s" at %s', $plugin_name, $require_plugin_file ) ); } + /** * Provide the file path for a file within the mu-plugins folder. * diff --git a/composer.json b/composer.json index 8d88623..e859f24 100644 --- a/composer.json +++ b/composer.json @@ -43,6 +43,9 @@ "pre-package-uninstall" : [ "ComposerScript\\Installer::pre_package_uninstall" ], + "pre-package-update": [ + "ComposerScript\\Installer::pre_package_update" + ], "post-package-update": [ "ComposerScript\\Installer::post_package_update" ], @@ -51,4 +54,4 @@ ] } -} \ No newline at end of file +} From 353eafac08140c6ad3e0c1eaf220c3b7270cd005 Mon Sep 17 00:00:00 2001 From: Simon Wheatley Date: Tue, 15 Jul 2014 21:00:05 +0100 Subject: [PATCH 7/8] Better inline docs. --- ComposerScript/Installer.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ComposerScript/Installer.php b/ComposerScript/Installer.php index 2676af5..7fba460 100644 --- a/ComposerScript/Installer.php +++ b/ComposerScript/Installer.php @@ -9,6 +9,10 @@ class Installer { /** * Hooks the post-package-install Composer event * + * After a package is installed, we need to write + * process the package in case it's a MU plugin + * and we need to add the require files. + * * @param Event $event A Composer Event object * @return void * @author Simon Wheatley @@ -28,6 +32,11 @@ public static function post_package_install( Event $event ) { /** * Hooks the pre-package-update Composer event * + * Before a package is updated, we need to remove + * related require files, in case they are stale + * (we will recreate the required files after the + * package has been updated). + * * @param Event $event A Composer Event object * @return void * @author Simon Wheatley @@ -47,6 +56,9 @@ public static function pre_package_update( Event $event ) { /** * Hooks the post-package-update Composer event * + * After the package is updated, we write any + * require files we need. + * * @param Event $event A Composer Event object * @return void * @author Simon Wheatley @@ -65,6 +77,9 @@ public static function post_package_update( Event $event ) { /** * Hooks the pre-package-uninstall Composer event + * + * Before the package is uninstalled, while it still + * exists, we remove the require files. * * @param Event $event A Composer Event object * @return void From 25640204256c19d5a246eae10face977abf0b2d4 Mon Sep 17 00:00:00 2001 From: Simon Wheatley Date: Tue, 15 Jul 2014 21:00:48 +0100 Subject: [PATCH 8/8] Rename the `write_plugin_requires` to `handle_plugin_requires`, because it doesn't always write them (sometimes it's not a MU plugin) --- ComposerScript/Installer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ComposerScript/Installer.php b/ComposerScript/Installer.php index 7fba460..38cdb33 100644 --- a/ComposerScript/Installer.php +++ b/ComposerScript/Installer.php @@ -26,7 +26,7 @@ public static function post_package_install( Event $event ) { $install_path = $im->getInstallPath( $package ); - self::write_plugin_requires( $install_path, $io ); + self::handle_plugin_requires( $install_path, $io ); } /** @@ -72,7 +72,7 @@ public static function post_package_update( Event $event ) { $install_path = $im->getInstallPath( $package ); - self::write_plugin_requires( $install_path, $io ); + self::handle_plugin_requires( $install_path, $io ); } /** @@ -106,7 +106,7 @@ public static function pre_package_uninstall( Event $event ) { * @return void * @author Simon Wheatley **/ - protected static function write_plugin_requires( $install_path, $io ) { + protected static function handle_plugin_requires( $install_path, $io ) { if ( 'htdocs/wp-content/mu-plugins' == dirname( $install_path ) ) { $plugin_files = self::get_plugin_files( $install_path ); foreach ( $plugin_files as $plugin_file => $plugin_name ) {