[pmwiki-devel] Extension development Qs

Petko Yotov 5ko at 5ko.fr
Mon Apr 6 22:35:45 PDT 2026


On 07/04/2026 06:38, Simon wrote:
> If both MyExt.zip and MyExt folder exist which is used?

If both are present, the uncompressed folder is used, not the most 
recent of the two.

If there are multiple files or folders with the same basename, the 
behavior is undefined, ie unknown which will be loaded. We should think 
about handling this.

> What is the expected structure of the .zip file?
> PmWiki usage is a zip file is often to have a single root folder, i.e.
> - MyExt
> --MyExt.php
> --licence.txt
> --readme.md
> --etc

Look at some of the published extensions.

The file name should be MyExt.zip or MyExt-2026-04-07.zip.

Inside there should be a folder with the same basename as the zip file, 
either MyExt or MyExt-2026-04-07.

Inside there should be MyExt.php (not MyExt-2026-04-07.php).

To create a zip file, on GNU/Linux I right-click on the MyExt folder and 
select "Create archive...", then it suggests MyExt.zip and I accept it.

In a terminal, one would cd (change directory) to pmwiki/extensions and 
type:
   zip -r MyExt.zip MyExt

If there is already MyExt.zip one could do an update, only changed and 
new files:
   zip -ru MyExt.zip MyExt

My own extensions are on GitHub and when I create a release, without me 
expressly asking, it makes the MyExt-2026-04-07.zip/MyExt-2026-04-07 
structure.

We could add a hub admin action to pack an extension you develop for 
publication, with the correct structure.

But the zip file cannot be saved in the same folder (the extensions 
folder should not be writable by the PHP process). It could be saved 
under uploads/ or just sent for download to the browser.

Petko



More information about the pmwiki-devel mailing list