OSDN Git Service
(root)
/
wvm
/
wvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c8ce1cb
)
introduce is_windows() helper
author
scribu
<mail@scribu.net>
Wed, 25 Dec 2013 17:13:50 +0000
(19:13 +0200)
committer
scribu
<mail@scribu.net>
Wed, 25 Dec 2013 17:13:50 +0000
(19:13 +0200)
php/commands/help.php
patch
|
blob
|
history
php/utils.php
patch
|
blob
|
history
diff --git
a/php/commands/help.php
b/php/commands/help.php
index
d722a92
..
46cf470
100644
(file)
--- a/
php/commands/help.php
+++ b/
php/commands/help.php
@@
-76,7
+76,7
@@
class Help_Command extends WP_CLI_Command {
}
private static function pass_through_pager( $out ) {
- if (
strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'
) {
+ if (
Utils\is_windows()
) {
// no paging for Windows cmd.exe; sorry
echo $out;
return 0;
diff --git
a/php/utils.php
b/php/utils.php
index
1972c25
..
a281bd1
100644
(file)
--- a/
php/utils.php
+++ b/
php/utils.php
@@
-375,3
+375,10
@@
function parse_url( $url ) {
return $url_parts;
}
+/**
+ * Check if we're running in a Windows environment (cmd.exe).
+ */
+function is_windows() {
+ return strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
+}
+