News5.8.4RC2at 2012-01-23 in 5.8-SERIES, Announcements, Releases by friebeWe would like to announce the immediate availability of the second release candidate for XP 5.8.4. On top of the first RC, we have included fixes for the HTTP transport based on the curl extension and bugfixes for XMLRPC deserialization. We would like to thank the contributors from over at GamePay for these patches! Also, there have been several optimization to the XP compiler in generating dependencies. You can download and install as always: $ cd ~/xp Enjoy RFC #0231: Remove xp.contrib's "dba" moduleat 2012-01-22 in 5.8-SERIES, 5.9-SERIES, RFCs by friebeScope of Change The module "dba" will be completely removed. Rationale The io.dba classes where deprecated in the 5.8-SERIES and moved to the ports repository (what is now "xp.contrib") for backwards compatibility on 2010-02-14, almost two years ago at the time of writing. Read the full RFC here RFC #0184: Drop SAPI feature alltogetherat 2012-01-21 in 5.9-SERIES, RFCs by friebeRationale The sapi feature was initially introduced to offer a way to extend the XP framework's core code, provided by lang.base.php, in a manner similar to that file, eg. without having to encapsulate that code in a class. Now, we think code should always be loaded as a class, which bring several features like having an associated classloader. Functionality Functionality provided by one of the XP framework's sapi files will be migrated to be provided by regular classes, preferrably backwards compatible. Read the full RFC here 5.8.4RC1at 2012-01-12 in Announcements, Releases by friebeWe would like to announce the immediate availability of the first release candidate for XP 5.8.4. This release contains various fixes and enhancements like SQLite3 support in the rdbms package, as well as the extended server protocol, the first release of our mocking library, a REST client and support for combining application properties from varios sources. You can download and install as always: $ cd ~/xp Enjoy Heads up: Using local sockets to connect to MySQLat 2012-01-08 in Announcements, Databases by friebe MySQL allows running MySQL servers with disabled networking. This is suggested as security measure if the application and the database server run on the same machine, but in reality we usually don't have this kind of a setup except on the developers' machines. This is where we hit an inconsistency in our userland MySQL driver "mysqlx": It wasn't connecting to the MySQL server on localhost, where the standard MySQL driver was. This has been fixed in the meantime.Some research into this topic revealed the following:
Especially the last part is a bit frustrating, because it's magic, and magic behaviour is never good in software. This is why the XP group has decided to be inconsistent with the MySQL libraries and not support this in mysqlx. Furthermore, we have decided to remove the magic from the standard MySQL driver implementations in order to be consistent. Instead, use the dot (.) as a notation for "this machine", as seen in the following examples: // Connect to the MySQL server on this machine via local sockets.In contrast, this will now always use TCP/IP: $conn= DriverManager::getConnection('mysql://localhost/NEWS'); PHP Namespaces and the XP Frameworkat 2012-01-06 in RFCs, PHP5, Examples, 5.9-SERIES by friebeWith the implementation of RFC #0222, we have added optional PHP namespaces support to the XP Framework. Optional 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 you can't use them, though Here's a quick-start guide:
As an example, if we have the following in de/thekid/tools/SQL.class.php: namespace de\thekid\tools;To run this class, use xp de.thekid.tools.SQL ... as you would with a non-namespaced class. Support for SQLite3 / SQLite2 deprecationat 2012-01-06 in Announcements, Databases by friebeWith pull request #104 implemented the XP Framework now supports SQLite v3 databases via PHP's sqlite3 extension. To acquire a "connection" to an SQLite database, use "." as the hostname and supply the filename where you usually put the database in the DSN string: $conn= DriverManager::getConnection('sqlite://./test.db?autoconnect=1'); Note: At the same time, the sqlite scheme was changed to default to this new implementation instead of the older SQLite version 2, which will be deprecated in PHP 5.4. To stick with the old implementation, use sqlite+std as scheme to forcefully select the old driver. If you want to be forward-compatible, you may upgrade existing SQLite files as follows: sqlite old.db .dump | sqlite3 new.db. Explicitely selecting drivers in DriverManagerat 2011-12-30 in Databases by friebeIn a recent discussion in the XP Framework's issue tracker, the topic was brought up that the database connectivity layer was preferring the userland MySQL implementation over PHP's builtin-MySQL support. This change occurs in PHP versions using the mysqlnd implementation (default as of PHP 5.3.0) and was causing productive applications to malfunction. While the change in the XP Framework was made due to the fact that mysqlnd doesn't support older MySQL versions, matching our BC strategy, and there should've been more testing before deploying upgraded versions of both PHP and the XP Framework, it's still undesirable that there's no easy way "back". (more) RFC #0222: Optional support for PHP 5.3 namespacesat 2011-12-23 in 5.9-SERIES, PHP5, RFCs by friebeScope of Change Support for writing and using classes within PHP 5.3 namespaces will be added to the XP Framework's core. Because PHP namespaces are only available with PHP >= 5.3.0, support will be optional - using XP with PHP 5.2.x just will not offer the feature. Rationale Add benefit of using namespaces in classes. Namespaces allow reusing class names in a separate context, removing the need of class name prefixes and thus increasing overall code readability. Read the full RFC here TDS Protocol implementationat 2011-12-23 in PHP5, Editorial, Databases by friebeOne of the XP Framework's strategies is to keep compatibility over a large number of PHP versions on multiple platforms. For example, the message digest API contains a workaround for certain PHP versions with a broken CRC32b implementation, hiding it transparently from the user. In other places like the lang.Process class, we take care of platform differences, employing OS and feature detection, and even compensating for some implementation vagaries. Constructs like this can be found in various other places in our code base, and while this is definitely not desirable, it at least saves the user from going through this hell, and this way, we support the full range of PHP 5.2.10 through 5.3.8 (inofficially 5.2.0 - 5.5.0-dev also works) on a variety of Windows and Un*x systems. Following this strategy, we go as far as rewriting functionality previously available through a PHP extension to userland implementations: The FTP API (because of limitations in streaming support), the parse_url() function rewrite to work around behaviour changes, userland ini file parsing to support Unicode, a reimplemented MD5-crypt to compensate for a critical bug in crypt() in PHP 5.3.7 and our own MySQL protocol implementation to be able to support old MySQL 4.x instances, to name only a few cases. The TDS protocol implementation supporting connectivity with Microsoft SQL Server and Sybase database servers is the most recent addition to this stack. Though not yet completely finished, we expect to be able to add it to one of the upcoming 5.8 releases. |
|