mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-08 01:18:48 +00:00
Initial Release of the calendar plugin
This commit is contained in:
parent
45cc9885fc
commit
7115197a33
561 changed files with 189494 additions and 0 deletions
75
dav/SabreDAV/lib/Sabre/DAV/Property/GetLastModified.php
Normal file
75
dav/SabreDAV/lib/Sabre/DAV/Property/GetLastModified.php
Normal file
|
@ -0,0 +1,75 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This property represents the {DAV:}getlastmodified property.
|
||||
*
|
||||
* Although this is normally a simple property, windows requires us to add
|
||||
* some new attributes.
|
||||
*
|
||||
* This class uses unix timestamps internally, and converts them to RFC 1123 times for
|
||||
* serialization
|
||||
*
|
||||
* @package Sabre
|
||||
* @subpackage DAV
|
||||
* @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
|
||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
||||
*/
|
||||
class Sabre_DAV_Property_GetLastModified extends Sabre_DAV_Property {
|
||||
|
||||
/**
|
||||
* time
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $time;
|
||||
|
||||
/**
|
||||
* __construct
|
||||
*
|
||||
* @param int|DateTime $time
|
||||
*/
|
||||
public function __construct($time) {
|
||||
|
||||
if ($time instanceof DateTime) {
|
||||
$this->time = $time;
|
||||
} elseif (is_int($time) || ctype_digit($time)) {
|
||||
$this->time = new DateTime('@' . $time);
|
||||
} else {
|
||||
$this->time = new DateTime($time);
|
||||
}
|
||||
|
||||
// Setting timezone to UTC
|
||||
$this->time->setTimezone(new DateTimeZone('UTC'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* serialize
|
||||
*
|
||||
* @param Sabre_DAV_Server $server
|
||||
* @param DOMElement $prop
|
||||
* @return void
|
||||
*/
|
||||
public function serialize(Sabre_DAV_Server $server, DOMElement $prop) {
|
||||
|
||||
$doc = $prop->ownerDocument;
|
||||
$prop->setAttribute('xmlns:b','urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/');
|
||||
$prop->setAttribute('b:dt','dateTime.rfc1123');
|
||||
$prop->nodeValue = Sabre_HTTP_Util::toHTTPDate($this->time);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* getTime
|
||||
*
|
||||
* @return DateTime
|
||||
*/
|
||||
public function getTime() {
|
||||
|
||||
return $this->time;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue