mirror of
https://github.com/jbcr/core.git
synced 2026-04-26 01:58:15 +02:00
Rename guesstimatePublicFolder() to getPublicFolder() and make the function protected. This way subclasses of Kernel can provide their own implementation, for example returning a hard-coded path.
This commit is contained in:
committed by
Bob den Otter
parent
fdb266d60f
commit
36f03643f3
+11
-2
@@ -91,7 +91,7 @@ class Kernel extends BaseKernel
|
||||
|
||||
private function setBoltParameters(ContainerBuilder $container, string $confDir): void
|
||||
{
|
||||
$container->setParameter('bolt.public_folder', $this->guesstimatePublicFolder());
|
||||
$container->setParameter('bolt.public_folder', $this->getPublicFolder());
|
||||
|
||||
$fileLocator = new FileLocator([$confDir . '/bolt']);
|
||||
$fileName = $fileLocator->locate('config.yaml', null, true);
|
||||
@@ -158,7 +158,16 @@ class Kernel extends BaseKernel
|
||||
$container->setParameter('bolt.requirement.taxonomies', $slugs);
|
||||
}
|
||||
|
||||
private function guesstimatePublicFolder(): string
|
||||
/**
|
||||
* Return the public folder of this project. This implementation locates the public folder
|
||||
* for this project by checking for the following candidates in the project dir: 'public',
|
||||
* 'public_html', 'www', 'web', 'httpdocs', 'wwwroot', 'htdocs', 'http_public', 'private_html'
|
||||
* and picking the first that is a directory.
|
||||
*
|
||||
* @return string path to the public folder for this project
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function getPublicFolder(): string
|
||||
{
|
||||
$projectDir = $this->getProjectDir();
|
||||
$candidates = ['public', 'public_html', 'www', 'web', 'httpdocs', 'wwwroot', 'htdocs', 'http_public', 'private_html'];
|
||||
|
||||
Reference in New Issue
Block a user