fleshing out json output feature
This commit is contained in:
@@ -67,8 +67,11 @@ class MVCController{
|
||||
|
||||
//check if testaction is valid
|
||||
if(file_exists($this->testaction)){
|
||||
|
||||
echo('"output": [');
|
||||
//execute testaction
|
||||
include_once($this->testaction);
|
||||
echo("]");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,11 +4,16 @@
|
||||
class TestUtils{
|
||||
public static $log = [];
|
||||
public static $status;
|
||||
public static function log($output, $status = "OK"){
|
||||
public static function log($output, $status = "OK",$addComma = false){
|
||||
$loginput = [];
|
||||
$loginput['message'] = $output;
|
||||
$loginput['status'] = $status;
|
||||
echo(json_encode($loginput));
|
||||
if($addComma){
|
||||
echo(',');
|
||||
}
|
||||
echo("\n");
|
||||
return;
|
||||
}
|
||||
public static function returnLog(){
|
||||
echo(json_encode(self::$log));
|
||||
|
||||
Reference in New Issue
Block a user