A plan for improving Spartacus

Discussion corner for Developers of Serendipity.
Post Reply
onli
Regular
Posts: 2850
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

A plan for improving Spartacus

Post by onli »

I'm presenting this here to give a chance for feedback before trying to implement it.

tldr: I think we can improve Spartacus by putting the meta information for plugins into separate files. Opinions?

Problem and Goal

When serendipity wants to know which version a plugin is, it has to run the plugin code, as the version number etc is added to the plugin bag as PHP code. This makes old plugins dangerous: Even when not installed, Serendipity will run them at least once to check their version. If the plugin is old and incompatible with a new PHP version, that breaks the blog.

If serendipity would only run installed plugins, and ideally only run plugins it knows are working, this would be a lot more stable.

Approach: Separate meta information

I propose that we add something like a meta.inc.toml (or similar plain format) to each plugin. In it we collect all (or as much as possible) of the information that is currently added as code in the introspect function, like the id, the version, the requirements (see https://github.com/s9y/Serendipity/blob ... ck.php#L13 for an example). Then when serendipity checks the plugin versions etc it can read that information without running the plugin code.

To make it backwards compatible, the plugin api would read that meta file when initializing the plugin and fill the prop bag with it exactly as the current code does it. That way we do not need to change anything else.

As a possible next step, we could change the spartacus infrastructure on the server. Currently, that one also runs the PHP code in the Serendipity framework to generate the package files. Those could then be generated without serendipity involvement, which means: As a next step, it could all be generated in github's CI, without us needing a server.

I think this would also allow us to load plugins more carefully. To try loading them, and if they fail to skip them. Not directly related and probably already doable, but this change should make it easier.
erAck
Regular
Posts: 244
Joined: Mon Feb 16, 2015 1:20 am

Re: A plan for improving Spartacus

Post by erAck »

Sounds like a good plan.
onli
Regular
Posts: 2850
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: A plan for improving Spartacus

Post by onli »

:) Garvin also agreed, via mail. Gonna give this a try!
Post Reply