wibble
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Fri, 7 Jan 2005 22:15:56 +0000 (22:15 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 4 Jan 2008 23:34:23 +0000 (00:34 +0100)
git-archimport-id: opensource@polytechnique.org--2005/banana--mainline--1.0--patch-11

banana/spool.inc.php

index f657d55..9e078f2 100644 (file)
@@ -124,7 +124,7 @@ class BananaSpool
 
     function _readFromFile()
     {
-        $file = dirname(dirname(__FILE__))."/spool/spool-{$this->group}.dat";
+        $file = $this->_spoolfile();
         if (file_exists($file)) {
             $this = unserialize(file_get_contents($file));
         }
@@ -132,7 +132,7 @@ class BananaSpool
 
     function _saveToFile()
     {
-        $file = dirname(dirname(__FILE__))."/spool/spool-{$this->group}.dat";
+        $file = $this->_spoolfile();
         uasort($this->overview, "spoolcompare");
 
         $this->roots = Array();
@@ -145,6 +145,14 @@ class BananaSpool
         file_put_contents($file, serialize($this));
     }
 
+    function _spoolfile()
+    {
+        global $banana;
+        $url = parse_url($banana->host);
+        $file = $url['host'].'_'.$url['port'].'_'.$this->group;
+        return dirname(dirname(__FILE__)).'/spool/'.$file;
+    }
+
     function _updateSpool($arg)
     {
         global $banana;