Symfony 抛出 "Make sure there is a loader supporting the "/config/config_dev.yml“类型”错误?
Symfony is throwing a "Make sure there is a loader supporting the "/config/config_dev.yml" type" error?
我有一个一年前在 Symfony 3.4 中构建的应用程序,我需要再次短暂地使用它但是,当我检查它并尝试 运行 它时,我得到了错误:
Cannot load resouce "<folder_path_here>". Make sure there is a loader supporting the "/config/config_dev.yml" type
我以前没有遇到过这种情况,并且已经查找了有关可能导致这种情况的任何信息,但我仍然 none 比较聪明。
我的config_dev.yml文件供参考:
imports:
- { resource: config.yml }
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: info
console:
type: console
bubble: false
还有我的AppKernel.php
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = [
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Checkout\Checkout()
];
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
}
return $bundles;
}
public function getRootDir()
{
return __DIR__;
}
public function getCacheDir()
{
return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
}
public function getLogDir()
{
return dirname(__DIR__) . '/var/logs';
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__, '/config/config_' . $this->getEnvironment() . '.yml');
}
}
别理我。我是个白痴。 registerContainerConfiguration 中有错字。一个“,”而不是一个“。” ._.
我有一个一年前在 Symfony 3.4 中构建的应用程序,我需要再次短暂地使用它但是,当我检查它并尝试 运行 它时,我得到了错误:
Cannot load resouce "<folder_path_here>". Make sure there is a loader supporting the "/config/config_dev.yml" type
我以前没有遇到过这种情况,并且已经查找了有关可能导致这种情况的任何信息,但我仍然 none 比较聪明。
我的config_dev.yml文件供参考:
imports:
- { resource: config.yml }
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: info
console:
type: console
bubble: false
还有我的AppKernel.php
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = [
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Checkout\Checkout()
];
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
}
return $bundles;
}
public function getRootDir()
{
return __DIR__;
}
public function getCacheDir()
{
return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
}
public function getLogDir()
{
return dirname(__DIR__) . '/var/logs';
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__, '/config/config_' . $this->getEnvironment() . '.yml');
}
}
别理我。我是个白痴。 registerContainerConfiguration 中有错字。一个“,”而不是一个“。” ._.