diff options
author | Git'Fellow <carlos@reendex.com> | 2022-07-02 09:33:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-02 09:33:28 +0300 |
commit | 0de81a2395ba6e08abf2a21f7e98eda8f592fcf2 (patch) | |
tree | e8204fecda4f09ca55abef75750a30d6d8b185dd | |
parent | 50816ec79eeed7125fea164cf45060d434ded11c (diff) |
Update index.php
-rw-r--r-- | index.php | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -183,7 +183,7 @@ class Updater { return; } - $dataDir = $this->getDataDirectoryLocation(); + $dataDir = $this->getUpdateDirectoryLocation(); if (empty($dataDir) || !is_string($dataDir)) { throw new \Exception('Could not read data directory from config.php.'); } @@ -302,7 +302,7 @@ class Updater { * * @return string */ - private function getDataDirectoryLocation() { + private function getUpdateDirectoryLocation() { return $this->configValues['updatedirectory'] ?? $this->configValues['datadirectory']; } @@ -484,7 +484,7 @@ class Updater { ]; // Create new folder for the backup - $backupFolderLocation = $this->getDataDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid').'/backups/nextcloud-'.$this->getConfigOption('version') . '-' . time() . '/'; + $backupFolderLocation = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid').'/backups/nextcloud-'.$this->getConfigOption('version') . '-' . time() . '/'; $this->silentLog('[info] backup folder location: ' . $backupFolderLocation); $state = mkdir($backupFolderLocation, 0750, true); @@ -635,7 +635,7 @@ class Updater { $this->silentLog('[info] downloadUpdate()'); $response = $this->getUpdateServerResponse(); - $storageLocation = $this->getDataDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid') . '/downloads/'; + $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid') . '/downloads/'; if (file_exists($storageLocation)) { $this->silentLog('[info] storage location exists'); $this->recursiveDelete($storageLocation); @@ -703,7 +703,7 @@ class Updater { * @throws \Exception */ private function getDownloadedFilePath() { - $storageLocation = $this->getDataDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid') . '/downloads/'; + $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid') . '/downloads/'; $this->silentLog('[info] storage location: ' . $storageLocation); $filesInStorageLocation = scandir($storageLocation); @@ -923,7 +923,7 @@ EOF; throw new \Exception('core/shipped.json is not available'); } - $newShippedAppsFile = $this->getDataDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid') . '/downloads/nextcloud/core/shipped.json'; + $newShippedAppsFile = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid') . '/downloads/nextcloud/core/shipped.json'; if (!file_exists($newShippedAppsFile)) { throw new \Exception('core/shipped.json is not available in the new release'); } @@ -1081,7 +1081,7 @@ EOF; 'ocs/v1.php', 'ocs/v2.php', ]; - $storageLocation = $this->getDataDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid') . '/downloads/nextcloud/'; + $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid') . '/downloads/nextcloud/'; $this->silentLog('[info] storage location: ' . $storageLocation); $this->moveWithExclusions($storageLocation, $excludedElements); @@ -1097,14 +1097,14 @@ EOF; public function finalize() { $this->silentLog('[info] finalize()'); - $storageLocation = $this->getDataDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid') . '/downloads/nextcloud/'; + $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid') . '/downloads/nextcloud/'; $this->silentLog('[info] storage location: ' . $storageLocation); $this->moveWithExclusions($storageLocation, []); $state = rmdir($storageLocation); if ($state === false) { throw new \Exception('Could not rmdir $storagelocation'); } - $state = unlink($this->getDataDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid') . '/.step'); + $state = unlink($this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid') . '/.step'); if ($state === false) { throw new \Exception('Could not rmdir .step'); } @@ -1123,7 +1123,7 @@ EOF; * @throws \Exception */ private function writeStep($state, $step) { - $updaterDir = $this->getDataDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid'); + $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid'); if (!file_exists($updaterDir . '/.step')) { if (!file_exists($updaterDir)) { $result = mkdir($updaterDir); @@ -1168,7 +1168,7 @@ EOF; public function currentStep() { $this->silentLog('[info] currentStep()'); - $updaterDir = $this->getDataDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid'); + $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid'); $jsonData = []; if (file_exists($updaterDir. '/.step')) { $state = file_get_contents($updaterDir . '/.step'); @@ -1193,7 +1193,7 @@ EOF; public function rollbackChanges($step) { $this->silentLog('[info] rollbackChanges("' . $step . '")'); - $updaterDir = $this->getDataDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid'); + $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid'); if (file_exists($updaterDir . '/.step')) { $this->silentLog('[info] unlink .step'); $state = unlink($updaterDir . '/.step'); @@ -1237,7 +1237,7 @@ EOF; * @throws LogException */ public function log($message) { - $updaterLogPath = $this->getDataDirectoryLocation() . '/updater.log'; + $updaterLogPath = $this->getUpdateDirectoryLocation() . '/updater.log'; $fh = fopen($updaterLogPath, 'a'); if ($fh === false) { |