博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Magento Shell
阅读量:7065 次
发布时间:2019-06-28

本文共 763 字,大约阅读时间需要 2 分钟。

在magento/shell/下Virtualcard.php

Java代码  
  1. <?php  
  2. require_once 'abstract.php';  
  3.   
  4. class Mage_Shell_Virtualcard extends Mage_Shell_Abstract  
  5. {  
  6.   
  7.     protected function _getPool()  
  8.     {  
  9.         return Mage::getModel('virtualcard/pool');  
  10.     }  
  11.   
  12.     /** 
  13.      * Run script 
  14.      * 
  15.      */  
  16.     public function run()  
  17.     {  
  18.         if ($option = $this->getArg('option'))   
  19.         {    
  20.             switch ($option){  
  21.                 case 'generation':  
  22.                     $this->_getPool()->applyCodesGeneration();  
  23.                     break;  
  24.                 case 'updateStates':  
  25.                     Mage::getModel('virtualcard/cron')->updateStates();  
  26.                     break;  
  27.             }             
  28.         }else{  
  29.             echo $this->usageHelp();  
  30.         }  
  31.     }  
  32.     /** 
  33.      * Retrieve Usage Help Message 
  34.      * 
  35.      */  
  36.     public function usageHelp()  
  37.     {  
  38.         return <<<USAGE  
  39. Usage:  php -f virtualcard.php -- [options]  
  40.   
  41.   --option generation | updateStates  
  42.   help                          This help  
  43. USAGE;  
  44.     }  
  45. }  
  46.   
  47. $shell = new Mage_Shell_Virtualcard();  
  48. $shell->run();  

 将这个文件加入crontable即可

转载地址:http://rrall.baihongyu.com/

你可能感兴趣的文章
设计模式--六大原则
查看>>
MONyog监控系统
查看>>
后缀数组 --- HDU 3518 Boring counting
查看>>
让你的虚拟机飞起来--VMware workstaion
查看>>
Yeslab 马老师 V2V环境下vCenter Server Heartbeat v6.4实现vCenter5.0的双机备份
查看>>
一个Demo带你彻底掌握View的滑动冲突
查看>>
ZigBee TI ZStack CC2530 1.1 总体框架
查看>>
Oracle 11g RAC ASM 错误之(1)
查看>>
LoadRunner针对Centos实施监控
查看>>
在CentOS上编译安装Nginx+实验环境搭建+测试
查看>>
RabbitMQ基本功能测试用例(Java实现)
查看>>
Android开发学习笔记:浅谈ListView
查看>>
ext-js当用blur()和focus()来控制焦点
查看>>
批处理中的回车换行符
查看>>
opencms 页面编辑模式研究
查看>>
5.4. Summary
查看>>
[3/22]Windows Server 2008启用无线网络服务支持
查看>>
emeditor删除空行
查看>>
RHEL 5基础篇—管理系统服务和进程
查看>>
JAVA类型转换大全
查看>>