0

在我的开发系统(Ubuntu 11.10)上,我将缓存文件写入其中没有问题,/tmp但我担心部署时我的应用程序会发生什么。我目前有共享主机,所以我猜我无法访问该目录?我的应用程序目录如下所示:

MyApp
- application
   - cache
   - configs
   - controllers
   - forms
   - layouts
   - logs
   - models
   - views
- docs
- library
- public
- tests

我在我的应用程序目录中创建了一个名为缓存的自定义文件夹(如上所示),然后使用以下内容对其进行配置:

$frontendOptions = array('lifeTime' => (strtotime('tomorrow') - time()));
$backendOptions = array('cacheDir' => '../application/cache/');
$cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);

我使用该路径../application/cache/是因为 Zend_Framework 中的所有内容都从位于public文件夹中的 index.php(即前端控制器)中引用。

当我这样做时,它仍然会将我的缓存写入/tmp文件夹。我错过了什么?

4

1 回答 1

2

我认为你有一个错字:

$backendOptions = array('cache_dir' => '../application/cache/');

不是cacheDir

http://framework.zend.com/manual/en/zend.cache.backends.html

于 2012-01-23T20:05:25.317 回答