Commit 16e505b531801fce74a6178e3163f64faf3425c3

Authored by Brad Shuttleworth
1 parent 5ecba8d5

fix for windows file-location problems.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5356 c91229c3-7414-0410-bfa2-8a42b809f60b
config/dmsDefaults.php
... ... @@ -42,7 +42,11 @@ unset($microtime_simple);
42 42  
43 43 // If not defined, set KT_DIR based on my usual location in the tree
44 44 if (!defined('KT_DIR')) {
45   - define('KT_DIR', realpath(dirname(__FILE__) . '/..'));
  45 + $rootLoc = realpath(dirname(__FILE__) . '/..');
  46 + if (OS_WINDOWS) {
  47 + $rootLoc = str_replace('\\','/',$rootLoc);
  48 + }
  49 + define('KT_DIR', $rootLoc);
46 50 }
47 51  
48 52 if (!defined('KT_LIB_DIR')) {
... ... @@ -380,7 +384,7 @@ class KTInit {
380 384 }
381 385 } else {
382 386 $oKTConfig =& KTConfig::getSingleton();
383   -
  387 +
384 388 $oKTConfig->setdefaultns("KnowledgeTree", "fileSystemRoot", KT_DIR);
385 389 $oKTConfig->setdefaultns("KnowledgeTree", "serverName", KTUtil::arrayGet($_SERVER, 'HTTP_HOST', 'localhost'));
386 390 $oKTConfig->setdefaultns("KnowledgeTree", "sslEnabled", false);
... ...
lib/storage/ondiskhashedstoragemanager.inc.php
... ... @@ -45,6 +45,9 @@ class KTOnDiskHashedStorageManager extends KTStorageManager {
45 45 //copy the file accross
46 46 $start_time = KTUtil::getBenchmarkTime();
47 47 $file_size = $oDocument->getFileSize();
  48 + if (OS_WINDOWS) {
  49 + $sDocumentFileSystemPath = str_replace('\\','/',$sDocumentFileSystemPath);
  50 + }
48 51 if ($this->writeToFile($sTmpFilePath, $sDocumentFileSystemPath)) {
49 52 $end_time = KTUtil::getBenchmarkTime();
50 53 global $default;
... ... @@ -64,6 +67,7 @@ class KTOnDiskHashedStorageManager extends KTStorageManager {
64 67  
65 68 function writeToFile($sTmpFilePath, $sDocumentFileSystemPath) {
66 69 // Make it easy to write compressed/encrypted storage
  70 +
67 71 return copy($sTmpFilePath, $sDocumentFileSystemPath);
68 72 }
69 73  
... ...