General developer forum

I am developing a plugin, but reinstall it everytime to test it is too much time-consuming.

 
Davo
Re: I am developing a plugin, but reinstall it everytime to test it is too much time-consuming.
Core developersParticularly helpful MoodlersPlugin developers

It really depends what sort of changes you are making.

If you're changing the database definition, then the XMLDB editor (which you should always use to generate the install.xml file) can also generate statements to go in the upgrade.php file - so just put them in there, bump the version number and visit the notifications page, to run the upgrade.

If you're changing capability definitions, message providers, event handlers or any of the other definitions that sit inside the db/ subdirectory, then just bump the version number and visit the notifications page.

If you're changing language strings or styles, then purge caches (site admin > developer > purge caches) OR, if you can run command line scripts, "php admin/cli/purge_caches.php" (which I run a lot during development).

If it's just a change in the code itself (which doesn't require a change to the database structure or the caches), then just save the changes (assuming you are working with a local server, if it is a remote server you'll need to upload them as well) and refresh the page - the changes should appear immediately.

 
Average of ratings: Useful (11)
Picture of Mark Johnson
Re: I am developing a plugin, but reinstall it everytime to test it is too much time-consuming.
Core developersParticularly helpful MoodlersPlugin developers
Just one other thing to add, if you do genuinely want to check that the plugin installs correctly, if you set up PHPUnit or Behat testing, running the init.php script after bumping the version number will drop the testing database and reinstall the whole system in one command.
 
Average of ratings: -
Picture of Rachel Martin
Re: I am developing a plugin, but reinstall it everytime to test it is too much time-consuming.
 

I agree here.  I rarely have to reinstall a plugin to update it.  Just update your code, save the changes, and purge the cache.

 
Average of ratings: -
Picture of Lawrence Lagerlof
Re: I am developing a plugin, but reinstall it everytime to test it is too much time-consuming.
 

You helped me a lot. Thank you.

 
Average of ratings: -