Skip to content

Commit

Permalink
Update scripts to use now() helper
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIII committed Sep 13, 2018
1 parent 63ea968 commit a694bb3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
2018-09-13 DariusIII
* Chg: Update scripts to use now() helper
* Chg: Use now() helper and related functions for time calculations in ProcessReleases class
* Chg: Update laravel/framework to version 5.7
* Chg: Update smarty/smarty to version 3.1.33
Expand Down
7 changes: 3 additions & 4 deletions misc/testing/Releases/recategorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,17 @@ function reCategorize($argv)
} else {
echo ColorCLI::header('Categorizing all releases using searchname. This can take a while, be patient.');
}
$timestart = time();
$timestart = now();
if (isset($argv[1]) && (is_numeric($argv[1]) || $argv[1] === 'misc')) {
$chgcount = categorizeRelease(str_replace(' AND', 'WHERE', $where), $update, true);
} else {
$chgcount = categorizeRelease('', $update, true);
}
$consoletools = new ConsoleTools();
$time = $consoletools->convertTime(time() - $timestart);
$time = now()->diffInSeconds($timestart);
if ($update === true) {
echo ColorCLI::header('Finished re-categorizing '.number_format($chgcount).' releases in '.$time.' , using the searchname.'.PHP_EOL);
} else {
echo ColorCLI::header('Finished re-categorizing in '.$time.' , using the searchname.'.PHP_EOL
echo ColorCLI::header('Finished re-categorizing in '.$time.' seconds , using the searchname.'.PHP_EOL
.'This would have changed '.number_format($chgcount).' releases but no updates were done.'.PHP_EOL);
}
}
Expand Down
4 changes: 2 additions & 2 deletions misc/update/tmux/bin/update_groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Blacklight\ConsoleTools;
use Illuminate\Support\Facades\DB;

$start = time();
$start = now();
$consoleTools = new ConsoleTools();

// Create the connection here and pass
Expand Down Expand Up @@ -44,4 +44,4 @@
}
}

ColorCLI::doEcho(ColorCLI::header('Running time: '.$consoleTools->convertTimer(time() - $start)));
ColorCLI::doEcho(ColorCLI::header('Running time: '.now()->diffInSeconds($start).' seconds'), true);

0 comments on commit a694bb3

Please sign in to comment.