From 2012b546f129773deed8985a965f91d4be9f336b Mon Sep 17 00:00:00 2001 From: cdujeu Date: Mon, 30 Mar 2015 14:12:23 +0200 Subject: [PATCH] Add more logs for various "preview" operations (Imagick, Diaporama, etc) --- core/src/plugins/editor.audio/class.AudioPreviewer.php | 1 + core/src/plugins/editor.diaporama/class.ImagePreviewer.php | 2 +- core/src/plugins/editor.imagick/class.IMagickPreviewer.php | 5 ++++- core/src/plugins/editor.pixlr/class.PixlrEditor.php | 2 ++ core/src/plugins/editor.video/class.VideoReader.php | 4 ++++ core/src/plugins/editor.zoho/class.ZohoEditor.php | 2 ++ 6 files changed, 14 insertions(+), 2 deletions(-) diff --git a/core/src/plugins/editor.audio/class.AudioPreviewer.php b/core/src/plugins/editor.audio/class.AudioPreviewer.php index 8e3e1ed9e7..839cd060d3 100644 --- a/core/src/plugins/editor.audio/class.AudioPreviewer.php +++ b/core/src/plugins/editor.audio/class.AudioPreviewer.php @@ -75,6 +75,7 @@ public function switchAction($action, $httpVars, $postProcessData) $node = new AJXP_Node($destStreamURL.$file); AJXP_Controller::applyHook("node.read", array($node)); + $this->logInfo('Preview', 'Read content of '.$node->getUrl()); //exit(1); } else if ($action == "ls") { diff --git a/core/src/plugins/editor.diaporama/class.ImagePreviewer.php b/core/src/plugins/editor.diaporama/class.ImagePreviewer.php index 5d1cd61773..be6bec1447 100644 --- a/core/src/plugins/editor.diaporama/class.ImagePreviewer.php +++ b/core/src/plugins/editor.diaporama/class.ImagePreviewer.php @@ -56,7 +56,7 @@ public function switchAction($action, $httpVars, $filesVars) header("Content-Length: 0"); return; } - + $this->logInfo('Preview', 'Preview content of '.$file); if (isSet($httpVars["get_thumb"]) && $httpVars["get_thumb"] == "true" && $this->getFilteredOption("GENERATE_THUMBNAIL", $repository->getId())) { $dimension = 200; if(isSet($httpVars["dimension"]) && is_numeric($httpVars["dimension"])) $dimension = $httpVars["dimension"]; diff --git a/core/src/plugins/editor.imagick/class.IMagickPreviewer.php b/core/src/plugins/editor.imagick/class.IMagickPreviewer.php index f7b31e40ce..80e1630c5c 100644 --- a/core/src/plugins/editor.imagick/class.IMagickPreviewer.php +++ b/core/src/plugins/editor.imagick/class.IMagickPreviewer.php @@ -66,8 +66,11 @@ public function switchAction($action, $httpVars, $filesVars) if ($action == "imagick_data_proxy") { $this->extractAll = false; - if(isSet($httpVars["all"])) $this->extractAll = true; $file = $selection->getUniqueFile(); + if(isSet($httpVars["all"])) { + $this->logInfo('Preview', 'Preview content of '.$file); + $this->extractAll = true; + } if (($size = filesize($destStreamURL.$file)) === false) { return false; diff --git a/core/src/plugins/editor.pixlr/class.PixlrEditor.php b/core/src/plugins/editor.pixlr/class.PixlrEditor.php index 44ea885d8c..d2e38f55f3 100644 --- a/core/src/plugins/editor.pixlr/class.PixlrEditor.php +++ b/core/src/plugins/editor.pixlr/class.PixlrEditor.php @@ -56,6 +56,7 @@ public function switchAction($action, $httpVars, $filesVars) $fData = array("tmp_name" => $tmp, "name" => urlencode(basename($file)), "type" => "image/jpg"); //var_dump($fData); $node = new AJXP_Node($destStreamURL.$file); + $this->logInfo('Preview', 'Sending content of '.$file.' to Pixlr server.'); AJXP_Controller::applyHook("node.read", array($node)); @@ -86,6 +87,7 @@ public function switchAction($action, $httpVars, $filesVars) $file = AJXP_Utils::decodeSecureMagic($httpVars["original_file"]); $node = new AJXP_Node($destStreamURL.$file); $node->loadNodeInfo(); + $this->logInfo('Edit', 'Retrieving content of '.$file.' from Pixlr server.'); AJXP_Controller::applyHook("node.before_change", array(&$node)); $url = $httpVars["new_url"]; $urlParts = parse_url($url); diff --git a/core/src/plugins/editor.video/class.VideoReader.php b/core/src/plugins/editor.video/class.VideoReader.php index d0fc779a60..c62350305d 100644 --- a/core/src/plugins/editor.video/class.VideoReader.php +++ b/core/src/plugins/editor.video/class.VideoReader.php @@ -67,6 +67,9 @@ public function switchAction($action, $httpVars, $filesVars) $ranges = explode('=', $_SERVER['HTTP_RANGE']); $offsets = explode('-', $ranges[1]); $offset = floatval($offsets[0]); + if($offset == 0){ + $this->logInfo('Preview', 'Streaming content of '.$file); + } $length = floatval($offsets[1]) - $offset; if (!$length) $length = $filesize - $offset; @@ -96,6 +99,7 @@ public function switchAction($action, $httpVars, $filesVars) } fclose($file); } else { + $this->logInfo('Preview', 'Streaming content of '.$file); $fp = fopen($filename, "rb"); header("Content-Length: ".$filesize); header("Content-Range: bytes 0-" . ($filesize - 1) . "/" . $filesize. ";"); diff --git a/core/src/plugins/editor.zoho/class.ZohoEditor.php b/core/src/plugins/editor.zoho/class.ZohoEditor.php index f536f9883f..65cafc355e 100644 --- a/core/src/plugins/editor.zoho/class.ZohoEditor.php +++ b/core/src/plugins/editor.zoho/class.ZohoEditor.php @@ -124,6 +124,7 @@ public function switchAction($action, $httpVars, $filesVars) $node = new AJXP_Node($destStreamURL.$file); AJXP_Controller::applyHook("node.read", array($node)); + $this->logInfo('Preview', 'Posting content of '.$file.' to Zoho server'); $extension = strtolower(pathinfo(urlencode(basename($file)), PATHINFO_EXTENSION)); $httpClient = new http_class(); @@ -219,6 +220,7 @@ public function switchAction($action, $httpVars, $filesVars) echo "MODIFIED"; } } + $this->logInfo('Edit', 'Retrieved content of '.$node->getUrl()); AJXP_Controller::applyHook("node.change", array(null, &$node)); }