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

Commit

Permalink
Rename AJXP_Meta.. and AJXP_Scheme without AJXP_
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Jun 24, 2016
1 parent 0eceb18 commit 355e7e7
Show file tree
Hide file tree
Showing 26 changed files with 112 additions and 119 deletions.
Expand Up @@ -20,7 +20,7 @@
*/
namespace Pydio\Core\Http\Response;

use Pydio\Access\Core\AJXP_MetaStreamWrapper;
use Pydio\Access\Core\MetaStreamWrapper;
use Pydio\Access\Core\Model\AJXP_Node;
use Pydio\Access\Driver\StreamProvider\FS\FsAccessWrapper;
use Pydio\Core\Controller\HTMLWriter;
Expand Down Expand Up @@ -391,7 +391,7 @@ public function readFile($node = null, $filePath = null, $data = null, $headerTy
fclose($fp);
} else {

AJXP_MetaStreamWrapper::copyFileInStream($filePathOrData, $stream);
MetaStreamWrapper::copyFileInStream($filePathOrData, $stream);

}
fflush($stream);
Expand Down
4 changes: 2 additions & 2 deletions core/src/core/src/pydio/Core/PluginFramework/Plugin.php
Expand Up @@ -20,7 +20,7 @@
*/
namespace Pydio\Core\PluginFramework;

use Pydio\Access\Core\AJXP_MetaStreamWrapper;
use Pydio\Access\Core\MetaStreamWrapper;
use Pydio\Core\Model\Context;
use Pydio\Core\Model\ContextInterface;

Expand Down Expand Up @@ -949,7 +949,7 @@ public function detectStreamWrapper($register = false, ContextInterface $ctx = n
stream_wrapper_register($streamData["protocol"], $streamData["classname"]);
$pServ->registerWrapperClass($streamData["protocol"], $streamData["classname"]);
}
AJXP_MetaStreamWrapper::register($wrappers);
MetaStreamWrapper::register($wrappers);
}
return $streamData;
}
Expand Down
32 changes: 16 additions & 16 deletions core/src/plugins/access.fs/FsAccessDriver.php
Expand Up @@ -29,7 +29,7 @@
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\UploadedFileInterface;
use Pydio\Access\Core\AbstractAccessDriver;
use Pydio\Access\Core\AJXP_MetaStreamWrapper;
use Pydio\Access\Core\MetaStreamWrapper;
use Pydio\Access\Core\Model\AJXP_Node;
use Pydio\Access\Core\IAjxpWrapperProvider;
use Pydio\Access\Core\Model\NodesDiff;
Expand Down Expand Up @@ -389,7 +389,7 @@ public function uploadAction(ServerRequestInterface &$request, ResponseInterface
$dir = Utils::sanitize($httpVars["dir"], AJXP_SANITIZE_DIRNAME) OR "";
/** @var ContextInterface $ctx */
$ctx = $request->getAttribute("ctx");
if (AJXP_MetaStreamWrapper::actualRepositoryWrapperClass(new AJXP_Node($ctx->getUrlBase())) === "Pydio\\Access\\Driver\\StreamProvider\\FS\\FsAccessWrapper") {
if (MetaStreamWrapper::actualRepositoryWrapperClass(new AJXP_Node($ctx->getUrlBase())) === "Pydio\\Access\\Driver\\StreamProvider\\FS\\FsAccessWrapper") {
$dir = FsAccessWrapper::patchPathForBaseDir($dir);
}
$dir = Utils::securePath($dir);
Expand Down Expand Up @@ -647,7 +647,7 @@ public function downloadAction(ServerRequestInterface &$request, ResponseInterfa
$sessionKey = "chunk_file_".md5($fileId.time());
$totalSize = filesize($fileId);
$chunkSize = intval ( $totalSize / $chunkCount );
$realFile = AJXP_MetaStreamWrapper::getRealFSReference($fileId, true);
$realFile = MetaStreamWrapper::getRealFSReference($fileId, true);
$chunkData = [
"localname" => basename($fileId),
"chunk_count" => $chunkCount,
Expand Down Expand Up @@ -1144,7 +1144,7 @@ public function switchAction(ServerRequestInterface &$request, ResponseInterface
$dir = Utils::sanitize($httpVars["dir"], AJXP_SANITIZE_DIRNAME) OR "";
}
$patch = false;
if (AJXP_MetaStreamWrapper::actualRepositoryWrapperClass(new AJXP_Node($selection->currentBaseUrl())) === "Pydio\\Access\\Driver\\StreamProvider\\FS\\FsAccessWrapper") {
if (MetaStreamWrapper::actualRepositoryWrapperClass(new AJXP_Node($selection->currentBaseUrl())) === "Pydio\\Access\\Driver\\StreamProvider\\FS\\FsAccessWrapper") {
$dir = FsAccessWrapper::patchPathForBaseDir($dir);
$patch = true;
}
Expand Down Expand Up @@ -1250,7 +1250,7 @@ public function switchAction(ServerRequestInterface &$request, ResponseInterface
$parentAjxpNode->loadNodeInfo(false, true, ($lsOptions["l"]?"all":"minimal"));
Controller::applyHook("node.read", [&$parentAjxpNode]);

$streamIsSeekable = AJXP_MetaStreamWrapper::wrapperIsSeekable($path);
$streamIsSeekable = MetaStreamWrapper::wrapperIsSeekable($path);

$sharedHandle = null; $handle = null;
if($streamIsSeekable){
Expand Down Expand Up @@ -1628,7 +1628,7 @@ protected function copyUploadedData($uploadData, $destination, $messages){
if(is_array($uploadData)){
$result = @move_uploaded_file($uploadData["tmp_name"], $destination);
if (!$result) {
$realPath = AJXP_MetaStreamWrapper::getRealFSReference($destination);
$realPath = MetaStreamWrapper::getRealFSReference($destination);
$result = move_uploaded_file($uploadData["tmp_name"], $realPath);
}
}else{
Expand All @@ -1639,7 +1639,7 @@ protected function copyUploadedData($uploadData, $destination, $messages){
}catch(\Exception $e){
// Can be blocked by open_basedir, try to perform the move again, with the
// real FS reference.
$realPath = AJXP_MetaStreamWrapper::getRealFSReference($destination);
$realPath = MetaStreamWrapper::getRealFSReference($destination);
try{
$clone->moveTo($realPath);
$result = true;
Expand Down Expand Up @@ -1752,7 +1752,7 @@ public function date_modif($file)
public function extractArchiveItemPreCallback($crtUrlBase, $status, $data, $taskId = null){
$fullname = $data['filename'];
$size = $data['size'];
$realBase = AJXP_MetaStreamWrapper::getRealFSReference($crtUrlBase);
$realBase = MetaStreamWrapper::getRealFSReference($crtUrlBase);
$realBase = str_replace("\\", "/", $realBase);
$repoName = $crtUrlBase.str_replace($realBase, "", $fullname);

Expand All @@ -1777,7 +1777,7 @@ public function extractArchiveItemPreCallback($crtUrlBase, $status, $data, $task
*/
public function extractArchiveItemPostCallback($crtUrlBase, $status, $data, $taskId = null){
$fullname = $data['filename'];
$realBase = AJXP_MetaStreamWrapper::getRealFSReference($crtUrlBase);
$realBase = MetaStreamWrapper::getRealFSReference($crtUrlBase);
$repoName = str_replace($realBase, "", $fullname);
if($taskId !== null){
TaskService::getInstance()->updateTaskStatus($taskId, Task::STATUS_RUNNING, "Extracted file ".$repoName);
Expand Down Expand Up @@ -1806,7 +1806,7 @@ public function extractArchive($destDir, $selection, &$error, &$success, $taskId
$files = $selection->getFiles();
$currentUrlBase = $selection->currentBaseUrl();

$realZipFile = AJXP_MetaStreamWrapper::getRealFSReference($currentUrlBase.$zipPath);
$realZipFile = MetaStreamWrapper::getRealFSReference($currentUrlBase.$zipPath);
$archive = new PclZip($realZipFile);
$content = $archive->listContent();
foreach ($files as $key => $item) {// Remove path
Expand All @@ -1822,7 +1822,7 @@ public function extractArchive($destDir, $selection, &$error, &$success, $taskId
}
}
$this->logDebug("Archive", $this->addSlugToPath($files));
$realDestination = AJXP_MetaStreamWrapper::getRealFSReference($currentUrlBase.$destDir);
$realDestination = MetaStreamWrapper::getRealFSReference($currentUrlBase.$destDir);
$this->logDebug("Extract", [$realDestination, $realZipFile, $this->addSlugToPath($files), $zipLocalPath]);

$result = $archive->extract(PCLZIP_OPT_BY_NAME, $files,
Expand Down Expand Up @@ -2120,12 +2120,12 @@ public function chmod(AJXP_Node $node, $chmodValue, $recursive, $nodeType, &$cha
$nodeUrl = $node->getUrl();
if (is_file($nodeUrl)) {
if ($nodeType=="both" || $nodeType=="file") {
AJXP_MetaStreamWrapper::changeMode($nodeUrl, $realValue);
MetaStreamWrapper::changeMode($nodeUrl, $realValue);
$changedFiles[] = $node->getPath();
}
} else {
if ($nodeType=="both" || $nodeType=="dir") {
AJXP_MetaStreamWrapper::changeMode($nodeUrl, $realValue);
MetaStreamWrapper::changeMode($nodeUrl, $realValue);
$changedFiles[] = $node->getPath();
}
if ($recursive) {
Expand Down Expand Up @@ -2217,7 +2217,7 @@ public function makeZip (UserSelection $selection, $dest, $basedir, $taskId = nu
if($basedir == "__AJXP_ZIP_FLAT__/"){
$vList = $archive->create($filePaths, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_NO_COMPRESSION, PCLZIP_OPT_ADD_TEMP_FILE_ON, PCLZIP_CB_PRE_ADD, $preAddCallback);
}else{
$basedir = AJXP_MetaStreamWrapper::getRealFSReference($selection->currentBaseUrl()).trim($basedir);
$basedir = MetaStreamWrapper::getRealFSReference($selection->currentBaseUrl()).trim($basedir);
$this->logDebug("Basedir", [$basedir]);
$vList = $archive->create($filePaths, PCLZIP_OPT_REMOVE_PATH, $basedir, PCLZIP_OPT_NO_COMPRESSION, PCLZIP_OPT_ADD_TEMP_FILE_ON, PCLZIP_CB_PRE_ADD, $preAddCallback);
}
Expand Down Expand Up @@ -2275,8 +2275,8 @@ public function recursivePurge($dirName, $hardPurgeTime, $softPurgeTime = 0)
* @param \Pydio\Access\Core\Model\AJXP_Node $node
*/
public function setHiddenAttribute($node){
if(AJXP_MetaStreamWrapper::actualRepositoryWrapperClass($node) === "Pydio\\Access\\Driver\\StreamProvider\\FS\\FsAccessWrapper" && strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'){
$realPath = AJXP_MetaStreamWrapper::getRealFSReference($node->getUrl());
if(MetaStreamWrapper::actualRepositoryWrapperClass($node) === "Pydio\\Access\\Driver\\StreamProvider\\FS\\FsAccessWrapper" && strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'){
$realPath = MetaStreamWrapper::getRealFSReference($node->getUrl());
@shell_exec("attrib +H " . escapeshellarg($realPath));
}
}
Expand Down
14 changes: 5 additions & 9 deletions core/src/plugins/access.inbox/InboxAccessWrapper.php
Expand Up @@ -21,7 +21,7 @@
namespace Pydio\Access\Driver\StreamProvider\Inbox;

use ArrayIterator;
use Pydio\Access\Core\AJXP_MetaStreamWrapper;
use Pydio\Access\Core\MetaStreamWrapper;
use Pydio\Access\Core\Model\AJXP_Node;
use Pydio\Access\Core\IAjxpWrapper;

Expand Down Expand Up @@ -156,7 +156,7 @@ public static function translateURL($path){
}catch (\Exception $e){

}
AJXP_MetaStreamWrapper::detectWrapperForNode($node, true);
MetaStreamWrapper::detectWrapperForNode($node, true);
}
return $url;
}
Expand All @@ -172,8 +172,8 @@ public static function getRealFSReference($path, $persistent = false)
{
$url = self::translateURL($path);
if(self::$linkNode !== null){
$isRemote = AJXP_MetaStreamWrapper::wrapperIsRemote($url);
$realFilePointer = AJXP_MetaStreamWrapper::getRealFSReference($url, true);
$isRemote = MetaStreamWrapper::wrapperIsRemote($url);
$realFilePointer = MetaStreamWrapper::getRealFSReference($url, true);
if(!$isRemote){
$ext = pathinfo(parse_url($url, PHP_URL_PATH), PATHINFO_EXTENSION);
$tmpname = tempnam(Utils::getAjxpTmpDir(), "real-file-inbox-pointer").".".$ext;
Expand Down Expand Up @@ -201,11 +201,7 @@ public static function getRealFSReference($path, $persistent = false)
public static function copyFileInStream($path, $stream)
{
$url = self::translateURL($path);
AJXP_MetaStreamWrapper::copyFileInStream($url, $stream);
/*
$wrapperClass = AJXP_MetaStreamWrapper::actualRepositoryWrapperClass(parse_url($url, PHP_URL_HOST));
call_user_func(array($wrapperClass, "copyFileInStream"), $url, $stream);
*/
MetaStreamWrapper::copyFileInStream($url, $stream);
if(self::$linkNode !== null){
self::$linkNode->getDriver();
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/plugins/access.sftp/SFTPAccessDriver.php
Expand Up @@ -23,7 +23,7 @@

use DOMNode;
use PclZip;
use Pydio\Access\Core\AJXP_MetaStreamWrapper;
use Pydio\Access\Core\MetaStreamWrapper;
use Pydio\Access\Core\Model\AJXP_Node;
use Pydio\Access\Core\Model\UserSelection;
use Pydio\Access\Core\RecycleBinManager;
Expand Down Expand Up @@ -101,7 +101,7 @@ protected function parseSpecificContributions(ContextInterface $ctx, \DOMNode &$

protected function filecopy($srcFile, $destFile)
{
if (AJXP_MetaStreamWrapper::nodesUseSameWrappers($srcFile, $destFile)) {
if (MetaStreamWrapper::nodesUseSameWrappers($srcFile, $destFile)) {
$srcFilePath = Utils::safeParseUrl($srcFile)["path"];
$destFilePath = Utils::safeParseUrl($destFile)["path"];
$destDirPath = dirname($destFilePath);
Expand Down
12 changes: 6 additions & 6 deletions core/src/plugins/action.compression/PluginCompression.php
Expand Up @@ -24,7 +24,7 @@
use Exception;
use Phar;
use PharData;
use Pydio\Access\Core\AJXP_MetaStreamWrapper;
use Pydio\Access\Core\MetaStreamWrapper;
use Pydio\Access\Core\Model\AJXP_Node;
use Pydio\Access\Core\Model\UserSelection;

Expand Down Expand Up @@ -150,7 +150,7 @@ public function receiveAction(\Psr\Http\Message\ServerRequestInterface &$request
$tabAllFiles = array_combine($tabAllRecursiveFiles, $tabFilesNames);
foreach ($tabAllFiles as $fullPath => $fileName) {
try {
$archive->addFile(AJXP_MetaStreamWrapper::getRealFSReference($fullPath), $fileName);
$archive->addFile(MetaStreamWrapper::getRealFSReference($fullPath), $fileName);
$counterCompression++;
$percent = round(($counterCompression / count($tabAllFiles)) * 100, 0, PHP_ROUND_HALF_DOWN);
$postMessageStatus(sprintf($messages["compression.6"], $percent . " %"), Task::STATUS_RUNNING, $percent);
Expand Down Expand Up @@ -194,7 +194,7 @@ public function receiveAction(\Psr\Http\Message\ServerRequestInterface &$request
$extensionLength = 0;
$counterExtract = 0;
$currentAllPydioPath = $currentDirUrl . $fileArchive;
$pharCurrentAllPydioPath = "phar://" . AJXP_MetaStreamWrapper::getRealFSReference($currentAllPydioPath);
$pharCurrentAllPydioPath = "phar://" . MetaStreamWrapper::getRealFSReference($currentAllPydioPath);
$pathInfoCurrentAllPydioPath = pathinfo($currentAllPydioPath, PATHINFO_EXTENSION);
//WE TAKE ONLY TAR, TAR.GZ AND TAR.BZ2 ARCHIVES
foreach ($authorizedExtension as $extension => $strlenExtension) {
Expand Down Expand Up @@ -235,9 +235,9 @@ public function receiveAction(\Psr\Http\Message\ServerRequestInterface &$request
};

mkdir($currentDirUrl . $onlyFileName, 0777, true);
chmod(AJXP_MetaStreamWrapper::getRealFSReference($currentDirUrl . $onlyFileName), 0777);
chmod(MetaStreamWrapper::getRealFSReference($currentDirUrl . $onlyFileName), 0777);
try {
$archive = new PharData(AJXP_MetaStreamWrapper::getRealFSReference($currentAllPydioPath));
$archive = new PharData(MetaStreamWrapper::getRealFSReference($currentAllPydioPath));
$fichiersArchive = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($pharCurrentAllPydioPath));
foreach ($fichiersArchive as $file) {
$fileGetPathName = $file->getPathname();
Expand All @@ -246,7 +246,7 @@ public function receiveAction(\Psr\Http\Message\ServerRequestInterface &$request
}
$fileNameInArchive = substr(strstr($fileGetPathName, $fileArchive), strlen($fileArchive) + 1);
try {
$archive->extractTo(AJXP_MetaStreamWrapper::getRealFSReference($currentDirUrl . $onlyFileName), $fileNameInArchive, false);
$archive->extractTo(MetaStreamWrapper::getRealFSReference($currentDirUrl . $onlyFileName), $fileNameInArchive, false);
} catch (Exception $e) {
$postMessageStatus($e->getMessage(), Task::STATUS_FAILED);
throw new PydioException($e);
Expand Down
4 changes: 2 additions & 2 deletions core/src/plugins/action.timestamp/TimestampCreator.php
Expand Up @@ -7,7 +7,7 @@

namespace Pydio\Action\Timestamp;

use Pydio\Access\Core\AJXP_MetaStreamWrapper;
use Pydio\Access\Core\MetaStreamWrapper;
use Pydio\Access\Core\Model\UserSelection;

use Pydio\Core\Exception\PydioException;
Expand Down Expand Up @@ -58,7 +58,7 @@ public function switchAction(\Psr\Http\Message\ServerRequestInterface $requestIn

$fileName = $selection->getUniqueFile();
$fileUrl = $destStreamURL . $fileName;
$file = AJXP_MetaStreamWrapper::getRealFSReference($fileUrl, true);
$file = MetaStreamWrapper::getRealFSReference($fileUrl, true);

//Hash the file, to send it to Universign
$hashedDataToTimestamp = hash_file('sha256', $file);
Expand Down
16 changes: 8 additions & 8 deletions core/src/plugins/core.access/src/AbstractAccessDriver.php
Expand Up @@ -163,12 +163,12 @@ public function crossRepositoryCopy(ServerRequestInterface &$requestInterface, R
$repositoryId = $this->repository->getId();
$origStreamURL = "pydio://$crtUser@$repositoryId";
$origNode = new AJXP_Node($origStreamURL);
AJXP_MetaStreamWrapper::detectWrapperForNode($origNode, true);
MetaStreamWrapper::detectWrapperForNode($origNode, true);

$destRepoId = $httpVars["dest_repository_id"];
$destStreamURL = "pydio://$crtUser@$destRepoId";
$destNode = new AJXP_Node($destStreamURL);
AJXP_MetaStreamWrapper::detectWrapperForNode($destNode, true);
MetaStreamWrapper::detectWrapperForNode($destNode, true);

// Check rights
if (UsersService::usersEnabled()) {
Expand Down Expand Up @@ -310,7 +310,7 @@ protected function copyOrMoveFile($destFile, $srcFile, &$error, &$success, $move
if ($move) {
Controller::applyHook("node.before_path_change", array($srcNode));
if(file_exists($destFile)) unlink($destFile);
if(AJXP_MetaStreamWrapper::nodesUseSameWrappers($realSrcFile, $destFile)){
if(MetaStreamWrapper::nodesUseSameWrappers($realSrcFile, $destFile)){
rename($realSrcFile, $destFile);
}else{
copy($realSrcFile, $destFile);
Expand Down Expand Up @@ -365,9 +365,9 @@ protected function copyOrMoveFile($destFile, $srcFile, &$error, &$success, $move
*/
protected function filecopy($srcFile, $destFile)
{
if (!AJXP_MetaStreamWrapper::nodesUseSameWrappers($srcFile, $destFile)
|| AJXP_MetaStreamWrapper::wrapperIsRemote($srcFile)
|| AJXP_MetaStreamWrapper::wrapperIsRemote($destFile)) {
if (!MetaStreamWrapper::nodesUseSameWrappers($srcFile, $destFile)
|| MetaStreamWrapper::wrapperIsRemote($srcFile)
|| MetaStreamWrapper::wrapperIsRemote($destFile)) {
$src = fopen($srcFile, "r");
$dest = fopen($destFile, "w");
if (is_resource($src) && is_resource($dest)) {
Expand Down Expand Up @@ -423,7 +423,7 @@ protected function dircopy($srcdir, $dstdir, &$errors, &$success, $verbose = fal
if(is_file($dstfile)) $ow = filemtime($srcfile) - filemtime($dstfile); else $ow = 1;
if ($ow > 0) {
try {
if($convertSrcFile) $tmpPath = AJXP_MetaStreamWrapper::getRealFSReference($srcfile);
if($convertSrcFile) $tmpPath = MetaStreamWrapper::getRealFSReference($srcfile);
else $tmpPath = $srcfile;
if($verbose) echo "Copying '$tmpPath' to '$dstfile'...";
if(!empty($taskId)){
Expand Down Expand Up @@ -465,7 +465,7 @@ protected function changeMode($filePath, $repoData)
$chmodValue = $repoData["chmod"];
if (isSet($chmodValue) && $chmodValue != "") {
$chmodValue = octdec(ltrim($chmodValue, "0"));
AJXP_MetaStreamWrapper::changeMode($filePath, $chmodValue);
MetaStreamWrapper::changeMode($filePath, $chmodValue);
}
}

Expand Down

0 comments on commit 355e7e7

Please sign in to comment.