<?xml version="1.0" encoding="iso-8859-1"?>
<rdf:RDF
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns="http://purl.org/rss/1.0/"
>
  <channel rdf:about="http://news.xp-framework.net/8/News">  
    <title>News</title>
    <link>http://news.xp-framework.net/8/News</link>
    <description>XP Framework</description>
    <dc:language>en-US</dc:language>
    <dc:date>2010-03-10T05:26:19+01:00</dc:date>
    <dc:creator>xp-admin@xp-framework.net</dc:creator>
    <dc:publisher/>
    <dc:rights/>
    <items>    
      <rdf:Seq>      
        <rdf:li rdf:resource="http://news.xp-framework.net/article/348/2010/03/09/PHP_5.3.2_support"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/347/2010/02/18/RFC__0197__Type_literals_in_tokens"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/346/2010/02/18/RFC__0193__Generics_optimization"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/345/2010/02/16/Command_line_reflection"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/344/2010/02/15/SVN_moved"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/343/2010/02/01/Bind_server_sockets_to_any_free_port"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/342/2010/01/30/Merging_XAR_files"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/341/2010/01/26/5.7.7-RELEASE"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/340/2010/01/24/XP_on_a_Mac"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/339/2010/01/24/XP_Framework___APC"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/338/2010/01/15/Windows_runners"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/337/2010/01/10/BSD_Runners"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/336/2010/01/08/Reading_gzip_ed_websites"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/335/2010/01/06/Compressing_data"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/334/2009/12/28/FTP_API_Class_constants"/>
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="http://news.xp-framework.net/article/348/2010/03/09/PHP_5.3.2_support">  
    <title>PHP 5.3.2 support</title>
    <link>http://news.xp-framework.net/article/348/2010/03/09/PHP_5.3.2_support</link>
    <description>Following the &lt;a href=&quot;http://www.php.net/archive/2010.php#id2010-03-04-1&quot;&gt;PHP 5.3.2 release&lt;/a&gt; a couple of days ago we now officially support this new PHP version with the upcoming XP 5.7.8-RELEASE. Also tested successfully: The 5.8 development branch.</description>
    <dc:date>2010-03-09T20:35:26+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/347/2010/02/18/RFC__0197__Type_literals_in_tokens">  
    <title>RFC #0197: Type literals in tokens</title>
    <link>http://news.xp-framework.net/article/347/2010/02/18/RFC__0197__Type_literals_in_tokens</link>
    <description>&lt;b&gt;Scope of Change&lt;/b&gt;&lt;br/&gt;A common way to denote type literals in generated sourcecode will be introduced.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Rationale&lt;/b&gt;&lt;br/&gt;An example of where this is used is the type dispatching methods described in &lt;a href=&quot;http://xp-framework.net/rfc/0195&quot;&gt;RFC #0195&lt;/a&gt;. Another example is generics generation, as described in &lt;a href=&quot;http://xp-framework.net/rfc/0193&quot;&gt;RFC #0193&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;&lt;a href=&quot;http://xp-framework.net/rfc/0197&quot;&gt;Read the full RFC here&lt;/a&gt;&lt;br/&gt;</description>
    <dc:date>2010-02-18T16:48:59+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/346/2010/02/18/RFC__0193__Generics_optimization">  
    <title>RFC #0193: Generics optimization</title>
    <link>http://news.xp-framework.net/article/346/2010/02/18/RFC__0193__Generics_optimization</link>
    <description>&lt;b&gt;Scope of Change&lt;/b&gt;&lt;br/&gt;Generics will be optimized.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Rationale&lt;/b&gt;&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Improve performance&lt;/li&gt;&lt;li&gt;Enable reflection for generics&lt;/li&gt;&lt;li&gt;Enable reflective creation of generics&lt;/li&gt;&lt;li&gt;Support primitives a generic arguments&lt;/li&gt;&lt;/ul&gt;&lt;br/&gt;&lt;a href=&quot;http://xp-framework.net/rfc/0193&quot;&gt;Read the full RFC here&lt;/a&gt;&lt;br/&gt;</description>
    <dc:date>2010-02-18T16:47:54+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/345/2010/02/16/Command_line_reflection">  
    <title>Command line reflection</title>
    <link>http://news.xp-framework.net/article/345/2010/02/16/Command_line_reflection</link>
    <description>The &lt;tt&gt;xp&lt;/tt&gt; command line tool has a new command line switch, &lt;tt&gt;-r&lt;/tt&gt;, which will print reflection information about a class, interface or enum.&lt;br/&gt;&lt;br/&gt;&lt;center&gt;&lt;img width='630' height='367' src=&quot;/uploads/xp-reflect.png&quot; alt=&quot;Shell screenshot&quot; /&gt;&lt;br/&gt;Output of: &lt;tt&gt;xp -r io.streams.FileInputStream&lt;/tt&gt;&lt;/center&gt;&lt;br/&gt;This feature will be available with the next XP release, 5.7.8. If you're using an SVN checkout, you will need to update the runners as follows:&lt;br/&gt;&lt;br/&gt;&lt;pre&gt;  $ cd ~/bin&lt;br/&gt;  $ wget 'http://xp-framework.net/downloads/releases/bin/setup' -O - | php&lt;/pre&gt;</description>
    <dc:date>2010-02-16T11:11:16+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/344/2010/02/15/SVN_moved">  
    <title>SVN moved</title>
    <link>http://news.xp-framework.net/article/344/2010/02/15/SVN_moved</link>
    <description>&lt;img width='160' height='160' align=&quot;right&quot; hspace=&quot;5&quot; src=&quot;/uploads/server.png&quot; alt=&quot;Server&quot;/&gt;The XP repositories &quot;xp&quot;, &quot;xpforge&quot; and &quot;xpdoc&quot; have been moved to a new server, xpsrv.net. To fix your local SVN (development and/or anonymous) checkouts, use the following commands:&lt;br/&gt;&lt;br/&gt;1. Find out the checkout URL&lt;br/&gt;&lt;pre&gt;  ~/devel/xp/trunk$ svn info . | grep ^URL&lt;br/&gt;  URL: svn+ssh://friebe@xp-framework.net/home/svn/xp/trunk&lt;br/&gt;&lt;/pre&gt; &lt;br/&gt;2. Use svn switch. The new URL is the same except for the hostname!&lt;br/&gt;&lt;pre&gt;  ~/devel/xp/trunk$ svn switch \&lt;br/&gt;    svn+ssh://friebe@xp-framework.net/home/svn/xp/trunk \&lt;br/&gt;    svn+ssh://friebe@xpsrv.net/home/svn/xp/trunk&lt;br/&gt;&lt;/pre&gt;(&lt;i&gt;The backslashes indicate wrapped lines and are not part of the command&lt;/i&gt;)&lt;br/&gt;&lt;b&gt;Done!&lt;/b&gt;</description>
    <dc:date>2010-02-15T18:40:04+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/343/2010/02/01/Bind_server_sockets_to_any_free_port">  
    <title>Bind server sockets to any free port</title>
    <link>http://news.xp-framework.net/article/343/2010/02/01/Bind_server_sockets_to_any_free_port</link>
    <description>At the company I work for, we let the XP Framework's unittest run on various different machines, including Windows 2008 server and 32- as well as 64-bit Debian Linux boxes, with PHP versions ranging from 5.2.0 - 5.3.1 (&lt;i&gt;lots of permutation, yes&lt;/i&gt;). &lt;br/&gt;&lt;center&gt;&lt;img width='541' height='383' src=&quot;/uploads/xp-hudson.png&quot; alt=&quot;Hudson&quot; /&gt;&lt;/center&gt;&lt;br/&gt;On some of the newer machines we have configured &lt;a href=&quot;http://hudson-ci.org/&quot;&gt;Hudson&lt;/a&gt; to start multiple test runners at the same time. This lead to problems with the integration tests (for the FTP API, for example) where we actually fork off a standalone server in the background: The port in use was hardcoded. While this is perfectly OK normally, with mutiples suites executing simultaneously and trying to bind the same port, we were running into problems.</description>
    <dc:date>2010-02-01T16:00:15+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/342/2010/01/30/Merging_XAR_files">  
    <title>Merging XAR files</title>
    <link>http://news.xp-framework.net/article/342/2010/01/30/Merging_XAR_files</link>
    <description>With the 5.7.7-RELEASE there has a nitfy small feature been added to the xar command: merging multiple XAR files. XAR files are the archives in which XP Framework applications can ship their classes and/or resource files in a way comparable to Java`s .jar-files.&lt;br/&gt;&lt;br/&gt;Combining multiple xar files into one can be handy one the one hand, because you can merge all dependencies and the application itself into one single file and only have to provide the one. On the other hand, for applications where startup or I/O performance is a concern, it can be useful: each xar file involved in an application comes with a startup time penalty - the file must be opened, the index must be read before the first file can be retrieved. Here, a single file instead of many files mean increased startup performance and less I/O calls of an application.&lt;br/&gt;&lt;br/&gt;This is how it works:&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;Alex@mobile ~/dev/xp.public/trunk&lt;br/&gt;$ xar cf one.xar ChangeLog&lt;br/&gt;&lt;br/&gt;Alex@mobile ~/dev/xp.public/trunk&lt;br/&gt;$ xar cf two.xar skeleton/VERSION=VERSION&lt;br/&gt;&lt;br/&gt;Alex@mobile ~/dev/xp.public/trunk&lt;br/&gt;$ xar mf merge.xar one.xar two.xar&lt;br/&gt;&lt;br/&gt;Alex@mobile ~/dev/xp.public/trunk&lt;br/&gt;$ xar tvf merge.xar&lt;br/&gt;    58.978 ChangeLog&lt;br/&gt;        10 VERSION&lt;br/&gt;&lt;br/&gt;&lt;/pre&gt;</description>
    <dc:date>2010-01-30T15:05:05+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/341/2010/01/26/5.7.7-RELEASE">  
    <title>5.7.7-RELEASE</title>
    <link>http://news.xp-framework.net/article/341/2010/01/26/5.7.7-RELEASE</link>
    <description>The XP team is proud to announce the availability of the 5.7.7-RELEASE, featuring improvements to the web test API, support for reading and creating zip files (RFC #0175) and zip compressed streams , easy access of standard input in command line classes as well as several overall improvements and bugfixes.&lt;br/&gt;&lt;br/&gt;&lt;link href=&quot;http://releases.xp-framework.net/xml/release?5.7.7&quot;/&gt;</description>
    <dc:date>2010-01-26T17:55:25+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/340/2010/01/24/XP_on_a_Mac">  
    <title>XP on a Mac</title>
    <link>http://news.xp-framework.net/article/340/2010/01/24/XP_on_a_Mac</link>
    <description>Continuing our series of trying to get the XP Framework run on as many platforms as possible, here's our newest achievement:&lt;br/&gt;&lt;br/&gt;&lt;center&gt;&lt;img width='574' height='424' src=&quot;/uploads/xp-on-mac.png&quot; alt=&quot;Screenshot&quot; /&gt;&lt;/center&gt;&lt;br/&gt;So far we have:&lt;ul&gt;&lt;li&gt;&lt;b&gt;Windows&lt;/b&gt;: Windows XP, Windows 7, Windows Vista, Windows 2008 server&lt;/li&gt;&lt;li&gt;&lt;b&gt;BSD&lt;/b&gt;: FreeBSD 5, 6 and 7&lt;/li&gt;&lt;li&gt;&lt;b&gt;Linux&lt;/b&gt;: Gentoo, Ubuntu, Debian (3.1, 4.0, 5.0)&lt;/li&gt;&lt;li&gt;&lt;b&gt;Mac&lt;/b&gt;: OS X 10&lt;/li&gt;&lt;li&gt;&lt;b&gt;Other&lt;/b&gt;: &lt;a href=&quot;http://news.xp-framework.net/article/146/0000/00/00/&quot;&gt;Nokia 770&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;If you have XP running on a platform besides these, let us know and we'll add it here&lt;emoticon id=&quot;regular_smile&quot; text=&quot;:-)&quot;/&gt;</description>
    <dc:date>2010-01-24T11:38:18+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/339/2010/01/24/XP_Framework___APC">  
    <title>XP Framework &amp; APC</title>
    <link>http://news.xp-framework.net/article/339/2010/01/24/XP_Framework___APC</link>
    <description>Recently, I got an email from Jan, who has to websites running the XP Framework and who had upgraded his PHP to &lt;tt&gt;5.2.12&lt;/tt&gt;, asking for assistance with these sites being disfunctional and the following extracts from the web server's error log:&lt;br/&gt;&lt;br/&gt;&lt;pre&gt;  [Sun Jan 17 12:46:43 2010] [error] PHP Fatal error:  Interface 'Generic' not found&lt;br/&gt;  [Sun Jan 17 12:37:34 2010] [error] PHP Fatal error:  Allowed memory size ... exhausted&lt;br/&gt;&lt;/pre&gt;&lt;br/&gt;After some research work we found out the problem wasn't caused by the new PHP version but instead by the &lt;a href=&quot;http://pecl.php.net/package/APC&quot; title=&quot;Alternative PHP Cache&quot;&gt;APC&lt;/a&gt; extension he had installed. We can reproduce this problem even on the command line, and it seems to be related to &lt;a href=&quot;http://pecl.php.net/bugs/bug.php?id=16860&quot;&gt;PECL &lt;bug id=&quot;16860&quot;/&gt;&lt;/a&gt;. The workarounds suggested in this bug that work for some only relieve these problems partially, although a simple site then works the XP core unittests show that there are still problems.&lt;br/&gt;&lt;br/&gt;The XP Framework team suggests &lt;b&gt;not to use APC&lt;/b&gt; with the XP Framework for the time being.</description>
    <dc:date>2010-01-24T11:20:16+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/338/2010/01/15/Windows_runners">  
    <title>Windows runners</title>
    <link>http://news.xp-framework.net/article/338/2010/01/15/Windows_runners</link>
    <description>&lt;img width='178' height='160' align=&quot;right&quot; src=&quot;/uploads/windows.png&quot; alt=&quot;Windows&quot; /&gt;The Windows runners provided with the XP Framework were not shutting down PHP correctly when &lt;b&gt;Ctrl+C&lt;/b&gt; was pressed in the shell. In Windows console windows this can be easily worked around by setting the &lt;tt&gt;Console.CancelKeyPress&lt;/tt&gt; property to a delegate which will kill the executed PHP runtime. If any of the XP runners was run from inside a Cygwin shell though, this is not possible - see &lt;link href=&quot;http://www.cygwin.com/ml/cygwin/2006-12/msg00151.html&quot;/&gt; - Cygwin simply kills the XP runner - and we thus cannot do anything (an experiment with a WMI monitoring process seemed to work but caused problems in certain circumstances) and you will have to continue to &lt;tt&gt;taskkill /f /pid XXXX&lt;/tt&gt;'ing the &quot;left-over&quot; PHP processes manually&lt;emoticon id=&quot;sad_smile&quot; text=&quot;:-(&quot;/&gt;&lt;br/&gt;&lt;br/&gt;A bugfix for this problem has been comitted to the XP Framework and will be available in the upcoming 5.7.7-RELEASE. If you're using an SVN head checkout (and are using Windows), you should update the runners as follows:&lt;br/&gt;&lt;br/&gt;&lt;pre&gt;  $ cd ~/bin&lt;br/&gt;  $ wget 'http://xp-framework.net/downloads/releases/bin/setup' -O - | php&lt;/pre&gt;</description>
    <dc:date>2010-01-15T16:48:04+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/337/2010/01/10/BSD_Runners">  
    <title>BSD Runners</title>
    <link>http://news.xp-framework.net/article/337/2010/01/10/BSD_Runners</link>
    <description>&lt;img width='178' height='196' align='right' alt=&quot;Beastie&quot; src=&quot;/uploads/beastie.png&quot;/&gt;The XP runners could fail under certain circumstances on BSD operating systems if the &lt;tt&gt;/proc&lt;/tt&gt; filesystem was not mounted. This is due to the fact that the FreeBSD kernel does not keep command lines longer than &lt;tt&gt;kern.ps_arg_cache_limit&lt;/tt&gt; in memory and we rely on the command line an XP application was started with including arguments being available in the &lt;tt&gt;lang.Runtime&lt;/tt&gt; class.&lt;br/&gt;&lt;br/&gt;A bugfix for this problem has been comitted to the XP Framework and will be available in the upcoming 5.7.7-RELEASE. If you're using an SVN head checkout (and are using FreeBSD), you should update the runners as follows:&lt;br/&gt;&lt;br/&gt;&lt;pre&gt;  $ cd ~/bin&lt;br/&gt;  $ wget 'http://xp-framework.net/downloads/releases/bin/setup' -O - | php&lt;/pre&gt;</description>
    <dc:date>2010-01-10T18:00:51+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/336/2010/01/08/Reading_gzip_ed_websites">  
    <title>Reading gzip'ed websites</title>
    <link>http://news.xp-framework.net/article/336/2010/01/08/Reading_gzip_ed_websites</link>
    <description>To reduce bandwidth some servers have their content zipped using solutions such as Apache's &lt;a href=&quot;http://httpd.apache.org/docs/2.0/mod/mod_deflate.html&quot;&gt;mod_deflate&lt;/a&gt;. This is done only if the &lt;tt&gt;Accept-Encoding&lt;/tt&gt; request header contains the string &lt;tt&gt;gzip&lt;/tt&gt;. Combining the XP Framework's &lt;tt&gt;peer.http&lt;/tt&gt; API with the new &lt;tt&gt;io.streams.GzDecompressingInputStream&lt;/tt&gt; one can accomplish this compression:&lt;br/&gt;&lt;code&gt;&lt;span&gt; &lt;br/&gt;  &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$conn&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;= &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; HttpConnection&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$args&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;[0]&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;;&lt;br/&gt;  &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$response&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;= &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$conn&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;get&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;, array&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;'Accept-Encoding'&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;string&quot;&gt;'gzip'&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;;&lt;br/&gt;  &lt;br/&gt;  if &lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;'gzip'&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; == &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$response&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;getHeader&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;'Content-Encoding'&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; &lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;br/&gt;    &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$in&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;= &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; GzDecompressingInputStream&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$r&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;getInputStream&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;())&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;;&lt;br/&gt;  &lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; else &lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;br/&gt;    &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$in&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;= &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$r&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;getInputStream&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;;&lt;br/&gt;  &lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;br/&gt;  &lt;br/&gt;  &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;// Now read $in as with any other stream...&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/code&gt;</description>
    <dc:date>2010-01-08T20:44:56+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/335/2010/01/06/Compressing_data">  
    <title>Compressing data</title>
    <link>http://news.xp-framework.net/article/335/2010/01/06/Compressing_data</link>
    <description>&lt;img width='213' height='297' align=&quot;right&quot; vspace=&quot;8&quot; src=&quot;/uploads/compress.jpg&quot; alt=&quot;&quot; /&gt;The possibly easiest way to compress data in PHP is to use the string-in, string-out functions such as &lt;tt&gt;gzdeflate&lt;/tt&gt; or &lt;tt&gt;bzcompress&lt;/tt&gt;. For small number of bytes being passed in, this is fast and convenient, but it doesn't do well when working with large files, for example:&lt;br/&gt;&lt;code&gt;&lt;span&gt; &lt;br/&gt;  FileUtil::setContents&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;br/&gt;    &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$out&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;, &lt;br/&gt;    gzdeflate&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;FileUtil::getContents&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$in&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;br/&gt;  &lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;;&lt;br/&gt;&lt;/span&gt;&lt;/code&gt;In one test I ran here, this piece of code used roughly 50MB peaks to compress a 26 MB input file. As of 5.7.7, the XP Framework will provide compressing output streams enabling you to compress one chunk at a time and &lt;b&gt;saving more than 90%&lt;/b&gt; of memory:&lt;br/&gt;&lt;code&gt;&lt;span&gt; &lt;br/&gt;  &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$is&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;= &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$in&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;getInputStream&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;;&lt;br/&gt;  &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$os&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;= &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; DeflatingOutputStream&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$out&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;getOutputStream&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;())&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;;&lt;br/&gt;  while &lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$is&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;available&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; &amp;gt; 0&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; &lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;br/&gt;    &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$os&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;write&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$is&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;read&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;())&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;;&lt;br/&gt;  &lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;br/&gt;  &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$is&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;close&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;;&lt;br/&gt;  &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$os&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;close&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;;&lt;br/&gt;&lt;/span&gt;&lt;/code&gt;Sure, this is more code, but it constantly uses not more than 0.5 MB while running. If you now have a look at the new &lt;tt&gt;io.streams.StreamTransfer&lt;/tt&gt; class you can simplify the above code even more (&lt;i&gt;and still save the memory&lt;/i&gt;).</description>
    <dc:date>2010-01-06T17:09:40+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/334/2009/12/28/FTP_API_Class_constants">  
    <title>FTP API Class constants</title>
    <link>http://news.xp-framework.net/article/334/2009/12/28/FTP_API_Class_constants</link>
    <description>The global constants &lt;tt&gt;FTP_ASCII&lt;/tt&gt; and &lt;tt&gt;FTP_BINARY&lt;/tt&gt; have been replaced inside the &lt;tt&gt;peer.ftp&lt;/tt&gt; package by class constants in the &lt;tt&gt;FtpTransfer&lt;/tt&gt; class. Although these resolve to the same integer values and no change to existing sourcecode is required, the class constants are the preferred and portable way.&lt;br/&gt;&lt;br/&gt;&lt;code&gt;&lt;span&gt; &lt;br/&gt;  &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$conn&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;rootDir&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;file&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;'index.txt'&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;uploadFrom&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;br/&gt;    &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; FileInputStream&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; File&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;'index.txt'&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;,&lt;br/&gt;    FtpTransfer::ASCII          &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;// instead of: FTP_ASCII&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;br/&gt;  &lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;;&lt;br/&gt;&lt;/span&gt;&lt;/code&gt;</description>
    <dc:date>2009-12-28T10:27:53+01:00</dc:date>
  </item>
</rdf:RDF>
