aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/export.php
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-27 18:23:58 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-27 18:23:58 +0000
commiteebf21efc8dda30824c58bee33581a044f1cba59 (patch)
tree45d202128ffa3acf160fe79a5e1f9d5af01b2749 /engine/lib/export.php
parentde1a731825e9d9d2ea13077949d6937d28b31b04 (diff)
downloadelgg-eebf21efc8dda30824c58bee33581a044f1cba59.tar.gz
elgg-eebf21efc8dda30824c58bee33581a044f1cba59.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Sketch import/export functions added, pending event handling functions git-svn-id: https://code.elgg.org/elgg/trunk@275 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/export.php')
-rw-r--r--engine/lib/export.php97
1 files changed, 97 insertions, 0 deletions
diff --git a/engine/lib/export.php b/engine/lib/export.php
new file mode 100644
index 000000000..4a39d295f
--- /dev/null
+++ b/engine/lib/export.php
@@ -0,0 +1,97 @@
+<?php
+ /**
+ * Elgg Data import export functionality.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ */
+
+ /**
+ * Export a GUID.
+ *
+ * This function exports a GUID and all information related to it in an XML format.
+ *
+ * @param int $guid The GUID.
+ * @return xml
+ */
+ function export($guid)
+ {
+ // trigger serialise event
+
+ // serialise resultant object
+
+ /*
+ XML will look something like this:
+
+
+ <elgg>
+ <elgguser uuid="skdfjslklkjsldkfsdfjs:556">
+ <guid>556</guid>
+ <name>Marcus Povey</name>
+
+ ...
+
+ </elgguser>
+ <annotation>
+ <name>Foo</name>
+ <value>baaaa</value>
+ </annotation>
+ <annotation>
+ <name>Monkey</name>
+ <value>bibble</value>
+ </annotation>
+
+ ...
+
+ <metadata>
+ <name>Foo</name>
+ <value>baaaa</value>
+ </metadata>
+
+ ...
+
+ <my_plugin>
+
+ ...
+
+ </my_plugin>
+
+ </elgg>
+
+ */
+
+ }
+
+ /**
+ * Import an XML serialisation of an object.
+ * This will make a best attempt at importing a given xml doc.
+ *
+ * @param string $xml
+ * @return int The new GUID of the object.
+ */
+ function import($xml)
+ {
+ // import via object ?
+
+ // import via tag : so you pass a tag "<foo>" and all its contents out and something answers by handling it.
+ // THis is recursive but bredth first.
+
+
+ }
+
+ /**
+ * Generate a UUID from a given GUID.
+ *
+ * @param int $guid The GUID of an object.
+ */
+ function guid_to_uuid($guid)
+ {
+ global $CONFIG;
+
+ return md5($CONFIG->wwwroot . ":$guid");
+ }
+?> \ No newline at end of file