SMF Package Parser - Source code now available!

Started by Daniel15, January 05, 2007, 11:29:08 PM

Previous topic - Next topic

Daniel15

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 :)
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!

Dannii

"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."

directtech

Cool, thanks!  I just used it and it worked for me.  Very nice.

Daniel15

Quote from: eldʌkaː on January 05, 2007, 11:30:40 PM
It doesn't seem to actually parse the submitted file :P
Do you get any errors?

Quote from: directtech on January 08, 2007, 06:19:58 PM
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!

Dannii

"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."

Daniel15

QuoteNo, 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!

aglioeolio

NICE!! thats usefull for me

This will save me a lot of time, thanks




4LP3RUZ1

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:

QuoteWarning: 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 :(

Daniel15

No problem, guys :)

Quotethis 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 ;).

Quoteoh 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:
QuoteInput 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!


Daniel15

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!

richiehale

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

Daniel15

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!

4LP3RUZ1

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!
Frozen frogs are back :(

Daniel15

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!

Gr@fiker

İ dont have a msn


Visualcode

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.

Daniel15

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!

Advertisement: