Updated edit extension, better troubleshooting

This commit is contained in:
markseu 2022-04-29 17:21:12 +02:00
parent dc59b4bd36
commit ccc4c0171f
3 changed files with 13 additions and 14 deletions

View file

@ -2,7 +2,7 @@
// Edit extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/edit
class YellowEdit {
const VERSION = "0.8.59";
const VERSION = "0.8.60";
public $yellow; // access to API
public $response; // web response
public $merge; // text merge
@ -662,11 +662,11 @@ class YellowEdit {
if (empty($email) || !filter_var($email, FILTER_VALIDATE_EMAIL)) $this->response->status = "invalid";
}
if ($this->response->status=="ok") {
$fileName = $this->yellow->system->get("coreExtensionDirectory").$this->yellow->system->get("coreSystemFile");
$fileNameSystem = $this->yellow->system->get("coreExtensionDirectory").$this->yellow->system->get("coreSystemFile");
$settings = array("sitename" => $sitename, "author" => $author, "email" => $email);
$file = $this->response->getFileSystem($scheme, $address, $base, $location, $fileName, $settings);
$this->response->status = (!$file->isError() && $this->yellow->system->save($fileName, $settings)) ? "done" : "error";
if ($this->response->status=="error") $this->yellow->page->error(500, "Can't write file '$fileName'!");
$file = $this->response->getFileSystem($scheme, $address, $base, $location, $fileNameSystem, $settings);
$this->response->status = (!$file->isError() && $this->yellow->system->save($fileNameSystem, $settings)) ? "done" : "error";
if ($this->response->status=="error") $this->yellow->page->error(500, "Can't write file '$fileNameSystem'!");
}
if ($this->response->status=="done") {
$location = $this->yellow->lookup->normaliseUrl($scheme, $address, $base, $location);
@ -1185,9 +1185,9 @@ class YellowEditResponse {
}
// Return system file
public function getFileSystem($scheme, $address, $base, $pageLocation, $fileName, $settings) {
public function getFileSystem($scheme, $address, $base, $pageLocation, $fileNameSystem, $settings) {
$file = new YellowPage($this->yellow);
$file->setRequestInformation($scheme, $address, $base, "/".$fileName, $fileName);
$file->setRequestInformation($scheme, $address, $base, "/".$fileNameSystem, $fileNameSystem);
$file->parseData(null, false, 0);
foreach ($settings as $key=>$value) $file->set($key, $value);
$this->editSystemFile($file, "configure", $this->userEmail);

View file

@ -37,11 +37,11 @@ system/layouts/navigation.html: navigation.html, create, update, careful
system/layouts/pagination.html: pagination.html, create, update, careful
Extension: Edit
Version: 0.8.59
Version: 0.8.60
Description: Edit your website in a web browser.
DocumentationUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/edit
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/edit.zip
Published: 2022-04-29 07:51:22
Published: 2022-04-29 14:50:00
Developer: Datenstrom
Tag: feature
system/extensions/edit.php: edit.php, create, update
@ -131,11 +131,11 @@ system/themes/stockholm-opensans-light.woff: stockholm-opensans-light.woff, crea
system/themes/stockholm-opensans-regular.woff: stockholm-opensans-regular.woff, create, update, careful
Extension: Update
Version: 0.8.72
Version: 0.8.73
Description: Keep your website up to date.
DocumentationUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/update
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/update.zip
Published: 2022-04-22 18:04:58
Published: 2022-04-29 10:36:26
Developer: Datenstrom
Tag: feature
system/extensions/update.php: update.php, create, update

View file

@ -2,7 +2,7 @@
// Update extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/update
class YellowUpdate {
const VERSION = "0.8.72";
const VERSION = "0.8.73";
const PRIORITY = "2";
public $yellow; // access to API
public $extensions; // number of extensions
@ -873,8 +873,7 @@ class YellowUpdate {
if ($statusCode==200) {
$fileData = $rawData;
} elseif ($statusCode==0) {
$statusCode = 500;
list($scheme, $address) = $this->yellow->lookup->getUrlInformation($url);
$statusCode = 450;
$this->yellow->page->error($statusCode, "Can't connect to the update server!");
} else {
$statusCode = 500;