aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2017-11-07 15:05:32 +0100
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2017-11-07 15:05:32 +0100
commit19e182bdddaab39fb8c863860e32ce3f1d1aa22a (patch)
tree4038caf882ff027ae795db5e54e9a031cf6af416
parent059e130c849950a252ecd315d058b22563d4bf29 (diff)
downloadProtocol-19e182bdddaab39fb8c863860e32ce3f1d1aa22a.zip
Protocol-19e182bdddaab39fb8c863860e32ce3f1d1aa22a.tar.gz
Protocol-19e182bdddaab39fb8c863860e32ce3f1d1aa22a.tar.bz2
fix(protocol) Fix type for `dirname` argument.
-rw-r--r--Source/Protocol.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/Protocol.php b/Source/Protocol.php
index 93a870d..ed452b4 100644
--- a/Source/Protocol.php
+++ b/Source/Protocol.php
@@ -92,10 +92,12 @@ class Protocol extends Node
*/
protected function initialize(): void
{
- $root = dirname(__DIR__, 3);
- $cwd =
+ $root = dirname(__DIR__, 3);
+ $argv0 = realpath($_SERVER['argv'][0]);
+
+ $cwd =
'cli' === PHP_SAPI
- ? dirname(realpath($_SERVER['argv'][0]))
+ ? false !== $argv0 ? dirname($argv0) : ''
: getcwd();
$this[] = new Node(