PHP有關問題(急)

來源:互聯網
上載者:User
PHP問題(急)
請各位高手幫忙:下面的緩衝代碼:怎麼樣實現每隔15分鐘就調用一次鑽石榜,魅力榜,職分榜:
//調用緩衝
$cacheM = new Seed_Model_Cache2File();
$money_list = $cacheM->get("money_list");
$extcredits2_list = $cacheM->get("extcredits2_list");
$extcredits1_list = $cacheM->get("extcredits1_list");

if (!isset($money_list)){
//鑽石榜
$userM = new User_Model_User('user');
$money_list = $userM->fetch_rows(array(0,7), $where_str, array('money desc'));
//echo 111;//測試是否在用緩衝;
$cacheM->save("money_list",$money_list);
}
if (!isset($extcredits2_list)){
//魅力榜
$bbsM = new User_Model_Bbs('bbs');
$extcredits2_list = $bbsM->fetch_rows(array(0,7),$where_str,"extcredits2 DESC");
$cacheM->save("extcredits2_list",$extcredits2_list);
}
if (!isset($extcredits1_list)){
//職分榜
$extcredits1_list = $bbsM->fetch_rows(array(0,7),$where_str,"extcredits1 DESC");
$cacheM->save("extcredits1_list",$extcredits1_list);
}

$this->view->money_list = $money_list;
$this->view->extcredits2_list = $extcredits2_list;
$this->view->extcredits1_list = $extcredits1_list;

------解決方案--------------------
使用系統的任務計劃。要不就寫個死迴圈;sleep(15*60)shell調用。
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.