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

Commit 350f6a3

Browse files
committed
Rename getAjxpTmpDir to getTemporaryFolder
1 parent 02fd5c8 commit 350f6a3

File tree

24 files changed

+40
-40
lines changed

24 files changed

+40
-40
lines changed

core/src/core/src/lib/pclzip.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
// define( 'PCLZIP_TEMPORARY_DIR', '/temp/' );
6767
// define( 'PCLZIP_TEMPORARY_DIR', 'C:/Temp/' );
6868
if (!defined('PCLZIP_TEMPORARY_DIR')) {
69-
define( 'PCLZIP_TEMPORARY_DIR', ApplicationState::getAjxpTmpDir() .DIRECTORY_SEPARATOR );
69+
define( 'PCLZIP_TEMPORARY_DIR', ApplicationState::getTemporaryFolder() .DIRECTORY_SEPARATOR );
7070
}
7171

7272
// ----- Optional threshold ratio for use of temporary files

core/src/core/src/pydio/Core/Services/ApplicationState.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public static function getWorkspaceShortcutURL($repository)
230230
* @static
231231
* @return mixed|null|string
232232
*/
233-
public static function getAjxpTmpDir()
233+
public static function getTemporaryFolder()
234234
{
235235
$conf = ConfService::getGlobalConf("AJXP_TMP_DIR");
236236
if (!empty($conf)) {

core/src/core/src/pydio/Core/Utils/Http/BruteForceHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class BruteForceHelper
4141
*/
4242
public static function getBruteForceLoginArray()
4343
{
44-
$failedLog = ApplicationState::getAjxpTmpDir() . "/failedAJXP.log";
44+
$failedLog = ApplicationState::getTemporaryFolder() . "/failedAJXP.log";
4545
$loginAttempt = @file_get_contents($failedLog);
4646
$loginArray = unserialize($loginAttempt);
4747
$ret = array();
@@ -66,7 +66,7 @@ public static function setBruteForceLoginArray($loginArray, $validCurrent = fals
6666
if($validCurrent && isSet($loginArray[$_SERVER["REMOTE_ADDR"]])){
6767
unset($loginArray[$_SERVER["REMOTE_ADDR"]]);
6868
}
69-
$failedLog = ApplicationState::getAjxpTmpDir() . "/failedAJXP.log";
69+
$failedLog = ApplicationState::getTemporaryFolder() . "/failedAJXP.log";
7070
@file_put_contents($failedLog, serialize($loginArray));
7171
}
7272

core/src/core/src/pydio/Core/Utils/Vars/OptionsHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static function filterFormElementsFromMeta(ContextInterface $ctx, $metada
7575
}
7676
$value = "";
7777
} else {
78-
$file = ApplicationState::getAjxpTmpDir() . "/" . $value;
78+
$file = ApplicationState::getTemporaryFolder() . "/" . $value;
7979
if (file_exists($file)) {
8080
$id = !empty($level["original_binary"]) ? $level["original_binary"] : null;
8181
$id = ConfService::getConfStorageImpl()->saveBinary($binariesContext, $file, $id);
@@ -137,7 +137,7 @@ public static function parseStandardFormParameters(ContextInterface $ctx, &$repD
137137
}
138138
$value = "";
139139
} else {
140-
$file = ApplicationState::getAjxpTmpDir() . "/" . $value;
140+
$file = ApplicationState::getTemporaryFolder() . "/" . $value;
141141
if (file_exists($file)) {
142142
$id = !empty($repDef[$key . "_original_binary"]) ? $repDef[$key . "_original_binary"] : null;
143143
$id = ConfService::getConfStorageImpl()->saveBinary($binariesContext, $file, $id);

core/src/plugins/access.fs/FsAccessDriver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ public function downloadAction(ServerRequestInterface &$request, ResponseInterfa
656656
if ($zip) {
657657
// Make a temp zip and send it as download
658658
$loggedUser = $ctx->getUser();
659-
$file = ApplicationState::getAjxpTmpDir() ."/".($loggedUser?$loggedUser->getId():"shared")."_".time()."tmpDownload.zip";
659+
$file = ApplicationState::getTemporaryFolder() ."/".($loggedUser?$loggedUser->getId():"shared")."_".time()."tmpDownload.zip";
660660
$zipFile = $this->makeZip($selection, $file, empty($dir)?"/":$dir);
661661
if(!$zipFile) throw new PydioException("Error while compressing");
662662
$localName = (empty($base)?"Files":$base).".zip";
@@ -804,7 +804,7 @@ public function switchAction(ServerRequestInterface &$request, ResponseInterface
804804
} else {
805805
$localName = (basename($dir)==""?"Files":basename($dir)).".zip";
806806
}
807-
$file = ApplicationState::getAjxpTmpDir() ."/".($loggedUser?$loggedUser->getId():"shared")."_".time()."tmpCompression.zip";
807+
$file = ApplicationState::getTemporaryFolder() ."/".($loggedUser?$loggedUser->getId():"shared")."_".time()."tmpCompression.zip";
808808
if(isSet($httpVars["compress_flat"])) $baseDir = "__AJXP_ZIP_FLAT__/";
809809
else $baseDir = $dir;
810810
$zipFile = $this->makeZip($selection, $file, $baseDir, $taskId);

core/src/plugins/access.fs/FsAccessWrapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ protected static function initPath($path, $streamType, $storeOpenContext = false
113113
//print($streamType.$path);
114114
if ($streamType == "file") {
115115
if (self::$crtZip == null || !is_array(self::$currentListingKeys)) {
116-
$tmpDir = ApplicationState::getAjxpTmpDir() . DIRECTORY_SEPARATOR . md5(time()-rand());
116+
$tmpDir = ApplicationState::getTemporaryFolder() . DIRECTORY_SEPARATOR . md5(time()-rand());
117117
mkdir($tmpDir);
118118
$tmpFileName = $tmpDir.DIRECTORY_SEPARATOR.basename($localPath);
119119
Logger::debug(__CLASS__,__FUNCTION__,"Tmp file $tmpFileName");

core/src/plugins/access.ftp/FtpAccessWrapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class FtpAccessWrapper implements IAjxpWrapper
7979
*/
8080
public static function getRealFSReference($path, $persistent = false)
8181
{
82-
$tmpFile = ApplicationState::getAjxpTmpDir() ."/".md5(time());
82+
$tmpFile = ApplicationState::getTemporaryFolder() ."/".md5(time());
8383
$tmpHandle = fopen($tmpFile, "wb");
8484
self::copyFileInStream($path, $tmpHandle);
8585
fclose($tmpHandle);

core/src/plugins/access.inbox/InboxAccessDriver.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ public static function getNodeData($nodePath){
103103
$nodeObject = new AJXP_Node($nodePath);
104104
$basename = $nodeObject->getLabel();
105105
if($nodeObject->isRoot()){
106-
return ['stat' => stat(ApplicationState::getAjxpTmpDir())];
106+
return ['stat' => stat(ApplicationState::getTemporaryFolder())];
107107
}
108108
$allNodes = self::getNodes($nodeObject->getContext(), false);
109109
$nodeData = $allNodes[$basename];
110110
if(!isSet($nodeData["stat"])){
111111
if(in_array(pathinfo($basename, PATHINFO_EXTENSION), ["error", "invitation"])){
112-
$stat = stat(ApplicationState::getAjxpTmpDir());
112+
$stat = stat(ApplicationState::getTemporaryFolder());
113113
}else{
114114
$url = $nodeData["url"];
115115
$node = new AJXP_Node($url);
@@ -121,7 +121,7 @@ public static function getNodeData($nodePath){
121121
Controller::applyHook("node.read", [&$node]);
122122
$stat = stat($url);
123123
}catch (\Exception $e){
124-
$stat = stat(ApplicationState::getAjxpTmpDir());
124+
$stat = stat(ApplicationState::getTemporaryFolder());
125125
}
126126
if(is_array($stat) && $nodeObject->getContext()->hasUser()){
127127
$acl = $nodeObject->getContext()->getUser()->getMergedRole()->getAcl($nodeData["meta"]["shared_repository_id"]);
@@ -217,7 +217,7 @@ public static function getNodes(ContextInterface $parentContext, $checkStats = f
217217
$remoteShare = $ocsStore->remoteShareById($linkId);
218218
$status = $remoteShare->getStatus();
219219
if($status == OCS_INVITATION_STATUS_PENDING){
220-
$stat = stat(ApplicationState::getAjxpTmpDir());
220+
$stat = stat(ApplicationState::getTemporaryFolder());
221221
$ext = "invitation";
222222
$meta["ajxp_mime"] = "invitation";
223223
$meta["share_meta_type"] = 0;

core/src/plugins/access.inbox/InboxAccessWrapper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public static function translateURL($path){
136136
$node = $nodes[ltrim($nodePath, '/')];
137137

138138
if (empty($node) || ! isset($node['url'])) {
139-
return ApplicationState::getAjxpTmpDir();
139+
return ApplicationState::getTemporaryFolder();
140140
}
141141

142142
$url = $node['url'];
@@ -149,7 +149,7 @@ public static function translateURL($path){
149149
}
150150

151151
if(empty($nodePath)){
152-
return ApplicationState::getAjxpTmpDir();
152+
return ApplicationState::getTemporaryFolder();
153153
}
154154

155155
if($pydioScheme){
@@ -181,14 +181,14 @@ public static function getRealFSReference($path, $persistent = false)
181181
$realFilePointer = MetaStreamWrapper::getRealFSReference($url, true);
182182
if(!$isRemote){
183183
$ext = pathinfo(parse_url($url, PHP_URL_PATH), PATHINFO_EXTENSION);
184-
$tmpname = tempnam(ApplicationState::getAjxpTmpDir(), "real-file-inbox-pointer").".".$ext;
184+
$tmpname = tempnam(ApplicationState::getTemporaryFolder(), "real-file-inbox-pointer").".".$ext;
185185
copy($realFilePointer, $tmpname);
186186
$realFilePointer = $tmpname;
187187
}
188188
self::$linkNode->getDriver();
189189
return $realFilePointer;
190190
}else{
191-
$tmpname = tempnam(ApplicationState::getAjxpTmpDir(), "real-file-inbox-pointer");
191+
$tmpname = tempnam(ApplicationState::getTemporaryFolder(), "real-file-inbox-pointer");
192192
$source = fopen($url, "r");
193193
$dest = fopen($tmpname, "w");
194194
stream_copy_to_stream($source, $dest);

core/src/plugins/access.s3/S3AccessWrapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ public static function removeTmpFile($tmpDir, $tmpFile)
277277
*/
278278
public static function getRealFSReference($path, $persistent = false)
279279
{
280-
$tmpFile = ApplicationState::getAjxpTmpDir() . "/" . md5(time()) . "." . pathinfo($path, PATHINFO_EXTENSION);
280+
$tmpFile = ApplicationState::getTemporaryFolder() . "/" . md5(time()) . "." . pathinfo($path, PATHINFO_EXTENSION);
281281
$tmpHandle = fopen($tmpFile, "wb");
282282
self::copyFileInStream($path, $tmpHandle);
283283
fclose($tmpHandle);

0 commit comments

Comments
 (0)