/** * rename/move versions of renamed/moved files * @param array $params array with oldpath and newpath * * This function is connected to the rename signal of OC_Filesystem and adjust the name and location * of the stored versions along the actual file */ public static function rename_hook($params) { if (\OCP\App::isEnabled('files_versions')) { $oldpath = $params['oldpath']; $newpath = $params['newpath']; if ($oldpath != '' && $newpath != '') { Storage::rename($oldpath, $newpath); } } }
/** * @brief rename/move versions of renamed/moved files * @param array with oldpath and newpath * * This function is connected to the rename signal of OC_Filesystem and adjust the name and location * of the stored versions along the actual file */ public static function rename_hook($params) { if (\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED) == 'true') { $oldpath = $params['oldpath']; $newpath = $params['newpath']; if ($oldpath != '' && $newpath != '') { Storage::rename($oldpath, $newpath); } } }
protected function changeFilenames() { //folder names \Storage::rename($this->packageDir . '/src/VanillaModel', $this->modelDir); \Storage::rename($this->modelDir . '/Resources/Views/pages', $this->modelDir . '/Resources/Views/' . $this->models); \Storage::rename($this->modelDir . '/Config/pages', $this->modelDir . '/Config/' . $this->models); //file names \Storage::rename($this->modelDir . '/Config/authorization/pages.php', $this->files['config.authorization']); \Storage::rename($this->modelDir . '/Config/validation/page.php', $this->files['config.validation']); \Storage::rename($this->modelDir . '/Database/Factories/PageFactory.php', $this->files['database.factory']); \Storage::rename($this->modelDir . '/Database/Seeds/PagesTableSeeder.php', $this->files['database.seeds']); \Storage::rename($this->modelDir . '/Database/Migrations/create_pages_table.php', $this->files['database.migration']); \Storage::rename($this->modelDir . '/Events/PageWasSaved.php', $this->files['events.saved']); \Storage::rename($this->modelDir . '/Http/Controllers/PagesController.php', $this->files['http.controller']); \Storage::rename($this->modelDir . '/Jobs/SaveNewPage.php', $this->files['jobs.save']); \Storage::rename($this->modelDir . '/Jobs/UpdateExistingPage.php', $this->files['jobs.update']); \Storage::rename($this->modelDir . '/Listeners/PageSavedListener.php', $this->files['listeners.saved']); \Storage::rename($this->modelDir . '/Models/Page.php', $this->files['model']); \Storage::rename($this->modelDir . '/Policies/PagePolicy.php', $this->files['policy']); \Storage::rename($this->modelDir . '/Providers/LarapressPagesServiceProvider.php', $this->files['provider']); }