protected function finalize() { // overwrite themes content with new files only $themes = $this->toAbsolute($this->newBase . '/themes', Helper::scandir($this->newBase . '/themes')); foreach ($themes as $name => $location) { Helper::removeIfExists($this->oldBase . '/themes/' . $name); Helper::move($location, $this->oldBase . '/themes/' . $name); } parent::finalize(); }
public function index() { try { $list = Helper::scandir($this->config->getBackupBase()); } catch (\Exception $e) { $list = []; } clearstatcache(); $result = []; foreach ($list as $item) { if (in_array($item, ['.', '..'])) { continue; } $result[] = ['title' => $item, 'date' => date("F d Y H:i:s", filectime($this->config->getBackupBase() . '/' . $item)), 'size' => \OCP\Util::humanFileSize(filesize($this->config->getBackupBase() . '/' . $item))]; } return ['status' => 'success', 'data' => $result]; }