commit adbe9c1ad2758831800b13b2815cd6a43a29a1d7
parent a019dd9f53729d15f7b98dae84e2c9741a22253c
Author: markseu <mark2011@mayberg.se>
Date: Mon, 27 Jul 2020 11:55:12 +0200
Updated extensions for new API
Diffstat:
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/system/extensions/update.php b/system/extensions/update.php
@@ -2,7 +2,7 @@
// Update extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/update
class YellowUpdate {
- const VERSION = "0.8.25";
+ const VERSION = "0.8.26";
const PRIORITY = "2";
public $yellow; // access to API
public $updates; // number of updates
@@ -153,6 +153,18 @@ class YellowUpdate {
$this->yellow->log("error", "Can't write directory '$pathDestination'!");
}
}
+ if (is_dir($pathSource) && is_dir($pathDestination)) {
+ foreach ($this->yellow->toolbox->getDirectoryEntries($pathSource, "/.*/", true, false, false) as $entry) {
+ $entrySource = $pathSource.$entry;
+ $entryDestination = $pathDestination.$entry;
+ if (!$this->yellow->toolbox->copyFile($entrySource, $entryDestination)) {
+ $this->yellow->log("error", "Can't write file '$entryDestination'!");
+ }
+ }
+ if (!$this->yellow->toolbox->deleteDirectory($pathSource, $this->yellow->system->get("coreTrashDirectory"))) {
+ $this->yellow->log("error", "Can't delete directory '$pathSource'!");
+ }
+ }
foreach ($this->yellow->toolbox->getDirectoryEntries($pathDestination, "/^.*\-icon\.png$/", true, false) as $entry) {
$entryShort = str_replace("-icon.png", ".png", $entry);
if (!is_file($entryShort) && !$this->yellow->toolbox->copyFile($entry, $entryShort)) {