original_string: public function remove_plugin_folder(\core\plugininfo\base $plugin) {
  
          if (!$this->is_plugin_folder_removable($plugin->component)) {
              throw new moodle_exception('err_removing_unremovable_folder', 'core_plugin', '',
                  array('plugin' => $plugin->component, 'rootdir' => $plugin->rootdir),
                  'plugin root folder is not removable as expected');
          }
  
          if ($plugin->get_status() === self::PLUGIN_STATUS_UPTODATE or $plugin->get_status() === self::PLUGIN_STATUS_NEW) {
              $this->archive_plugin_version($plugin);
          }
  
          remove_dir($plugin->rootdir);
          clearstatcache();
          if (function_exists('opcache_reset')) {
              opcache_reset();
          }
      }
code: public function remove_plugin_folder(\core\plugininfo\base $plugin) {
  
          if (!$this->is_plugin_folder_removable($plugin->component)) {
              throw new moodle_exception('err_removing_unremovable_folder', 'core_plugin', '',
                  array('plugin' => $plugin->component, 'rootdir' => $plugin->rootdir),
                  'plugin root folder is not removable as expected');
          }
  
          if ($plugin->get_status() === self::PLUGIN_STATUS_UPTODATE or $plugin->get_status() === self::PLUGIN_STATUS_NEW) {
              $this->archive_plugin_version($plugin);
          }
  
          remove_dir($plugin->rootdir);
          clearstatcache();
          if (function_exists('opcache_reset')) {
              opcache_reset();
          }
      }
code_tokens: public function remove_plugin_folder ( \ core \ plugininfo \ base $ plugin ) { if ( ! $ this -> is_plugin_folder_removable ( $ plugin -> component ) ) { throw new moodle_exception ( 'err_removing_unremovable_folder' , 'core_plugin' , '' , array ( 'plugin' => $ plugin -> component , 'rootdir' => $ plugin -> rootdir ) , 'plugin root folder is not removable as expected' ) ; } if ( $ plugin -> get_status ( ) === self :: PLUGIN_STATUS_UPTODATE or $ plugin -> get_status ( ) === self :: PLUGIN_STATUS_NEW ) { $ this -> archive_plugin_version ( $ plugin ) ; } remove_dir ( $ plugin -> rootdir ) ; clearstatcache ( ) ; if ( function_exists ( 'opcache_reset' ) ) { opcache_reset ( ) ; } }
docstring: Remove the current plugin code from the dirroot.
  
  If removing the currently installed version (which happens during
  updates), we archive the code so that the upgrade can be cancelled.
  
  To prevent accidental data-loss, we also archive the existing plugin
  code if cancelling installation of it, so that the developer does not
  loose the only version of their work-in-progress.
  
  @param \core\plugininfo\base $plugin
docstring_tokens: Remove the current plugin code from the dirroot .