dongmibeng5885 2013-10-06 08:04
浏览 69

Symfony2白屏app.php:ProxyFactory.php

I've got a white screen in app.php but not in app_dev.php On Apache logs :

PHP Fatal error: require(): Failed opening required '[...]app/cache/prod/doctrine/orm/Proxies\_CG_SdzForumBundleEntityCategory.php' (include_path='.;C:\php\pear') in [...]\vendor\doctrine\orm\lib\Doctrine\ORM\Proxy\ProxyFactory.php on line 92

I already tried:

  • cache:clear --env=prod
  • cache:clear --env=prod --no-warmup
  • cache:warmup --env=prod
  • composer.phar update
  • chmod 777 -R app/cache app/logs web/js web/bundles web/css
  • doctrine:schema:update --force

The problem begin when I tried to move a vendor bundle into my sources because it is not updated by developpers: https://github.com/Herzult/HerzultForumBundle

I think there is many ways to get informations from database, and this forum bundle uses one way that I do not master.

Here are some code

config.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

Entity/Category.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
{

Entity/CategoryRepository.php

namespace Sdz\ForumBundle\Entity;

use Sdz\ForumBundle\Model\CategoryRepositoryInterface;
use Sdz\ForumBundle\Entity\ObjectRepository;

class CategoryRepository extends ObjectRepository implements CategoryRepositoryInterface
{

Resources/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>

model.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);

I hope that someone can help me. Thanks a lot at least for reading :)

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
    • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
    • ¥15 绘制多分类任务的roc曲线时只画出了一类的roc,其它的auc显示为nan
    • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
    • ¥20 腾讯企业邮箱邮件可以恢复么
    • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
    • ¥15 错误 LNK2001 无法解析的外部符号
    • ¥50 安装pyaudiokits失败
    • ¥15 计组这些题应该咋做呀
    • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?