mirror of
https://github.com/laravel/valet.git
synced 2026-02-06 08:40:09 +01:00
Disable default_mimetype with ini_set instead of via config file
This commit is contained in:
@@ -46,7 +46,6 @@ function install()
|
|||||||
$this->files->ensureDirExists('/usr/local/var/log', user());
|
$this->files->ensureDirExists('/usr/local/var/log', user());
|
||||||
|
|
||||||
$this->updateConfiguration();
|
$this->updateConfiguration();
|
||||||
$this->updateIni();
|
|
||||||
|
|
||||||
$this->restart();
|
$this->restart();
|
||||||
}
|
}
|
||||||
@@ -67,16 +66,6 @@ function updateConfiguration()
|
|||||||
$this->files->put($this->fpmConfigPath(), $contents);
|
$this->files->put($this->fpmConfigPath(), $contents);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the PHP FPM ini.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function updateIni()
|
|
||||||
{
|
|
||||||
$this->files->copyAsUser(__DIR__.'/../stubs/valet.ini', $this->fpmIniPath());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Restart the PHP FPM process.
|
* Restart the PHP FPM process.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ public function mutateUri($uri)
|
|||||||
*/
|
*/
|
||||||
public function serveStaticFile($staticFilePath, $sitePath, $siteName, $uri)
|
public function serveStaticFile($staticFilePath, $sitePath, $siteName, $uri)
|
||||||
{
|
{
|
||||||
|
ini_set('default_mimetype', '');
|
||||||
header('X-Accel-Redirect: ' . $staticFilePath);
|
header('X-Accel-Redirect: ' . $staticFilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,14 +31,6 @@ public function test_fpm_is_configured_with_the_correct_user_group_and_socket()
|
|||||||
$this->assertTrue(strpos($contents, "\ngroup = staff") !== false);
|
$this->assertTrue(strpos($contents, "\ngroup = staff") !== false);
|
||||||
$this->assertTrue(strpos($contents, "\nlisten = /var/run/fpm-valet.socket") !== false);
|
$this->assertTrue(strpos($contents, "\nlisten = /var/run/fpm-valet.socket") !== false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_default_mimetype_is_disabled_in_php_ini()
|
|
||||||
{
|
|
||||||
copy(__DIR__.'/files/ini.conf', __DIR__.'/output/ini.conf');
|
|
||||||
resolve(StubForUpdatingFpmConfigFiles::class)->updateIni();
|
|
||||||
$contents = file_get_contents(__DIR__.'/output/ini.conf');
|
|
||||||
$this->assertTrue(strpos($contents, 'default_mimetype = ""') !== false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user