Download the PHP package 4-angles/contao-google-calendar-bundle without Composer

On this page you can find all versions of the php package 4-angles/contao-google-calendar-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package contao-google-calendar-bundle

Contao Google Calendar Sync Bundle

License: MIT

Bi-directional synchronization between Contao CMS calendars and Google Calendar. Import events from Google Calendar into Contao and export Contao events to Google Calendar with automatic scheduling via cron jobs.

Version control

I will always publish releases version based on which Contao version they support, so if its 5.3.0 it supports 5.3.* Contao version, etc...

Features

Requirements

Need Help Installing?

If the setup looks too technical, we offer installation as a service. We'll handle the Google Cloud configuration, bundle setup, and authentication so you can focus on managing your events.

Contact us at [email protected] and we'll take care of it for you.

Installation

1. Google Cloud Console Setup

1.1 Create a Google Cloud Project

  1. Go to Google Cloud Console
  2. Create a new project or select an existing one
  3. Note your Project ID for reference

1.2 Enable Google Calendar API

  1. In your Google Cloud Project, navigate to APIs & Services → Library
  2. Search for "Google Calendar API"
  3. Click Enable

1.3 Configure OAuth Consent Screen

  1. Go to APIs & Services → OAuth consent screen
  2. Choose External (or Internal for Google Workspace domains)
  3. Fill in the required information:
    • App name: Your application name (e.g., "Contao Calendar Sync")
    • User support email: Your email address
    • Developer contact information: Your email address
  4. Click Save and Continue
  5. Scopes: Click "Add or Remove Scopes"
    • Add: https://www.googleapis.com/auth/calendar (See, edit, share....)
  6. Click Save and Continue
  7. Test users (for External apps in testing): Add your Google account email
  8. Click Save and Continue
  9. When you finish testing publish app so renew token works automaticly.

1.4 Create OAuth 2.0 Credentials

  1. Go to APIs & Services → Credentials
  2. Click Create Credentials → OAuth client ID
  3. Select Application type: Web application
  4. Name: Give it a descriptive name (e.g., "Contao Calendar OAuth")
  5. Authorized redirect URIs: Add your callback URL
    • Format: https://yourdomain.com/contao/google-calendar-callback
    • Note: The redirect URI is now generated automatically, so you just need to add it here in Google Console
  6. Click Create
  7. Copy the Client ID and Client Secret - you'll need these for configuration

2. Bundle Installation

Install via Composer:

Or manually:

  1. Copy the bundle files to your Contao installation
  2. Run composer install to install dependencies
  3. Clear the cache: php vendor/bin/contao-console cache:clear

3. Configuration

You can configure the bundle in two ways (backend UI takes precedence):

Option A: Backend UI (Recommended)

  1. Log in to Contao backend
  2. Navigate to System → Google Calendar Settings
  3. Enter your credentials:
    • Google Client ID: From Google Cloud Console
    • Google Client Secret: From Google Cloud Console
    • Application Name: (Optional) Custom name shown during OAuth
  4. Save

Option B: Environment Variables (.env) (Test 1st)

Add to your .env.local file:

4. Authentication

  1. Navigate to Content → Calendars
  2. Edit a calendar
  3. Enable Google Calendar Sync
  4. Select calendars for (you can select only import, or only export):
    • Import: Google Calendar to import FROM
    • Export: Google Calendar to export TO
  5. You'll be prompted to authenticate with Google (click link in the message) https://yourdomain.com/contao/google-calendar-auth
  6. Grant access to your Google Calendar

Important: Use different calendars for import and export to prevent sync loops!

Cron Job Setup

The bundle provides automatic synchronization via Contao's cron system:

Manual Cron Setup (Production)

For production environments, set up a system cron job for better reliability:

Cron Schedule Details

Import (Every Minute)

Export (Every Minute)

Manual Console Commands

You can also trigger sync manually:

Usage

Calendar Configuration

For each calendar you want to sync:

  1. Go to Content → Calendars
  2. Edit the calendar
  3. In the Google Sync section:
    • ✅ Enable Google Calendar Sync
    • Import Calendar: Select Google Calendar to import FROM
    • Export Calendar: Select Google Calendar to export TO
    • Sync Until: Date range limit (default: 1 year ahead)
    • Privacy Mode: Optionally sync as "Busy" without event details

Manual Sync Buttons

In Content → Calendar Events:

Buttons are shown only when the current calendar has Google sync enabled and the corresponding import/export calendar is configured.

Event-Level Behavior (tl_calendar_events)

Configuration Options

Calendar-Level Settings

Field Description
Google Sync Enabled Enable sync for this calendar
Import Calendar ID Google Calendar to import events FROM
Export Calendar ID Google Calendar to export events TO
Sync Until Import/export events up to this date (default: +1 year)
Sync as Busy Hide event details, show as "Busy" only
Busy Text Custom text for busy events (default: "Busy")
Override import location If enabled, imported events use custom location text
Import location text Custom value written into imported event location field

Global Settings (System → Google Calendar Settings)

Field Description
Google Client ID OAuth Client ID from Google Cloud Console
Google Client Secret OAuth Client Secret from Google Cloud Console
Application Name Name shown during OAuth flow

Architecture

Sync Logic

Import Direction (Google → Contao)

Export Direction (Contao → Google)

Sync Loop Prevention

Database Fields

Additional read-only tracking fields added to tl_calendar_events:

Field Purpose
google_event_id Event ID in import calendar
google_export_event_id Event ID in export calendar
google_updated Timestamp of last sync
google_event_origin 'google' or 'contao'
google_calendar_source Source calendar ID (for imports)

Troubleshooting

Authentication Issues

Error: "Could not generate authorization URL"

Error: "Access token expired"

Sync Issues

Events not importing

Events not exporting

Duplicate events

Rate Limiting

The bundle handles Google API rate limits automatically:

Security Considerations

Known Issues

Current Limitations

  1. Complex Recurring Patterns: Some advanced RRULE patterns (BYDAY, BYMONTHDAY, BYSETPOS) may not sync perfectly between systems due to differences in how Contao and Google Calendar handle recurring events

  2. Timezone Handling: Events are stored in google calendar timezone by default. Multi-timezone support may need additional configuration, or maybe not I didnt tested trough

  3. All-Day Events: Google Calendar all-day events use exclusive end dates (end date + 1 day), which is automatically handled but may cause confusion when viewing raw data

  4. Instance-Based Sync: Recurring events with singleEvents=true only import the first instance to prevent duplicates. Changes to individual instances of recurring events may not sync

  5. OAuth Token Refresh: If refresh token expires (rare), manual re-authentication is required. Token refresh should happen automatically if the app is published and in production mode

  6. Attachment/Image Sync: Event attachments and images are not synced between systems

  7. Attendee/Guest Lists: Attendee information is not synced

TODO / Roadmap

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

This project is licensed under the MIT License.

Support

For issues, questions, or feature requests:

Credits

Developed by Kimleta

Built with:


⚠️ Important Reminder: Always test in a development environment first. Back up your database before enabling sync on production calendars.


All versions of contao-google-calendar-bundle with dependencies

PHP Build Version
Package Version
Requires contao/calendar-bundle Version 5.3.*
contao/core-bundle Version 5.3.*
google/apiclient Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package 4-angles/contao-google-calendar-bundle contains the following files

Loading the files please wait ...