Commit 085f1ee3cc0ed2fe1f640e7f70b767915089a962
Merge branch 'edge' of git@github.com:ktgit/knowledgetree into edge
Showing
2 changed files
with
15 additions
and
2 deletions
plugins/thumbnails/thumbnails.php
| ... | ... | @@ -170,6 +170,11 @@ class thumbnailGenerator extends BaseProcessor |
| 170 | 170 | $default->log->debug('Thumbnail Generator Plugin: PDF file does not exist, cannot generate a thumbnail'); |
| 171 | 171 | return false; |
| 172 | 172 | } |
| 173 | + | |
| 174 | + if (WINDOWS_OS) { | |
| 175 | + $thumbnailfile = KT_DIR . $thumbnailfile; | |
| 176 | + } | |
| 177 | + | |
| 173 | 178 | // if a previous version of the thumbnail exists - delete it |
| 174 | 179 | if (file_exists($thumbnailfile)) { |
| 175 | 180 | @unlink($thumbnailfile); |
| ... | ... | @@ -177,7 +182,10 @@ class thumbnailGenerator extends BaseProcessor |
| 177 | 182 | // do generation |
| 178 | 183 | // if (extension_loaded('imagick')) { |
| 179 | 184 | $pathConvert = (!empty($default->convertPath)) ? $default->convertPath : 'convert'; |
| 180 | - $result = shell_exec("{$pathConvert} -size 200x200 {$pdfFile}[0] -resize 200x200 $thumbnailfile"); | |
| 185 | + if (WINDOWS_OS) { | |
| 186 | + $pathConvert = '"' . $pathConvert . '"'; | |
| 187 | + } | |
| 188 | + $result = KTUtil::pexec("{$pathConvert} -size 200x200 {$pdfFile}[0] -resize 200x200 $thumbnailfile"); | |
| 181 | 189 | return true; |
| 182 | 190 | //}else{ |
| 183 | 191 | //$default->log->debug('Thumbnail Generator Plugin: Imagemagick not installed, cannot generate a thumbnail'); |
| ... | ... | @@ -212,6 +220,10 @@ class ThumbnailViewlet extends KTDocumentViewlet { |
| 212 | 220 | global $default; |
| 213 | 221 | $varDir = $default->internalVarDirectory; |
| 214 | 222 | $thumbnailfile = $varDir . '/thumbnails/'.$documentId.'.jpg'; |
| 223 | + | |
| 224 | + if (WINDOWS_OS) { | |
| 225 | + $thumbnailfile = KT_DIR . $thumbnailfile; | |
| 226 | + } | |
| 215 | 227 | |
| 216 | 228 | // if the thumbnail doesn't exist try to create it |
| 217 | 229 | if (!file_exists($thumbnailfile)){ | ... | ... |
setup/wizard/steps/database.php
| ... | ... | @@ -781,7 +781,7 @@ class database extends Step |
| 781 | 781 | if($binaries) { |
| 782 | 782 | foreach ($binaries as $k=>$bin) { |
| 783 | 783 | if($k != 1) { |
| 784 | - $updateBin = 'UPDATE config_settings c SET c.value = "'.$bin.'" where c.group_name = "externalBinary" and c.display_name = "'.$k.'";'; | |
| 784 | + $updateBin = 'UPDATE config_settings c SET c.value = "'.str_replace('\\', '\\\\', $bin).'" where c.group_name = "externalBinary" and c.display_name = "'.$k.'";'; | |
| 785 | 785 | $this->util->dbUtilities->query($updateBin); |
| 786 | 786 | } |
| 787 | 787 | } |
| ... | ... | @@ -790,6 +790,7 @@ class database extends Step |
| 790 | 790 | // if Windows, hard code (relative to SYSTEM_ROOT) where we expect the Zend MSI installer to have placed them |
| 791 | 791 | if (WINDOWS_OS) { |
| 792 | 792 | $winBinaries = array('php' => 'ZendServer\bin\php.exe', 'python' => 'openoffice\program\python.exe', |
| 793 | + 'java' => 'jre\bin\java.exe', | |
| 793 | 794 | // since we don't know where convert is yet, let's just assume somewhere for now (manually test) |
| 794 | 795 | 'convert' => 'imagick\convert.exe', |
| 795 | 796 | 'zip' => 'bin\zip\zip.exe', 'unzip' => 'bin\unzip\unzip.exe'); | ... | ... |