2010-02-04 35 views
0

我'运行一个PHP脚本来插入我从CSV文件中取的事件。事件在我的日历中成功输入,但在输入约75个事件后停止。任何想法,如果它仅限于一定数量的事件或它是我的代码中的问题。我可以通过Google日历数据API输入事件的限制吗?

在此先感谢帮助我!

$event->title = $service->newTitle($title); 

    $event->where = array($service->newWhere("Red Ball Internet Centre")); 


    $service->newContent($content); 



    // Set the date using RFC 3339 format. 

    $tzOffset = "-04"; 



    $when = $service->newWhen(); 

    $when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00"; 

    $when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00"; 

    $event->when = array($when); 

    // Upload the event to the calendar server 

    // A copy of the event as it is recorded on the server is returned 
    switch($rink) 
    { 
    case"Rink A": 
     $uri = "http://www.google.com/calendar/feeds/qsqivvbvdm7o4ibrmt9gfu301g%40group.calendar.google.com/private/full"; 
    break; 
    case"Rink B": 
     $uri = "http://www.google.com/calendar/feeds/dcr864c3orqj264mufl1t3slt8%40group.calendar.google.com/private/full"; 
    break; 
    case"Rink C": 
     $uri = "http://www.google.com/calendar/feeds/bira8i123uuqovhn5kuk9caqnk%40group.calendar.google.com/private/full"; 
    break; 
    case"Rink D": 
     $uri = "http://www.google.com/calendar/feeds/11a8m100ccjhms971kc33app4g%40group.calendar.google.com/private/full"; 
    break;     
    } 

    $newEvent = $service->insertEvent($event, $uri); 

回答

0

该脚本在停止之前运行了多长时间?难道你需要增加php.ini文件中的MAX_EXECUTION_TIME设置吗?在它有机会完成之前,PHP可能会超时。

+0

ohhhh ...没有想到这一点。让我试试这个! – 2010-02-04 15:14:50

+0

这工作!非常感谢你 – 2010-02-04 16:29:07

相关问题