<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Fri, 09 Jan 2009 06:38:24 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Brian Moon's Blog: PHP's MySQL connection timeout]]></title>
      <guid>http://www.phpdeveloper.org/news/9419</guid>
      <link>http://www.phpdeveloper.org/news/9419</link>
      <description><![CDATA[<p>
In the process of debugging one of his scripts, <i>Brian Moon</i> came across a default setting (and problem) in the MySQL extension that didn't seem to <a href="http://doughboy.wordpress.com/2008/01/13/phps-mysql-connection-timeout/">make much sense to him</a>:
</p>
<blockquote>
There are several reasons that PHP could not be able to connect to MySQL. [...] Or, perhaps the entire server is offline.
</blockquote>
<p>
The mysql.connect_timeout setting in the php.ini is supposed to handle this sort of instance, but the default is set tpo 60 seconds. It's only apparently used when the server is completely offline and, in his opinion, is set way too high. He's proposing a patch to the MySQL extension to change this setting's default to shorten it to something a bit more reasonable.
</p>]]></description>
      <pubDate>Mon, 14 Jan 2008 12:59:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Jaanus' Blog: How to retrieve remote files in your web apps and still be friends with the server]]></title>
      <guid>http://www.phpdeveloper.org/news/4684</guid>
      <link>http://www.phpdeveloper.org/news/4684</link>
      <description><![CDATA[In <a href="http://www.jaanuskase.com/en/2006/01/how_to_retrieve_remote_files_i.html">this post</a> on <i>Jaanus'</i> blog today, they show how you can grab remote files from a server and still "remain friends" with the server.
<p>
<quote>
<i>
It often happens that when you're building a web page or app, you may want to include some content from a remote server. Say that it's some statistic figure that the remote outputs as HTML or TXT and you then want to retrieve it and either do something with it or directly display as part of your own page. And you're working in PHP.
<p>
PHP provides a fancy way of opening and including files directly over HTTP, which they call "<a href="http://ee.php.net/manual/en/features.remote-files.php">URL wrappers</a>". As tempting as it may seem, in the long run doing remote opens with URL wrappers is not the best practice. So here's what I came up with when needing to do this kind of caching thing in my own scenarios. It requires you have the cURL module installed and that the webserver can read and write from /tmp.
</i>
</quote>
<p>
They <a href="http://www.jaanuskase.com/en/2006/01/how_to_retrieve_remote_files_i.html">provide the short script</a> that does the work inside a function (easy to drop into a class), and grabs the remote file, and pulls down to /tmp for the script to use. It even allows you to specify a timeout for the file, forcing the script to grab a new copy every so often...]]></description>
      <pubDate>Wed, 18 Jan 2006 07:19:36 -0600</pubDate>
    </item>
  </channel>
</rss>
