Jump to content

How can i make a plugin indentification system?


alexandanthony

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.