PHP5

PHP 5.3.2 support

at 2010-03-09 in 5.8-SERIESPHP5 by friebe

Following the PHP 5.3.2 release a couple of days ago we now officially support this new PHP version with the upcoming XP 5.7.8-RELEASE. Also tested successfully: The 5.8 development branch.



XP Framework & APC

at 2010-01-24 in PHP5 by friebe

Recently, 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
[Sun Jan 17 12:37:34 2010] [error] PHP Fatal error: Allowed memory size ... exhausted

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.



PHP 5.3.1 Released

at 2009-11-20 in PHP5 by friebe

PHP 5The PHP team announced PHP 5.3.1 yesterday wich fixes several security related issues and crashes. Due to all the forward and backward compatibility workarounds and ajdustments the XP Framework offers, we can now extend our version compatibility for the 5.7 series from PHP 5.2.0 - 5.3.1 (including all versions inbetween).



PHP 5.3 Experiments

at 2008-08-23 in PHP5Experiments by friebe

PHP Version 5All the experiments with the newest PHP version can be found at the XP Forge's 5.3 experiments.



Singleton base class

at 2008-08-23 in PHP5 by friebe

With the so-called "late static binding" feature in PHP 5.3 and the function get_called_class() at hand we can realize a singleton base class. This will alleviate creating singleton classes -the only thing needed is to extend the base class:

<?php 
class Logger extends Singleton {

public
function log($arg) {
// ...
}
}

Logger::getInstance
()->log('Hello');
?>


(more)

PHP 5.3 and typesafe enumerations

at 2008-08-12 in PHP5 by friebe

Within RFC #0132, typesafe enumerations were added to the XP framework. Because PHP does not support them language-wise, we need a bit of workaround syntax to make them work.

With PHP 5.3 and its so-called "late static binding features", enum declarations can now be written much more compact for the simplest use-case. Example:

<?php 
class TransactionType extends Enum {
public
static $NOT_SUPPORTED, $REQUIRED, $SUPPORTS, $NEVER;
}
?>


(more)

PHP 5.3

at 2008-08-08 in PHP5 by friebe

I've started playing around with the first alpha release of PHP 5.3 (should be released around September or October this year), see also the PHP 5.3 alpha1 announcement from August 1st.

Some first observations:


(more)

RFC #0092: Switching from PHP4 to PHP5

at 2006-12-18 in PHP5 by kiesel

Tomorrow, RFC #0092 will be set to status implemented. With its implementation, the XP framework's newest version will work with PHP5 only.

If you are running XP and have an application that you don't want to change and just leave it as is - here's how to achieve that:


(more)

Running PHP4 and PHP5 at the same time

at 2006-12-10 in PHP5 by kiesel

RFC #0092 is about the strategy that the XP framework will follow when doing it's step to PHP5 - from the strategic point of view.

It's quite obvious that 3rd party applications cannot be run under a 5.xx version of XP from one day to the other (well, actually it could, but the problem here is that quite a number of applications exist and you cannot take care for them all at a single moment), so systems need to provide a backwards compatible way of doing this step.

What that means is: we need to be able to run PHP4 and PHP5 on the same host, as CLI and in a web environment.

The setup, this article is going to feature is having PHP4 as a Apache module and PHP5 as CGI.


(more)

Why we should migrate to PHP5

at 2005-02-06 in PHP5 by friebe

Migrating to PHP5 (plain, as released by the PHP team) is currently not possible:

  • Builtin classes like Exception and Iterator take names we've already used.
    So much for BC here. See also entry #16
  • The one-super-class-for-all rule of XP is broken as built-in Exception needs to be the base class of anything that can be throw()n
    I've discussed this earlier, in entry #11
  • Serialization is incompatible
    A class with private and protected members serialized in PHP5 will not be readable by PHP4's serialize(). That prevents us from being able to migrate parts of our web applications relying on a defined session format.

Of course, by using our patch, we can get around the first two of these issues (at least, at its current state). An addition to the patch could also fix up the third.

But let's also have a look at the other side, why it would make sense to upgrade:


(more)

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