NewsRefactoring the old FTP API usageat 2009-06-30 in Examples by friebeIf you are running an XP release before 5.7.3 and are still using the old FTP API (e.g. FtpConnection::put(), FtpConnection::get(), etcetera), this will no longer work. These methods have been deprecated since October 2007 when RFC #0140 was implemented but have continued to work until recently. But as the FTP API has been rewritten and in this course these deprecated methods have been removed, now it's finally time to migrate! (more) Deadlock handlingat 2009-06-16 in Examples, Databases, RFCs by friebe The changes implemented in RFC #1059 make handling deadlocks easier. During deadlocks you might want to your program behave differently than during "regular" statement failures. For example, in Sybase, all transactions, regardless of their nesting level, are rolled back during a deadlock!You may have written sourcecode as follows in the past: <?phpThe problems should be obvious to the reader: The hardcoded errorcode (here the relevant one for Sybase), the very unelegant if, the missing portability for other drivers (PostgreSQL for example). (more) rdbms.DriverManager and supported connectionsat 2009-06-09 in Databases, Announcements by friebeThe rdbms.DriverManager class has been changed to only support drivers when the required extension is available. This changes fatal errors to exceptions in the following use-case: <?phpBefore (assuming ext/mysql is not loaded), this would print Fatal error: Call to undefined function mysql_connect(), now it raises an exception: Exception rdbms.DriverNotSupportedException (No driver registered for mysql (more) 5.7.3-RELEASE: Doclet API, COM, New FTP API, Webservices revampat 2009-06-08 in Releases, Announcements by friebeThe XP team is proud to announce the release of 5.7.3. This release again features numerous bugfixes but also quite a bit of improvements to the doclet command (see here, here and here), reflection for class constants, package mapping for client classes in the remote API, a completely rewritten FTP API and the new text.spelling package. Continue reading... Generating your own API documentationat 2009-06-07 in Examples by friebe To generate api documentation for your project or library, a new project inside XP Forge has been started. It will - like the JavaDoc tool - generate documentation from apidoc comments inside your classes' sourcecode into browseable HTML pages. On the right hand side, you can see an example of the generated HTML.Features:
Note: To use this generator, you must be using an up-to-date source checkout of both xp framework and xp forge or wait for the upcoming 5.7.3 release which will include this. (more) XAR support in doclet commandat 2009-06-07 in Announcements by friebeAs mentioned in an earlier entry, the doclet command can be used - for example - to discover unittests in classes. While earlier on this only worked with classes residing in the filesystem the doclet API has now been extended to work with XAR files. To retrieve information about source files bundled in a XAR archive, use the sourcepath option: $ doclet -sp devel/xpadmin/trunk/releases/5.7.2/lib/xp-rt-5.7.2.xar doclet.Class [...]This feature will be included in the upcoming release, 5.7.3.. Discovering unittestsat 2009-06-01 in Unittests, Examples by friebeIn the api documentation of a class, certain tags can be used, such as @see, @param or @return. Not only can they be used but it's actually strongly encouraged (you knew that, though). To discover unittests by a given class name, the doclet API can be used. (more) FTP API Rewriteat 2009-05-17 in Announcements by friebeThe old FTP API used PHP's ftp extension. This had limitations that expressed themselves when using the streaming capabilities: <?php This code worked as expected but made the connection unusable thereafter. This was due to the fact that streaming requires using ftp_raw() commands and we needed to read two lines (150 opening XXX mode connection and 226 transfer complete), which is not supported. This messes up the internal state maintained in the implementation's stack. Because FTP is a drop-dead simple protocol, current head now contains a complete rewrite of the FTP api to use pure sockets. At the same time, there is no longer a dependency on the ftp extension. New package: text.spellingat 2009-05-17 in Announcements by friebeThe new text.spelling package provides a wrapper around the pspell extension and provides an easy way to spell-check texts. Here's the basic usage: <?php (more) XP Runners with CGI-PHPat 2009-04-28 in Announcements by friebeUsing a dev-checkout, you can now use the XP runners using CGI-PHP (SAPI cgi-fcgi). This requires an update to the runners which can be accomplished as follows: $ cd ~/binThe new runners will be distributed along with the upcoming 5.7.3-RELEASE. |
|