summaryrefslogtreecommitdiff
path: root/tools/benchmark.php
diff options
context:
space:
mode:
Diffstat (limited to 'tools/benchmark.php')
-rwxr-xr-xtools/benchmark.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/benchmark.php b/tools/benchmark.php
index ed7c200d..0bf38509 100755
--- a/tools/benchmark.php
+++ b/tools/benchmark.php
@@ -5,17 +5,17 @@
*
*/
-require dirname(__FILE__) . '/inc/cli.php';
+require __DIR__ . '/inc/cli.php';
require 'inc/image.php';
// move back to this directory
-chdir(dirname(__FILE__));
+chdir(__DIR__);
-if(count($argv) != 2)
+if((is_countable($argv) ? count($argv) : 0) != 2)
die("Usage: {$argv[0]} [file]\n");
$file = $argv[1];
-$extension = strtolower(substr($file, strrpos($file, '.') + 1));
+$extension = strtolower(substr((string) $file, strrpos((string) $file, '.') + 1));
$out = tempnam($config['tmp'], 'thumb');
$count = 300;
@@ -30,7 +30,7 @@ function benchmark($method) {
for($i = 0; $i < $count; $i++) {
$image = new Image($file, $extension);
$thumb = $image->resize(
- $config['thumb_ext'] ? $config['thumb_ext'] : $extension,
+ $config['thumb_ext'] ?: $extension,
$config['thumb_width'],
$config['thumb_height']
);