我在 app.php 中有一个白屏,但在 app_dev.php 中没有在 Apache 日志中:
PHP 致命错误:require(): 无法打开所需的 '[...]app/cache/prod/doctrine/orm/Proxies\_ CG _SdzForumBundleEntityCategory.php' (include_path='.;C:\php\pear') [...]\vendor\doctrine\orm\lib\Doctrine\ORM\Proxy\ProxyFactory.php 在第 92 行
我已经尝试过:
- 缓存:清除 --env=prod
- 缓存:清除 --env=prod --no-warmup
- 缓存:预热 --env=prod
- composer.phar 更新
- chmod 777 -R app/cache app/logs web/js web/bundles web/css
- 学说:架构:更新--force
当我尝试将供应商捆绑包移动到我的源时,问题就开始了,因为它没有被开发人员更新: https ://github.com/Herzult/HerzultForumBundle
我认为有很多方法可以从数据库中获取信息,而这个论坛包使用了一种我不掌握的方法。
这是一些代码
配置.yml
doctrine:
orm:
auto_mapping: true
auto_generate_proxy_classes: "%kernel.debug%"
proxy_namespace: Proxies
proxy_dir: %kernel.cache_dir%/doctrine/orm/Proxies
default_entity_manager: default
metadata_cache_driver: array
query_cache_driver: array
result_cache_driver: array
实体/类别.php
namespace Sdz\ForumBundle\Entity;
use Sdz\ForumBundle\Model\Category as BaseCategory;
use Doctrine\ORM\Mapping as ORM;
/**
*
* @ORM\Table(name="sdz_forum_category")
* @ORM\Entity(repositoryClass="Sdz\ForumBundle\Entity\CategoryRepository")
*/
class Category extends BaseCategory
{
实体/CategoryRepository.php
namespace Sdz\ForumBundle\Entity;
use Sdz\ForumBundle\Model\CategoryRepositoryInterface;
use Sdz\ForumBundle\Entity\ObjectRepository;
class CategoryRepository extends ObjectRepository implements CategoryRepositoryInterface
{
资源/config/orm.xml
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<!-- Object Manager Service -->
<service id="herzult_forum.object_manager" alias="doctrine.orm.entity_manager" />
</services>
</container>
模型.xml
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<!-- [...] -->
<!-- Topic Repository Service -->
<service id="herzult_forum.repository.topic" class="Sdz\ForumBundle\Model\TopicRepositoryInterface" factory-service="herzult_forum.object_manager" factory-method="getRepository">
<argument type="string">%herzult_forum.model.topic.class%</argument>
</service>
<!-- [...] -->
</services>
</container>
DefaultController.php
//Problem line
$topics = $this->get('herzult_forum.repository.topic')->findBy(array(), array('pulledAt' => 'desc'), 10);
我希望有人能帮助我。至少非常感谢您阅读:)