Advertisement:

Author Topic: SMF Package Parser - Source code now available!  (Read 78604 times)

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,221
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
SMF Package Parser - Source code now available!
« on: January 05, 2007, 11:29:08 PM »
Hi everyone,
 Recently, I combined my package-info and modification parsers into one script: The Package Parser. Basically, you upload a packaged SMF modification to this script, and it will tell you how to install or uninstall the package :). This is great if you don't understand the XML format, or you just want a way to see exactly what changes a package will do (in case you have to do changes manually).
In addition, there's an option to only show theme edits, in the case that you want to edit your theme to support a mod.

Please go to http://modparser.dev.dansoftaustralia.net/ to use the package parser. Note that it's in beta at the moment, so there may be small bugs (there shouldn't be any major bugs, though).

Please tell me what you think, and if you encounter any bugs  :D

Update 2007-03-22: After a long delay, the source code for the SMF Package Parser is now available! Please see http://modparser.dev.dansoftaustralia.net/about.php (temporary homepage) for more information :)
« Last Edit: March 22, 2007, 05:50:46 AM by Daniel15 »
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline Dannii

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,211
  • Mind the volcano!
    • My homepage
Re: SMF Package Parser - The perfect utility for installing mods manually
« Reply #1 on: January 05, 2007, 11:30:40 PM »
It doesn't seem to actually parse the submitted file :P
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Offline directtech

  • Semi-Newbie
  • *
  • Posts: 84
Re: SMF Package Parser - The perfect utility for installing mods manually
« Reply #2 on: January 08, 2007, 06:19:58 PM »
Cool, thanks!  I just used it and it worked for me.  Very nice.

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,221
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: SMF Package Parser - The perfect utility for installing mods manually
« Reply #3 on: January 08, 2007, 08:56:35 PM »
It doesn't seem to actually parse the submitted file :P
Do you get any errors?

Cool, thanks!  I just used it and it worked for me.  Very nice.
Thank you :). Please tell me if you have any suggestions :D
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline Dannii

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,211
  • Mind the volcano!
    • My homepage
Re: SMF Package Parser - The perfect utility for installing mods manually
« Reply #4 on: January 09, 2007, 05:31:11 AM »
No, it just parses another mod than what I submitted.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,221
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: SMF Package Parser - The perfect utility for installing mods manually
« Reply #5 on: January 09, 2007, 05:37:44 AM »
Quote
No, it just parses another mod than what I submitted.
This is because it extracts the archive to a temporary directory, and then checks for a package-info.xml file. Since I forgot to make it empty the temporary directory after use, if the package doesn't have a package-info.xml file, it will use an old one :P
I'll change the code so it removes all the files after use :)
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline aglioeolio

  • Jr. Member
  • **
  • Posts: 152
  • Gender: Male
    • Brazilian SMF fan
Re: SMF Package Parser - The perfect utility for installing mods manually
« Reply #6 on: January 09, 2007, 07:16:44 AM »
NICE!! thats usefull for me

This will save me a lot of time, thanks



Offline dcmouser

  • Charter Member
  • Jr. Member
  • *
  • Posts: 187
    • donationcoder.com
Re: SMF Package Parser - The perfect utility for installing mods manually
« Reply #7 on: January 09, 2007, 08:14:38 AM »
Very useful, thanks!
proud member of donationcoder.com (forum)

Offline 4LP3RUZ1

  • SMF Hero
  • ******
  • Posts: 3,438
  • Gender: Male
  • Frozen frogs are gone!
Re: SMF Package Parser - The perfect utility for installing mods manually
« Reply #8 on: January 09, 2007, 08:39:53 AM »
this is going to be a major major life-saver if a Turkish version is made, whaddaya think? (pm if neccesary)

oh and I tried it with my mod, and I don't think it likes foreign characters :D The UTF-8 version of the mod passes thru fine, but otherwise I get these:

Quote
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: Entity: line 184: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xF6 0x73 0x74 0x65 in /var/www/smf/package.php on line 360

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: $txt['enable_mini_avatars'] = 'Mesaj indeksinde minik avatar g�sterimini etkinle in /var/www/smf/package.php on line 360

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /var/www/smf/package.php on line 360

Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /var/www/smf/package.php:360 Stack trace: #0 /var/www/smf/package.php(360): SimpleXMLElement->__construct('<?xml version="...') #1 /var/www/smf/package.php(329): parseModificationXML('/tmp/smf_xml/mo...', Object(SimpleXMLElement), 'all') #2 /var/www/smf/package.php(49): parsePackageInfoXML('/tmp/smf_xml/pa...', 'install', 'all') #3 /var/www/smf/package.php(631): parseArchive('/tmp/phpSFohJG', 'install', 'all') #4 {main} thrown in /var/www/smf/package.php on line 360
Frozen frogs are back :(

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,221
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: SMF Package Parser - The perfect utility for installing mods manually
« Reply #9 on: January 09, 2007, 10:59:36 PM »
No problem, guys :)

Quote
this is going to be a major major life-saver if a Turkish version is made, whaddaya think? (pm if neccesary)
I'll try to make it use language files, similar to what SMF does (currently, all text is hard-coded). Once I do this, I'll tell you ;).

Quote
oh and I tried it with my mod, and I don't think it likes foreign characters  The UTF-8 version of the mod passes thru fine, but otherwise I get these:
I'm using PHP 5's SimpleXML functions, and it looks like it only likes UTF-8 input:
Quote
Input is not proper UTF-8
There's no real way for me to fix this, other than use a different XML parser...
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!


Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,221
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: SMF Package Parser - The perfect utility for installing mods manually
« Reply #11 on: January 13, 2007, 09:30:04 PM »
Anyone willing to translate? I've edited the script to use a language file, and attached the language file here. Once I get a few languages, I'll add a "Choose Language" dropdown.
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline richiehale

  • Jr. Member
  • **
  • Posts: 113
  • Gender: Male
    • ThePicPalace
Re: SMF Package Parser - The perfect utility for installing mods manually
« Reply #12 on: January 13, 2007, 09:47:08 PM »
just tried to follow the link and got...

Warning: require_once(/var/www/smf/languages/package.english.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/smf/package.php on line 5

Fatal error: require_once() [function.require]: Failed opening required '/var/www/smf/languages/package.english.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/smf/package.php on line 5

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,221
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: SMF Package Parser - The perfect utility for installing mods manually
« Reply #13 on: January 14, 2007, 01:08:57 AM »
richiehale, I've fixed that problem, it was due to a stupid mistake by me (I accidentally wrote package.english.php instead of english.php).
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline 4LP3RUZ1

  • SMF Hero
  • ******
  • Posts: 3,438
  • Gender: Male
  • Frozen frogs are gone!
Re: SMF Package Parser - The perfect utility for installing mods manually
« Reply #14 on: January 14, 2007, 04:04:27 AM »
here is the turkish file

pm me if something doesn't look correct, the way Turkish is causes some of the sentence structures to be awkward, however I'm pretty sure it is okay as it is.

New file uploaded! In UTF-8, should solve character problems!
« Last Edit: January 19, 2007, 03:17:56 AM by alperuzi »
Frozen frogs are back :(

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,221
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: SMF Package Parser - The perfect utility for installing mods manually
« Reply #15 on: January 14, 2007, 05:34:09 AM »
OK, thanks alperuzi, I'll implement this it as soon as I can (probably not until tommorow)
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline Gr@fiker

  • SMF Hero
  • ******
  • Posts: 2,176
Re: SMF Package Parser - The perfect utility for installing mods manually
« Reply #16 on: January 14, 2007, 02:03:44 PM »
thanks alperuzi


where iz download links  :'(   ::)  :-[ :-X
İ dont have a msn

Offline EAGLE_MINTER

  • Newbie
  • *
  • Posts: 2
Re: SMF Package Parser - The perfect utility for installing mods manually
« Reply #17 on: January 18, 2007, 03:29:17 PM »
thanks daniel...    wery good... 

Offline Visualcode

  • Jr. Member
  • **
  • Posts: 132
Re: SMF Package Parser - The perfect utility for installing mods manually
« Reply #18 on: January 18, 2007, 09:11:50 PM »
I just keep getting: parseArchive(): No package-info.xml in this mod! Is it corrupted?

My mods are fine, so I don't know why I get the message.

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,221
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: SMF Package Parser - The perfect utility for installing mods manually
« Reply #19 on: January 18, 2007, 09:19:53 PM »
OK, I've almost finished implementing Turkish, but I'm having some problems with characters not displaying properly: http://server.daniel15.com/smf/package-dev.php?lang=turkish

Visualcode, are the mod's files in a directory inside the archive? The parser expects the package-info.xml to be in the root of the archive (you may have problems with SMF if the files are all inside a folder)
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!