projects
/
tweeper.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d831bbe
)
tweeper: make is_cli() stricter
author
Antonio Ospite <ao2@ao2.it>
Wed, 29 Jul 2015 20:52:15 +0000
(22:52 +0200)
committer
Antonio Ospite <ao2@ao2.it>
Wed, 29 Jul 2015 20:52:15 +0000
(22:52 +0200)
Assume that tweeper is running from an actual command line only when
php_sapi_name() matches _exactly_ the string "cli".
This makes it possible to use tweeper in a browser using the PHP
built-in web server, for which php_sapi_name() returns "cli-server".
tweeper.php
patch
|
blob
|
history
diff --git
a/tweeper.php
b/tweeper.php
index
5e9d242
..
f07382b
100644
(file)
--- a/
tweeper.php
+++ b/
tweeper.php
@@
-285,7
+285,7
@@
class Tweeper {
function is_cli()
{
- return (
substr(php_sapi_name(), 0, 3) == 'cli'
);
+ return (
php_sapi_name() === "cli"
);
}
function usage($argv)