DevNetwork Forums

The Developer's Network
It is currently Mon Feb 08, 2010 10:18 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 44 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: iCalendar library (critique new use cases for qCal library)
PostPosted: Wed Mar 28, 2007 4:51 pm 
Offline
The Ninja Space Mod
User avatar

Joined: Fri Aug 05, 2005 1:53 pm
Posts: 6357
Location: Chico, CA
I've decided to try putting together an open-source php5 library that would allow users to parse and create iCalendar files on the fly. It may not ever see the light of day, but I think it will be a great learning experience. I would just like to get some suggestions as to what to name this library. I was going to go with PHPiCal, but that is kind of already taken... ( http://phpical.org/ )

As far as I know, nothing like this exists. At least not an open-source library... I take that back. I just looked on sourceforge and found bennu. I'll look at it and make an assessment on whether it's good or not. :)

UPDATE- 9/25/07 - I have added a google code homepage for this project here: http://code.google.com/p/qcal/

_________________
My Personal Blog :: My Resume
Clever got me this far... then tricky got me in
Luke Visinoni luke d0t visinoni at gmail d0t com


Last edited by Luke on Tue Sep 25, 2007 7:12 pm, edited 3 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 5:08 pm 
Offline
DevNet Master
User avatar

Joined: Tue Nov 02, 2004 6:43 am
Posts: 2704
Location: Ireland
If you go ahead, be sure to keep the parser well separated. For example, the iCalendar specification (well, RFC at least) is also followed by the hCal microformat so the two can be made interchangeable. I've been fiddling with a hCal parser in bits and pieces so iCal should be a very tidy format to work on.

_________________
Pádraic Brady
Projects: PHPSpec, Zend Framework
Book: Zend Framework: Surviving The Deep End (Coming 2009)


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 5:19 pm 
Offline
The Ninja Space Mod
User avatar

Joined: Fri Aug 05, 2005 1:53 pm
Posts: 6357
Location: Chico, CA
Here is something I just whipped out just to get an idea of how I want the interface to be... let me know if it's WAY off. Keep in mind it's just a rough idea of how I want it to work and I haven't finished reading the RFC yet. Also, I'm using TDD so the interface will change a lot.

[php]<?php
// some use cases for PHPiCal

$iCal = new PHPiCal('Luke\'s Test Calendar', 'publish');

$event = new PHPiCal_Event; // uid auto-generated
//$event = new PHPiCal_Event($unique_id); // uid set by user
$event->setTitle('Luke\'s Birthday');
$event->setStartDate(new PHPiCal_Date('2007-04-23'));
$event->setStartTime(new PHPiCal_Time('4:00pm'));
$event->setDescription('Just a nice little birthday get together');
/** and so on **/
$iCal->attach($event);

$todo = new PHPiCal_Todo;
$todo->setTitle('Luke\'s friend\'s birthday');
$todo->setStartDate(new PHPiCal_Date('2007-04-07'));
$todo->setStartTime(new PHPiCal_Time('5:00am'));
/** and so on **/
$iCal->attach($todo);

echo $iCal->render(new PHPiCal_Renderer_Month);

// reading a calendar

$iCal2 = new PHPiCal;

$iCal2->import('./files/test_calendar.ics');
echo $iCal2->render(new PHPiCal_Renderer_hCal);

// exporting to a file

$iCal3 = new PHPiCal('Luke\'s Test Calendar', 'publish');

// add some events, todos, journal entries, etc.

$iCal3->exportFile('./files/test_calendar.ics');
?>[/php]

_________________
My Personal Blog :: My Resume
Clever got me this far... then tricky got me in
Luke Visinoni luke d0t visinoni at gmail d0t com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 5:21 pm 
Offline
Admin
User avatar

Joined: Tue Sep 09, 2003 6:04 pm
Posts: 14184
Location: Fremont, CA, USA
That's a lot of code for General Discussion Ninja. :wink:

_________________
PHPDN's Most Friendly Award, 2006, Most Helpful, Friendliest 2007, Friendliest, Peacemaker 2008
Zend Certified Engineer 2008, Zend Framework Certified Engineer 2009
Common Forum Answers | PHPDN Forum Tour | <?php $me = `whoami`; ?> | <?php while (!$succeed) $try++; ?>
I don't offer solutions via PM. It is much more helpful to the community if we can solve problems in the open so others can benefit from the solution as well.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 5:38 pm 
Offline
The Ninja Space Mod
User avatar

Joined: Fri Aug 05, 2005 1:53 pm
Posts: 6357
Location: Chico, CA
good point... but in my defense, the original question was "What should I call this" :oops:

_________________
My Personal Blog :: My Resume
Clever got me this far... then tricky got me in
Luke Visinoni luke d0t visinoni at gmail d0t com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 5:52 pm 
Offline
Admin
User avatar

Joined: Tue Sep 09, 2003 6:04 pm
Posts: 14184
Location: Fremont, CA, USA
Maybe you could ask a moderator to move it to PHP - Theory & Design perhaps? ;)

_________________
PHPDN's Most Friendly Award, 2006, Most Helpful, Friendliest 2007, Friendliest, Peacemaker 2008
Zend Certified Engineer 2008, Zend Framework Certified Engineer 2009
Common Forum Answers | PHPDN Forum Tour | <?php $me = `whoami`; ?> | <?php while (!$succeed) $try++; ?>
I don't offer solutions via PM. It is much more helpful to the community if we can solve problems in the open so others can benefit from the solution as well.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 3:19 am 
Offline
DevNet Master
User avatar

Joined: Tue Nov 02, 2004 6:43 am
Posts: 2704
Location: Ireland
Looks fine ;). The Data and Time fields could have an integrated alias, e.g. setDateTime() so it can accept a timestamp or date string. Also be sure to account for the whether the date is local or UTC (or whether it needs conversion even). Only other tricky thing to watch is the format's line endings - CRLF per the RFC (ugh!).

_________________
Pádraic Brady
Projects: PHPSpec, Zend Framework
Book: Zend Framework: Surviving The Deep End (Coming 2009)


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 1:06 pm 
Offline
Moderator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 9960
Location: Portland, Oregon, US
I am wondering whether the render() and import()/export() methods should be in the main class or moved out to other classes that take a core object in the constructor. I think moving them out would make the system more modular and customizable.

So:[php]
$month = new PHPiCal_Renderer_Month($iCal);
echo $month ->render();

// reading a calendar

$iCal2 = new PHPiCal;

$io = new PHPiCal_IO($iCal);
$io>import('./files/test_calendar.ics');

$hCal = new PHPiCal_Renderer_hCal($iCal2);
echo $hCal->render();

// exporting to a file

$iCal3 = new PHPiCal('Luke\'s Test Calendar', 'publish');

// add some events, todos, journal entries, etc.

$io->setCal($iCal3);
$io->exportFile('./files/test_calendar.ics'); [/php]

_________________
Christopher (#10850)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 1:22 pm 
Offline
The Ninja Space Mod
User avatar

Joined: Fri Aug 05, 2005 1:53 pm
Posts: 6357
Location: Chico, CA
probably will... that is where tdd will come it. It will help me decide on a lot of these ui details. the great thing is... I think I am FINALLY starting to get the hang of this whole testing thing.

_________________
My Personal Blog :: My Resume
Clever got me this far... then tricky got me in
Luke Visinoni luke d0t visinoni at gmail d0t com


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 4:04 pm 
Offline
DevNet Master
User avatar

Joined: Tue Nov 02, 2004 6:43 am
Posts: 2704
Location: Ireland
Are you contagious yet? ;)

_________________
Pádraic Brady
Projects: PHPSpec, Zend Framework
Book: Zend Framework: Surviving The Deep End (Coming 2009)


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 12:43 am 
Offline
The Ninja Space Mod
User avatar

Joined: Fri Aug 05, 2005 1:53 pm
Posts: 6357
Location: Chico, CA
:: coughs :: maybe :wink:

Alright, so nobody has any ideas for what to call this thing. I'm at a loss myself. maybe iCalPHP?

_________________
My Personal Blog :: My Resume
Clever got me this far... then tricky got me in
Luke Visinoni luke d0t visinoni at gmail d0t com


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 1:02 am 
Offline
Moderator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 9960
Location: Portland, Oregon, US
I think PHPiCal or iCalPHP are silly because you don't really need to say it's PHP. I would just call the classes Icalendar_* or Ical_*.

_________________
Christopher (#10850)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 1:12 am 
Offline
The Ninja Space Mod
User avatar

Joined: Fri Aug 05, 2005 1:53 pm
Posts: 6357
Location: Chico, CA
Well the issue with that is iCal is already a known piece of software and iCalendar is a known standard. Let's say somebody on this forum asks "does anybody know where I can find an oop php library that is capable of creating/parsing iCalendar files?". I'd like for the answer to be yea, go do http://www.icalphp.com and download iCalPHP. If I were to name the library simply iCal, that would not be possible.

I really don't like the name iCalPHP nor PHPiCal though. What do you think?

EDIT: What do you think of pical (PHPiCalendar) ?

_________________
My Personal Blog :: My Resume
Clever got me this far... then tricky got me in
Luke Visinoni luke d0t visinoni at gmail d0t com


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 2:04 am 
Offline
Moderator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 9960
Location: Portland, Oregon, US
In that case pical or phical are good ... or how about phpical or icalphp ;)

_________________
Christopher (#10850)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 2:21 am 
Offline
DevNet Master
User avatar

Joined: Wed Dec 06, 2006 5:14 pm
Posts: 3598
Location: Toronto, Canada
Php Extension for Normalized iCal Syntax

I happen to know of a computer store with the ideal logo!

Seriously though, maybe you should stick with the incredibly un-sexy "PHPiCal" name, it's far more Google friendly.

_________________
My name is Kieran... and I heart jQuery and this real-time regex evaluator // DevNet Awards '07/08: Funniest /*looking*/ // 基兰既不说话也不写着中文
Image


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 44 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: PCSpectra and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group