Zend Framework 2 How To Set Doctrine 2 Proxy Directory(Zend Framework 2 如何设置 Doctrine 2 代理目录)
问题描述
所以我在 Zend Framework 2 中使用 Doctrine 2 模块,根据 Jason Grimes 的 turorial (http://www.jasongrimes.org/2012/01/using-doctrine-2-in-zend-framework-2/).
So I am using Doctrine 2 module in Zend Framework 2 configured according to Jason Grimes' turorial (http://www.jasongrimes.org/2012/01/using-doctrine-2-in-zend-framework-2/).
有时我会不断收到此错误:
Sometimes I keep getting this error though:
您的代理目录必须是可写的.
Your proxy directory must be writable.
如何设置代理目录?
这是我在 module.config.php 中的 Doctrine 配置:
Here is my Doctrine configuration from module.config.php:
'doctrine' => array(
'driver' => array(
__NAMESPACE__ . '_driver' => array(
'class' => 'DoctrineORMMappingDriverAnnotationDriver',
'cache' => 'array',
'paths' => array(__DIR__ . '/../src/' . __NAMESPACE__ . '/Entity')
),
'orm_default' => array(
'drivers' => array(
__NAMESPACE__ . 'Entity' => __NAMESPACE__ . '_driver'
),
),
),
),
推荐答案
默认代理目录为data/DoctrineORMModule/Proxy.我想你知道如何使它可写,对吗?
The default proxy directory is data/DoctrineORMModule/Proxy. I guess you know how to make it writable, right?
如果由于某种原因需要更改,可以覆盖相应的配置键:
If you need to change it for some reason, you can overwrite the appropriate configuration key:
<?php
return array(
'doctrine' => array(
'configuration' => array(
'<YOUR DRIVER NAME (orm_default by default)>' => array(
'proxy_dir' => 'data/DoctrineORMModule/Proxy',
'proxy_namespace' => 'DoctrineORMModuleProxy',
)
)
)
);
?>
希望这会有所帮助.
这篇关于Zend Framework 2 如何设置 Doctrine 2 代理目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Zend Framework 2 如何设置 Doctrine 2 代理目录
基础教程推荐
- php中的PDF导出 2022-01-01
- 使用 scandir() 在目录中查找文件夹 (PHP) 2022-01-01
- 将变量从树枝传递给 js 2022-01-01
- php中的foreach复选框POST 2021-01-01
- PHPUnit 的 Selenium 2 文档到底在哪里? 2022-01-01
- php 7.4 在写入变量中的 Twig 问题 2022-01-01
- 主题化 Drupal 7 的 Ubercart “/cart"页 2021-01-01
- 如何在数学上评估像“2-1"这样的字符串?产生“1"? 2022-01-01
- Web 服务器如何处理请求? 2021-01-01
- Yii2 - 在运行时设置邮件传输参数 2022-01-01
