|
PHP51
Making SabreDAV work on PHP 5.1
Phase-Implementation IntroductionSabreDAV requires PHP 5.2. This is mostly due to the heavy use of the DateTime and DateTimeZone object. However, there is a PHP 5.1 branch. While this branch is not as maintained as the standard branch, it may suit your needs. In this branch DateTime and DateTimeZone have been replaced with custom classes and other fixes have been done to get things to work as expected. The branch can be found here: Important notes:
| |
► Sign in to add a comment
the calDAV plugin does not work with PHP 5.2 either as datetime comparison is not available until 5.3. Filtered collection will not be returned and an exception is thrown in PHP 5.2.
I should support 5.2, so if it's really broken in PHP5.2 I have some fixing to do. Thank you!
@IngoRatsdorf?:
I just tested it, it works fine on PHP 5.2. It won't work on PHP 5.1 though, so I added a note.
I tested this on PHP 5.2.13. Test script:
<?php
$date1 = new DateTime?('today'); $date2 = new DateTime?('yesterday');
echo $date1<$date2?'A':'B'; echo $date1>$date2?'B':'A'; echo "\n";
?>
Output on PHP 5.2.13 is 'BB', which is expected.
<?php
?>
Returns
someone call the ambulance! PHP Version 5.2.0-8+etch16 [..]
The comparison must have been added in a later 5.2. version. I've been hunting through the changelog, but haven't been able to find anything yet.
It's also correct on PHP 5.2.6-1+lenny8
For now I'll just set the minimum required version to 5.2.6.
I hacked the code with a nasty "public string DateTime?::format ( string $format )" into string and compare the strings instead. Performancewise not ideal but does the trick for me now until my ISP upgrades. :-)