Linux anchor 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
Apache/2.4.18 (Ubuntu)
Server IP : 10.10.100.4 & Your IP : 216.73.216.195
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
owncloud-prm /
lib /
private /
Files /
Storage /
Delete
Unzip
Name
Size
Permission
Date
Action
PolyFill
[ DIR ]
drwxr-xr-x
2018-04-19 18:15
Wrapper
[ DIR ]
drwxr-xr-x
2018-04-19 18:15
CacheableFlysystem.php
4.35
KB
-rw-r--r--
2018-04-19 18:15
Common.php
18.16
KB
-rw-r--r--
2018-04-19 18:15
CommonTest.php
2.43
KB
-rw-r--r--
2018-04-19 18:15
DAV.php
24.04
KB
-rw-r--r--
2018-04-19 18:15
FailedStorage.php
7.22
KB
-rw-r--r--
2018-04-19 18:15
Flysystem.php
5.63
KB
-rw-r--r--
2018-04-19 18:15
Home.php
2.64
KB
-rw-r--r--
2018-04-19 18:15
Local.php
12.6
KB
-rw-r--r--
2018-04-19 18:15
LocalTempFileTrait.php
2.25
KB
-rw-r--r--
2018-04-19 18:15
Storage.php
3.58
KB
-rw-r--r--
2018-04-19 18:15
StorageFactory.php
3.54
KB
-rw-r--r--
2018-04-19 18:15
Temporary.php
1.45
KB
-rw-r--r--
2018-04-19 18:15
Save
Rename
<?php /** * @author Hemant Mann <hemant.mann121@gmail.com> * * @copyright Copyright (c) 2018, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License, version 3, * along with this program. If not, see <http://www.gnu.org/licenses/> * */ namespace OC\Files\Storage; use League\Flysystem\FileNotFoundException; use Icewind\Streams\IteratorDirectory; /** * Generic Cacheable adapter between flysystem adapters and owncloud's storage system * * To use: subclass and call $this->buildFlysystem with the flysystem adapter of choice */ abstract class CacheableFlysystem extends \OCP\Files\Storage\FlysystemStorageAdapter { /** * Stores the results in cache for the current request to prevent multiple requests to the API * * @var array */ protected $cacheContents = []; /** * Get the location which will be used as a key in cache * If Storage is not case sensitive then convert the key to lowercase * * @param string $path Path to file/folder * @return string */ public function getCacheLocation($path) { $location = $this->buildPath($path); if ($location === '') { $location = '/'; } return $location; } public function buildPath($path) { $location = parent::buildPath($path); if ($this->isCaseInsensitiveStorage) { $location = strtolower($location); } return $location; } /** * Check if Cache Contains the data for given path, if not then get the data * from flysystem and store it in cache for this request lifetime * * @param string $path Path to file/folder * @param boolean $overRideCache Whether to fetch the contents from Cache or directly from the API * @return array|boolean */ public function getFlysystemMetadata($path, $overRideCache = false) { $location = $this->getCacheLocation($path); if (!isset($this->cacheContents[$location]) || $overRideCache) { try { $this->cacheContents[$location] = $this->flysystem->getMetadata($location); } catch (FileNotFoundException $e) { // do not store this info in cache as it might interfere with Upload process return false; } } return $this->cacheContents[$location]; } /** * Store the list of files/folders in the cache so that subsequent requests in the * same request life cycle does not call the flysystem API * * @param array $contents Return value of $this->flysystem->listContents */ public function updateCache($contents) { foreach ($contents as $object) { $path = $object['path']; $this->cacheContents[$path] = $object; } } /** * {@inheritdoc} */ public function opendir($path) { try { $location = $this->buildPath($path); $content = $this->flysystem->listContents($location); $this->updateCache($content); } catch (FileNotFoundException $e) { return false; } $names = array_map(function ($object) { return $object['basename']; }, $content); return IteratorDirectory::wrap($names); } /** * {@inheritdoc} */ public function fopen($path, $mode) { switch ($mode) { case 'r': case 'rb': return parent::fopen($path, $mode); default: unset($this->cacheContents[$this->getCacheLocation($path)]); return parent::fopen($path, $mode); } return false; } /** * {@inheritdoc} */ public function filesize($path) { if ($this->is_dir($path)) { return 0; } else { $info = $this->getFlysystemMetadata($path); return $info['size']; } } /** * {@inheritdoc} */ public function filemtime($path) { $info = $this->getFlysystemMetadata($path); return $info['timestamp']; } /** * {@inheritdoc} */ public function stat($path) { $info = $this->getFlysystemMetadata($path); return [ 'mtime' => $info['timestamp'], 'size' => $info['size'] ]; } /** * {@inheritdoc} */ public function filetype($path) { if ($path === '' or $path === '/' or $path === '.') { return 'dir'; } $info = $this->getFlysystemMetadata($path); return $info['type']; } }