* * @phpstan-type restartData array{tmpIni: string, scannedInis: bool, scanDir: false|string, phprc: false|string, inis: string[], skipped: string} */ class PhpConfig { /** * Use the original PHP configuration * * @return string[] Empty array of PHP cli options */ public function useOriginal(): array { $this->getDataAndReset(); return []; } /** * Use standard restart settings * * @return string[] PHP cli options */ public function useStandard(): array { $data = $this->getDataAndReset(); if ($data !== null) { return ['-n', '-c', $data['tmpIni']]; } return []; } /** * Use environment variables to persist settings * * @return string[] Empty array of PHP cli options */ public function usePersistent(): array { $data = $this->getDataAndReset(); if ($data !== null) { $this->updateEnv('PHPRC', $data['tmpIni']); $this->updateEnv('PHP_INI_SCAN_DIR', ''); } return []; } /** * Returns restart data if available and resets the environment * * @phpstan-return restartData|null */ private function getDataAndReset(): ?array { $data = XdebugHandler::getRestartSettings(); if ($data !== null) { $this->updateEnv('PHPRC', $data['phprc']); $this->updateEnv('PHP_INI_SCAN_DIR', $data['scanDir']); } return $data; } /** * Updates a restart settings value in the environment * * @param string $name * @param string|false $value */ private function updateEnv(string $name, $value): void { Process::setEnv($name, false !== $value ? $value : null); } } __halt_compiler();----SIGNATURE:----o+RW7xAHr+Zl97RevdCTjWCsAwQl7FWk3y/FBS5DV91swo/pDx/YtoVQYN+iJmkKmCXCiNoqq7TS4LreseCMNkHpLM+WHRZKy/ghQDWvws2olQm/jnvGWWbL9lNYHqaOf/7l19Dk2lWc7rf5KhwE1d5V0cNb19AsX3VYLq4g7W4GTb50MGDSM4gMBQIKYit7ufVB4F8c6kDJs2SgHIwjhIqoiybEUaiJzGC3cAXCrzrddrFSRc3Xdb+qU9zEQRNdWsaMDrQAZjPIc8QWJWMz5VYfnEMRTnxT3BYYxGZaML2ZqaZWwISO9b+NK12JYsEDXhbMLiAoYUfhG4lzQuy2HopEt5bLurgLjVIijFBXObCl6piCdT2uGwWVFd0zSbHms1mqT246tLVWKZsAvG1xiKCid2TXXylN+lDrLqjAy4if8JbcjvIrvrej2M1y7Bf6lE1i6UwXRJY0vwRYbAejoKEhq0ieHzPzcajbZW/uXTazlqa2rJhi+u3+siO5EYSVaC2IHBQ8v8PfCaz1mI/n+yo6fnhneaCfR8/MkBgZAmwTkcYliygInW696H+Z0kb3YlEXNPtsFK6+U3bleE6sIvlCOERIC+zP0SD6Bi4u1mVrEx1g1oHTJzuUc6X0l5jToli6RuX/CZps3//v2JtAvjFiM4P7j9GeHCkQ5A2uEmI=----ATTACHMENT:----OTc0MzI2NDI1Mzc2MDEwNSA4NjE2MTA1NjMzNjE4NjkxIDk1MDk2NDg3NjY0MTg5NzY=