PHP 用予約サーバー スケルトン
これは、PHP ベースの API v3 予約サーバーのリファレンス実装です。
前提条件
インストールが必要
スタートガイド
予約サーバーは PHP と Apache を使用して実装されています。リクエストを適切に転送するために、.htaccess ファイルが使用されるため、ディレクトリで AllowOverride が有効になっていることを確認してください。
SSL 証明書を設定し、すべてのリクエストを HTTPS 経由で提供する必要があります。サーバーに SSL 証明書がまだ設定されていない場合は、Apache SSL/TLS のドキュメントをご覧ください。
PHP 実装は、プロトコル バッファ ライブラリではなく、単純な JSON シリアル化メソッドに依存しています。
プロジェクトをダウンロードするには、次のコマンドを実行します。
git clone https://maps-booking.googlesource.com/php-maps-booking-rest-server-v3-skeleton
コードベース全体は次の 3 つのファイルのみで構成されています。
- .htaccess は、すべての /v3/ リクエストを bookingserver.php 経由で転送するように Apache に指示します。
- bookingserver.php は、認証などのリクエスト ロジックを処理します。
- apiv3methods.php には、API v3 インターフェースを実装するメソッドがあります。
ファイルをダウンロードしたら、サービング可能なディレクトリに配置する必要があります。どのディレクトリに配置しても、そのディレクトリが /v3/ ディレクトリの親になります。このディレクトリは明示的に作成する必要はありません。
予約サーバーのテスト
予約テスト ユーティリティをダウンロードして実行できます。インストールするには、README ページに記載されているインストール手順に沿って操作します。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-11-26 UTC。
[null,null,["最終更新日 2024-11-26 UTC。"],[[["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, necessitates an SSL certificate for HTTPS, and uses JSON for serialization."],["The project can be downloaded via `git clone`, consisting of three primary files: `.htaccess`, `bookingserver.php`, and `apiv3methods.php`."],["After downloading, place the files in a web-servable directory, which will act as the parent for the `/v3/` endpoint."],["The [booking test utility](https://maps-booking.googlesource.com/maps-booking-v3/) can be used to test the functionality of the implemented Booking Server."]]],["This PHP-based reference implementation of the API v3 Booking Server requires Apache and PHP. It uses `.htaccess` for request routing, necessitating `AllowOverride` and HTTPS with an SSL certificate. The server uses JSON for data exchange and can be downloaded via `git clone`. The code comprises three files: `.htaccess` for routing, `bookingserver.php` for request handling, and `apiv3methods.php` for API implementation. The files need to be placed in a servable directory, and the booking test utility can be downloaded and installed separately for testing.\n"]]