<?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/7/Examples">  
    <title>Examples</title>
    <link>http://news.xp-framework.net/7/Examples</link>
    <description>XP Framework</description>
    <dc:language>en-US</dc:language>
    <dc:date>2013-05-26T04:28:29+02: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/502/2013/03/01/Injection_in_REST_handlers"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/464/2012/06/07/New_Package__getComment___method"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/433/2012/01/06/PHP_Namespaces_and_the_XP_Framework"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/403/2011/01/16/Available_database_drivers"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/402/2011/01/16/ZIP_files_now_support_Unicode_filenames"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/397/2010/12/31/The_new_lang.Closeable_interface_and_ARM_blocks"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/396/2010/12/30/Hudson_and_the_xml.meta_API"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/394/2010/12/16/apt-get_meets_the_XP-Framework"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/390/2010/10/18/XP__Log_SQL_queries"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/382/2010/09/24/First_steps_with_the_XP_Language"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/371/2010/08/30/5.8_Feature_showcase__Accessing_class_interna"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/364/2010/08/10/Generics_of_primitives"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/359/2010/06/22/Fluent_XML_with_the_XP_Framework"/>
        <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/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/323/2009/10/14/Type_duplication_in_xpcli_injections"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/318/2009/09/21/New_xml.Node__withChild___method"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/296/2009/08/11/Unified_runners_in_the_web"/>
        <rdf:li rdf:resource="http://news.xp-framework.net/article/306/2009/07/12/Redirecting_console_output"/>
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="http://news.xp-framework.net/article/502/2013/03/01/Injection_in_REST_handlers">  
    <title>Injection in REST handlers</title>
    <link>http://news.xp-framework.net/article/502/2013/03/01/Injection_in_REST_handlers</link>
    <description>The &lt;a href=&quot;https://github.com/xp-framework/rfc/issues/243&quot;&gt;new REST API&lt;/a&gt; brings XPCLI-like &lt;tt&gt;@inject&lt;/tt&gt; handling to REST handlers. Although this is not a full-featured &lt;b&gt;IOC&lt;/b&gt; container, you can have the log categories, properties and the invocation context injected into your REST resource handler class.&lt;br/&gt;&lt;br/&gt;To accomplish this, decorate methods with the afforementioned &lt;tt&gt;@inject&lt;/tt&gt; annotation. Here's an example:&lt;br/&gt;&lt;code&gt;&lt;span&gt;  /**&lt;br/&gt;   * Sets a logger category for debugging&lt;br/&gt;   */&lt;br/&gt;  &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;#[@inject(name = 'trace')]&lt;br/&gt;&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;  public &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; setTrace&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;LogCategory &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$cat&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;= NULL&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;$this&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;cat= &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$cat&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;/span&gt;&lt;/code&gt;&lt;br/&gt;Some more details:&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Properties can be injected via &lt;tt&gt;util.Properties&lt;/tt&gt; and must supply a name&lt;br/&gt;&lt;/li&gt;&lt;li&gt;Log categories are retrieved via &lt;tt&gt;util.log.LogCategory&lt;/tt&gt; and can supply a name - if omitted, the scriptlet's trace is used (this is previously set via &lt;tt&gt;debug=&quot;TRACE&quot;&lt;/tt&gt; inside &lt;i&gt;web.ini&lt;/i&gt;).&lt;br/&gt;&lt;/li&gt;&lt;li&gt;The invocation context can be used for marshalling and exception mapping customizations. Its type is &lt;tt&gt;webservices.rest.srv.RestContext&lt;/tt&gt;&lt;br/&gt;&lt;/li&gt;&lt;/ul&gt;</description>
    <dc:date>2013-03-01T11:11:42+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/464/2012/06/07/New_Package__getComment___method">  
    <title>New Package::getComment() method</title>
    <link>http://news.xp-framework.net/article/464/2012/06/07/New_Package__getComment___method</link>
    <description>With the implementation of the feature suggested in &lt;a href=&quot;https://github.com/xp-framework/xp-framework/pull/139&quot;&gt;pull request #139&lt;/a&gt;, there's now a new method in the &lt;tt&gt;lang.reflect.Package&lt;/tt&gt; class, &lt;tt&gt;public string getComment()&lt;/tt&gt;. It returns the api doc comment of the &lt;tt&gt;package-info.xp&lt;/tt&gt; file, if existant, NULL otherwise.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Example&lt;/b&gt;&lt;br/&gt;To add package documentation (&lt;i&gt;this is also picked up by the doclet API and te api doc generator!&lt;/i&gt;), add a file called &lt;tt&gt;package-info.xp&lt;/tt&gt; alongside with the package directory. Here's an example (goes in net/xp_framework/tutorial/package-info.xp):&lt;br/&gt;&lt;br/&gt;&lt;code&gt;&lt;span&gt;&amp;lt;?php&lt;br/&gt;&lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;/* This file is part of the XP framework&lt;br/&gt; *&lt;br/&gt; * $Id$&lt;br/&gt; */&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;br/&gt;  &lt;br/&gt;/**&lt;br/&gt; * The XP tutorial package&lt;br/&gt; *&lt;br/&gt; * @see  http://xp-framework.net/&lt;br/&gt; */&lt;br/&gt;package net.xp_framework.tutorial &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;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;br/&gt;Invoking &lt;tt&gt;Package::forName('net.xp_framework.tutorial')-&gt;getComment()&lt;/tt&gt; will then return the string &quot;The XP tutorial package&quot;.&lt;br/&gt;&lt;br/&gt;One possible use could be &lt;a href=&quot;https://gist.github.com/2183228&quot;&gt;XP Tools: Command line reflection + &quot;-v&quot; and &quot;-vv&quot;&lt;/a&gt;.</description>
    <dc:date>2012-06-07T15:38:00+02:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/433/2012/01/06/PHP_Namespaces_and_the_XP_Framework">  
    <title>PHP Namespaces and the XP Framework</title>
    <link>http://news.xp-framework.net/article/433/2012/01/06/PHP_Namespaces_and_the_XP_Framework</link>
    <description>With the implementation of &lt;a href=&quot;https://github.com/xp-framework/rfc/issues/222&quot;&gt;RFC #0222&lt;/a&gt;, we have added optional PHP namespaces support to the XP Framework. &lt;i&gt;Optional&lt;/i&gt; means the XP Framework itself will neither depend on PHP 5.3 (still supporting PHP 5.2.10 upward at least for the 5.9-SERIES) nor will it change any of its classes to use them. That doesn't mean &lt;b&gt;you&lt;/b&gt; can't use them, though&lt;emoticon id=&quot;regular_smile&quot; text=&quot;:-)&quot;/&gt;&lt;br/&gt;&lt;br/&gt;Here's a quick-start guide:&lt;br/&gt;&lt;ul&gt;&lt;li&gt;PHP namespaces use the backslash (&lt;tt&gt;\&lt;/tt&gt;). These translate 1:1 to the package separator in the XP Framework, the dot (&lt;tt&gt;.&lt;/tt&gt;).&lt;br/&gt;&lt;/li&gt;&lt;li&gt;Classes with PHP namespaces, fully-qualified &lt;b&gt;and&lt;/b&gt; non-qualified XP classes may be mixed in one project. The XP group recommends &lt;a href=&quot;https://github.com/thekid/xp-experiments/tree/master/ns-convert&quot;&gt;migrating&lt;/a&gt; complete packages.&lt;br/&gt;&lt;/li&gt;&lt;li&gt;Inside classes using PHP namespaces, other XP classes need to be either addressed by their absolute fully-qualified names (e.g. &lt;tt&gt;\lang\Object&lt;/tt&gt;) or imported via the &lt;tt&gt;use&lt;/tt&gt; statement by their fully-qualified names; &lt;tt&gt;uses()&lt;/tt&gt; may not be used there.&lt;br/&gt;&lt;/li&gt;&lt;li&gt;Inside classes &lt;b&gt;not&lt;/b&gt; using PHP namespaces, namespaced classes must be added to the &lt;tt&gt;uses()&lt;/tt&gt; list &lt;i&gt;and&lt;/i&gt; addressed in their namespaced version.&lt;br/&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br/&gt;As an example, if we have the following in &lt;i&gt;de/thekid/tools/SQL.class.php&lt;/i&gt;:&lt;br/&gt;&lt;code&gt;&lt;span&gt;  namespace de\thekid\tools;&lt;br/&gt;  use rdbms\DriverManager;&lt;br/&gt;  &lt;br/&gt;  &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; SQL extends \lang\Object &lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;br/&gt;    public &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; main&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;variable&quot;&gt;$args&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;$conn&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;= DriverManager::getConnection&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;comment&quot;&gt;// ...&lt;br/&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;bracket&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;/span&gt;&lt;/code&gt;To run this class, use &lt;tt&gt;xp de.thekid.tools.SQL ...&lt;/tt&gt; as you would with a non-namespaced class.</description>
    <dc:date>2012-01-06T15:31:22+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/403/2011/01/16/Available_database_drivers">  
    <title>Available database drivers</title>
    <link>http://news.xp-framework.net/article/403/2011/01/16/Available_database_drivers</link>
    <description>Here's how to find out which database drivers are available (keys) - and what classes they're implemented by (values):&lt;br/&gt;&lt;br/&gt;&lt;code&gt;&lt;span&gt;  Console::writeLine&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;DriverManager::getInstance&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;drivers&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;;&lt;/span&gt;&lt;/code&gt;This will yield, depending on the PHP installation and configuration, something along the lines of:&lt;br/&gt;&lt;tt&gt;&lt;br/&gt;&amp;#160;  [&lt;br/&gt;&amp;#160;  &amp;#160;  mysql =&gt; lang.XPClass&amp;lt;rdbms.mysql.MySQLConnection&amp;gt;&lt;br/&gt;&amp;#160;  &amp;#160;  pgsql =&gt; lang.XPClass&amp;lt;rdbms.pgsql.PostgreSQLConnection&amp;gt;&lt;br/&gt;&amp;#160;  &amp;#160;  sqlite =&gt; lang.XPClass&amp;lt;rdbms.sqlite.SQLiteConnection&amp;gt;&lt;br/&gt;&amp;#160;  ]&lt;/tt&gt;</description>
    <dc:date>2011-01-16T22:45:39+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/402/2011/01/16/ZIP_files_now_support_Unicode_filenames">  
    <title>ZIP files now support Unicode filenames</title>
    <link>http://news.xp-framework.net/article/402/2011/01/16/ZIP_files_now_support_Unicode_filenames</link>
    <description>The XP Framework's &lt;tt&gt;io.archive.zip&lt;/tt&gt; package allows reading and creating ZIP files and is tested against zip archives created by Info-ZIP 3.0, PHP's Zip class, 7-zip, WinRAR and Windows' &quot;compressed folders&quot;. &lt;br/&gt;&lt;br/&gt;In SVN head, we have made a couple of adjustments to be able to support files written by Java's &lt;tt&gt;java.util.zip&lt;/tt&gt; package (which is internally used by the &lt;tt&gt;jar&lt;/tt&gt; command):&lt;br/&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Reading the central directory to find the compressed and uncompressed lengths&lt;/b&gt;, Java doesn't write this into the local file header - making it impossible to stream those files&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Supporting character set detection on extraction&lt;/b&gt; - up until JDK7 Build 57, the Java API was incorrectly writing entry names in UTF-8 but not setting the so-called &quot;Language Encoding bit (EFS)&quot;.&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Supporting to write archives with Unicode names&lt;/b&gt; - a JDK build downloaded yesterday still chokes on non-Unicode filenames inside ZIP archives when no charset is given (default is &quot;CP437&quot; here).&lt;br/&gt;&lt;/li&gt;&lt;/ul&gt;This way we can now create JAR files, &lt;a href=&quot;http://code.planet-xp.net/xml/browse?blog,zip&quot;&gt;for example&lt;/a&gt;.</description>
    <dc:date>2011-01-16T17:15:50+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/397/2010/12/31/The_new_lang.Closeable_interface_and_ARM_blocks">  
    <title>The new lang.Closeable interface and ARM blocks</title>
    <link>http://news.xp-framework.net/article/397/2010/12/31/The_new_lang.Closeable_interface_and_ARM_blocks</link>
    <description>The new &lt;tt&gt;lang.Closeable&lt;/tt&gt; interface and the &lt;tt&gt;io.streams&lt;/tt&gt; classes being retrofitted to implement it may not seem very useful on the first glance, although they serve the purpose of supporting the so-called &lt;acronym title=&quot;Automatic Resource Management&quot;&gt;ARM&lt;/acronym&gt; blocks. These are a feature supported by XP Language and reuse the &lt;tt&gt;try&lt;/tt&gt; keyword:&lt;br/&gt;&lt;br/&gt;&lt;code&gt;&lt;span&gt;  try &lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$expression&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;[, &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$expression&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;/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;comment&quot;&gt;// Statements&lt;br/&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;/span&gt;&lt;/code&gt;&lt;br/&gt;Any of the expressions are expected to be &lt;tt&gt;instanceof lang.Closeable&lt;/tt&gt; and their &lt;tt&gt;close()&lt;/tt&gt; methods are guaranteed to be called in the declaration order regardless of whether the block raises an exception or not.</description>
    <dc:date>2010-12-31T09:41:43+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/396/2010/12/30/Hudson_and_the_xml.meta_API">  
    <title>Hudson and the xml.meta API</title>
    <link>http://news.xp-framework.net/article/396/2010/12/30/Hudson_and_the_xml.meta_API</link>
    <description>&lt;img width='96' height='96' align=&quot;right&quot; src=&quot;/image/fetch/uploads/hudson.png&quot; alt=&quot;Hudson Logo&quot;/&gt;I'm currently working on a &lt;a href=&quot;http://hudson-ci.org/&quot;&gt;Hudson&lt;/a&gt; remoting API to be able to remotely configure our continuous integration projects. An example usecase occurred today: A co-worker had created a Hudson plugin which helps us distinguish projects with &lt;i&gt;no tests at all&lt;/i&gt; from projects with tests exist: It display a different icon in the &quot;weather&quot; column and sets the build status to unstable. Now what we want to do is to enable this plugins in all projects, which would mean clicking through an odyssee of &quot;Select Project - Configure - Enable - Save&quot; more than 70 times in the frontend.&lt;br/&gt;&lt;br/&gt;Hudson contains a &lt;a href=&quot;http://deadlock.netbeans.org/hudson/api/&gt;Remote API&lt;/a&gt; which should be able to tackle this job.</description>
    <dc:date>2010-12-30T21:48:23+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/394/2010/12/16/apt-get_meets_the_XP-Framework">  
    <title>apt-get meets the XP-Framework</title>
    <link>http://news.xp-framework.net/article/394/2010/12/16/apt-get_meets_the_XP-Framework</link>
    <description>&lt;img width='110' height='110' align=&quot;right&quot; src=&quot;/image/fetch/uploads/debian-package.png&quot; alt=&quot;Debian Package&quot;/&gt;The XP Framework has an easy-to-use installation mechanism - simply downloading a setup script and piping it directly to PHP. What this mechanism cannot do though is to install PHP as a dependency itself, which is usually done in an operating-system dependant manner. On Debian and Ubuntu distributions, the packaging mechanism is called APT (Advanced Packaging Tool), which installs Debian packages (.deb files). In order to build such a package, we need to create a control file as well as the intended directory structure and wrap all that up using the &quot;dpkg&quot; tool (there's a &lt;a href=&quot;http://www.ibm.com/developerworks/linux/library/l-debpkg.html&gt;howto over at IBM's developerworks&lt;/a&gt;). Unfortunately, this approach requires the Debian packaging tools to be available for the build platform - a situation we cannot rely on. This article shows a solution written in the XP Framework.</description>
    <dc:date>2010-12-16T16:39:00+01:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/390/2010/10/18/XP__Log_SQL_queries">  
    <title>XP: Log SQL queries</title>
    <link>http://news.xp-framework.net/article/390/2010/10/18/XP__Log_SQL_queries</link>
    <description>Reading &lt;a href=&quot;http://blog.ulf-wendel.de/?p=296&quot;&gt;PHP: 62 characters to see all MySQL queries&lt;/a&gt;, I thought I'd post a similar use case solution here. The task is to log all SQL queries and a backtrace of where they're executed from. In Ulf's post, this is accomplished by an extension function written in C, which needs to be compiled and loaded into PHP. &lt;br/&gt;&lt;br/&gt;Altough a nice feature, this way has several downsides, first of all, the compilation, a hurdle big enough to keep me from trying it out, and second, it's only going to work with MySQL databases (and to be precise, only those newer than 4.0, because &lt;tt&gt;mysqlnd&lt;/tt&gt; doesn't support MySQL's old password protocol handshake).</description>
    <dc:date>2010-10-18T14:14:26+02:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/382/2010/09/24/First_steps_with_the_XP_Language">  
    <title>First steps with the XP Language</title>
    <link>http://news.xp-framework.net/article/382/2010/09/24/First_steps_with_the_XP_Language</link>
    <description>The XP language is not completely different from the way PHP works, it keeps the flexibility and the general &quot;look and feel&quot; while adding syntactical support for features PHP doesn't support or doesn't support in all versions the XP Framework runs on.&lt;br/&gt;&lt;br/&gt;Like in the XP framework, the entry point is always a class. In their most simple form, these classes have a static main() method. An example:&lt;br/&gt;&lt;br/&gt;&lt;code&gt;&lt;span&gt;  public &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; HelloWorld &lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;br/&gt;    public &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; void main&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;string[] &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$args&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;      util.cmd.Console::writeLine&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;'Hello World from '&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;, self::&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;.getName&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;string&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;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;/span&gt;&lt;/code&gt;&lt;i&gt;OK, this doesn't look too unfamiliar, does it?&lt;/i&gt;</description>
    <dc:date>2010-09-24T10:22:00+02:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/371/2010/08/30/5.8_Feature_showcase__Accessing_class_interna">  
    <title>5.8 Feature showcase: Accessing class interna</title>
    <link>http://news.xp-framework.net/article/371/2010/08/30/5.8_Feature_showcase__Accessing_class_interna</link>
    <description>&lt;img width='144' height='196' align=&quot;right&quot; hspace=&quot;4&quot; src=&quot;/image/fetch/uploads/neo.jpg&quot; alt=&quot;Neo&quot; /&gt;The XP Framework's 5.8-SERIES contains a feature that will allow the reflection API to access private and protected members. Of course, &lt;b&gt;just because you can, doesn't mean you should&lt;/b&gt;, as this does allow you to &lt;a href=&quot;http://stackoverflow.com/questions/1796055/is-reflection-breaking-the-encapsulation-principle&gt;break the encapsulation principle&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;On the other side, this feature comes in handy for serialization mechanisms, as well as for reflection-based factory or delegation patterns.</description>
    <dc:date>2010-08-30T08:40:33+02:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/364/2010/08/10/Generics_of_primitives">  
    <title>Generics of primitives</title>
    <link>http://news.xp-framework.net/article/364/2010/08/10/Generics_of_primitives</link>
    <description>Like in C# (and unlike Java), primitives can be used as components of generics in the 5.8-SERIES. Given a vector &lt;tt&gt;util.collections.Vector&amp;lt;string&amp;gt;&lt;/tt&gt;, the following applies:&lt;br/&gt;&lt;br/&gt;&lt;code&gt;&lt;span&gt;  &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;// OK&lt;br/&gt;&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$v&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;[]= &lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;Hello&amp;quot;&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;// Throws a lang.IllegalArgumentException &lt;br/&gt;&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$v&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;[]= 1;&lt;/span&gt;&lt;/code&gt;&lt;br/&gt;Primitives can also be used in other generic collections types, e.g. &lt;tt&gt;Set&lt;/tt&gt; and &lt;tt&gt;Map&lt;/tt&gt; implementations as well as &lt;tt&gt;Stack&lt;/tt&gt; and &lt;tt&gt;Queue&lt;/tt&gt;.</description>
    <dc:date>2010-08-10T09:39:00+02:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/359/2010/06/22/Fluent_XML_with_the_XP_Framework">  
    <title>Fluent XML with the XP Framework</title>
    <link>http://news.xp-framework.net/article/359/2010/06/22/Fluent_XML_with_the_XP_Framework</link>
    <description>To create an XML tree programmatically, the XP Framework has offered the &lt;tt&gt;xml.Tree&lt;/tt&gt; class since its beginning in 2001. Recently, we've added a &lt;a href=&quot;http://en.wikipedia.org/wiki/Fluent_interface&quot;&gt;fluent interface&lt;/a&gt; to it, allowing for the following:&lt;br/&gt;&lt;br/&gt;&lt;code&gt;&lt;span&gt;  &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$t&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;= create&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; Tree&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;())&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;withRoot&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;create&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; Node&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;'book'&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;br/&gt;    -&amp;gt;withChild&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; Node&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;'author'&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;string&quot;&gt;'Timm'&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;br/&gt;    -&amp;gt;withChild&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; Node&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;'isbn'&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;string&quot;&gt;'978-0000000000'&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;br/&gt;    -&amp;gt;withChild&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; Node&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;'title'&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;string&quot;&gt;'Fluent XML with the XP Framework'&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;/span&gt;&lt;/code&gt;</description>
    <dc:date>2010-06-22T10:00:00+02: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/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;/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;/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;/image/fetch/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;  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;/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;/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&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/323/2009/10/14/Type_duplication_in_xpcli_injections">  
    <title>Type duplication in xpcli injections</title>
    <link>http://news.xp-framework.net/article/323/2009/10/14/Type_duplication_in_xpcli_injections</link>
    <description>It's just become another bit easier to write command line classes in the XP framework (&quot;xpclis&quot;). When using the &lt;tt&gt;@inject&lt;/tt&gt; annotation you no longer have to specify the type parameter if you use a so-called &quot;type hint&quot; - so instead of writing the following:&lt;br/&gt;&lt;code&gt;&lt;span&gt;  &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;#[@inject(type= 'rdbms.DBConnection', name= 'caffeine')]&lt;br/&gt;&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;  public &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; setConnection&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;DBConnection &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$conn&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;/span&gt;&lt;span class=&quot;bracket&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;/span&gt;&lt;/code&gt;...you can now omit the type part - it will be inferred from the first parameter's type:&lt;br/&gt;&lt;code&gt;&lt;span&gt;  &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;#[@inject(name= 'caffeine')]&lt;br/&gt;&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;  public &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;default&quot;&gt; setConnection&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;DBConnection &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$conn&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;/span&gt;&lt;span class=&quot;bracket&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;&lt;/span&gt;&lt;/code&gt;&lt;br/&gt;</description>
    <dc:date>2009-10-14T15:18:46+02:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/318/2009/09/21/New_xml.Node__withChild___method">  
    <title>New xml.Node::withChild() method</title>
    <link>http://news.xp-framework.net/article/318/2009/09/21/New_xml.Node__withChild___method</link>
    <description>To easily create XML documents, the xml.Node class has been extended with a new &lt;tt&gt;withChild()&lt;/tt&gt; method complementing &lt;tt&gt;addChild()&lt;/tt&gt;. In contrast to the latter, &lt;tt&gt;withChild()&lt;/tt&gt; returns the node the child was added to instead of the added child.</description>
    <dc:date>2009-09-21T15:04:34+02:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/296/2009/08/11/Unified_runners_in_the_web">  
    <title>Unified runners in the web</title>
    <link>http://news.xp-framework.net/article/296/2009/08/11/Unified_runners_in_the_web</link>
    <description>The XP framework had offered developers the power of an easy class loading setup via the new XP runners that are delivered with every release since several releases now. These runners have proven themselves very useful in day-to-day business, so we're working on porting them to the web!&lt;br/&gt;&lt;br/&gt;With the so-called web-runners these new cool and useful features will become available for you:&lt;ul&gt;&lt;br/&gt;&lt;li&gt;&lt;b&gt;Easier classpath setup&lt;/b&gt;&lt;br/&gt;Classpaths will be constructed from &lt;tt&gt;.pth&lt;/tt&gt; files, in the same manner as &lt;tt&gt;xpcli&lt;/tt&gt; does it.&lt;/li&gt;&lt;br/&gt;&lt;li&gt;&lt;b&gt;No boilerplate &quot;index.php&quot;s any more&lt;/b&gt;&lt;br/&gt;you won't need the same &lt;tt&gt;index.php&lt;/tt&gt; over and over in every project again; even more: you don't need any entrypoint &lt;tt&gt;.php&lt;/tt&gt; any more even for SOAP- or JSON-endpoints.&lt;/li&gt;&lt;br/&gt;&lt;li&gt;&lt;b&gt;Multiple etc/ configuration directories&lt;/b&gt;&lt;br/&gt;you can switch between multipe &lt;tt&gt;etc/&lt;/tt&gt;, eg. one for the test server and one for production, by changing a single file&lt;/li&gt;&lt;br/&gt;&lt;li&gt;&lt;b&gt;Overwrite arbitrary settings for special servers&lt;/b&gt;&lt;br/&gt;you can overwrite settings, eg. debugging settings, based on where your application runs - eg. on the development machine, you can have debugging enabled, while on production it's disabled. You don't need to have different files for them - no more mistakenly committed debug settings.&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;This article shows you how you can make use of the web runners in a XP application. Read on for more information!</description>
    <dc:date>2009-08-11T17:30:00+02:00</dc:date>
  </item>
  <item rdf:about="http://news.xp-framework.net/article/306/2009/07/12/Redirecting_console_output">  
    <title>Redirecting console output</title>
    <link>http://news.xp-framework.net/article/306/2009/07/12/Redirecting_console_output</link>
    <description>To capture output written by any of the PHP functions the &lt;a href=&quot;http://de3.php.net/outcontrol&quot;&gt;ouput control functions&lt;/a&gt; can be used (&lt;tt&gt;ob_start()&lt;/tt&gt;, &lt;tt&gt;ob_get_contents()&lt;/tt&gt; and friends). These functions do not affect the output made by the &lt;tt&gt;util.cmd.Console&lt;/tt&gt; class as this writes directly to the standard out and error streams. To redirect these, you can use the following:&lt;br/&gt;&lt;br/&gt;&lt;code&gt;&lt;span&gt;  &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;// Save original stream in variable, change output stream to $stream&lt;br/&gt;&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$out&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;= Console::&lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$out&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;getStream&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;;&lt;br/&gt;  Console::&lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$out&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;setStream&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$stream&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;// Write &amp;quot;Hello&amp;quot; and a newline, this will trigger $stream's write() method&lt;br/&gt;&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;  Console::writeLine&lt;/span&gt;&lt;span class=&quot;bracket&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;'Hello'&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;// Finally, restore original output stream  &lt;br/&gt;&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;  Console::&lt;/span&gt;&lt;span class=&quot;variable&quot;&gt;$out&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;-&amp;gt;setStream&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;bracket&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;br/&gt;This can be useful in unittests, when running command line applications inside a web container or inside GUIs, or whatever other usecase you can invent&lt;emoticon id=&quot;regular_smile&quot; text=&quot;:-)&quot;/&gt;&lt;br/&gt;</description>
    <dc:date>2009-07-12T18:11:38+02:00</dc:date>
  </item>
</rdf:RDF>
