是否可以使用cron刷新magento中的生命周期或每日统计信息? [英] Is it possible to refresh the Lifetime or Daily Statistics in magento with a cron?

查看:64
本文介绍了是否可以使用cron刷新magento中的生命周期或每日统计信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用cron刷新生命周期"或每日统计"? 如果可能的话,怎么办?

Is it possible to refresh the Lifetime or Daily Statistics with a cron ? And if it is possible how ?

因为不是每个人在这里都有对magento的相同权限.

Because not everyone haves the same permissions in magento here.

预先感谢

推荐答案

您还可以在根目录中使用cron和php文件运行它.您可以在cron之外运行Shell脚本以刷新统计信息.

You can also run this with cron and a php file in the root. You can run a shell script off cron that refreshes the statistics.

这种方式是否有缺点?因为这比创建模块要容易得多,而且看起来尽可能简单.

Are there any disadvantages to this manner? As this is much easier than creating a module and seems as simple as possible.

您可能会遇到的一个问题是文件的权限,请确保chmod + x该文件.

One issue you may run into is permission for the file, be sure to chmod +x the file.

哦,其他重要的事情. http://pravams.com/2011/08/09/magento-refresh-statistics-automatically /将为您提供Mage_Shell_Abstract的出色的类扩展.

Oh, few other important things. http://pravams.com/2011/08/09/magento-refresh-statistics-automatically/ will give you an excellent class extension of Mage_Shell_Abstract to use.

在该文件中,请务必检查abstact.php的包含路径,它可能需要为shell/,然后使用shell脚本在文件的底部-确保文件名本身与该值匹配.显然,如果那是不正确的,那将是行不通的.

In that file be sure to check your abstact.php inclue path, it may need to be shell/, and then the usage of the shell script is at the bottom of the file- be sure your filename itself matches that value. Obviously it won't work if that is not correct.

还有一件事.如果无法从浏览器运行该文件,但是如果您不希望任何人看到它,则只需在htaccss中添加一个拒绝即可,当然是假设使用了Apache.

One more thing. If the file can't be ran from the browser, but if you don't want anyone to see it anyways... you just add an deny in the htaccss, assuming apache of course.

<Files refresh_statistics.php>
    order allow,deny
    deny from all
</Files>

这篇关于是否可以使用cron刷新magento中的生命周期或每日统计信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆