1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 16:40:05 +01:00

Merge pull request #1238 from jjpmann/feature/custom-site-stubs

use getStub to allow custom stub files
This commit is contained in:
Matt Stauffer
2022-12-01 20:25:41 -05:00
committed by GitHub
7 changed files with 32 additions and 17 deletions

View File

@@ -689,7 +689,7 @@ public function trustCertificate($crtPath)
*/
public function buildCertificateConf($path, $url)
{
$config = str_replace('VALET_DOMAIN', $url, $this->files->get(__DIR__.'/../stubs/openssl.conf'));
$config = str_replace('VALET_DOMAIN', $url, $this->files->getStub('openssl.conf'));
$this->files->putAsUser($path, $config);
}
@@ -704,7 +704,7 @@ public function buildSecureNginxServer($url, $siteConf = null)
{
if ($siteConf === null) {
$siteConf = $this->replaceOldLoopbackWithNew(
$this->files->get(__DIR__.'/../stubs/secure.valet.conf'),
$this->files->getStub('secure.valet.conf'),
'VALET_LOOPBACK',
$this->valetLoopback()
);
@@ -742,7 +742,7 @@ public function isolate($valetSite, $phpVersion)
$siteConf = str_replace(
['VALET_HOME_PATH', 'VALET_SERVER_PATH', 'VALET_STATIC_PREFIX', 'VALET_SITE', 'VALET_PHP_FPM_SOCKET', 'VALET_ISOLATED_PHP_VERSION'],
[VALET_HOME_PATH, VALET_SERVER_PATH, VALET_STATIC_PREFIX, $valetSite, PhpFpm::fpmSockName($phpVersion), $phpVersion],
$this->replaceLoopback($this->files->get(__DIR__.'/../stubs/site.valet.conf'))
$this->replaceLoopback($this->files->getStub('site.valet.conf'))
);
}
@@ -852,9 +852,7 @@ public function proxyCreate($url, $host, $secure = false)
}
$siteConf = $this->replaceOldLoopbackWithNew(
$this->files->get(
$secure ? __DIR__.'/../stubs/secure.proxy.valet.conf' : __DIR__.'/../stubs/proxy.valet.conf'
),
$this->files->getStub($secure ? 'secure.proxy.valet.conf' : 'proxy.valet.conf'),
'VALET_LOOPBACK',
$this->valetLoopback()
);
@@ -979,7 +977,7 @@ public function updateLoopbackPlist($loopback)
str_replace(
'VALET_LOOPBACK',
$loopback,
$this->files->get(__DIR__.'/../stubs/loopback.plist')
$this->files->getStub('loopback.plist')
)
);