@@ -19,10 +19,27 @@ headers.
1919.. |shield-loc | image :: https://img.shields.io/github/languages/code-size/grommunio/mapi-header-php
2020 :target: https://github.com/grommunio/mapi-header-php/
2121
22+ Features
23+ ========
24+
25+ * **MS-OX* Protocol Compliance **: Full compliance with Microsoft Exchange
26+ protocols (MS-OXOCAL, MS-OXOTASK, MS-OXOMSG, MS-OXCICAL, etc.)
27+ * **Meeting Request Handling **: Complete lifecycle management for meeting
28+ requests, responses, updates, and cancellations
29+ * **Recurrence Support **: Comprehensive recurrence pattern parsing and
30+ generation for appointments and tasks (daily, weekly, monthly, yearly)
31+ * **Task Management **: Full task request and delegation support with
32+ multi-assignee capabilities
33+ * **Exception Handling **: Robust error handling with detailed MAPI exception
34+ mapping
35+ * **Authentication **: KeyCloak SSO integration and JWT token management
36+ * **Free/Busy **: Calendar free/busy message and folder utilities
37+
2238Compatibility
2339=============
2440
25- * PHP 7.4+, PHP 8.x
41+ * **PHP 8.2+ ** (Version 2.0+)
42+ * Requires PHP MAPI extension
2643
2744Support
2845=======
@@ -48,3 +65,199 @@ Coding style
4865
4966This repository follows a custom coding style, which can be validated anytime
5067using the repository's provided `configuration file <.phpcs >`_.
68+
69+ Installation
70+ ============
71+
72+ Via Composer
73+ ------------
74+
75+ .. code-block :: bash
76+
77+ composer require grommunio/mapi-header-php
78+
79+ Manual Installation
80+ -------------------
81+
82+ .. code-block :: bash
83+
84+ git clone https://github.com/grommunio/mapi-header-php.git
85+ cd mapi-header-php
86+ make install
87+
88+ This installs the PHP files to ``/usr/share/php-mapi/ ``.
89+
90+ Library Structure
91+ =================
92+
93+ Core Components
94+ ---------------
95+
96+ **Definition Files **
97+
98+ * ``mapidefs.php `` - Core MAPI constants, property types, object types
99+ * ``mapiguid.php `` - MAPI GUID constants for property sets (PSETID_*)
100+ * ``mapitags.php `` - Custom property tag definitions
101+ * ``mapi.util.php `` - Utility functions for MAPI operations
102+ * ``bootstrap.php `` - Bootstrap loader for all headers
103+
104+ **Class Files **
105+
106+ * ``class.meetingrequest.php `` - Meeting request lifecycle management
107+ * ``class.recurrence.php `` - Appointment recurrence handling
108+ * ``class.taskrecurrence.php `` - Task-specific recurrence
109+ * ``class.taskrequest.php `` - Task delegation and request handling
110+ * ``class.baserecurrence.php `` - Abstract recurrence base class
111+ * ``class.baseexception.php `` - Base exception with display messages
112+ * ``class.mapiexception.php `` - MAPI-specific exception handling
113+ * ``class.freebusy.php `` - Free/busy utilities
114+ * ``class.keycloak.php `` - KeyCloak SSO integration
115+ * ``class.token.php `` - JWT token parsing and validation
116+
117+ Key Classes
118+ -----------
119+
120+ Meetingrequest
121+ ~~~~~~~~~~~~~~
122+
123+ Handles the complete lifecycle of meeting requests:
124+
125+ * **Sending **: Create and send meeting requests to attendees
126+ * **Receiving **: Process incoming meeting requests, responses, cancellations
127+ * **Updating **: Update existing meetings with counter-proposals
128+ * **Tracking **: Monitor attendee responses and track status
129+ * **Resources **: Automatic resource booking and conflict detection
130+
131+ Example:
132+
133+ .. code-block :: php
134+
135+ <?php
136+ require_once '/usr/share/php-mapi/bootstrap.php';
137+
138+ $mr = new Meetingrequest($store, $message, $session);
139+
140+ // Check if it's a meeting request
141+ if ($mr->isMeetingRequest()) {
142+ // Accept the meeting
143+ $mr->doAccept(false, true, true);
144+ }
145+
146+ Recurrence
147+ ~~~~~~~~~~
148+
149+ Parse and generate recurrence patterns according to MS-OXOCAL:
150+
151+ * Daily, weekly, monthly, yearly patterns
152+ * Exception handling (modified and deleted occurrences)
153+ * Timezone support
154+ * Occurrence expansion within date ranges
155+
156+ Example:
157+
158+ .. code-block :: php
159+
160+ <?php
161+ $recurrence = new Recurrence($store, $message);
162+
163+ // Get occurrences in a date range
164+ $items = $recurrence->getCalendarItems(
165+ $store,
166+ $calendarFolder,
167+ $startDate,
168+ $endDate
169+ );
170+
171+ TaskRequest
172+ ~~~~~~~~~~~
173+
174+ Manage task assignments and delegation:
175+
176+ * Task assignment to multiple recipients
177+ * Task acceptance/declination workflow
178+ * Task history tracking
179+ * Status updates and completion tracking
180+
181+ BaseException & MAPIException
182+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
183+
184+ Structured error handling:
185+
186+ * User-friendly display messages
187+ * Technical details for debugging
188+ * MAPI error code mapping
189+ * Exception handling state tracking
190+
191+ Testing
192+ =======
193+
194+ This library includes a comprehensive PHPUnit test suite. See `tests/README.md
195+ <tests/README.md> `_ for details.
196+
197+ Run tests:
198+
199+ .. code-block :: bash
200+
201+ composer install
202+ vendor/bin/phpunit
203+
204+ Run with coverage:
205+
206+ .. code-block :: bash
207+
208+ vendor/bin/phpunit --coverage-html coverage
209+
210+ Code Quality
211+ ============
212+
213+ The codebase maintains high quality standards:
214+
215+ * **PHP-CS-Fixer **: Automated code style enforcement
216+ * **PHPUnit **: Comprehensive unit test coverage
217+ * **Type Safety **: Extensive use of PHP 7.4+/8.x type hints
218+ * **PHPstan* **: Static code analysis
219+
220+ Check code style:
221+
222+ .. code-block :: bash
223+
224+ vendor/bin/php-cs-fixer fix --dry-run --diff
225+
226+ Apply fixes:
227+
228+ .. code-block :: bash
229+
230+ vendor/bin/php-cs-fixer fix
231+
232+ Static code analysis:
233+
234+ .. code-block :: bash
235+
236+ vendor/bin/php-cs-fixer analyze
237+
238+ MS-OXPROPS Compliance
239+ =====================
240+
241+ This library follows Microsoft Exchange protocol specifications:
242+
243+ * **MS-OXOCAL **: Calendar and Appointment Objects
244+ * **MS-OXOTASK **: Task Objects
245+ * **MS-OXOMSG **: Message Objects
246+ * **MS-OXCICAL **: iCalendar to Appointment Object Conversion
247+ * **MS-OXPROPS **: Property Set Definitions
248+
249+ All named properties use the PidLid naming convention and are resolved via
250+ ``getPropIdsFromStrings() `` to ensure compatibility.
251+
252+ Changelog
253+ =========
254+
255+ See `doc/changelog.rst <doc/changelog.rst >`_ for version history and release
256+ notes.
257+
258+ License
259+ =======
260+
261+ AGPL-3.0-only. See LICENSE.txt for details.
262+
263+ Copyright 2020-2025 grommunio GmbH
0 commit comments