From ce1c129e85f377e15543c1ba27f5a6020102d6ce Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Fri, 24 May 2019 11:14:14 +0200 Subject: [PATCH] Fix building phars --- build.xml | 83 ++++++++++++++++++------------------ phpdraft | 12 +++--- tests/test.bootstrap.inc.php | 1 - 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/build.xml b/build.xml index 1ec15526..e1b621cb 100644 --- a/build.xml +++ b/build.xml @@ -3,13 +3,13 @@ - - - - - + + + + + - + @@ -23,40 +23,41 @@ - + - + - - + - + - + - + - - - - + + + + - - + + + @@ -68,23 +69,23 @@ - + - + - + - - + + @@ -94,15 +95,18 @@ - + - + + + + - + @@ -110,13 +114,13 @@ - + - - + + - + @@ -124,17 +128,17 @@ - + - - + + - + - + @@ -154,16 +158,13 @@ - + - - - - + \ No newline at end of file diff --git a/phpdraft b/phpdraft index b3de27f9..edd0029f 100755 --- a/phpdraft +++ b/phpdraft @@ -1,5 +1,4 @@ #!/usr/bin/env php - description('Parse API Blueprint files.') - ->opt('file:f', 'Specifies the file to parse.', true, 'string') + ->opt('file:f', 'Specifies the file to parse.', false, 'string') ->opt('yes:y', 'Always accept using the online mode.', false) ->opt('online:o', 'Always use the online mode.', false) ->opt('template:t', 'Specifies the template to use. (defaults to \'default\').', false, 'string') @@ -43,6 +41,9 @@ try Version::version(); throw new ExecutionException('', 0); } + if (!isset($args['file'])) { + throw new ExecutionException('Missing required option: file', 1); + } define('THIRD_PARTY_ALLOWED', getenv('PHPDRAFT_THIRD_PARTY') !== '0'); if ((isset($args['y']) || isset($args['o'])) && THIRD_PARTY_ALLOWED) { @@ -61,8 +62,7 @@ try } catch (ResourceException $exception) { - file_put_contents('php://stderr', "No drafter available.\n"); - return; + throw new ExecutionException('No drafter available', 255); } $html = new JsonToHTML($parser->parseToJson()); @@ -101,4 +101,4 @@ function phpdraft_var_dump(...$vars) var_dump($var); } echo ''; -} +} \ No newline at end of file diff --git a/tests/test.bootstrap.inc.php b/tests/test.bootstrap.inc.php index e4d59569..4da57d07 100755 --- a/tests/test.bootstrap.inc.php +++ b/tests/test.bootstrap.inc.php @@ -22,7 +22,6 @@ ); // Load and setup class file autloader -//require_once 'PHPDraft/Core/Autoloader.php'; require_once $base . '/vendor/autoload.php'; define('THIRD_PARTY_ALLOWED', TRUE);