commit d49c2f203d8f40384298009d5c6df60e13ffa68b
parent 030509a13a2fd59d1a1f08a928ad8ebb41f41fe9
Author: markseu <mark2011@mayberg.se>
Date: Mon, 5 Oct 2020 13:41:48 +0200
Updated built-in web server for Igor
Diffstat:
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/system/extensions/command.php b/system/extensions/command.php
@@ -2,7 +2,7 @@
// Command extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/command
class YellowCommand {
- const VERSION = "0.8.22";
+ const VERSION = "0.8.23";
public $yellow; // access to API
public $files; // number of files
public $links; // number of links
@@ -451,14 +451,18 @@ class YellowCommand {
if ($scheme=="http" && !empty($address)) {
if (!preg_match("/\:\d+$/", $address)) $address .= ":8000";
echo "Starting built-in web server on $scheme://$address/\n";
- echo "Press Ctrl-C to quit...\n";
+ echo "Press Ctrl+C to quit...\n";
if (empty($path) || $path=="dynamic") {
- system("php -S $address yellow.php", $returnStatus);
+ exec("php -S $address yellow.php 2>&1", $outputLines, $returnStatus);
} else {
- system("php -S $address -t $path", $returnStatus);
+ exec("php -S $address -t $path 2>&1", $outputLines, $returnStatus);
}
$statusCode = $returnStatus!=0 ? 500 : 200;
- if ($statusCode!=200) echo "ERROR starting web server: Please check your arguments!\n";
+ if ($statusCode!=200) {
+ $output = !empty($outputLines) ? end($outputLines) : "Please check arguments!";
+ if (preg_match("/^\[(.*?)\]\s*(.*)$/", $output, $matches)) $output = $matches[2];
+ echo "ERROR starting web server: $output\n";
+ }
} else {
$statusCode = 400;
echo "Yellow $command: Invalid arguments\n";
diff --git a/system/extensions/update-current.ini b/system/extensions/update-current.ini
@@ -11,11 +11,11 @@ Tag: feature
system/extensions/bundle.php: bundle.php, create, update
Extension: Command
-Version: 0.8.22
+Version: 0.8.23
Description: Command line of the website.
HelpUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/command
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/command.zip
-Published: 2020-08-08 16:53:28
+Published: 2020-10-05 13:37:47
Developer: Datenstrom
Tag: feature
system/extensions/command.php: command.php, create, update