<?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>Sun, 12 Feb 2012 17:57:37 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[DevShed: PHP Closures as View Helpers: Lazy-Loading File Data]]></title>
      <guid>http://www.phpdeveloper.org/news/17466</guid>
      <link>http://www.phpdeveloper.org/news/17466</link>
      <description><![CDATA[<p>
In the second part of their look at using closures in PHP as view helpers, DevShed improves upon <a href="http://phpdeveloper.org/news/17446">their original code</a> by adding some additional classes and <a href="http://www.devshed.com/c/a/PHP/PHP-Closures-as-View-Helpers-LazyLoading-File-Data/">using them in the closures</a>.
</p>
<blockquote>
The best way to show you how using anonymous functions can help you to develop more efficient OO applications is with some functional, hands-on examples. With this idea in mind, in the installment that preceded this one, I implemented an extendable template system. This system could spawn view objects and render the template files associated with these objects.
</blockquote>
<p>
In this second part of the (two-part) series they include "Serializer" and "FileHandler" classes and show how to use them inside of the closures to lazy-load in data from an external file and work with it as serialized content.
</p>]]></description>
      <pubDate>Mon, 30 Jan 2012 13:08:28 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: A Tour of PHP.INI]]></title>
      <guid>http://www.phpdeveloper.org/news/17243</guid>
      <link>http://www.phpdeveloper.org/news/17243</link>
      <description><![CDATA[<p>
On PHPMaster.com today <i>Callum Hopkins</i> has <a href="http://phpmaster.com/a-tour-of-php-ini/">written up an introduction to the php.ini</a>, the heart and soul of any PHP installation. With configuration options for just about everything, it can be confusing. This tutorial hits some of the highs and most commonly updated settings.
</p>
<blockquote>
Anyone who has a server using PHP has undoubtedly heard of php.ini - it's the configuration file used to control and customize PHP's run-time behavior. It provides a simple way to configure settings. [...] In this article I'll give an overview of some important settings I believe you should be concerned with when tweaking your own php.ini file.
</blockquote>
<p>The tutorial's broken up into a few different topics:</p>
<ul>
<li>the PHP engine
<li>Short tags
<li>Output buffering
<li>Automatic headers and footers
<li>Handling errors
<li>Time zones
</ul>]]></description>
      <pubDate>Mon, 12 Dec 2011 10:42:45 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Handling File Data with PHP (Reading & Seeking)]]></title>
      <guid>http://www.phpdeveloper.org/news/17196</guid>
      <link>http://www.phpdeveloper.org/news/17196</link>
      <description><![CDATA[<p>
DevShed has posted the fifth part of their "handling files in PHP" tutorial series today (excerpted from the book "Beginning PHP and PostgreSQL 8: From Novice to Professional") with a focus on <a href="http://www.devshed.com/c/a/PHP/Handling-File-Data-with-PHP/">read from multiple places in a file</a> to get to different data.
</p>
<blockquote>
In this fifth part of an eight-part series on working with file and operating systems with PHP, you'll learn how to read data from a file and move the file pointer. 
</blockquote>
<p>
Example code is included showing how to use the <a href="http://php.net/file">file</a>, <a href="http://php.net/file_get_contents">file_get_contents</a>, <a href="http://php.net/fgetc">fgetc</a>, <a href="http://php.net/fgetcsv">fgetcsv</a>, <a href="http://php.net/readfile">readfile</a> and <a href="http://php.net/fscanf">fscanf</a> (among several others). Also included is code showing how to use the <a href="http://php.net/fseek">fseek</a> method to move around in a file.
</p>]]></description>
      <pubDate>Thu, 01 Dec 2011 10:09:14 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: File Security and Resources with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17165</guid>
      <link>http://www.phpdeveloper.org/news/17165</link>
      <description><![CDATA[<p>
In the fourth part of their series looking at working with the filesystem in PHP, DevShed has posted a new tutorial focusing on <a href="http://www.devshed.com/c/a/PHP/File-Security-and-Resources-with-PHP/">security and permission handling</a> for files/resources.
</p>
<blockquote>
These days, security is paramount to any server installation, large or small. Most modern operating systems have embraced the concept of the separation of file rights via a user/group ownership paradigm, which, when properly configured, offers a wonderfully convenient and powerful means for securing data. In this section, you'll learn how to use PHP's built-in functionality to review and manage these permissions.
</blockquote>
<p>They introduce functions like:</p>
<ul>
<li><a href="http://php.net/chown">chown</a>
<li><a href="http://php.net/chgrp">chgrp</a>
<li><a href="http://php.net/fileperms">fileperms</a>
<li><a href="http://php.net/isexecutable">isexecutable</a>
<li><a href="http://php.net/umask">umask</a>
</ul>
<p>
Sample code is also included to show how to <a href="http://www.devshed.com/c/a/PHP/File-Security-and-Resources-with-PHP/2/">open and close a file</a>.
</p>]]></description>
      <pubDate>Wed, 23 Nov 2011 16:23:27 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Kevin Schroeder's Blog: fatal: The remote end hung up unexpectedly]]></title>
      <guid>http://www.phpdeveloper.org/news/17089</guid>
      <link>http://www.phpdeveloper.org/news/17089</link>
      <description><![CDATA[<p>
<i>Kevin Schroeder</i> has a <a href="http://www.eschrade.com/page/fatal-the-remote-end-hung-up-unexpectedly">quick tip</a> for anyone using <a href="http://phpcloud.com">phpcloud.com</a> and having trouble with git and "remote end hung up" error messages.
</p>
<blockquote>
If  you are using phpcloud.com and are experiencing errors with git [...] and you are trying to push large files (not sure what is defined as "large") you may need to change some git settings.
</blockquote>
<p>
He points out two settings - one for Windows and the other for Linux - that increase the buffer size to handle larger files that might be included in your repository.
</p>]]></description>
      <pubDate>Fri, 04 Nov 2011 12:55:28 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Sending Emails with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17031</guid>
      <link>http://www.phpdeveloper.org/news/17031</link>
      <description><![CDATA[<p>
In a new tutorial from PHPMaster.com <i>Jason Pasnikowski</i> takes a look at <a href="http://phpmaster.com/sending-emails-with-php/">sending emails with PHP</a> - an introduction to what the language offers and how it can be used to send an HTML version.
</p>
<blockquote>
In most cases your installation of PHP will be capable of sending emails. If you are using a shared host, or if you installed PHP using a package management system like apt-get, more than likely you're all set. You'll really only need to worry about extra configuration if you're compiling PHP from source or if you're running it on Windows. In either case, there are plenty of resources available online to help you out. Because that's all beyond the scope of this article, I'll assume you're set. If not, Google will be your friend.
</blockquote>
<p>
He starts with a simple example using the <a href="http://php.net/mail">mail</a> function but quickly moves on to sending a multi-part email with an attached zip file and HTML content. He includes the all code you'll need and explains each part in detail so you'll know exactly what's going on.
</p>]]></description>
      <pubDate>Mon, 24 Oct 2011 20:08:52 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Sameer Borate's Blog: Splitting large MySQL dump files]]></title>
      <guid>http://www.phpdeveloper.org/news/16937</guid>
      <link>http://www.phpdeveloper.org/news/16937</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Sameer Borate</i> includes a handy bit of code you can use to <a href="http://www.codediesel.com/php/splitting-large-mysql-dump-files/">split up a large MySQL dump file</a> into smaller, easier to digest chunks.
</p>
<blockquote>
One of the frustrating things with working with MySQL is of importing large sql dump files. Either you get a 'max execution time exceeded' error from PHP or a 'Max_allowed_packet_size' from MySQL. In a recent task I needed to import a table of around a million records on a remote host, which quickly became an exercise in frustration due to various limitations on the server. SSH was of no help as changing the configuration files was restricted to the root user. My last resort was to split the huge 'INSERT' statements into smaller size files. 
</blockquote>
<p>
His script needs a little extra time to run (he sets max execute to 600 seconds) and takes the SQL file in line by line, splitting them back out to over files based on a "count" value - "dump-split-*". Depending on the size of your files, using something like this might not be an option. You might need something more like the <a href="http://kb.iu.edu/data/afar.html">command line "split" feature</a> to keep it outside of PHP's memory management all together.
</p>]]></description>
      <pubDate>Mon, 03 Oct 2011 08:44:43 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: File Uploads with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16907</guid>
      <link>http://www.phpdeveloper.org/news/16907</link>
      <description><![CDATA[<p>
SitePoint's PHPMaster.com site has a new tutorial today from <i>Timothy Boronczky</i> about <a href="http://phpmaster.com/file-uploads-with-php/">handling file uploads</a> in PHP. It's a pretty low-level introduction and is perfect for those new to PHP.
</p>
<blockquote>
What do pictures in an online photo album, email attachments in a web-based mail client, and data files submitted to an online application for batch processing all have in common? They all rely on the ability to upload files across the Internet from the user's web browser. Indeed, uploading files is an important feature of many of the sites and web-based applications we use on a daily basis. In this post, I show you how to add support for file uploads to your site using PHP.
</blockquote>
<p>
He starts with the changes you might need to make to your php.ini configuration file (for allowing uploads and setting a temporary directory) and a basic "form" tag with the necessary "enctype" setting. The sample form includes a "file" type field that submits the file data to a waiting PHP script on the backend. The script looks for the submit (in the $_FILES superglobal) and, after doing some filtering on the name and content type, moves it to a new directory.
</p>]]></description>
      <pubDate>Mon, 26 Sep 2011 11:42:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: Phar: PHP libraries included with a single file]]></title>
      <guid>http://www.phpdeveloper.org/news/16900</guid>
      <link>http://www.phpdeveloper.org/news/16900</link>
      <description><![CDATA[<p>
On DZone.com today <i>Giorgio Sironi</i> has a new post looking at an interesting, if seldom used, feature of recent PHP releases - <a href="http://css.dzone.com/articles/phar-php-libraries-single-file">packaging applications with phar archives</a>.
</p>
<blockquote>
<a href="http://php.net/phar">Phar</a> is a php extensions that provides the means for distributing code as a single archive, that does not have to be extracted to a folder before usage. The concept is similar to JVM Jars: each archive becomes a virtual directory where files can be accessed. However, the virtual folder is not limited to class loading, but you can open and read internal files as if it were decompresse into a directory.
</blockquote>
<p>
He includes a brief "hello world" example of packaging up a script into a phar archive and executing it via PHP. He also shows how easy it is to create an archive from current code, making an archive containing the latest Doctrine 2 release for simple inclusion. Phars also allow compression and hashing but has issues with resource management and access external files.
</p>]]></description>
      <pubDate>Fri, 23 Sep 2011 11:30:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[XpertDeveloper.com: PHP clearstatecache() Explained]]></title>
      <guid>http://www.phpdeveloper.org/news/16892</guid>
      <link>http://www.phpdeveloper.org/news/16892</link>
      <description><![CDATA[<p>
XPertDeveloper.com has a <a href="http://www.xpertdeveloper.com/2011/09/php-clearstatecache/">quick new post</a> looking at a function that might be overlooked until it suddenly becomes just what you need - <a href="http://php.net/clearstatecache">clearstatecache</a> for clearing file state information in the current script.
</p>
<blockquote>
For the functions like is_file(), file_exists(), etc PHP caches the result of this function for each file for faster performance if function called again. But in some cases you want to clear this cached information, for the task like getting the information of the same file multiple times in same page.
</blockquote>
<p>
Other methods this cache effects include <a href="http://php.net/stat">stat</a>, <a href="http://php.net/file_exists">file_exists</a>, <a href="http://php.net/is_file">is_file</a> and more. If the state of a file is changed during the course of the script - say it's deleted manually, not by PHP, your script may not recognize that. By calling <a href="http://php.net/clearstatecache">clearstatecache</a>, you refresh this cache and make it possible to see the latest file system info.
</p>]]></description>
      <pubDate>Thu, 22 Sep 2011 09:21:40 -0500</pubDate>
    </item>
  </channel>
</rss>

