Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Jan 2006
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Creating a package system

    Hi, I want to learn how to create a package system like SMF's package system so that I can release modifications to my script easily.

    The user can just download a patch file or a mod file, upload it to the server, and then my script would parse the actions, then add/remove/replace code in the files. That way, code modifications are automatic and the user doesn't need to go into the code. I'm wondering how I could create this script.

    Does anybody know how the package system in SMF works, and how I could code something similar? It doesn't need to be very advanced, just a simple one will do.

    Or, does anybody know of another way in which I can release code modifications easily?

    I'm just stuck on how I could parse this kind of file and then perform the actions. What functions would I use for what?

    Thanks!


    Edit:
    btw, here's an example mod file from SMF (it's an old version):
    Code:
    -- This information needs to be the same as that in the package-info.xml. --
    <id>username:testing123</id>
    <version>1.0</version>
     
    -- Edit a specific file.. --
    <edit file>$sourcedir/Filename.php</edit file>
     
    -- The code to search for. --
    <search for>
    Search for some code to add stuff after.
    </search for>
     
    -- Add this text when we find it, after what we found. -->
    <add after>
    This is what to add.
    </add after>
     
    <search for>
    Another search operation?
    </search for>
     
    <replace>
    Yes, another.  This time, replacing!
    </replace>
    Of course, using a different format for the mod file is fine. I was thinking JSON. SMF currently uses XML.
    I have an idea of how I want the format in JSON, and it's in another topic here: Is this valid JSON?
    Last edited by Zegg90; 01-15-2008 at 05:26 PM.


 

Posting Permissions

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