Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-06-14 12:17:45

Bastian
Plugin Author
From: Wuppertal, Germany
Registered: 2005-02-02
Posts: 376
Website

Advanced plugin manager

For my latest plugins i code an advanced install script, that adds plugin prefs, plugin tables and import files.

And i see, that more and more plugins have db-prefs instead of editing the plugin code.

For some reasons i thing we need a standard for these things:

  • It is a lot of coding work to add the advanced install
  • Making sure, that all db-prefs etc. can be removed easy and complete
  • A standard could increase security and stability

My plan is to source these functions out to an lib.

That one should:

  • Advanced plugin (un)install
  • Adding / removing plugin prefs
  • Adding / removing plugin table
  • Adding / removing files that are needed by plugin
  • Adding / removing localisation of plugin
  • Update plugin ?

Is anyone interested to take part working on that?
Any other ideas, what a

Offline

#2 2006-06-14 12:23:46

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Advanced plugin manager

I’ll help anyway I can. I’m going through this exact pain right now updating hak_tinymce.


Shoving is the answer – pusher robot

Offline

#3 2006-06-14 13:25:40

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: Advanced plugin manager

Bastian,

last night I was working on a set of DB functions (based on something Inspired posted recently) to test for/add/remove DB tables and I was about to add them to my own library plugin.

You’re welcome to the code if you want it.

If you want any help on this plugin let me know.


Steve

Offline

#4 2006-06-15 15:17:03

jamiew
Archived Plugin Author
From: NYC
Registered: 2005-01-08
Posts: 74
Website

Re: Advanced plugin manager

This is a fantastic idea — a plugin plugin! I’d love to get involved in removing the question mark from the Update Plugin functionality.

‘ve kicked around the idea of a central plugin repository (via Trac or whatever) here before and havn’t heard much response, but at the very least plugins should be able to go to the author’s distribution location and see if it’s changed… I spend way too much time doing this by hand!

Offline

#5 2006-06-15 16:47:17

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: Advanced plugin manager

Jamie
Yep, an update mechanism would be handy, how do you envisage such a feature working?

FWIW, could this work…?
Plugin authors implement a simple query/response mechanism on the plugin server (this could be a plugin too). The server simply uses HTTP headers in response to well formed query URLs fired at it from the plugin doing the update query. A 304 not changed response from the server means nothing to do, a 404 is what-a-ya-talking-about? I know nothing about that plugin!! and a 200 returns the encoded txt of the new version. The plugin library simply updates and activates the 200 page.


Steve

Offline

#6 2006-06-15 19:55:17

jamiew
Archived Plugin Author
From: NYC
Registered: 2005-01-08
Posts: 74
Website

Re: Advanced plugin manager

Steve — a plugin-distro plugin could work, but might be overkill unless you had some specific functionality in mind that would require a web service like that.

The simple solution I had in mind (inspired by DokuWiki) would be for each plugin to define a URL for itself that doesn’t change*. When you run “Update Plugins” the plugin manager grabs a copy and updates the plugin if it’s changed — not very smart, but certainly effective, and txp plugins never go over a few dozen K at most.

Then when you’re installing plugins you could just pass a URL to the plugin manager instead of pasting in the code.

*if you really need multiple versions of your plugins on your site you can just symlink the newest one

Last edited by jamiew (2006-06-15 19:56:04)

Offline

#7 2006-06-15 23:26:28

Bastian
Plugin Author
From: Wuppertal, Germany
Registered: 2005-02-02
Posts: 376
Website

Re: Advanced plugin manager

I’m experimenting with uploading plugins as .zip.
The .zip contains all needed files and images, the regular plugin.txt and a plugin.xml which contains all prefs.

An extension “Plugin manager” handels the .zip-upload, extracts the files, install the plugin and adapt prefs out the .xml.

How do you think about that method?

Offline

#8 2006-06-16 00:25:59

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: Advanced plugin manager

Jamie
Good points, KISS sounds just fine as the filesizes are so small.

Bastian
I am looking forward to trying it out :)


Steve

Offline

#9 2006-06-16 01:01:40

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Advanced plugin manager

Remember to make note that the user will need to have zip support in order for that to work. Lots of servers have it, but lots don’t too.

Offline

#10 2006-06-16 05:07:10

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: Advanced plugin manager

Bastian

Would it be worth including an option to revert a plugin to the previous version after an update?

This is in case an updated plugin happens to be bugged/incompatible with your PHP/MySQL/TxP version in some way.


Steve

Offline

#11 2006-06-16 08:42:42

Bastian
Plugin Author
From: Wuppertal, Germany
Registered: 2005-02-02
Posts: 376
Website

Re: Advanced plugin manager

Mary wrote:

Remember to make note that the user will need to have zip support in order for that to work. Lots of servers have it, but lots don’t too.

I use PclZip from phpconcept.net and there is also a tar lib:
PclTar.
It is possible to support tar, too.

BTW: I get inspired to use packed plugins by the way eyeos.org managing its apps instaling
eyeOS is definitive worth a look!

net-carver wrote

Would it be worth including an option to revert a plugin to the previous version after an update?

That updating issues will not be part of the first version, but i will keep that in mind.

Offline

#12 2006-06-16 20:05:39

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Advanced plugin manager

I use PclZip from phpconcept.net and there is also a tar lib:
PclTar.
It is possible to support tar, too.

Both are just PHP libraries to easily create and manage compressed archives, they don’t provide the server support for them. In order to use either, you need to have Zlib.

It’s not a bad idea, just remember to make that obvious to the user.

Offline

#13 2006-06-17 12:33:09

Bastian
Plugin Author
From: Wuppertal, Germany
Registered: 2005-02-02
Posts: 376
Website

Re: Advanced plugin manager

Mary wrote:

they don’t provide the server support for them.

I know, but with these libs tar and zib could be supported.

I had no experience working with compressed files.

How many servers don’t support neither zip nor tar.gz ?

Offline

#14 2006-06-18 00:29:48

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Advanced plugin manager

I don’t know numbers. I do know Zlib is not a part of the default PHP install, the host has to choose to install it. PHP on Windows has it installed by default, though. All I’m saying is to let people know up-front so you can save on support time later. :)

Offline

#15 2006-06-19 22:08:11

Bastian
Plugin Author
From: Wuppertal, Germany
Registered: 2005-02-02
Posts: 376
Website

Re: Advanced plugin manager

Download bas Plugin Manager BETA

Download archive.zip Upload all files contained into <strong>/textpattern/lib/archive/</strong>

I finished this first version last night and this afternoon i spend some time to test it at a localhost and at samisdat.org. But i strongly recommen to test it local! it is over 1000 lines of code and i would wonder if it would be free of bugs.

However this first version is a point to start from and everyone is invited, to test, report, request and use my code!

Install and active bas Plugin Manager, create an folder plugins in your txp-root and make sure that plugins and textpattern/tmp are writeable. Find the plugin manager at the extensions tab.

I wrote a little plugin.zip for the manager. Without the testing would be short :)

Download bas_a_plugin-01.zip

This .zip contains a plugin.txt, plugin.xml and some images and files.
Upload the .zip via plugin manager and i hope it works :)

TO-DO

  • Like Mary suggested, there should be a bypass for users without Zlib. Uploading the extracted plugin via ftp as option.
  • Support for txp in subdirs
  • File-Parsing: After uploading js and css files should be parset once, to addjust pathes
  • Include Plugins code to the xml instead of using an seperate .txt within the zip (??Noz sure about that)
  • Adding support for forms, pages, css etc. At the moment only txp_prefs are supported

Much more things to do, but for the moment i wait for your feedback.

Editing: Forget the archive.zip, sorry

Last edited by Bastian (2006-06-19 22:12:53)

Offline

Board footer

Powered by FluxBB