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

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

napisao/la Davo Smith -
Broj odgovora: 3
Slika Core developers Slika Particularly helpful Moodlers Slika Peer reviewers Slika Plugin 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.

Odgovor na Davo Smith

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

napisao/la Mark Johnson -
Slika Core developers Slika Particularly helpful Moodlers Slika Peer reviewers Slika Plugin 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.
Odgovor na Davo Smith

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

napisao/la Rachel Martin -

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