From 4dd3a67b9e71e218bebabe597ecea73abf8065eb Mon Sep 17 00:00:00 2001 From: markseu Date: Fri, 17 Sep 2021 00:09:29 +0200 Subject: [PATCH] Updated install extension for Luis --- system/extensions/install.php | 30 +++++++++----- system/extensions/update-current.ini | 7 +++- system/extensions/yellow-system.ini | 62 ---------------------------- 3 files changed, 25 insertions(+), 74 deletions(-) diff --git a/system/extensions/install.php b/system/extensions/install.php index 03f9b0e..cfd5c63 100755 --- a/system/extensions/install.php +++ b/system/extensions/install.php @@ -2,7 +2,7 @@ // Install extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/install class YellowInstall { - const VERSION = "0.8.56"; + const VERSION = "0.8.57"; const PRIORITY = "1"; public $yellow; // access to API @@ -268,33 +268,39 @@ class YellowInstall { // Check web server requirements public function checkServerRequirements() { - list($name) = $this->yellow->toolbox->detectServerInformation(); + if (defined("DEBUG") && DEBUG>=1) { + list($name, $version, $os) = $this->yellow->toolbox->detectServerInformation(); + echo "YellowInstall::checkServerRequirements for $name $version, $os
\n"; + } $troubleshooting = "yellow->getTroubleshootingUrl()."\">See troubleshooting."; $this->checkServerComplete() || die("Datenstrom Yellow requires complete upload! $troubleshooting\n"); - $this->checkServerWrite() || die("Datenstrom Yellow requires write access for $name! $troubleshooting\n"); - $this->checkServerConfiguration() || die("Datenstrom Yellow requires configuration file for $name! $troubleshooting\n"); - $this->checkServerRewrite() || die("Datenstrom Yellow requires rewrite support for $name! $troubleshooting\n"); + $this->checkServerWrite() || die("Datenstrom Yellow requires write access! $troubleshooting\n"); + $this->checkServerConfiguration() || die("Datenstrom Yellow requires configuration file! $troubleshooting\n"); + $this->checkServerRewrite() || die("Datenstrom Yellow requires rewrite support! $troubleshooting\n"); } // Check web server complete upload public function checkServerComplete() { $complete = true; - foreach ($this->yellow->toolbox->getDirectoryEntriesRecursive(".", "/.*/", false, false) as $entry) { - if (filesize($entry)==0) $complete = false; - } $fileName = $this->yellow->system->get("coreExtensionDirectory").$this->yellow->system->get("updateCurrentFile"); $fileData = $this->yellow->toolbox->readFile($fileName); $settings = $this->yellow->toolbox->getTextSettings($fileData, "extension"); + $fileNames = array("yellow.php", "robots.txt", $fileName); foreach ($settings as $extension=>$block) { foreach ($block as $key=>$value) { if (strposu($key, "/")) { list($entry, $flags) = $this->yellow->toolbox->getTextList($value, ",", 2); if (preg_match("/delete/i", $flags)) continue; - if (!is_file($key)) $complete = false; + array_push($fileNames, $key); } } } - if (count($settings)==0) $complete = false; + foreach ($fileNames as $fileName) { + if (!is_file($fileName) || filesize($fileName)==0) { + $complete = false; + if (defined("DEBUG") && DEBUG>=1) echo "YellowInstall::checkServerComplete detected missing file:$fileName
\n"; + } + } return $complete; } @@ -329,6 +335,10 @@ class YellowInstall { // Check command line requirements public function checkCommandRequirements() { + if (defined("DEBUG") && DEBUG>=1) { + list($name, $version, $os) = $this->yellow->toolbox->detectServerInformation(); + echo "YellowInstall::checkCommandRequirements for $name $version, $os
\n"; + } $this->checkServerComplete() || die("Datenstrom Yellow requires complete upload!\n"); } diff --git a/system/extensions/update-current.ini b/system/extensions/update-current.ini index af8c291..d45863d 100755 --- a/system/extensions/update-current.ini +++ b/system/extensions/update-current.ini @@ -65,17 +65,20 @@ media/images/photo.jpg: photo.jpg, create, optional media/thumbnails/photo-100x40.jpg: photo-100x40.jpg, create, optional Extension: Install -Version: 0.8.56 +Version: 0.8.57 Description: Install a brand new, shiny website. HelpUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/install DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/install.zip -Published: 2021-08-17 20:31:42 +Published: 2021-09-16 23:55:13 Developer: Datenstrom Status: unlisted system/extensions/install.php: install.php, create system/extensions/install-language.zip: @base/zip/language.zip, create system/extensions/install-wiki.zip: @base/zip/wiki.zip, create system/extensions/install-blog.zip: @base/zip/blog.zip, create +system/extensions/yellow-system.ini: yellow-system.ini, create +system/extensions/yellow-user.ini: yellow-user.ini, create +system/extensions/yellow-language.ini: yellow-language.ini, create content/1-home/page.md: 1-home-page.md, create content/9-about/page.md: 9-about-page.md, create media/downloads/yellow.pdf: yellow.pdf, create diff --git a/system/extensions/yellow-system.ini b/system/extensions/yellow-system.ini index 2102379..097b40a 100644 --- a/system/extensions/yellow-system.ini +++ b/system/extensions/yellow-system.ini @@ -8,65 +8,3 @@ Language: en Layout: default Parser: markdown Status: public -CoreStaticUrl: -CoreServerUrl: auto -CoreServerTimezone: UTC -CoreMultiLanguageMode: 0 -CoreTrashTimeout: 7776660 -CoreMediaLocation: /media/ -CoreDownloadLocation: /media/downloads/ -CoreImageLocation: /media/images/ -CoreExtensionLocation: /media/extensions/ -CoreThemeLocation: /media/themes/ -CoreMediaDirectory: media/ -CoreDownloadDirectory: media/downloads/ -CoreImageDirectory: media/images/ -CoreSystemDirectory: system/ -CoreExtensionDirectory: system/extensions/ -CoreLayoutDirectory: system/layouts/ -CoreThemeDirectory: system/themes/ -CoreTrashDirectory: system/trash/ -CoreCacheDirectory: cache/ -CoreContentDirectory: content/ -CoreContentRootDirectory: default/ -CoreContentHomeDirectory: home/ -CoreContentSharedDirectory: shared/ -CoreContentDefaultFile: page.md -CoreContentErrorFile: page-error-(.*).md -CoreContentExtension: .md -CoreDownloadExtension: .download -CoreUserFile: yellow-user.ini -CoreLanguageFile: yellow-language.ini -CoreLogFile: yellow.log -UpdateExtensionUrl: https://github.com/datenstrom/yellow-extensions -UpdateExtensionFile: extension.ini -UpdateLatestFile: update-latest.ini -UpdateCurrentFile: update-current.ini -UpdateCurrentRelease: 0 -UpdateEventPending: none -UpdateEventDaily: 0 -CommandStaticBuildDirectory: public/ -CommandStaticDefaultFile: index.html -CommandStaticErrorFile: 404.html -EditLocation: /edit/ -EditUploadNewLocation: /media/@group/@filename -EditUploadExtensions: .gif, .jpg, .mp3, .ogg, .pdf, .png, .svg, .zip -EditKeyboardShortcuts: ctrl+b bold, ctrl+i italic, ctrl+k strikethrough, ctrl+e code, ctrl+s save, ctrl+alt+p preview -EditToolbarButtons: auto -EditEndOfLine: auto -EditNewFile: page-new-(.*).md -EditUserPasswordMinLength: 8 -EditUserHashAlgorithm: bcrypt -EditUserHashCost: 10 -EditUserHome: / -EditUserAccess: create, edit, delete, upload -EditLoginRestriction: 0 -EditLoginSessionTimeout: 2592000 -EditBruteForceProtection: 25 -ImageUploadWidthMax: 1280 -ImageUploadHeightMax: 1280 -ImageUploadJpgQuality: 80 -ImageThumbnailLocation: /media/thumbnails/ -ImageThumbnailDirectory: media/thumbnails/ -ImageThumbnailJpgQuality: 80 -MetaDefaultImage: favicon