PHP  
downloads | documentation | faq | getting help | mailing lists | | php.net sites | links | my php.net 
search for in the  
<mb_substrmcal_append_event>
view the version of this page
Last updated: Sat, 19 Apr 2003

LIII. MCAL Funktionen

Einf�hrung

MCAL bedeutet Modular Calendar Access Library.

Libmcal ist eine C Bibliothek f�r den Zugriff auf Kalender. Sie ist sehr modular programmiert, mit austauschbaren Treibern. MCAL ist das Kalendergegenst�ck zum IMAP Modul f�r Mailboxen.

Mit Hilfe der mcal-Unterst�tzung kann ein Kalender-Stream, �hnlich wie ein Mailbox-Stream mit der IMAP-Unterst�tzung, ge�ffnet werden. Kalender k�nnen lokale Dateispeicher, entfernte ICAP-Server oder andere Formate,von der mcal-Bibliothek unterst�tzt werden, sein.

Kalendereintr�ge k�nnen aufgerufen, abgefragt und gespeichert werden. Desweiteren werden Kalendertermine (Alarm) und wiederkehrende Termine unterst�tzt.

Mit libmcal kann auf zentrale Kalenderserver zugegriffen und diese benutzt werden, was die Programmierung einer bestimmten Datenbank oder einer Datei unn�tig macht.

Um diese Funktionen benutzen zu k�nnen, muss PHP mit der Option --with-mcal kompiliert werden. Dies setzt eine installierte mcal-Bibliothek voraus. Holen Sie sich die aktuelle Version unter und kompilieren und installieren Sie sie.

Anmerkung: PHP hatte eine ICAP Extension, aber sowohl die Originalbibliothek, als auch die PHP Extension werden nicht mehr unterst�tzt. Es wird statt dessen emphohlen, MCAL zu verwenden.

Anforderungen

Diese Extension ben�tigt die MCAL Bibliothek. Downloaden Sie die aktuelle Version unter , kompilieren und installieren Sie sie.

Installation

Nachdem Sie die MCAL Bibliothek installiert haben, m�ssen Sie PHP mit der Option --with-mcal kompilieren, um die MCAL Funktionen nutzen zu k�nnen.

Laufzeit Konfiguration

Diese Erweiterung definiert keine Konfigurationseinstellungen in der php.ini.

Resource Typen

Diese Erweiterung definiert keine Resource-Typen.

Vordefinierte Konstanten

Folgende Konstanten werden von dieser Erweiterung definiert und stehen nur zur Verf�gung, wenn die Erweiterung entweder statisch in PHP kompiliert oder dynamisch zur Laufzeit geladen wurde.

MCAL_SUNDAY (integer)

MCAL_MONDAY (integer)

MCAL_TUESDAY (integer)

MCAL_WEDNESDAY (integer)

MCAL_THURSDAY (integer)

MCAL_FRIDAY (integer)

MCAL_SATURDAY (integer)

MCAL_JANUARY (integer)

MCAL_FEBRUARY (integer)

MCAL_MARCH (integer)

MCAL_APRIL (integer)

MCAL_MAY (integer)

MCAL_JUNE (integer)

MCAL_JULY (integer)

MCAL_AUGUST (integer)

MCAL_SEPTEMBER (integer)

MCAL_OCTOBER (integer)

MCAL_NOVEMBER (integer)

MCAL_DECEMBER (integer)

MCAL_RECUR_NONE (integer)

MCAL_RECUR_DAILY (integer)

MCAL_RECUR_WEEKLY (integer)

MCAL_RECUR_MONTHLY_MDAY (integer)

MCAL_RECUR_MONTHLY_WDAY (integer)

MCAL_RECUR_YEARLY (integer)

MCAL_M_SUNDAY (integer)

MCAL_M_MONDAY (integer)

MCAL_M_TUESDAY (integer)

MCAL_M_WEDNESDAY (integer)

MCAL_M_THURSDAY (integer)

MCAL_M_FRIDAY (integer)

MCAL_M_SATURDAY (integer)

MCAL_M_WEEKDAYS (integer)

MCAL_M_WEEKEND (integer)

MCAL_M_ALLDAYS (integer)

Inhaltsverzeichnis
mcal_append_event -- Store a new event into an MCAL calendar
mcal_close -- Schlie�en eines MCAL-Streams
mcal_create_calendar -- Create a new MCAL calendar
mcal_date_compare -- Compares two dates
mcal_date_valid --  Returns TRUE if the given year, month, day is a valid date
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_days_in_month --  Returns the number of days in the given month
mcal_delete_calendar -- Delete an MCAL calendar
mcal_delete_event -- Delete an event from an MCAL calendar
mcal_event_add_attribute --  Adds an attribute and a value to the streams global event structure
mcal_event_init --  Initializes a streams global event structure
mcal_event_set_alarm --  Sets the alarm of the streams global event structure
mcal_event_set_category --  Sets the category of the streams global event structure
mcal_event_set_class --  Sets the class of the streams global event structure
mcal_event_set_description --  Sets the description 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_recur_daily --  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_none --  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_yearly --  Sets the recurrence 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_title --  Sets the title of the streams global event structure
mcal_expunge --  Deletes all events marked for being expunged.
mcal_fetch_current_stream_event --  Returns an object containing the current streams event structure
mcal_fetch_event --  Holt ein Ereignis aus einem Kalender-Stream.
mcal_is_leap_year --  Returns if the given year is a leap year or not
mcal_list_alarms --  Return a list of events that has an alarm triggered at the given datetime
mcal_list_events --  Zeigt eine Liste der Eintr�ge zwischen zwei Zeitpunkten an
mcal_next_recurrence -- Returns the next recurrence of the event
mcal_open -- Stellt eine MCAL-Verbindung her
mcal_popen -- Opens up a persistent MCAL connection
mcal_rename_calendar -- Rename an MCAL calendar
mcal_reopen -- Reopens an MCAL connection
mcal_snooze -- Turn off an alarm for an event
mcal_store_event -- Modify an existing event in an MCAL calendar
mcal_time_valid --  Returns TRUE if the given year, month, day is a valid time
mcal_week_of_year --  Returns the week number of the given date


User Contributed Notes
MCAL Funktionen
add a note
inan at canada dot com
25-Mar-2000 10:59

MCAL is a great little package, but has changed quite a bit since the documentation has been updated.  If you're having trouble stop by mcal.chek.com and pop a question onto the mcal users mailing list and we'll be happy to help you out.
lurker at shadowtech dot org
23-Dec-2000 08:04

After a thorough search of the web for documentation of how recurence works in MCAL, or even for documentation of the recurence function parameters, I found nothing.  So, I gave up and dove into the MCAL source code for answers, and this is what I have found.  Please keep in mind that this is all "As far as I can tell" information.

First of all, I believe that mcal_list_events DOES return events that recur in the range being searched.

The mcal_event_set_recur_* functions take in an mcal stream, and date for the event to stop recuring by (given by day, month, year), and an "interval".

mcal_event_set_recur_weekly takes an additional integer parameter "weekdays" which is basicly a binary mask created by bitwise ANDing together integers representing the days of the week.

Sunday = 1
Monday = 2
Tuesday = 4
Wednesday = 8
Thursday = 16
Friday = 32
Saturday = 64

So if I wanted the value that represented  "Monday, Wednesday, and Friday" I would do this:
$weekdays = 2 & 8 & 32;

Here is how to interpret "interval" and "weekdays".

For mcal_event_set_recur_daily:
This event should recur every "interval" days.

For mcal_event_set_recur_weekly:
This event should recur on every day specified in "weekdays", and should do so every "interval" weeks.

For mcal_event_set_recur_monthly_mday:
This event should recur on the "interval" day of every month.

For mcal_event_set_recur_monthly_wday:
This event should recur every on every Xday of the Yth week of the month, every "interval" months. (Where Xday is a day of the week, e.g. Monday, Tuesday, etc. Note: This is the one I am the least sure about though it seems to be the logical assumption for how it should work based on the fact that there are two monthly functions and the other one's operation is intuitive.)

For mcal_event_set_recur_yearly:
This event should recur every "interval" years.

lars at sral dot org
11-Jan-2001 11:31

If you compile the libmcal tarball - be sure to copy all the .h files to /usr/local/mcal/include (or whatever) - the Makefile doesn't copy all of them.
mikep at oeone dot com
11-Jan-2001 10:37

Lurker had it a bit wrong (I think)...
If you want Monday, Wednesday and Friday, you would do
2 | 8 | 64
Check out Kronolith (part of the horde project) for more information:

jeff at univrel dot pr dot uconn dot edu
03-Jul-2001 07:03

As of 7/3/2001, libmcal can be built shared (libmcal.so), which should get rid of the linking problem with the MySQL driver. Check the latest version out of the repository if you're planning on building it this way.
verdy_p at wanadoo dot fr
12-May-2002 06:55

Correction to previous extensive note:
ANDing distinct bit values will always result in zero, so your weekly events won't ever be raised. You must use the bitwise-or operator (|) to combine several week days.

mcal_event_set_recur_weekly takes an additional integer parameter
"weekdays" which is basicly a binary mask created by bitwise
ORing together integers representing the days of the week.

Sunday = 1
Monday = 2
Tuesday = 4
Wednesday = 8
Thursday = 16
Friday = 32
Saturday = 64

So if I wanted the value needed to raise the event every "Monday, Wednesday, and Friday" I would do this:
$weekdays = 2 | 8 | 32;

dhorwitz at ched dot uct dot ac dot za
24-May-2002 09:58

Warning to Redhat 7.3 users - the PhP rpms in redhat 7.3 seem to sugest that they have mcal suport - phpinfo() includes the entry '-enable-mcal' but mcal doesn't seem to work
jpmkn at iki dot fi
06-Oct-2002 05:58

Mcal/mstore is not GPL. Read the license and decide if you can live with it before embarking on a big project around mcal.
mmusone at synacor dot com
15-Jan-2003 10:23

Being the author of MCAL, i am completely releasing it as GPL.
It will be modifiied in all subsequent MCAL documentation,
but for now take this as official GPL license notice.

Mark Musone

add a note

<mb_substrmcal_append_event>
 Last updated: Sat, 19 Apr 2003
show source | credits | mirror sites 
Copyright © 2001-2003 The PHP Group
All rights reserved.
This mirror generously provided by: /
Last updated: Wed May 14 01:12:44 2003 CEST