Bas*_*sit 10 performance benchmarking bundle symfony
我有应用程序,它有核心网站,api和管理区域.我想知道在一个应用程序中包含所有内容或者我应该创建不同的Symfony2项目还是应该将它们拆分为不同的内核?
我不确定在相同的内核上添加大量的捆绑包是否会影响性能或者只是一点点,这无关紧要?
以下是选项:
您可以定义更多“环境”。
例如 :
在AppKernel.php中
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
//new AppBundle\AppBundle()
);
if (in_array($this->getEnvironment(), array('api'), true)) {
$bundles[] = new ApiBundle\ApiBundle();
//-- Other bundle
}
//-- Other environments
return $bundles;
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
488 次 |
| 最近记录: |