From 5000ec49a17c686ba4df1364b0f11558825a3e53 Mon Sep 17 00:00:00 2001 From: Prince Mbekwa Date: Fri, 25 Sep 2009 17:21:34 +0200 Subject: [PATCH] attempt to fix conflict brought about by revert of earlier commit --- lib/config/config.inc.php | 15 ++++++--------- plugins/thumbnails/thumbnails.php | 5 +++-- sql/mysql/upgrade/3.7.0/config_settings.sql | 31 ------------------------------- 3 files changed, 9 insertions(+), 42 deletions(-) delete mode 100644 sql/mysql/upgrade/3.7.0/config_settings.sql diff --git a/lib/config/config.inc.php b/lib/config/config.inc.php index a594d6e..ecd552e 100644 --- a/lib/config/config.inc.php +++ b/lib/config/config.inc.php @@ -73,8 +73,7 @@ class KTConfig { } // FIXME nbm: how do we cache errors here? - function loadCache() - { + function loadCache() { $filename = $this->getCacheFilename(); if($filename === false){ return false; @@ -94,8 +93,7 @@ class KTConfig { return true; } - function createCache() - { + function createCache() { $filename = $this->getCacheFilename(); $config_cache = array(); @@ -121,21 +119,20 @@ class KTConfig { } // {{{ readConfig - function readConfig () - { + function readConfig () { //Load config data from the database $sQuery = 'select group_name, item, value, default_value from config_settings'; $confResult = DBUtil::getResultArray($sQuery); - if(PEAR::isError($confResult)) { + if(PEAR::isError($confResult)){ return $confResult; } // Update the config array - overwrite the current settings with the settings in the database. - foreach ($confResult as $confItem) { + foreach ($confResult as $confItem) + { $this->setns($confItem['group_name'], $confItem['item'], $confItem['value'], $confItem['default_value']); } - $this->populateDefault(); } // }}} diff --git a/plugins/thumbnails/thumbnails.php b/plugins/thumbnails/thumbnails.php index de9592d..bcc1134 100755 --- a/plugins/thumbnails/thumbnails.php +++ b/plugins/thumbnails/thumbnails.php @@ -141,7 +141,8 @@ class thumbnailGenerator extends BaseProcessor { } // if there is no pdf that exists - hop out - if(!file_exists($pdfFile)) { + if(!file_exists($pdfFile)){ + global $default; $default->log->debug('Thumbnail Generator Plugin: PDF file does not exist, cannot generate a thumbnail'); return false; } @@ -153,7 +154,7 @@ class thumbnailGenerator extends BaseProcessor { // do generation if (extension_loaded('imagick')) { - $result= KTUtil::pexec("\"{$default->imagemagick}\" -size 200x200 \"{$pdfFile}[0]\" -resize 230x200 \"$thumbnailfile\""); + $result= shell_exec("convert -size 200x200 {$pdfFile}[0] -resize 200x200 $thumbnailfile"); return true; }else{ $default->log->debug('Thumbnail Generator Plugin: Imagemagick not installed, cannot generate a thumbnail'); diff --git a/sql/mysql/upgrade/3.7.0/config_settings.sql b/sql/mysql/upgrade/3.7.0/config_settings.sql deleted file mode 100644 index 4c8b436..0000000 --- a/sql/mysql/upgrade/3.7.0/config_settings.sql +++ /dev/null @@ -1,31 +0,0 @@ -INSERT INTO `config_settings` ( -`id` , -`group_name` , -`display_name` , -`description` , -`item` , -`value` , -`default_value` , -`type` , -`options` , -`can_edit` -) -VALUES ( -NULL , 'externalBinary', 'image magick', 'Path to binary', 'imagemagick', 'default', 'convert', 'string', NULL , '1' -); - -INSERT INTO `config_settings` ( -`id` , -`group_name` , -`display_name` , -`description` , -`item` , -`value` , -`default_value` , -`type` , -`options` , -`can_edit` -) -VALUES ( -NULL , 'externalBinary', 'pdf2swf', 'Path to binary', 'pdf2swf', 'default', 'pdf2swf', 'string', NULL , '1' -); -- libgit2 0.21.4