我有一個腳本,插入到數據庫中,例如20,000郵箱地址的用戶批量爲1000代碼點燃器和exec?
(so two tables,emailParent,emailChild),emailParent中的每一行在emailChild中有1000行。
我想運行發送這些郵件,基本上說,現在 //check_for_pending_parent_rows() returns the id of the first pending row found, or 0
while($parentId = check_for_pending_parent_row()){//loop over children of parent row}
因爲這是談話的sendgrid服務器這可能需要一些時間的腳本。
所以我希望能夠打一個頁面,讓那個頁面啓動一個後臺進程,發送郵件到sendgrid。
我以爲我可以使用exec()
但後來我意識到,我使用的代碼點火器,這意味着入口點必須是index.php
因此,我不認爲exec()
會的工作,
我如何可以啓動一個後臺使用代碼點火器的過程?
你可以通過'index.php'和'system/codeigniter/CodeIgniter.php'的一部分來構建一個腳本來完成基本的CI初始化。這不是很漂亮 - 我看到的代碼大約有70行(格式化,評論)PHP。我沒有權限分享我正在查看的代碼,但它爲類似問題引用了更強大的解決方案:http://www.foostack.com/foostack/ – 2011-06-08 02:14:23