projects
/
tweeper.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b453301
)
tweeper: avoid a reference to $argv in non-cli mode
author
Antonio Ospite <ao2@ao2.it>
Wed, 29 Jul 2015 20:56:42 +0000
(22:56 +0200)
committer
Antonio Ospite <ao2@ao2.it>
Wed, 29 Jul 2015 20:58:28 +0000
(22:58 +0200)
$argv is not defined in non-cli mode, so protect its usage behind an
is_cli() check.
For instance, this avoids a message in the PHP built-in web server, when
usage() gets called:
PHP Notice: Undefined variable: argv in .../tweeper.php on line 357
tweeper.php
patch
|
blob
|
history
diff --git
a/tweeper.php
b/tweeper.php
index
f07382b
..
a9fce9b
100644
(file)
--- a/
tweeper.php
+++ b/
tweeper.php
@@
-354,7
+354,7
@@
if (is_cli()) {
}
if (!isset($options['src_url'])) {
- fwrite($ERROR_STREAM, usage(
$argv
));
+ fwrite($ERROR_STREAM, usage(
is_cli() ? $argv : NULL
));
exit(1);
}