]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
start doing some writing
authorEvan Prodromou <evan@status.net>
Thu, 6 Oct 2011 21:31:50 +0000 (17:31 -0400)
committerEvan Prodromou <evan@status.net>
Thu, 6 Oct 2011 21:31:50 +0000 (17:31 -0400)
plugins/OfflineBackup/offlinebackupqueuehandler.php

index ae83e6741df403a3ab40ade6904605329d468fa4..81b29c43bc54912eaa69948b37e20542120702e0 100644 (file)
@@ -56,6 +56,31 @@ class OfflineBackupQueueHandler extends QueueHandler
     {
         $userId = $object;
 
+        $user = User::staticGet($userId);
+
+        $fileName = $this->makeBackupFile($user);
+
+        $this->notifyBackupFile($fileName);
+
         return true;
     }
+
+    function makeBackupFile($user)
+    {
+        $fileName = File::filename($user->getProfile(), "backup", "application/atom+xml");
+        $fullPath = File::path($fileName);
+
+        // XXX: this is pretty lose-y;  try another way
+
+        $actstr = new UserActivityStream($user, true, UserActivityStream::OUTPUT_RAW);
+
+        file_put_contents($fullPath, $actstr->getString());
+
+        return $fileName;
+    }
+
+    function notifyBackupFile($fileName)
+    {
+        $fileUrl = 
+    }
 }