News

5.8.4RC3: JSON, Configuration, Properties and FC

at 2012-02-03 in 5.8-SERIES5.9-SERIESAnnouncementsReleases by friebe

We would like to announce the immediate availability of the third release candidate for XP 5.8.4. On top of the second RC, we have included JSON serialization for objects, the possibility to supply multiple configuration sources for both XPCLIs and web applications based on RFC #0221, extended the util.Properties class to be case-insensitive when parsing boolean values and added a method lang.reflect.Field::getTypeName() for forward compatibility with the upcoming 5.9-SERIES.

You can download and install as always:

  $ cd ~/xp
$ wget http://releases.xp-framework.net/setup/5.8.4RC3 -O - | php -- -d ~/bin/

Enjoy:-)



RFC #0210: Separate contrib & framework versions - vote please!

at 2012-02-01 in RFCs5.9-SERIES by friebe

We've worked on RFC #0210: Separate contrib and framework versions, the goal of which is to separate framework and contrib. library versions. While today, all libraries are versioned alongside the framework, e.g. xp-rt-5.8.4 and xp-contrib.stomp-5.8.4, the libraries will have separate versions in the future and instead a pointer to the framework version (range) they depend on. We've therefore gathered all the current libraries inside the xp.contrib repository and have reconstructed their changelog from SVN and Git commit history. The RFC includes these and the version numbers we can derive from that for each library.

Now while we were doing that, we also noticed quite a bunch of deprecated, badly named, unmaintained and otherwise outdated libraries. For the most obvious, we've created RFCs on how to further proceed with them. Please give your votes by adding "+1" or "-1" (and optionally, a reason) as to these proposals in the issue comments.


Thanks!



New method Field::getTypeName()

at 2012-01-28 in 5.8-SERIESAnnouncements by friebe

In preparation for the upcoming change of lang.reflect.Field::getType(), due to fix its inconsistency with other parts of the reflection API, we have added a forward-compatible lang.reflect.Field::getTypeName() method that you can start migrating your code to so it will work in both XP Framework versions.

For an example of what needs to be changed, see this pull request to the XP compiler.



RFC #0218: Parameter annotations

at 2012-01-28 in 5.9-SERIESRFCs by friebe

Scope of Change
Annotations on method parameters will be allowed.

Rationale
Originally motivated from XP Framework's pull request #33 - Stubbles IoC container and dependency injection.

Read the full RFC here.



5.8.4RC2

at 2012-01-23 in 5.8-SERIESAnnouncementsReleases by friebe

We 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
$ wget http://releases.xp-framework.net/setup/5.8.4RC2 -O - | php -- -d ~/bin/

Enjoy:-)



RFC #0231: Remove xp.contrib's "dba" module

at 2012-01-22 in 5.8-SERIES5.9-SERIESRFCs by friebe

Scope 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 alltogether

at 2012-01-21 in 5.9-SERIESRFCs by friebe

Rationale
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.4RC1

at 2012-01-12 in AnnouncementsReleases by friebe

We 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
$ wget http://releases.xp-framework.net/setup/5.8.4RC1 -O - | php -- -d ~/bin/

Enjoy:-)



Heads up: Using local sockets to connect to MySQL

at 2012-01-08 in AnnouncementsDatabases by friebe

MySQL logoMySQL 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:

  • MySQL uses an AF_UNIX socket on Un*x systems. By default, this is in /tmp/mysql.sock
  • On Windows, a named pipe serves the same purpose. It's usually called \\.\pipe\MySQL
  • The MySQL libraries will connect via these local sockets if "localhost" is supplied as host name

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.
// Determine socket by using OS-dependant lookup mechanisms.
$conn= DriverManager::getConnection('mysql://./NEWS');

// Supply local socket's name
$conn= DriverManager::getConnection('mysql://./NEWS?socket=/tmp/mysql.sock');
$conn= DriverManager::getConnection('mysql://./NEWS?socket=\\\\.\\pipe\\mysql');
In contrast, this will now always use TCP/IP:

  $conn= DriverManager::getConnection('mysql://localhost/NEWS');



PHP Namespaces and the XP Framework

at 2012-01-06 in RFCsPHP5Examples5.9-SERIES by friebe

With 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:

  • PHP namespaces use the backslash (\). These translate 1:1 to the package separator in the XP Framework, the dot (.).
  • Classes with PHP namespaces, fully-qualified and non-qualified XP classes may be mixed in one project. The XP group recommends migrating complete packages.
  • Inside classes using PHP namespaces, other XP classes need to be either addressed by their absolute fully-qualified names (e.g. \lang\Object) or imported via the use statement by their fully-qualified names; uses() may not be used there.
  • Inside classes not using PHP namespaces, namespaced classes must be added to the uses() list and addressed in their namespaced version.

As an example, if we have the following in de/thekid/tools/SQL.class.php:
  namespace de\thekid\tools;
use rdbms\DriverManager;

class SQL extends \lang\Object {
public
static function main(array $args) {
$conn= DriverManager::getConnection($args[0]);
// ...
}
}
To run this class, use xp de.thekid.tools.SQL ... as you would with a non-namespaced class.



Subscribe

You can subscribe to the XP framework's news by using RSS syndication.


Categories

News
General
PHP5
Announcements
RFCs
Further reading
Examples
Editorial
EASC
Experiments
Unittests
Databases
5.8-SERIES
Unicode
Language
5.9-SERIES