diff --git a/config/dmsDefaults.php b/config/dmsDefaults.php index ccdb51b..7ce635b 100644 --- a/config/dmsDefaults.php +++ b/config/dmsDefaults.php @@ -42,7 +42,11 @@ unset($microtime_simple); // If not defined, set KT_DIR based on my usual location in the tree if (!defined('KT_DIR')) { - define('KT_DIR', realpath(dirname(__FILE__) . '/..')); + $rootLoc = realpath(dirname(__FILE__) . '/..'); + if (OS_WINDOWS) { + $rootLoc = str_replace('\\','/',$rootLoc); + } + define('KT_DIR', $rootLoc); } if (!defined('KT_LIB_DIR')) { @@ -380,7 +384,7 @@ class KTInit { } } else { $oKTConfig =& KTConfig::getSingleton(); - + $oKTConfig->setdefaultns("KnowledgeTree", "fileSystemRoot", KT_DIR); $oKTConfig->setdefaultns("KnowledgeTree", "serverName", KTUtil::arrayGet($_SERVER, 'HTTP_HOST', 'localhost')); $oKTConfig->setdefaultns("KnowledgeTree", "sslEnabled", false); diff --git a/lib/storage/ondiskhashedstoragemanager.inc.php b/lib/storage/ondiskhashedstoragemanager.inc.php index 5f433f9..00aa182 100644 --- a/lib/storage/ondiskhashedstoragemanager.inc.php +++ b/lib/storage/ondiskhashedstoragemanager.inc.php @@ -45,6 +45,9 @@ class KTOnDiskHashedStorageManager extends KTStorageManager { //copy the file accross $start_time = KTUtil::getBenchmarkTime(); $file_size = $oDocument->getFileSize(); + if (OS_WINDOWS) { + $sDocumentFileSystemPath = str_replace('\\','/',$sDocumentFileSystemPath); + } if ($this->writeToFile($sTmpFilePath, $sDocumentFileSystemPath)) { $end_time = KTUtil::getBenchmarkTime(); global $default; @@ -64,6 +67,7 @@ class KTOnDiskHashedStorageManager extends KTStorageManager { function writeToFile($sTmpFilePath, $sDocumentFileSystemPath) { // Make it easy to write compressed/encrypted storage + return copy($sTmpFilePath, $sDocumentFileSystemPath); }