NewsBind server sockets to any free portat 2010-02-01 in Unittests, Editorial, Announcements by friebeAt 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 (lots of permutation, yes). ![]() On some of the newer machines we have configured Hudson 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. (more) Merging XAR filesat 2010-01-30 in Examples by kieselWith 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. 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. This is how it works:
5.7.7-RELEASEat 2010-01-26 in Announcements, Releases by gelliThe 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. http://releases.xp-framework.net/xml/release?5.7.7 XP on a Macat 2010-01-24 in Releases, Unittests by friebeContinuing our series of trying to get the XP Framework run on as many platforms as possible, here's our newest achievement: ![]() So far we have:
XP Framework & APCat 2010-01-24 in PHP5 by friebeRecently, I got an email from Jan, who has to websites running the XP Framework and who had upgraded his PHP to 5.2.12, asking for assistance with these sites being disfunctional and the following extracts from the web server's error log: [Sun Jan 17 12:46:43 2010] [error] PHP Fatal error: Interface 'Generic' not found After some research work we found out the problem wasn't caused by the new PHP version but instead by the APC extension he had installed. We can reproduce this problem even on the command line, and it seems to be related to PECL bug #16860. 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. The XP Framework team suggests not to use APC with the XP Framework for the time being. Windows runnersat 2010-01-15 in Releases, Announcements by friebe The Windows runners provided with the XP Framework were not shutting down PHP correctly when Ctrl+C was pressed in the shell. In Windows console windows this can be easily worked around by setting the Console.CancelKeyPress 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 http://www.cygwin.com/ml/cygwin/2006-12/msg00151.html - 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 taskkill /f /pid XXXX'ing the "left-over" PHP processes manuallyA 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: $ cd ~/bin BSD Runnersat 2010-01-10 in Releases, Announcements by friebe The XP runners could fail under certain circumstances on BSD operating systems if the /proc filesystem was not mounted. This is due to the fact that the FreeBSD kernel does not keep command lines longer than kern.ps_arg_cache_limit in memory and we rely on the command line an XP application was started with including arguments being available in the lang.Runtime class.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: $ cd ~/bin Reading gzip'ed websitesat 2010-01-08 in Examples by friebeTo reduce bandwidth some servers have their content zipped using solutions such as Apache's mod_deflate. This is done only if the Accept-Encoding request header contains the string gzip. Combining the XP Framework's peer.http API with the new io.streams.GzDecompressingInputStream one can accomplish this compression: <?php Compressing dataat 2010-01-06 in Examples by friebe The possibly easiest way to compress data in PHP is to use the string-in, string-out functions such as gzdeflate or bzcompress. 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:<?phpIn 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 saving more than 90% of memory: <?phpSure, 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 io.streams.StreamTransfer class you can simplify the above code even more (and still save the memory). FTP API Class constantsat 2009-12-28 in Announcements by friebeThe global constants FTP_ASCII and FTP_BINARY have been replaced inside the peer.ftp package by class constants in the FtpTransfer 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. <?php |
|