[pmwiki-users] PmWiki.org attachments cleanup

Patrick R. Michaud pmichaud at pobox.com
Tue Mar 25 18:51:57 CDT 2014


On Wed, Mar 26, 2014 at 12:17:42AM +0100, Petko Yotov wrote:
> I'd like to know Pm's opinion on migrating uploads from group based
> to page based, ie $UploadPrefixFmt = '/$Group/$Name';

I don't see any real advantage of page-based uploads for the Cookbook.
We'd still have to check all of the pages to find orphaned attachments;
and on top of that the attachments would then be spread across multiple
directories to be checked.  It might help as far as figuring out which
page an attachment was originally intended to be associated with...
but I'm not sure that's a big enough advantage to warrant a switch.

Note that even with a per-page file organization it's still 
possible/likely that some attachments will be referenced from
multiple Cookbook pages.  So, for any given attachment we still
should check every Cookbook page for an active link to it.

Also, there might be some attachment files referenced by [[http://... ]]
links instead of Attach: .

I'd suggest developing a mechanism (recipe, likely) that scans
a set of pages to generate attachment links, then generate a table
cross referencing attachments with the pages that link to them.
Then we can figure out which files are candidates for deletion.

Another possibility is to use a spider to crawl the 
pmwiki.org/wiki/Cookbook/ space and then extract the list
of links to the uploads/Cookbook/ directory.

Pm



More information about the pmwiki-users mailing list