From 10947733a201ef35204e4daaf5726da271840477 Mon Sep 17 00:00:00 2001 From: Marc Rodriguez <31536387+mrodespin@users.noreply.github.com> Date: Wed, 18 Jun 2025 11:27:56 +0200 Subject: [PATCH] Create php-memory-limits.ini only one time Change how the php-memory-limits.ini is managed because when changed between PHP versions all the configuration added previously is overrided and it a waste of time if you work with several PHP versions during the day --- cli/Valet/PhpFpm.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cli/Valet/PhpFpm.php b/cli/Valet/PhpFpm.php index c1a85bf..6b89fc7 100644 --- a/cli/Valet/PhpFpm.php +++ b/cli/Valet/PhpFpm.php @@ -82,10 +82,12 @@ public function createConfigurationFiles(string $phpVersion): void $destDir = dirname(dirname($fpmConfigFile)).'/conf.d'; $this->files->ensureDirExists($destDir, user()); - $this->files->putAsUser( - $destDir.'/php-memory-limits.ini', - $this->files->getStub('php-memory-limits.ini') - ); + if (!file_exists($destDir.'/php-memory-limits.ini')) { + $this->files->putAsUser( + $destDir.'/php-memory-limits.ini', + $this->files->getStub('php-memory-limits.ini') + ); + } $contents = str_replace( ['VALET_USER', 'VALET_HOME_PATH'],