diff --git a/bl-plugins/updater/languages/en.json b/bl-plugins/updater/languages/en.json deleted file mode 100644 index b8347111..00000000 --- a/bl-plugins/updater/languages/en.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugin-data": - { - "name": "Updater", - "description": "" - } -} \ No newline at end of file diff --git a/bl-plugins/updater/metadata.json b/bl-plugins/updater/metadata.json deleted file mode 100644 index f2d3a7f4..00000000 --- a/bl-plugins/updater/metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "author": "Bludit", - "email": "", - "website": "https://plugins.bludit.com", - "version": "3.0", - "releaseDate": "2018-01-23", - "license": "MIT", - "compatible": "3.0", - "notes": "" -} \ No newline at end of file diff --git a/bl-plugins/updater/plugin.php b/bl-plugins/updater/plugin.php deleted file mode 100644 index 4fa32e1a..00000000 --- a/bl-plugins/updater/plugin.php +++ /dev/null @@ -1,122 +0,0 @@ -formButtons = false; - - // Check for zip extension installed - $this->zip = extension_loaded('zip'); - - // Local full path of the file of the latest version of Bludit - $this->localLatestVersionFile = $this->workspace().DS.'bludit-latest.zip'; - } - - // Redefine workspace - public function workspace() - { - return PATH_CONTENT.'updater'.DS; - } - - // Install the plugin and create the workspace directory - public function install($position=0) - { - parent::install($position); - $workspace = $this->workspace(); - return mkdir($workspace, 0755, true); - } - - // Uninstall the plugin and delete the workspace directory - public function uninstall() - { - parent::uninstall(); - $workspace = $this->workspace(); - return Filesystem::deleteRecursive($workspace); - } - - // Check if the root directory is writable - public function isWritable() - { - return is_writable(PATH_ROOT); - } - - // Create a copy of all the system and compress it - // Returns the name of the backup directory - public function makeFullBackup() - { - $currentDate = Date::current(BACKUP_DATE_FORMAT); - $backupDirectory = $this->workspace().$currentDate; - - // Copy all files from PATH_ROOT to $backupDirectory, also omit the directory $backupDirectory - Filesystem::copyRecursive(PATH_ROOT, $backupDirectory, $backupDirectory); - - // Compress the backup directory - if (Filesystem::zip($backupDirectory, $backupDirectory.'.zip')) { - Filesystem::deleteRecursive($backupDirectory); - } - - return $backupDirectory; - } - - // Download the latest version of Bludit - public function downloadLatestVersion() - { - return TCP::download($this->urlLatestVersionFile, $this->localLatestVersionFile); - } - - public function validChecksum() - { - // IMPLEMENT !!! - return true; - } - - // Unzip the latest version and replace the old files - public function upgradeFiles() - { - return Filesystem::unzip($this->localLatestVersionFile, PATH_ROOT); - } - - public function post() - { - if (isset($_POST['updateNow'])) { - echo 'Making a backup'; - $this->makeFullBackup(); - - echo 'Downloading the latest version of Bludit'; - $this->downloadLatestVersion(); - - echo 'Validating checksum'; - if ($this->validChecksum()) { - echo 'Updating files'; - return $this->upgradeFiles(); - } - } - - return false; - } - - public function form() - { - global $L; - - return '
This plugin is not yet complete
'; - - if ($this->zip===false) { - return '
The extension zip file is not installed, to use this plugin you need install the extension first.
'; - } - - $html = '
'; - $html .= ''; - $html .= '
'; - - return $html; - } - -}