Commit f53db7d
authored
fix: php port replacement removes entire line in site config (#43)
Fixes #42.
This pull request makes a minor update to the way the PHP port is
replaced in the site configuration within the
`replacePhpVersionInSiteConf` function. The change simplifies the usage
of replacement variables in the `preg_replace` call, improving
readability and maintainability.
- Refactored the `preg_replace` replacement string in the
`replacePhpVersionInSiteConf` function in `Site.php` to use string
concatenation with `${1}` instead of double-quoted interpolation with
`$1`, ensuring correct variable substitution and preventing entire line
removal with the wrong interpretation of the backreference numbers.
- Removed the limit of max replacements the `preg_replace` can do,
ensuring all PHP port lines in multiple location blocks in the site
configs are replaced.1 file changed
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
992 | 992 | | |
993 | 993 | | |
994 | 994 | | |
995 | | - | |
996 | | - | |
997 | | - | |
| 995 | + | |
| 996 | + | |
998 | 997 | | |
999 | 998 | | |
1000 | 999 | | |
| |||
0 commit comments