首页 > Web开发 > 详细

using components in Cakephp 2+ Shell

时间:2016-08-24 11:16:49      阅读:291      评论:0      收藏:0      [点我收藏+]


 1 <?php
 2 App::uses(‘AppShell‘, ‘Console/Command‘);
 3 App::uses(‘ComponentCollection‘, ‘Controller‘);
 4 App::uses(‘Controller‘, ‘Controller‘);
 5 App::uses(‘MTurkComponent‘, ‘Controller/Component‘);
 6 
 7 class ProcessCompletedTask extends Shell {
 8     public function execute() {
 9         $this->out("Processing...\n");
10         $collection = new ComponentCollection();
11         $this->MTurk = new MTurkComponent($collection);
12         $controller = new Controller();
13         $this->MTurk->initialize($controller);
14 
15         $this->MTurk->processHITs();
16         $this->out("Complete\n");
17     }
18 }

 

原文出处: using components in Cakephp 2+ Shell


using components in Cakephp 2+ Shell

原文:http://www.cnblogs.com/wscrlhs/p/5801899.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!