bash - CakePHP 3.x 如何使用控制台清除 View 缓存?

标签 bash cakephp caching cakephp-3.0

我的 CakePHP 3.x 应用托管在 bitbucket 中。

我有一个部署脚本,它将 git clone 到一个使用时间戳作为文件夹名称的文件夹。

之后脚本将创建符号链接(symbolic link) /var/virtual/webapp/current 到这个带时间戳的文件夹。

但是,由于某些原因,尽管有这个新部署的文件夹, View 文件仍然被缓存。 tmp 文件夹也是空的。

如何使用控制台清除 View 文件的缓存,以便将其添加到 bash 脚本中?

'Cache' => [
        'default' => [
            'className' => 'File',
            'path' => CACHE,
        ],

        /**
         * Configure the cache used for general framework caching. Path information,
         * object listings, and translation cache files are stored with this
         * configuration.
         */
        '_cake_core_' => [
            'className' => 'File',
            'prefix' => 'myapp_cake_core_',
            'path' => CACHE . 'persistent/',
            'serialize' => true,
            'duration' => '+2 minutes',
        ],

        /**
         * Configure the cache for model and datasource caches. This cache
         * configuration is used to store schema descriptions, and table listings
         * in connections.
         */
        '_cake_model_' => [
            'className' => 'File',
            'prefix' => 'myapp_cake_model_',
            'path' => CACHE . 'models/',
            'serialize' => true,
            'duration' => '+2 minutes',
        ],
    ],

最佳答案

试试这个

// Clear one cache config
bin/cake cache clear <configname>

// Clear all cache configs
bin/cake cache clear_all

关于bash - CakePHP 3.x 如何使用控制台清除 View 缓存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29893003/

相关文章:

bash - 读取文件并使用 bash 程序将每一行拆分为两个变量

linux - Bash - 反引号调用永远阻塞

bash - 在 Mininet 中批量执行命令

bash - 在 bash 中解析电子邮件中的发件人姓名

CakePHP + AngularJS + 复杂的 json 输出

c - block 大小是在硬件中固定的还是可以用 C 或 asm 重新编程?

php - CakePhp单页获取多表数据

javascript - 为什么要使用 CakePHP 的 JsHelper?

jquery - 如何缓存每个列表项子元素以供以后使用?

java - 如何在不重启服务器的情况下清除ehcache