Thanks for your interest in this, Trevor!
I'm on a shared host, and my hosting provider have now reset the
memory to 150mb, which is the default for their packages.
Also, the code I'm trying to execute is part of a module I'm
developing for the Joomla! CMS (www.joomla.org), so the error could be
there as well. Everything is working fine, but when I'm trying to
fetch 40 or so events it crashes. The funny thing is that I can
include several modules in the same page, with different data spans
(and hence way more than 40 events), and then everything is fine. I've
invluded the code below. Perhaps some obvious errors can be spotted? I
will do some postings on the Joomla! forum as well, but if you would
like to have a go at it, please do. All help is much appreciated!
Stian
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
require_once
(JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
set_include_path( get_include_path() . PATH_SEPARATOR . JPATH_LIBRARIES);
require_once ('Zend/Loader.php');
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
class modActivitiesHelper
{
function getEvents(&$params)
{
$mindate = trim( $params->get('mindate') );
$maxdate = trim( $params->get('maxdate') );
$user = '[EMAIL PROTECTED]';
$pass = 'xxxxx';
$service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
$client = Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service);
$gdataCal = new Zend_Gdata_Calendar($client);
$query = $gdataCal->newEventQuery();
$query->setUser('[EMAIL PROTECTED]');
$query->setVisibility('public');
$query->setMaxresults('10000');
$query->setProjection('full');
$query->setOrderby('starttime');
$query->setSortorder('ascending');
if ($mindate != '') $query->setStartMin($mindate);
if ($maxdate != '') $query->setStartMax($maxdate);
$eventFeed = $gdataCal->getCalendarEventFeed($query);
$i = 0;
$events = array();
foreach ($eventFeed as $event) {
$title = $event->title->text;
$feedurl = explode('/', $event->id->text);
$googleid = $feedurl[count($feedurl)-1];
$description = $event->content->text;
foreach ($event->when as $when) {
$start = $when->startTime;
$end = $when->endTime;
}
foreach ($event->where as $where) {
$where = $where->valueString;
}
if ($where == '') $where = ' ';
$datestamp = strtotime($start);
$date = date("d.m.Y", $datestamp);
$time = date("H:i", $datestamp);
$prevmonth = $curmonth;
$curmonth = ucfirst(strftime("%B", $datestamp));
$prevyear = $curyear;
$curyear = date("Y", $datestamp);
if ($time == '00:00') $time = ' ';
$color = ($color == 'even' || $prevmonth != $curmonth) ? 'odd' : 'even';
//$open = ($description != '') ? 'open' : '';
$class = $color . ' ' . $open;
$events[$i]->date = $date;
$events[$i]->time = $time;
$events[$i]->title = $title;
$events[$i]->where = $where;
$events[$i]->description = $description;
$events[$i]->curyear = $curyear;
$events[$i]->prevyear = $prevyear;
$events[$i]->curmonth = $curmonth;
$events[$i]->prevmonth = $prevmonth;
$events[$i]->class = $class;
$i++;
}
return $events;
}
}
?>
2007/9/12, Trevor Johns <[EMAIL PROTECTED]>:
>
> On Sep 11, 1:38 am, "Stian Totland" <[EMAIL PROTECTED]> wrote:
> > Hm, I raised it to 250MB, but no success. Any other idéas?
> >
> > Stian
>
> Hm, that's odd. I sincerely hope it's not gobbling up that much space!
>
> Are you still getting the same error as before? Specifically, has the
> amount of memory that's been allocated before it gave up larger now? I
> just want to make sure that the changes you made took effect.
>
> --
> Trevor Johns
> http://tjohns.net
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---