ASPN ActiveState Programmer Network
  ActiveState, a division of Sophos
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups | Web Services
SEARCH
advanced | search help

Reference
PHP Manual
Function Reference
Apache-specific Functions
Array Functions
Aspell functions [deprecated]
BCMath Arbitrary Precision Mathematics Functions
Bzip2 Compression Functions
Calendar functions
CCVS API Functions
COM support functions for Windows
Class/Object Functions
ClibPDF functions
CURL, Client URL Library Functions
Cybercash payment functions
Crédit Mutuel CyberMUT functions
Character type functions
Database (dbm-style) abstraction layer functions
Date and Time functions
dBase functions
DBM Functions
dbx functions
DB++ Functions
Directory functions
DOM XML functions
Error Handling and Logging Functions
FrontBase Functions
filePro functions
Filesystem functions
Forms Data Format functions
FTP functions
Function Handling functions
Gettext
GMP functions
HTTP functions
Hyperwave functions
ICAP Functions
iconv functions
Image functions
IMAP, POP3 and NNTP functions
Informix functions
InterBase functions
Ingres II functions
IRC Gateway Functions
Java
LDAP functions
Mail functions
Mathematical Functions
Multi-Byte String Functions
MCAL functions
Mcrypt Encryption Functions
Mhash Functions
Microsoft SQL Server functions
Ming functions for Flash
Miscellaneous functions
mnoGoSearch Functions
mSQL functions
MySQL Functions
Network Functions
Unified ODBC functions
Oracle 8 functions
OpenSSL functions
Oracle functions
Ovrimos SQL functions
Output Control Functions
Object property and method call overloading
PDF functions
Verisign Payflow Pro functions
PHP options & information
POSIX functions
PostgreSQL functions
Program Execution functions
Printer functions
Pspell Functions
GNU Readline
GNU Recode functions
Regular Expression Functions (Perl-Compatible)
Regular Expression Functions (POSIX Extended)
Satellite CORBA client extension
Semaphore and Shared Memory Functions
SESAM database functions
Session handling functions
Shared Memory Functions
Shockwave Flash functions
SNMP functions
Socket functions
String functions
Sybase functions
URL Functions
Variable Functions
WDDX Functions
XML parser functions
XSLT functions
YAZ functions
YP/NIS Functions
Zip File Functions (Read Only Access)
Zlib Compression Functions

MyASPN >> Reference >> PHP Manual >> Function Reference
PHP Manual

XLVII. MCAL functions

MCAL stands for Modular Calendar Access Library.

Libmcal is a C library for accessing calendars. It's written to be very modular, with pluggable drivers. MCAL is the calendar equivalent of the IMAP module for mailboxes.

With mcal support, a calendar stream can be opened much like the mailbox stream with the IMAP support. Calendars can be local file stores, remote ICAP servers, or other formats that are supported by the mcal library.

Calendar events can be pulled up, queried, and stored. There is also support for calendar triggers (alarms) and recurring events.

With libmcal, central calendar servers can be accessed, removing the need for any specific database or local file programming.

To get these functions to work, you have to compile PHP with --with-mcal. That requires the mcal library to be installed. Grab the latest version from http://mcal.chek.com/ and compile and install it.

The following constants are defined when using the MCAL module. For weekdays :

  • MCAL_SUNDAY

  • MCAL_MONDAY

  • MCAL_TUESDAY

  • MCAL_WEDNESDAY

  • MCAL_THURSDAY

  • MCAL_FRIDAY

  • MCAL_SATURDAY

For recurrence :

  • MCAL_RECUR_NONE

  • MCAL_RECUR_DAILY

  • MCAL_RECUR_WEEKLY

  • MCAL_RECUR_MONTHLY_MDAY

  • MCAL_RECUR_MONTHLY_WDAY

  • MCAL_RECUR_YEARLY

For months :

  • MCAL_JANUARY

  • MCAL_FEBRUARY

  • MCAL_MARCH

  • MCAL_APRIL

  • MCAL_MAY

  • MCAL_JUNE

  • MCAL_JULY

  • MCAL_AUGUST

  • MCAL_SEPTEMBER

  • MCAL_OCTOBER

  • MCAL_NOVEMBER

  • MCAL_DECEMBER

Most of the functions use an internal event structure that is unique for each stream. This alleviates the need to pass around large objects between functions. There are convenience functions for setting, initializing, and retrieving the event structure values.

Table of Contents
mcal_open -- Opens up an MCAL connection
mcal_popen -- Opens up a persistent MCAL connection
mcal_reopen -- Reopens an MCAL connection
mcal_close -- Close an MCAL stream
mcal_create_calendar -- Create a new MCAL calendar
mcal_rename_calendar -- Rename an MCAL calendar
mcal_delete_calendar -- Delete an MCAL calendar
mcal_fetch_event --  Fetches an event from the calendar stream
mcal_list_events --  Return a list of IDs for a date or a range of dates.
mcal_append_event -- Store a new event into an MCAL calendar
mcal_store_event -- Modify an existing event in an MCAL calendar
mcal_delete_event -- Delete an event from an MCAL calendar
mcal_snooze -- Turn off an alarm for an event
mcal_list_alarms --  Return a list of events that has an alarm triggered at the given datetime
mcal_event_init --  Initializes a streams global event structure
mcal_event_set_category --  Sets the category of the streams global event structure
mcal_event_set_title --  Sets the title of the streams global event structure
mcal_event_set_description --  Sets the description of the streams global event structure
mcal_event_set_start --  Sets the start date and time of the streams global event structure
mcal_event_set_end --  Sets the end date and time of the streams global event structure
mcal_event_set_alarm --  Sets the alarm of the streams global event structure
mcal_event_set_class --  Sets the class of the streams global event structure
mcal_is_leap_year --  Returns if the given year is a leap year or not
mcal_days_in_month --  Returns the number of days in the given month
mcal_date_valid --  Returns TRUE if the given year, month, day is a valid date
mcal_time_valid --  Returns TRUE if the given year, month, day is a valid time
mcal_day_of_week --  Returns the day of the week of the given date
mcal_day_of_year --  Returns the day of the year of the given date
mcal_date_compare -- Compares two dates
mcal_next_recurrence -- Returns the next recurrence of the event
mcal_event_set_recur_none --  Sets the recurrence of the streams global event structure
mcal_event_set_recur_daily --  Sets the recurrence of the streams global event structure
mcal_event_set_recur_weekly --  Sets the recurrence of the streams global event structure
mcal_event_set_recur_monthly_mday --  Sets the recurrence of the streams global event structure
mcal_event_set_recur_monthly_wday --  Sets the recurrence of the streams global event structure
mcal_event_set_recur_yearly --  Sets the recurrence of the streams global event structure
mcal_fetch_current_stream_event --  Returns an object containing the current streams event structure
mcal_event_add_attribute --  Adds an attribute and a value to the streams global event structure
mcal_expunge --  Deletes all events marked for being expunged.

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2003 ActiveState, a division of Sophos All rights reserved