@@ -972,29 +972,14 @@ public function processLongArgument($arg, $pos)
972
972
if ($ this ->reportFile === false ) {
973
973
$ this ->reportFile = substr ($ arg , 12 );
974
974
975
- $ dir = dirname ($ this ->reportFile );
975
+ $ dir = Util \Common:: realpath ( dirname ($ this ->reportFile ) );
976
976
if (is_dir ($ dir ) === false ) {
977
977
$ error = 'ERROR: The specified report file path " ' .$ this ->reportFile .'" points to a non-existent directory ' .PHP_EOL .PHP_EOL ;
978
978
$ error .= $ this ->printShortUsage (true );
979
979
throw new DeepExitException ($ error , 3 );
980
980
}
981
981
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 );
998
983
}//end if
999
984
1000
985
self ::$ overriddenDefaults ['reportFile ' ] = true ;
@@ -1050,28 +1035,19 @@ public function processLongArgument($arg, $pos)
1050
1035
if ($ output === false ) {
1051
1036
$ output = null ;
1052
1037
} else {
1053
- $ dir = dirname ($ output );
1038
+ $ dir = Util \Common:: realpath ( dirname ($ output) );
1054
1039
if (is_dir ($ dir ) === false ) {
1055
1040
$ error = 'ERROR: The specified ' .$ report .' report file path " ' .$ output .'" points to a non-existent directory ' .PHP_EOL .PHP_EOL ;
1056
1041
$ error .= $ this ->printShortUsage (true );
1057
1042
throw new DeepExitException ($ error , 3 );
1058
1043
}
1059
1044
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 );
1075
1051
}
1076
1052
}//end if
1077
1053
}//end if
0 commit comments