<?php

use App\CoreUtils;

require __DIR__.'/../config/init/minimal.php';

$result = CoreUtils::generateApiSchema();
if (!$result){
	fwrite(STDERR, "Could not write API schema\n");
	exit(1);
}
fwrite(STDOUT, "Written API schema ($result bytes)\n");
exit(0);


<?php

require __DIR__.'/../config/init/minimal.php';

try {
	$result = \App\CoreUtils::generateApiSchema();
}
catch (\Exception $e){
	fwrite(STDERR, implode("\n", ['Could not write API schema to file: '.get_class($e), $e->getMessage(), 'Stack trace:', $e->getTraceAsString(), '']));
	exit(1);
}
fwrite(STDOUT, "Written API schema to file\n");
exit(0);


Fix schema generator script error condition check
Fix schema generator script error condition check
