OgreXMLToFlowerConverter - in php

proof

13-02-2011 14:46:56

Check it out here!

I decided to port Betajaen's ruby script to PHP because I didn't wanna install ruby, and I already had PHP (always have PHP installed). Usage is the same as the ruby one.
Copy the source into a file named 'ogrexmltoflower.php'.

How to make it work (Windows):

Easiest way to get PHP is to get xampp.

It's your decision on where do you want the converter stored, but I hope you've done it by now. Go to that folder and add another file named ogrexmltoflower.bat, which should contain:

@echo.
@echo off

SET lib=%~dp0

php -q "%lib%ogrexmltoflower.php" %*

echo.

exit /B %ERRORLEVEL%


In order to run it from the command line, you have to set some paths. Go to System -> Advanced System Settings -> Advanced -> Environment Variables and under System variables find Path and edit it. At the end, add the following:

PATH_TO_XAMPP\php;PATH_TO_CONVERTER\;

where you would replace PATH_TO_XAMPP by the path to XAMPP, logically. The default path is c:\xampp\
Also replace PATH_TO_CONVERTER with the path to your converter.

And that's it! :D

How to make it work (Linux, Ubuntu):

You also have xampp for linux, so download it.
It's your decision on where do you want the converter stored, but I hope you've done it by now. Go to that folder and add another file named ogrexmltoflower, which should contain:

#!/bin/bash
exec php -q "ogrexmltoflower.php" "$@"


Open the terminal and do a 'gedit ~/.bashrc', scroll down to the bottom and add: 'export PATH=$PATH:/path/to/converter/:/opt/lampp/bin/'. This is, of course, if your lampp instalation is in /opt/lampp/.


Hope it works fine ^^

betajaen

13-02-2011 15:10:22

That's pretty awesome. I did start on something like this in Javascript a week or two ago, but got quickly bored and left. Perhaps I can just put my Ruby script online somewhere.

betajaen

13-02-2011 19:54:33

Took me a few hours.

http://nxogre.org/flowerconverter


I did have to reinstall the OS several times, but after I got Ruby installed. I made that puppy. All in SSH too. Nano is a great text editor.;)

Diabolikal49

13-02-2011 21:12:17

Betajaen, I love you. Good job both of you!

betajaen

13-02-2011 21:37:45

Thanks. There is probably a file size limit there, so get it to upload files - next time I'm on the server again.