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.217.150
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 /
updater /
src /
Utils /
Delete
Unzip
Name
Size
Permission
Date
Action
AppManager.php
2.65
KB
-rw-r--r--
2018-04-19 18:16
Checkpoint.php
6.13
KB
-rw-r--r--
2018-04-19 18:16
Collection.php
1.48
KB
-rw-r--r--
2018-04-19 18:16
ConfigReader.php
2.42
KB
-rw-r--r--
2018-04-19 18:16
DocLink.php
1.54
KB
-rw-r--r--
2018-04-19 18:16
Feed.php
2.53
KB
-rw-r--r--
2018-04-19 18:16
Fetcher.php
5.18
KB
-rw-r--r--
2018-04-19 18:16
FilesystemHelper.php
4.87
KB
-rw-r--r--
2018-04-19 18:16
Locator.php
5.01
KB
-rw-r--r--
2018-04-19 18:16
OccRunner.php
4.25
KB
-rw-r--r--
2018-04-19 18:16
Registry.php
1.59
KB
-rw-r--r--
2018-04-19 18:16
ZipExtractor.php
3.57
KB
-rw-r--r--
2018-04-19 18:16
Save
Rename
<?php /** * @author Victor Dubiniuk <dubiniuk@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @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 Owncloud\Updater\Utils; use \Owncloud\Updater\Console\Application; /** * Class Locator * * @package Owncloud\Updater\Utils */ class Locator { /** * absolute path to ownCloud root * @var string */ protected $ownCloudRootPath; /** * absolute path to updater root * @var string */ protected $updaterRootPath; /** * * @param string $baseDir */ public function __construct($baseDir){ $this->updaterRootPath = $baseDir; $this->ownCloudRootPath = dirname($baseDir); } /** * @return string */ public function getOwnCloudRootPath(){ return $this->ownCloudRootPath; } /** * expected items in the core * @return string[] */ public function getRootDirContent(){ return [ "3rdparty", "config", "core", "l10n", "lib", "ocs", "ocs-provider", "resources", "settings", ".htaccess", ".mailmap", ".tag", ".user.ini", "AUTHORS", "CHANGELOG.md", "console.php", "COPYING", "cron.php", "db_structure.xml", "index.html", "index.php", "indie.json", "occ", "public.php", "remote.php", "robots.txt", "status.php", "version.php", ]; } /** * @return array */ public function getUpdaterContent(){ return [ 'app', 'application.php', 'box.json', 'composer.json', 'composer.lock', 'CONTRIBUTING.md', 'COPYING-AGPL', 'index.php', 'pub', 'src', 'vendor', 'README.md', '.travis.yml', '.scrutinizer.yml', 'nbproject', ]; } /** * Absolute path to core root dir content * @return array */ public function getRootDirItems(){ $items = $this->getRootDirContent(); $items = array_map( function($item){ return $this->ownCloudRootPath . "/" . $item; }, $items ); return $items; } /** * Absolute path * @return string * @throws \Exception */ public function getDataDir(){ $container = Application::$container; if (isset($container['utils.configReader']) && $container['utils.configReader']->getIsLoaded()){ return $container['utils.configReader']->getByPath('system.datadirectory'); } // Fallback case include $this->getPathToConfigFile(); if (isset($CONFIG['datadirectory'])){ return $CONFIG['datadirectory']; } // Something went wrong throw new \Exception('Unable to detect datadirectory'); } /** * Absolute path to updater root dir * @return string */ public function getUpdaterBaseDir(){ return $this->getDataDir() . '/updater-data'; } /** * Absolute path to create a core and apps backups * @return string */ public function getCheckpointDir(){ return $this->getUpdaterBaseDir() . '/checkpoint'; } /** * Absolute path to store downloaded packages * @return string */ public function getDownloadBaseDir(){ return $this->getUpdaterBaseDir() . '/download'; } /** * Absolute path to a temporary directory * to extract downloaded packages into * @return string */ public function getExtractionBaseDir(){ return $this->getUpdaterBaseDir() . "/_oc_upgrade"; } /** * * @return string */ public function getPathToOccFile(){ return $this->ownCloudRootPath . '/occ'; } /** * * @return string */ public function getInstalledVersion(){ include $this->getPathToVersionFile(); /** @var $OC_Version string */ return $OC_Version; } /** * * @return string */ public function getChannelFromVersionsFile(){ include $this->getPathToVersionFile(); /** @var $OC_Channel string */ return $OC_Channel; } /** * * @return string */ public function getBuild(){ include $this->getPathToVersionFile(); /** @var $OC_Build string */ return $OC_Build; } /** * @return string */ public function getSecretFromConfig(){ include $this->getPathToConfigFile(); if (isset($CONFIG['updater.secret'])){ return $CONFIG['updater.secret']; } return ''; } /** * @param string $filePostfix * @return array */ public function getPathtoConfigFiles($filePostfix = 'config.php'){ // Only config.php for now return [ $this->ownCloudRootPath . '/config/' . $filePostfix ]; } /** * @return string */ public function getPathToConfigFile(){ return $this->ownCloudRootPath . '/config/config.php'; } /** * * @return string */ public function getPathToVersionFile(){ return $this->ownCloudRootPath . '/version.php'; } }