缓存 – Symfony2 bootstrap.php.cache文件的目的是什么?

前端之家收集整理的这篇文章主要介绍了缓存 – Symfony2 bootstrap.php.cache文件的目的是什么?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在我们的遗留项目之一使用SF2,而不是整个框架,而是通过拉入需要的捆绑包和组件.我一直想知道这些代码行:
$loader = require_once __DIR__.'/../app/bootstrap.PHP.cache';

require_once __DIR__.'/../app/AppKernel.PHP';
//require_once __DIR__.'/../app/AppCache.PHP';

$kernel = new AppKernel('prod',false);
$kernel->loadClassCache();

我不知道这个bootstrap.PHP.cache文件是什么,它是什么,它是如何生成的(如果我不使用SF2整个框架).我以前没有使用过,没有问题,但是我想知道这是否可以给我一些性能提升等等,我应该研究一下.我试图找到周围,但找不到专门针对这个主题文件.

解决方法

To ensure optimal flexibility and code reuse,Symfony2 applications leverage a variety of classes and 3rd party components. But loading all of these classes from separate files on each request can result in some overhead. To reduce this overhead,the Symfony2 Standard Edition provides a script to generate a so-called bootstrap file,consisting of multiple classes definitions in a single file. By including this file (which contains a copy of many of the core classes),Symfony no longer needs to include any of the source files containing those classes. This will reduce disc IO quite a bit.

资料来源:Use Bootstrap Files.

原文链接:https://www.f2er.com/bootstrap/234066.html

猜你在找的Bootstrap相关文章