Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Anyone do PHP?  (Read 1823 times)

0 Members and 1 Guest are viewing this topic.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:July 20, 2025, 03:37:24 pm
  • The Bears Still Suck!
Anyone do PHP?
« on: June 19, 2004, 01:19:00 am »
I hve run into a problem and I just don't know the language enough to figure out a solution.  Ok, for the controls.dat project one of the things I need to do is output an xml file.  Well there is getting to be enough data where that option times out the server limit (30 seconds).  Now I know the first thing to do is lok and see if I can slim down the xml.  Well, I might beable to but that won't help in the long run.  

However there may be an easier way of duming the information from several tables into an xml file that I haven't though of yet.

SNAAAKE

  • -Banned-
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3147
  • Last login:July 21, 2004, 03:44:18 am
  • Banned for abusive postings.
Re:Anyone do PHP?
« Reply #1 on: June 19, 2004, 01:26:12 am »
 ...
« Last Edit: June 19, 2004, 10:15:47 pm by saint »

planetjay

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 547
  • Last login:April 22, 2019, 10:50:57 pm
  • Ex-Evil Admin Monkey.
    • planetjay.com
Re:Anyone do PHP?
« Reply #2 on: June 19, 2004, 09:50:12 pm »
Someone's looking to get banned for LIFE.  >:(
planetjay.com. Still in Chicago. Still no hurricanes!

rampy

  • *shrug*
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2910
  • Last login:March 02, 2007, 11:32:16 am
  • ...as useless as a JPG is to Helen Keller
    • Build Your Own PVR
Re:Anyone do PHP?
« Reply #3 on: June 19, 2004, 10:14:48 pm »
that was rude...

sirp... you should be able to (host depending) your php.ini file to adjust the time out settings...

if you don't have access to edit php.ini on your host, you *may* get lucky and be able to modify php server variables via .htaccess file.

I don't know the declaration off hand, but a little bit of googling should unearth it...

lmk if you want any other advice sirp... i also suggest checking out php adodb database abstraction layer (it also handles xml parsing if i'm not mistaken... not sure if that'll help... but *shrug*

good luck!

rampy

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:July 20, 2025, 03:37:24 pm
  • The Bears Still Suck!
Re:Anyone do PHP?
« Reply #4 on: June 19, 2004, 10:25:53 pm »
that was rude...

sirp... you should be able to (host depending) your php.ini file to adjust the time out settings...

if you don't have access to edit php.ini on your host, you *may* get lucky and be able to modify php server variables via .htaccess file.

Well, you know who own the fe.donkeyfly.com server, right!

I've tried php's xml stuff.  It is extremely slow.  It even caused' pj's server to fillup the swap.

rampy

  • *shrug*
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2910
  • Last login:March 02, 2007, 11:32:16 am
  • ...as useless as a JPG is to Helen Keller
    • Build Your Own PVR
Re:Anyone do PHP?
« Reply #5 on: June 20, 2004, 03:03:12 pm »
is mysql the backend?

where are you pushing the output xml too (i.e. a local file on the server,  or over http to the webbrowser?)

can I get access to the scripts you are using (i'm a bit of hack but... maybe i can see something obvious...)

are you using an existing php library to do the xml creation?

I would think XML reading/parsing would be more intensive than xml file creation... but what do i know...

rampy

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:July 20, 2025, 03:37:24 pm
  • The Bears Still Suck!
Re:Anyone do PHP?
« Reply #6 on: June 21, 2004, 12:04:29 am »
I know I am doing it an not so efficient way, I am still learning php.  Here's what I am doing now.

MySQL backend.  
Code: [Select]
header("Cache-control: private"); //IE 6 Fix
header("Pragma: no-cache");
header("Content-type: text/xml");
header('Content-Disposition: attachment; filename="controls.xml"');

...

$tempxml = $tempxml . "<dat>\r\n";
$tempxml = $tempxml . "    <meta>\r\n";
$tempxml = $tempxml . "        <description name=\"Controls.dat XML file\"/>\r\n";
$tempxml = $tempxml . "        <version name=\"0.01\"/>\r\n";

...

if($nowhite == 1)
{
   $tempxml = str_replace("\r\n", "", $tempxml);
   $tempxml = str_replace("    ", "", $tempxml);
}
$tempxml = str_replace( '&', '&amp;', $tempxml );
print $tempxml;


rampy

  • *shrug*
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2910
  • Last login:March 02, 2007, 11:32:16 am
  • ...as useless as a JPG is to Helen Keller
    • Build Your Own PVR
Re:Anyone do PHP?
« Reply #7 on: June 21, 2004, 03:28:51 pm »
I know it's probably not the "best" way to do it, but consider creating a folder writeable by apache/php... and having your program write the xml to local file (instead of sending it through the browser), then create a link to finished output file.

i'm probably misunderstanding the intent of the application... but all the overhead of sending it via browser can make it timeout... i've had simillar fustrations when dumping/uploading HUGE mysql database backups via phpmyadmin... but i digress...

do you know if the script works properly if given enough time to execute? i.e. a smaller slice of XML, or if you get an upp'ed script execution time on the mamehost server?

rampy

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:July 20, 2025, 03:37:24 pm
  • The Bears Still Suck!
Re:Anyone do PHP?
« Reply #8 on: June 22, 2004, 12:55:48 am »
Yes, I know it works because it has been working until the dataset has been too large.  

Writing to file will actually be slightly slower.  Right now I write all the data to memory then send it.

I've been thinking of making it a file on the but that is more complicated than it sounds.

I am going to look at the source for phpmyadmin and see how they do it.

rampy

  • *shrug*
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2910
  • Last login:March 02, 2007, 11:32:16 am
  • ...as useless as a JPG is to Helen Keller
    • Build Your Own PVR
Re:Anyone do PHP?
« Reply #9 on: June 22, 2004, 11:17:48 am »
Yes, I know it works because it has been working until the dataset has been too large.  

Writing to file will actually be slightly slower.  Right now I write all the data to memory then send it.

I've been thinking of making it a file on the but that is more complicated than it sounds.

I am going to look at the source for phpmyadmin and see how they do it.

I really dont' think writing to a "local" file will be slower (just a gut feeling)... I think the http transfer forces the php interpretter to be loaded too long for long datasets.  but that's just my gut feeling... of course storing/retrieving stuff from memory is faster, but in this case... for a large dataset... hmm...

*Shrug*

rampy