AI-generated Key Takeaways
-
This is a PHP-based reference implementation of the API v3 Booking Server, requiring Apache and PHP for setup.
-
The server utilizes a .htaccess file for routing, mandates HTTPS with an SSL certificate, and employs JSON serialization.
-
Download the project using
git clone
, place the three files (.htaccess
,bookingserver.php
,apiv3methods.php
) in a servable directory, and ensure/v3/
requests are routed throughbookingserver.php
. -
Test the Booking Server using the provided booking test utility after installation.
This is a reference implementation of API v3 Booking Server based on PHP
Prerequisites
Requires an installation of
Getting Started
The Booking Server is implemented using PHP and Apache. To properly route the requests, it makes use of the .htaccess file, so make sure that AllowOverride is enabled for the directory.
You must set up a SSL certificate, and have all requests served over HTTPS. If your server does not already have an SSL certificate setup, you can review the Apache SSL/TLS documentation.
The PHP implementation does not rely upon protocol buffer libraries, but instead, relies on simple JSON serialization methods.
To download the project, execute the following command:
git clone https://maps-booking.googlesource.com/php-maps-booking-rest-server-v3-skeleton
The entire code base consists of only three files:
- .htaccess instructs apache to route all of the /v3/ requests through bookingserver.php
- bookingserver.php handles the request logic, including authentication
- apiv3methods.php has the methods implementing API v3 interface
After you download the files, you should place them in a servable directory. Note that whichever directory you put them in will become the parent to the /v3/ directory, which you do not need to explicitly create.