SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation [CMS] Installing & Updating Extensions

    I'm developing a new extensions management panel in my CMS.

    Usually plugins provide install(), uninstall() and update() functions. However, there are some problematic issues:
    - CMS supports more databases (MySQL & SQLite)
    - How to inform about plugin's and/or CMS's version?

    If plugins provide these functions, they will have to detect database engine, CMS version, its version and other information. It's a risk that they might do it incorrectly.

    The basic question is: what should take care of integrity?
    A. Plugins (their installers make all actions)
    B. CMS (plugins only provide information about tables, menu, etc.)

    In case of B - example:

    HTML Code:
    <e>
            <!-- Tables - `date` field has been added in version 2.0 -->
            <table name="items">
                    <field name="ID" auto="auto" type="int" />
                    <field name="title" default="Untitled Item" type="varchar" />
                    <field name="date" added="2.0" type="datetime" />
            </table>
    
            <!-- Menu block deleted in version 2.0 -->
            <block name="A title" deleted="2.0" />
    
            <!-- Menu -->
            <menu id="1">
                    <item url="showItems.php" lang="en">Items</item>
                    <item url="showItems.php" lang="pl">Pozycje</item>
            </menu>
    </e>
    Maybe you know better solutions? I hope you will help me.

  2. #2
    SitePoint Addict
    Join Date
    Feb 2007
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by User997 View Post
    If plugins provide these functions, they will have to detect database engine, CMS version, its version and other information. It's a risk that they might do it incorrectly.
    Maybe. Or maybe your CMS provides the db access methods that plugins use, so when they create a table, for example, they call the cms code that creates a table, which is set to use whatever db is installed.

    If the CMS also provides environment info calls, that covers the rest. Depending upon the nature of the plugin, I can see where it would certainly be necessary to know the CMS version, so that it can interoperate with the CMS correctly.

    Quote Originally Posted by User997 View Post
    Maybe you know better solutions? I hope you will help me.
    Don't see that much wrong with your approach. It looks like you have the install or activate method in the CMS that you're feeding with an xml file describing the plugin, and letting the CMS handle all the details. Works fine and is in use in several current CMS's.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •