[Pkg-owncloud-commits] [php-sabre-vobject] 82/341: !xml Assume we serialize a document.
David Prévot
taffit at moszumanska.debian.org
Tue Aug 11 13:35:36 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository php-sabre-vobject.
commit 2a28f177111358bbaa0f70464ab28717eb1e5670
Author: Ivan Enderlin <ivan.enderlin at hoa-project.net>
Date: Mon Nov 24 14:21:42 2014 +0100
!xml Assume we serialize a document.
---
lib/Writer.php | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/lib/Writer.php b/lib/Writer.php
index 1adb07c..bcd26fd 100644
--- a/lib/Writer.php
+++ b/lib/Writer.php
@@ -51,9 +51,24 @@ class Writer {
$writer = new XML\Writer();
$writer->openMemory();
+ $writer->startDocument('1.0', 'utf-8');
+
+ if($component instanceof Component\VCalendar) {
+
+ $writer->startElement('icalendar');
+ $writer->writeAttribute('xmlns', Parser\Xml::XCAL_NAMESPACE);
+ }
+ else {
+
+ $writer->startElement('vcards');
+ $writer->writeAttribute('xmlns', Parser\Xml::XCARD_NAMESPACE);
+ }
+
$writer->setIndent(true);
$writer->write($component->xmlSerialize());
+ $writer->endElement();
+
return $writer->outputMemory();
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabre-vobject.git
More information about the Pkg-owncloud-commits
mailing list