@@ -972,29 +972,14 @@ public function processLongArgument($arg, $pos)
972972 if ($ this ->reportFile === false ) {
973973 $ this ->reportFile = substr ($ arg , 12 );
974974
975- $ dir = dirname ($ this ->reportFile );
975+ $ dir = Util \Common:: realpath ( dirname ($ this ->reportFile ) );
976976 if (is_dir ($ dir ) === false ) {
977977 $ error = 'ERROR: The specified report file path " ' .$ this ->reportFile .'" points to a non-existent directory ' .PHP_EOL .PHP_EOL ;
978978 $ error .= $ this ->printShortUsage (true );
979979 throw new DeepExitException ($ error , 3 );
980980 }
981981
982- if ($ dir === '. ' ) {
983- // Passed report file is a file in the current directory.
984- $ this ->reportFile = getcwd ().'/ ' .basename ($ this ->reportFile );
985- } else {
986- if ($ dir [0 ] === '/ ' ) {
987- // An absolute path.
988- $ dir = Util \Common::realpath ($ dir );
989- } else {
990- $ dir = Util \Common::realpath (getcwd ().'/ ' .$ dir );
991- }
992-
993- if ($ dir !== false ) {
994- // Report file path is relative.
995- $ this ->reportFile = $ dir .'/ ' .basename ($ this ->reportFile );
996- }
997- }
982+ $ this ->reportFile = $ dir .'/ ' .basename ($ this ->reportFile );
998983 }//end if
999984
1000985 self ::$ overriddenDefaults ['reportFile ' ] = true ;
@@ -1050,28 +1035,19 @@ public function processLongArgument($arg, $pos)
10501035 if ($ output === false ) {
10511036 $ output = null ;
10521037 } else {
1053- $ dir = dirname ($ output );
1038+ $ dir = Util \Common:: realpath ( dirname ($ output) );
10541039 if (is_dir ($ dir ) === false ) {
10551040 $ error = 'ERROR: The specified ' .$ report .' report file path " ' .$ output .'" points to a non-existent directory ' .PHP_EOL .PHP_EOL ;
10561041 $ error .= $ this ->printShortUsage (true );
10571042 throw new DeepExitException ($ error , 3 );
10581043 }
10591044
1060- if ($ dir === '. ' ) {
1061- // Passed report file is a filename in the current directory.
1062- $ output = getcwd ().'/ ' .basename ($ output );
1063- } else {
1064- if ($ dir [0 ] === '/ ' ) {
1065- // An absolute path.
1066- $ dir = Util \Common::realpath ($ dir );
1067- } else {
1068- $ dir = Util \Common::realpath (getcwd ().'/ ' .$ dir );
1069- }
1070-
1071- if ($ dir !== false ) {
1072- // Report file path is relative.
1073- $ output = $ dir .'/ ' .basename ($ output );
1074- }
1045+ $ output = $ dir .'/ ' .basename ($ output );
1046+
1047+ if (is_dir ($ output ) === true ) {
1048+ $ error = 'ERROR: The specified ' .$ report .' report file path " ' .$ output .'" is a directory ' .PHP_EOL .PHP_EOL ;
1049+ $ error .= $ this ->printShortUsage (true );
1050+ throw new DeepExitException ($ error , 3 );
10751051 }
10761052 }//end if
10771053 }//end if
0 commit comments