Commit 78bbfbaaa0135883546e848a32329ef33659b5bd

Authored by Paul Barrett
1 parent 173bc363

Fixed error with dmsDefaults setting fileSystemRoot too late for dynamic db conf…

…ig read.  Then removed attempts to fix broken path on windows

Committed by: Paul Barrett
config/dmsDefaults.php
@@ -483,6 +483,9 @@ class KTInit { @@ -483,6 +483,9 @@ class KTInit {
483 function initConfig() { 483 function initConfig() {
484 global $default; 484 global $default;
485 $oKTConfig = KTConfig::getSingleton(); 485 $oKTConfig = KTConfig::getSingleton();
  486 +
  487 + // Override the config setting - KT_DIR is resolved on page load
  488 + $oKTConfig->setdefaultns('KnowledgeTree', 'fileSystemRoot', KT_DIR);
486 489
487 // TODO: refactor when all the config settings are stored in the database 490 // TODO: refactor when all the config settings are stored in the database
488 // Check for the config cache 491 // Check for the config cache
plugins/thumbnails/thumbnails.php
@@ -158,15 +158,8 @@ class thumbnailGenerator extends BaseProcessor @@ -158,15 +158,8 @@ class thumbnailGenerator extends BaseProcessor
158 $thumbnaildir = $default->internalVarDirectory.DIRECTORY_SEPARATOR.'thumbnails'; 158 $thumbnaildir = $default->internalVarDirectory.DIRECTORY_SEPARATOR.'thumbnails';
159 159
160 if (stristr(PHP_OS,'WIN')) { 160 if (stristr(PHP_OS,'WIN')) {
161 - $thumbnaildir = str_replace('/', '\\', $thumbnaildir);  
162 - $pdfFile = str_replace('/', '\\', $pdfFile);  
163 - }  
164 -  
165 - if (!preg_match('/' . str_replace('/', '\/', str_replace('\\', '\\\\', KT_DIR)) . '/', $thumbnaildir))  
166 - {  
167 - if (stristr(PHP_OS,'WIN')) {  
168 - $thumbnaildir = KT_DIR . '\\' . trim($thumbnaildir, '\\');  
169 - } 161 + $thumbnaildir = str_replace('/', '\\', $thumbnaildir);
  162 + $pdfFile = str_replace('/', '\\', $pdfFile);
170 } 163 }
171 164
172 $thumbnailfile = $thumbnaildir.DIRECTORY_SEPARATOR.$this->document->iId.'.jpg'; 165 $thumbnailfile = $thumbnaildir.DIRECTORY_SEPARATOR.$this->document->iId.'.jpg';
@@ -237,13 +230,6 @@ class ThumbnailViewlet extends KTDocumentViewlet { @@ -237,13 +230,6 @@ class ThumbnailViewlet extends KTDocumentViewlet {
237 $varDir = str_replace('/', '\\', $varDir); 230 $varDir = str_replace('/', '\\', $varDir);
238 } 231 }
239 232
240 - if (!preg_match('/' . str_replace('/', '\/', str_replace('\\', '\\\\', KT_DIR)) . '/', $thumbnaildir))  
241 - {  
242 - if (stristr(PHP_OS,'WIN')) {  
243 - $varDir = KT_DIR . '\\' . trim($varDir, '\\');  
244 - }  
245 - }  
246 -  
247 $thumbnailCheck = $varDir . '/thumbnails/'.$documentId.'.jpg'; 233 $thumbnailCheck = $varDir . '/thumbnails/'.$documentId.'.jpg';
248 234
249 // if the thumbnail doesn't exist try to create it 235 // if the thumbnail doesn't exist try to create it
@@ -279,15 +265,6 @@ class ThumbnailViewlet extends KTDocumentViewlet { @@ -279,15 +265,6 @@ class ThumbnailViewlet extends KTDocumentViewlet {
279 public function get_width($documentId){ 265 public function get_width($documentId){
280 global $default; 266 global $default;
281 $varDir = $default->internalVarDirectory; 267 $varDir = $default->internalVarDirectory;
282 - if (stristr(PHP_OS,'WIN'))  
283 - {  
284 - $varDir = str_replace('/', '\\', $varDir);  
285 -  
286 - if (!preg_match('/' . str_replace('/', '\/', str_replace('\\', '\\\\', KT_DIR)) . '/', $thumbnaildir))  
287 - {  
288 - $varDir = KT_DIR . '\\' . trim($varDir, '\\');  
289 - }  
290 - }  
291 $thumbnailfile = $varDir . '/thumbnails/'.$documentId.'.jpg'; 268 $thumbnailfile = $varDir . '/thumbnails/'.$documentId.'.jpg';
292 $size = getimagesize($thumbnailfile); 269 $size = getimagesize($thumbnailfile);
293 return $size[0]; 270 return $size[0];