Fix JSON parse error on PHP warnings
Redirect PHP warnings to stderr instead of stdout so that the JSON doesn't become invalid if there are PHP warnings.
This commit is contained in:
parent
c5d7c0e916
commit
aa79e9a295
1 changed files with 2 additions and 3 deletions
|
|
@ -28,20 +28,19 @@ def get_db_connecition_from_typo3_config(ssh_host, ssh_user, config_file):
|
|||
"--",
|
||||
"php",
|
||||
"-d",
|
||||
"display_errors=1",
|
||||
"display_errors=stderr",
|
||||
"--",
|
||||
config_file,
|
||||
],
|
||||
check=True,
|
||||
input=php_code,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
stderr=sys.stderr,
|
||||
text=True,
|
||||
)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"Error: Command failed with return code {e.returncode}")
|
||||
print(f"stdout: {e.stdout}")
|
||||
print(f"stderr: {e.stderr}")
|
||||
raise
|
||||
|
||||
return json.loads(proc.stdout)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue