fix: align server globals with PHP CLI

pull/39/head
韩天峰 1 month ago
parent 620c9e2ab1
commit d7de18f993
  1. 4
      src/Translator.php

@ -693,8 +693,8 @@ class Translator extends Preprocessor
// Embedded binaries populate the CLI script fields in $_SERVER at // Embedded binaries populate the CLI script fields in $_SERVER at
// request startup, even when the source does not reference $_SERVER. // request startup, even when the source does not reference $_SERVER.
if ($this->isBuildModeBin() && !isset($this->globalVars['_SERVER'])) { if ($this->isBuildModeBin() && !$this->hasGlobalVar('_SERVER')) {
$this->globalVars['_SERVER'] = Type::ARRAY; $this->addGlobalVar('_SERVER', Type::ARRAY);
} }
foreach ($this->globalVars as $name => $type) { foreach ($this->globalVars as $name => $type) {

Loading…
Cancel
Save