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, 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 through `bookingserver.php`."],["Test the Booking Server using the provided booking test utility after installation."]]],["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 implementation utilizes JSON instead of protocol buffers. To get started, clone the project using `git clone`. The codebase includes `.htaccess` for routing, `bookingserver.php` for request handling and authentication, and `apiv3methods.php` for API v3 method implementations, all of which need to be placed in a directory. A separate booking test utility is provided.\n"]]