i'm using the browser plugin to access to my SabreDAV server it lists
files creates a new folder and uploads files.
But when downloading files i get this error message:
( ! ) Fatal error: Class 'DateTime' not found in /lib/Sabre/DAV/
Server.php on line 308
Call Stack
# Time Function Location
1 0.0001 {main}( ) ../index.php:0
2 0.0029 Sabre_DAV_Server->exec( ) ../index.php:37
3 0.0029 Sabre_DAV_Server->invoke( ) ../Server.php:112
4 0.0033 call_user_func ( ) ../Server.php:697
5 0.0033 Sabre_DAV_Server->httpGet( ) ../Server.php:0
my server is a Red Hat i686 i386 GNU/Linux, PHP Version 5.1.6, Apache/
2.2.8 (Unix)
when i put the line 308 in Server.php as comment the download works
well.
Could you please tell me what that line is standing for ? and what
could happen when i comment it ?
Hatem Ounis
Line 308 refrences the DateTime class. This class was introduced in
PHP version 5.2. I see you are using PHP 5.1.6 which means the
DateTime class does not exist. This is what is causing the error I
think.
You could consider the upgrading the PHP installation to a version
higher than 5.2 to get this to work. Also see the PHP manual on
DateTime: http://nl3.php.net/manual/en/datetime.installation.php
I did not find any mention of minimum requirements for SabreDav on the
wiki other than PHP 5. Maybe we should change this?
cheers,
mattijs
Added it here:
http://code.google.com/p/sabredav/wiki/Installation
Since you mention 'we', I'd be happy to enlist you as a contributor, just send me your gmail account.
@Hatem:
If you really can't upgrade, you could try to substitute the DateTime class with a PHP version. The class below you be an absolute minimal version of what I believe is needed.
I have no idea what else would break on PHP 5.1 though. PHP 5.2 has been around since early 2007
class DateTime {
public $time;
const RFC1123 = 'D, d M Y H:i:s O';
function __construct($time) {
$this->time = strtotime($time);
}
function format($format) {
return date($this->time, $format);
}
}
But if you must..
class DateTimeZone { }
will do it, I think.. Just remember that timezones might no longer be
entirely correct after that.