Jump to content

How can i make a plugin indentification system?


alexandanthony

Recommended Posts

I guess that it depends on how the plugins work. Do they need to be installed and registered? Can they just be dropped into a plugin folder? It would help to know how they have to be built to work with the framework.

 

 

HTH

Teamatomic

You need to scandir the plugin folder. You then file_get_contents on a desc file in each folder. The desc file can contain the proper plugin name,description,version,author,contact,etc.

 

You can additionally preface a plugin folder with a _ if you want to disable it. Fairly easy to implement. That way you can disable a plugin if an automatic upgrade will break it.

 

 

HTH

Teamatomic

You might have a look at the sourcecode for the serendipity blog.  It provides this type of functionality. 

 

Often what will happen is that the admin system  will provide a function that looks through the plugins directory for new plugin directories, comparing  the structure against a table of currently installed plugins.  There's a lot to this, so I really don't want to say too much more about it, as a book could be written on the subject.  Many systems also see value in having a manifest file that provides configuration info, as per the suggesion from teamatomic.  This file might also specify the list of files, and sometimes even a hash so that the system can determine if the plugin is complete and valid.  Often plugins have install and uninstall scripts that set up a newly installed plugin for the first time, or allow the system to remove the plugin and clean up after itself.

 

I'm afraid you'll have to be a lot more specific about what your objectives are.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.