CVS update: /cowiki/includes/cowiki/class/core/

[email protected] 15 Mar 2005 13:34:02 -0000
Newsgroups gmane.comp.php.cowiki.cvs
Message-ID <[email protected]>
User: nibra   
Date: 05/03/15 05:34:02

Modified:
 /cowiki/includes/cowiki/class/core/
  class.RuntimeContext.php

Log:
 Reverted to 1.54

File Changes:

Directory: /cowiki/includes/cowiki/class/core/
==============================================

File [changed]: class.RuntimeContext.php
Url: http://cowiki.tigris.org/source/browse/cowiki/includes/cowiki/class/core/class.RuntimeContext.php?r1=1.55&r2=1.56
Delta lines:  +21 -8
--------------------
--- class.RuntimeContext.php	12 Mar 2005 03:23:26 -0000	1.55
+++ class.RuntimeContext.php	15 Mar 2005 13:34:02 -0000	1.56
@@ -2,7 +2,7 @@
 
 /**
  *
- * $Id: class.RuntimeContext.php,v 1.55 2005/03/12 03:23:26 nibra Exp $
+ * $Id: class.RuntimeContext.php,v 1.56 2005/03/15 13:34:02 nibra Exp $
  *
  * This file is part of coWiki. coWiki is free software under the terms of
  * the GNU General Public License (GPL). Read the LICENSE file. If you did
@@ -17,7 +17,7 @@
  * @author      Daniel T. Gorski, <[email protected]>
  * @copyright   (C) Daniel T. Gorski, {@link http://www.develnet.org}
  * @license     http://www.gnu.org/licenses/gpl.html
- * @version     $Revision: 1.55 $
+ * @version     $Revision: 1.56 $
  *
  */
 
@@ -675,14 +675,25 @@
         static $sPath = null;
 
         if (!$sPath) {
-            // Get temporary file location
-            $sPath       = $this->getPathInfo()->getPath('TEMP');
-            $sCowikiRoot = $this->getPathInfo()->getPath('BASE');
+            // Get temporary file location, add slash if necessary
+            $sPath = $this->getRegistry()->get('PATH_TEMP') ;
+
+            // make the temp path absolute
+            if ($sCwd = getcwd()) {
+                chdir($sPath);
+                $sPath = getcwd();
+                chdir($sCwd);
+            }
+
+            if (substr($sPath, -1) != '/') {
+                $sPath .= '/';
+            }
+
+            $sCowikiRoot = $this->getEnvironment()->get('COWIKI_ROOT');
 
             // FIX: make temp file a MD5 string only, this is sufficient
-            $sPath .= DIRECTORY_SEPARATOR;
-            $sPath .= $this->getRegistry()->get('COWIKI_NAME');
-            $sPath .= '_' . strtoupper(substr(md5($sCowikiRoot), 0, 8)) .'_';
+            $sPath .= $this->getRegistry()->get('COWIKI_NAME') . '_';
+            $sPath .= strtoupper(substr(md5($sCowikiRoot), 0, 8)) . '_';
         }
 
         return $sPath;
@@ -1005,6 +1016,8 @@
         }
 
         $bErrorState = true;
+
+        $sImgPath  = $this->getRegistry()->get('PATH_IMAGES');
 
         $aTplItem = array();