Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 2012b54

Browse files
committed
Add more logs for various "preview" operations (Imagick, Diaporama, etc)
1 parent 041798b commit 2012b54

File tree

6 files changed

+14
-2
lines changed

6 files changed

+14
-2
lines changed

core/src/plugins/editor.audio/class.AudioPreviewer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public function switchAction($action, $httpVars, $postProcessData)
7575

7676
$node = new AJXP_Node($destStreamURL.$file);
7777
AJXP_Controller::applyHook("node.read", array($node));
78+
$this->logInfo('Preview', 'Read content of '.$node->getUrl());
7879
//exit(1);
7980

8081
} else if ($action == "ls") {

core/src/plugins/editor.diaporama/class.ImagePreviewer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function switchAction($action, $httpVars, $filesVars)
5656
header("Content-Length: 0");
5757
return;
5858
}
59-
59+
$this->logInfo('Preview', 'Preview content of '.$file);
6060
if (isSet($httpVars["get_thumb"]) && $httpVars["get_thumb"] == "true" && $this->getFilteredOption("GENERATE_THUMBNAIL", $repository->getId())) {
6161
$dimension = 200;
6262
if(isSet($httpVars["dimension"]) && is_numeric($httpVars["dimension"])) $dimension = $httpVars["dimension"];

core/src/plugins/editor.imagick/class.IMagickPreviewer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@ public function switchAction($action, $httpVars, $filesVars)
6666

6767
if ($action == "imagick_data_proxy") {
6868
$this->extractAll = false;
69-
if(isSet($httpVars["all"])) $this->extractAll = true;
7069
$file = $selection->getUniqueFile();
70+
if(isSet($httpVars["all"])) {
71+
$this->logInfo('Preview', 'Preview content of '.$file);
72+
$this->extractAll = true;
73+
}
7174

7275
if (($size = filesize($destStreamURL.$file)) === false) {
7376
return false;

core/src/plugins/editor.pixlr/class.PixlrEditor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public function switchAction($action, $httpVars, $filesVars)
5656
$fData = array("tmp_name" => $tmp, "name" => urlencode(basename($file)), "type" => "image/jpg");
5757
//var_dump($fData);
5858
$node = new AJXP_Node($destStreamURL.$file);
59+
$this->logInfo('Preview', 'Sending content of '.$file.' to Pixlr server.');
5960
AJXP_Controller::applyHook("node.read", array($node));
6061

6162

@@ -86,6 +87,7 @@ public function switchAction($action, $httpVars, $filesVars)
8687
$file = AJXP_Utils::decodeSecureMagic($httpVars["original_file"]);
8788
$node = new AJXP_Node($destStreamURL.$file);
8889
$node->loadNodeInfo();
90+
$this->logInfo('Edit', 'Retrieving content of '.$file.' from Pixlr server.');
8991
AJXP_Controller::applyHook("node.before_change", array(&$node));
9092
$url = $httpVars["new_url"];
9193
$urlParts = parse_url($url);

core/src/plugins/editor.video/class.VideoReader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ public function switchAction($action, $httpVars, $filesVars)
6767
$ranges = explode('=', $_SERVER['HTTP_RANGE']);
6868
$offsets = explode('-', $ranges[1]);
6969
$offset = floatval($offsets[0]);
70+
if($offset == 0){
71+
$this->logInfo('Preview', 'Streaming content of '.$file);
72+
}
7073

7174
$length = floatval($offsets[1]) - $offset;
7275
if (!$length) $length = $filesize - $offset;
@@ -96,6 +99,7 @@ public function switchAction($action, $httpVars, $filesVars)
9699
}
97100
fclose($file);
98101
} else {
102+
$this->logInfo('Preview', 'Streaming content of '.$file);
99103
$fp = fopen($filename, "rb");
100104
header("Content-Length: ".$filesize);
101105
header("Content-Range: bytes 0-" . ($filesize - 1) . "/" . $filesize. ";");

core/src/plugins/editor.zoho/class.ZohoEditor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ public function switchAction($action, $httpVars, $filesVars)
124124

125125
$node = new AJXP_Node($destStreamURL.$file);
126126
AJXP_Controller::applyHook("node.read", array($node));
127+
$this->logInfo('Preview', 'Posting content of '.$file.' to Zoho server');
127128

128129
$extension = strtolower(pathinfo(urlencode(basename($file)), PATHINFO_EXTENSION));
129130
$httpClient = new http_class();
@@ -219,6 +220,7 @@ public function switchAction($action, $httpVars, $filesVars)
219220
echo "MODIFIED";
220221
}
221222
}
223+
$this->logInfo('Edit', 'Retrieved content of '.$node->getUrl());
222224
AJXP_Controller::applyHook("node.change", array(null, &$node));
223225
}
224226

0 commit comments

Comments
 (0)