On Dec 4, 2007 1:29 PM, Nathan C. Smith <<a href="mailto:nathan.smith@ipmvs.com">nathan.smith@ipmvs.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'm not sure if I would keep the<br>settings in a database or not. If php has some .ini file or plist-type<br>libraries I might choose those instead to keep the footprint small<br>(sacrificing scalability).</blockquote>
<div><br>sqlite is really nice. It's got all the benefits of a standard config file (and more) but with an sql interface.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
What is the best way to schedule a reoccurring item in php? Use cron to run<br>a script every 15 minutes or so?<br></blockquote></div><br>I use cron. I usually include something like this at the top of my scripts:<br><br>
if($_ENV["DEBUG"]) $debug = true;<br><br>Then, further down in my code I can do<br>if ($debug) print("Some status information\n");<br><br>This allows me to run my scripts manually as<br>env DEBUG=1 php
myscript.php<br>and get useful output. Then, once I'm sure things are working I can put them in cron and they run silently.<br><br>Something else I keep meaning to do but haven't actually done yet is if a fatal error occurs to spit out some useful diagnostic info, for example the name of the program that's running. I hate getting those cron messages and trying to figure out which thing died.
<br><br><?php<br>$program_info =<<< INFOEND<br>Program Name: Session cleanup<br>Program Description: Runs nightly and clears the sessions table<br>Version: 1.112 modified 11/28/2007 by Matthew Nuzum<br>INFOEND
<br><br>if( !$ok) die("Couldn't attach to database\n$program_info");<br clear="all"><br>-- <br>Matthew Nuzum<br>newz2000 on freenode