Skip to content

Commit

Permalink
#597 - PHP warning fix for macOS Catalina (#600)
Browse files Browse the repository at this point in the history
for details, see #597
  • Loading branch information
kensoh authored Oct 25, 2019
1 parent c30d5f5 commit 47cdf94
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/tagui
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ chrome_command="google-chrome"

if [ -z "$1" ]
then
echo "tagui v5.8: use following options and this syntax to run - ./tagui flow_filename option(s)"
echo "tagui v5.9: use following options and this syntax to run - ./tagui flow_filename option(s)"
echo
echo "chrome - run on visible Chrome web browser instead of invisible PhantomJS (first install Chrome)"
echo "headless - run on invisible Chrome web browser instead of default PhantomJS (first install Chrome)"
Expand Down
2 changes: 1 addition & 1 deletion src/tagui.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rem enable windows for loop advanced flow control
setlocal enableextensions enabledelayedexpansion

if "%~1"=="" (
echo tagui v5.8: use following options and this syntax to run - tagui flow_filename option^(s^)
echo tagui v5.9: use following options and this syntax to run - tagui flow_filename option^(s^)
echo.
echo chrome - run on visible Chrome web browser instead of invisible PhantomJS ^(first install Chrome^)
echo headless - run on invisible Chrome web browser instead of default PhantomJS ^(first install Chrome^)
Expand Down
22 changes: 11 additions & 11 deletions src/tagui_parse.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,28 @@
$repo_count = 0; if (file_exists(getenv('custom_csv_file'))) { // load datatable or legacy datatable / repository
$repo_file = fopen(getenv('custom_csv_file'),'r') or die("ERROR - cannot open " . getenv('custom_csv_file') . "\n");
while (!feof($repo_file)) {$repo_data[$repo_count] = fgetcsv($repo_file);
if (count($repo_data[$repo_count]) == 0) die("ERROR - empty row found in " . getenv('custom_csv_file') . "\n");
if (@count($repo_data[$repo_count]) == 0) die("ERROR - empty row found in " . getenv('custom_csv_file') . "\n");
$repo_count++;} fclose($repo_file); $repo_count-=1; //-1 for header, for EOF need to check flexibly using below line
if (count($repo_data[$repo_count]) == 1) $repo_count-=1;} //-1 for EOF (Windows files don't end with newline character)
if (@count($repo_data[$repo_count]) == 1) $repo_count-=1;} //-1 for EOF (Windows files don't end with newline character)

$local_repo_location = str_replace("\\","/",dirname($script)) . '/tagui_local.csv';
if (file_exists($local_repo_location)) { // load local repository file if it exists for objects and keywords
$local_repo_file = fopen($local_repo_location,'r') or die("ERROR - cannot open " . 'tagui_local.csv' . "\n");
if ($repo_count != 0) $repo_count++; fgetcsv($local_repo_file); // +1 if array has data, discard header record
while (!feof($local_repo_file)) {$repo_data[$repo_count] = fgetcsv($local_repo_file);
if (count($repo_data[$repo_count]) == 0) die("ERROR - empty row found in " . 'tagui_local.csv' . "\n");
if (count($repo_data[$repo_count]) != 1) // pad the empty columns when local repository is used with datatable
{$repo_data[$repo_count] = array_pad($repo_data[$repo_count], count($repo_data[0]), $repo_data[$repo_count][1]);}
$repo_count++;} fclose($local_repo_file); $repo_count-=1; if (count($repo_data[$repo_count]) == 1) $repo_count-=1;}
if (@count($repo_data[$repo_count]) == 0) die("ERROR - empty row found in " . 'tagui_local.csv' . "\n");
if (@count($repo_data[$repo_count]) != 1) // pad the empty columns when local repository is used with datatable
{$repo_data[$repo_count] = array_pad($repo_data[$repo_count], @count($repo_data[0]), $repo_data[$repo_count][1]);}
$repo_count++;} fclose($local_repo_file); $repo_count-=1; if (@count($repo_data[$repo_count]) == 1) $repo_count-=1;}

if (file_exists('tagui_global.csv')) { // load global repository file if it exists for objects and keywords
$global_repo_file = fopen('tagui_global.csv','r') or die("ERROR - cannot open " . 'tagui_global.csv' . "\n");
if ($repo_count != 0) $repo_count++; fgetcsv($global_repo_file); // +1 if array has data, discard header record
while (!feof($global_repo_file)) {$repo_data[$repo_count] = fgetcsv($global_repo_file);
if (count($repo_data[$repo_count]) == 0) die("ERROR - empty row found in " . 'tagui_global.csv' . "\n");
if (count($repo_data[$repo_count]) != 1) // pad the empty columns when global repository is used with datatable
{$repo_data[$repo_count] = array_pad($repo_data[$repo_count], count($repo_data[0]), $repo_data[$repo_count][1]);}
$repo_count++;} fclose($global_repo_file); $repo_count-=1; if (count($repo_data[$repo_count]) == 1) $repo_count-=1;}
if (@count($repo_data[$repo_count]) == 0) die("ERROR - empty row found in " . 'tagui_global.csv' . "\n");
if (@count($repo_data[$repo_count]) != 1) // pad the empty columns when global repository is used with datatable
{$repo_data[$repo_count] = array_pad($repo_data[$repo_count], @count($repo_data[0]), $repo_data[$repo_count][1]);}
$repo_count++;} fclose($global_repo_file); $repo_count-=1; if (@count($repo_data[$repo_count]) == 1) $repo_count-=1;}

$tagui_web_browser = "this"; // set the web browser to be used base on tagui_web_browser environment variable
if ((getenv('tagui_web_browser')=='headless') or (getenv('tagui_web_browser')=='chrome')) $tagui_web_browser = 'chrome';
Expand Down Expand Up @@ -1087,7 +1087,7 @@ function parse_condition($logic) { // natural language handling for conditions
$token = explode(" ",$logic); // split into tokens for loop in natural language, eg - for cupcake from 1 to 4
if (strpos($raw_logic,"{")!==false) // show error to put { to next line for parsing as { step
echo "ERROR - " . current_line() . " put { to next line - " . $raw_logic . "\n";
else if (count($token) != 6) echo "ERROR - " . current_line() . " invalid for loop - " . $raw_logic . "\n";
else if (@count($token) != 6) echo "ERROR - " . current_line() . " invalid for loop - " . $raw_logic . "\n";
else $logic = $token[0]." (".$token[1]."=".$token[3]."; ".$token[1]."<=".$token[5]."; ".$token[1]."++)";}
else if ((substr($logic,0,4)=="for ") and (strpos($raw_logic,"{")!==false))
echo "ERROR - " . current_line() . " put { to next line - " . $raw_logic . "\n";
Expand Down
2 changes: 1 addition & 1 deletion src/tagui_report.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

$audit_output_header = '"#","AUTOMATION FLOW","START TIME","FINISH TIME","ERROR STATUS","LOG FILE"';
if (!file_exists('tagui_report.csv')) file_put_contents('tagui_report.csv', $audit_output_header . "\r\n");
$audit_output_count = count(file('tagui_report.csv')) - 1 + 1; // to track and increment entry # in audit file
$audit_output_count = @count(file('tagui_report.csv')) - 1 + 1; // to track and increment entry # in audit file
$html_log_file = $script . '_' . $audit_output_count . '.html'; // to allow log persistence without overwriting
$audit_output_line = '"' . $audit_output_count . '","' . $escaped_script . '","' . $start_timestamp . '","';
$audit_output_line .= $finish_timestamp . '","' . $error_status . '","' . $html_log_file . '"' . "\r\n";
Expand Down
2 changes: 1 addition & 1 deletion src/translate.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
$language = strtolower($language); $language_count = 0; if (file_exists('languages/' . $language . '.csv')) {
$language_file = fopen('languages/' . $language . '.csv','r') or die("ERROR - cannot open " . $language . '.csv' . "\n");
while (!feof($language_file)) {$language_data[$language_count] = fgetcsv($language_file);
if (count($language_data[$language_count]) == 0) die("ERROR - empty row found in " . $language . '.csv' . "\n");
if (@count($language_data[$language_count]) == 0) die("ERROR - empty row found in " . $language . '.csv' . "\n");
$language_count++;} fclose($language_file); $language_count-=1; // -1 for header
if ($language_data[$language_count][0] == '') $language_count-=1;} // -1 for EOF
else die("ERROR - missing language file " . $language . '.csv' . "\n");
Expand Down
2 changes: 1 addition & 1 deletion src/transpose.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
if (is_array($csv_line) && $csv_line[0] !== null) {
$csv_data[] = $csv_line;
}
} fclose($source_file); $csv_count = count($csv_data);
} fclose($source_file); $csv_count = @count($csv_data);

// do some prep, transpose datatable and output csv file
$csv_result = array(); $target_csv = str_replace("_transpose.csv",".csv",$source_csv);
Expand Down

0 comments on commit 47cdf94

Please sign in to comment.