Navigation Menu

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

Commit

Permalink
modify log function
Browse files Browse the repository at this point in the history
  • Loading branch information
c12simple committed Oct 17, 2014
1 parent b8fd0cb commit cf0a30a
Showing 1 changed file with 8 additions and 8 deletions.
Expand Up @@ -68,7 +68,7 @@ public function preProcess($action, &$httpVars, &$fileVars)

/* if fileId is not set, request for cross-session resume (only if the protocol is not ftp)*/
if (!isSet($httpVars["fileId"])) {
AJXP_LOGGER::debug("Trying Cross-Session Resume request");
$this->logDebug("Trying Cross-Session Resume request");

$plugin = AJXP_PluginsService::findPlugin("access", $repository->getAccessType());
$streamData = $plugin->detectStreamWrapper(true);
Expand All @@ -89,15 +89,15 @@ public function preProcess($action, &$httpVars, &$fileVars)
$resumeFileId = $explodedSubPathName[1];
$resumeIndexes[] = $explodedSubPathName[2];

AJXP_LOGGER :: debug("Current Index: " . $explodedSubPathName[2]);
$this->logDebug("Current Index: " . $explodedSubPathName[2]);
}
}
$it->next();
}

/* no valid temp file found. return. */
if (empty ($resumeIndexes)){
AJXP_LOGGER::debug("No Cross-Session Resume request");
$this->logDebug("No Cross-Session Resume request");
return;
}

Expand All @@ -107,7 +107,7 @@ public function preProcess($action, &$httpVars, &$fileVars)
AJXP_LOGGER :: debug("Next Resume Index: " . $nextResumeIndex);

if (isSet($resumeFileId)) {
AJXP_LOGGER::debug("ResumeFileId is set. Returning values: fileId: " . $resumeFileId . ", partitionIndex: " . $nextResumeIndex);
$this->logDebug("ResumeFileId is set. Returning values: fileId: " . $resumeFileId . ", partitionIndex: " . $nextResumeIndex);
$httpVars["resumeFileId"] = $resumeFileId;
$httpVars["resumePartitionIndex"] = $nextResumeIndex;
}
Expand All @@ -117,14 +117,14 @@ public function preProcess($action, &$httpVars, &$fileVars)

/* if the file has to be partitioned */
if (isSet($httpVars["partitionCount"]) && intval($httpVars["partitionCount"]) > 1) {
AJXP_LOGGER::debug("Partitioned upload");
$this->logDebug("Partitioned upload");
$fileId = $httpVars["fileId"];
$fileHash = md5($realName);

/* In order to enable cross-session resume, temp files must not depend on session.
* Now named after and md5() of the original file name.
*/
AJXP_LOGGER::debug("Filename: " . $realName . ", File hash: " . $fileHash);
$this->logDebug("Filename: " . $realName . ", File hash: " . $fileHash);
$fileVars["userfile_0"]["name"] = "$fileHash.$fileId.$index";
$httpVars["lastPartition"] = false;
}else{
Expand Down Expand Up @@ -216,7 +216,7 @@ public function postProcess($action, $httpVars, $postProcessData)
$destStreamURL = $streamData["protocol"]."://".$repository->getId().$dir."/";

/* we check if the current file has a relative path (aka we want to upload an entire directory) */
AJXP_LOGGER::debug("Now dispatching relativePath dest:", $httpVars["relativePath"]);
$this->logDebug("Now dispatching relativePath dest:", $httpVars["relativePath"]);
$subs = explode("/", $httpVars["relativePath"]);
$userfile_name = array_pop($subs);

Expand Down Expand Up @@ -345,7 +345,7 @@ public function postProcess($action, $httpVars, $postProcessData)
$this->logDebug("Should now rebuild file!", $httpVars);
// Now move the final file to the right folder
// Currently the file is at the base of the current
AJXP_LOGGER::debug("PartitionRealName", $destStreamURL.$httpVars["partitionRealName"]);
$this->logDebug("PartitionRealName", $destStreamURL.$httpVars["partitionRealName"]);

// Get file by name (md5 value)
$relPath_md5 = AJXP_Utils::decodeSecureMagic(md5($httpVars["relativePath"]));
Expand Down

0 comments on commit cf0a30a

Please sign in to comment.