mikuli.cz

:)
git clone https://git.sr.ht/~ashymad/mikuli.cz
Log | Files | Refs

commit 4924922d56aad164b2137ab39c393a0c62866ac1
parent 60cf21f414e3a1ebaf3fc69dd4eb0c05b9fd4848
Author: markseu <mark2011@mayberg.se>
Date:   Wed, 12 Feb 2020 17:25:03 +0100

Updated installation, added links to troubleshooting

Diffstat:
Msystem/extensions/core.php | 4++++
Msystem/extensions/image.php | 19+++++--------------
Msystem/extensions/install.php | 15+++++++++++----
3 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/system/extensions/core.php b/system/extensions/core.php @@ -66,6 +66,10 @@ class YellowCore { $this->system->setDefault("coreSystemFile", "system.ini"); $this->system->setDefault("coreTextFile", "text.ini"); $this->system->setDefault("coreLogFile", "yellow.log"); + $troubleshooting = "<a href=\"https://datenstrom.se/yellow/help/troubleshooting\">See troubleshooting</a>."; + extension_loaded("mbstring") || die("Datenstrom Yellow requires PHP mbstring extension! $troubleshooting"); + extension_loaded("curl") || die("Datenstrom Yellow requires PHP cURL extension! $troubleshooting"); + extension_loaded("zip") || die("Datenstrom Yellow requires PHP zip extension! $troubleshooting"); } public function __destruct() { diff --git a/system/extensions/image.php b/system/extensions/image.php @@ -4,10 +4,9 @@ // This file may be used and distributed under the terms of the public license. class YellowImage { - const VERSION = "0.8.5"; + const VERSION = "0.8.6"; const TYPE = "feature"; public $yellow; //access to API - public $graphicsLibrary; //graphics library support? (boolean) // Handle initialisation public function onLoad($yellow) { @@ -19,17 +18,14 @@ class YellowImage { $this->yellow->system->setDefault("imageThumbnailLocation", "/media/thumbnails/"); $this->yellow->system->setDefault("imageThumbnailDir", "media/thumbnails/"); $this->yellow->system->setDefault("imageThumbnailJpgQuality", "80"); - $this->graphicsLibrary = $this->isGraphicsLibrary(); - } + $troubleshooting = "<a href=\"https://datenstrom.se/yellow/help/troubleshooting\">See troubleshooting</a>."; + extension_loaded("gd") || die("Datenstrom Yellow requires PHP GD extension! $troubleshooting"); + extension_loaded("exif") || die("Datenstrom Yellow requires PHP Exif extension! $troubleshooting"); } // Handle page content of shortcut public function onParseContentShortcut($page, $name, $text, $type) { $output = null; if ($name=="image" && $type=="inline") { - if (!$this->graphicsLibrary) { - $this->yellow->page->error(500, "Image extension requires GD library and EXIF library!"); - return $output; - } list($name, $alt, $style, $width, $height) = $this->yellow->toolbox->getTextArgs($text); if (!preg_match("/^\w+:/", $name)) { if (empty($alt)) $alt = $this->yellow->system->get("imageAlt"); @@ -52,7 +48,7 @@ class YellowImage { // Handle media file changes public function onEditMediaFile($file, $action) { - if ($action=="upload" && $this->graphicsLibrary) { + if ($action=="upload") { $fileName = $file->fileName; $fileType = $this->yellow->toolbox->getFileType($file->get("fileNameShort")); list($widthInput, $heightInput, $type) = $this->yellow->toolbox->detectImageInformation($fileName, $fileType); @@ -273,9 +269,4 @@ class YellowImage { public function isFileNotUpdated($fileNameInput, $fileNameOutput) { return $this->yellow->toolbox->getFileModified($fileNameInput)!=$this->yellow->toolbox->getFileModified($fileNameOutput); } - - // Check graphics library support - public function isGraphicsLibrary() { - return extension_loaded("gd") && function_exists("gd_info") && extension_loaded("exif"); - } } diff --git a/system/extensions/install.php b/system/extensions/install.php @@ -4,7 +4,7 @@ // This file may be used and distributed under the terms of the public license. class YellowInstall { - const VERSION = "0.8.14"; + const VERSION = "0.8.15"; const TYPE = "feature"; const PRIORITY = "1"; public $yellow; //access to API @@ -17,10 +17,12 @@ class YellowInstall { // Handle request public function onRequest($scheme, $address, $base, $location, $fileName) { $statusCode = 0; - if ($this->yellow->lookup->isContentFile($fileName)) { + if ($this->yellow->lookup->isContentFile($fileName) || empty($fileName)) { $server = $this->yellow->toolbox->getServerVersion(true); - $this->checkServerRewrite($scheme, $address, $base, $location, $fileName) || die("Datenstrom Yellow requires $server rewrite module!"); - $this->checkServerAccess() || die("Datenstrom Yellow requires $server read/write access!"); + $troubleshooting = "<a href=\"https://datenstrom.se/yellow/help/troubleshooting\">See troubleshooting</a>."; + $this->checkServerConfiguration($server) || die("Datenstrom Yellow requires $server configuration file! $troubleshooting"); + $this->checkServerRewrite($scheme, $address, $base, $location, $fileName) || die("Datenstrom Yellow requires $server rewrite module! $troubleshooting"); + $this->checkServerAccess() || die("Datenstrom Yellow requires $server read/write access! $troubleshooting"); $statusCode = $this->processRequestInstall($scheme, $address, $base, $location, $fileName); } return $statusCode; @@ -268,6 +270,11 @@ class YellowInstall { return $statusCode; } + // Check web server configuration + public function checkServerConfiguration($server) { + return strtoloweru($server)!="apache" || is_file(".htaccess"); + } + // Check web server rewrite public function checkServerRewrite($scheme, $address, $base, $location, $fileName) { $curlHandle = curl_init();