Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major Refactoring, Clean-Up and Simplification #39

Merged
merged 9 commits into from Mar 4, 2024

Conversation

splitbrain
Copy link
Member

This plugin tried to do a lot of things and thus was hard to maintain. The documentation was severely lacking.

This is a very opinionated refactoring on the basic assumption that this plugin should only do one thing: list files that are external to the wiki and make them downloadable. Thus:

  • removed all the handling of media files including the various preview options
    • This is better served by other plugins like the filelisting or gallery plugins
  • removed the output of single links
  • removed the page style output
  • removed the paging options (offset, limit, index)

The mechanism to configure allowed paths have been completely overhauled:

  • paths are configured one per line
  • the web path can optionally be set with a W> prefix
  • an alias can optionally be set with a A> prefix
\\somewindows.server\with\a\share
  W> https://somewindows.server/has/itsowndocroot/
  A> fileserver
/this/is/a/local/path/outside/thewebroot/
  A> local

With the above you could use {{filelist>fileserver/somedir/*}} or {{filelist>local/another}}. fileserver and local are the aliases defined above and will be replaced accordingly. This makes it easier to type and you can change where all the listings point to at a central location.

Note that for the second config no web path is defined. This will use the default PHP dispatcher included in the plugin, eg. PHP will access the file and pipe it through to the browser. No need to have the files in the webserver root anymore.

This should be fully compatible with linux, windows letter style and windows UNC paths and make #38 obsolete.

Docs will be updated once merged. I will keep this open for a bit for feedback.

This refactors the plugin from one mega syntax file into multiple
classes.

The plugin now focuses on one usecase: listing files that are external
to the wiki and making them downloadable. All other usecases have been
dropped. Also a bunch of other options have been dropped.

A new dispatcher makes it possible to deliver files without the need to
have the webserver pointing at them.
This could really use some more tests but this has to suffice for now.
@Klap-in
Copy link
Member

Klap-in commented Feb 27, 2024

The latest version before this refactoring should be available as release on GitHub. At first sight I think that's the case. That gives some respite for specific cases.

@splitbrain splitbrain merged commit ea0fa0c into dokufreaks:master Mar 4, 2024
@splitbrain splitbrain deleted the refactor branch March 4, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants