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
전체 코드베이스는 다음 세 개의 파일로만 구성됩니다.
- .htaccess는 Apache에 모든 /v3/ 요청을 bookingserver.php를 통해 라우팅하도록 지시합니다.
- bookingserver.php는 인증을 비롯한 요청 로직을 처리합니다.
- apiv3methods.php에는 API v3 인터페이스를 구현하는 메서드가 있습니다.
파일을 다운로드한 후에는 제공 가능한 디렉터리에 배치해야 합니다.
어느 디렉터리에 두든지 /v3/ 디렉터리의 상위 디렉터리가 되며, 이 디렉터리는 명시적으로 만들 필요가 없습니다.
예약 서버 테스트
예약 테스트 유틸리티를 다운로드하여 실행할 수 있습니다. 설치하려면 README 페이지에 제공된 설치 안내를 따르세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003eThis is a PHP-based reference implementation of the API v3 Booking Server, requiring Apache and PHP for setup.\u003c/p\u003e\n"],["\u003cp\u003eThe server utilizes a .htaccess file for routing, mandates HTTPS with an SSL certificate, and employs JSON serialization.\u003c/p\u003e\n"],["\u003cp\u003eDownload the project using \u003ccode\u003egit clone\u003c/code\u003e, place the three files (\u003ccode\u003e.htaccess\u003c/code\u003e, \u003ccode\u003ebookingserver.php\u003c/code\u003e, \u003ccode\u003eapiv3methods.php\u003c/code\u003e) in a servable directory, and ensure \u003ccode\u003e/v3/\u003c/code\u003e requests are routed through \u003ccode\u003ebookingserver.php\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTest the Booking Server using the provided booking test utility after installation.\u003c/p\u003e\n"]]],["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"],null,["# Booking Server Skeleton for PHP\n\nThis is a reference implementation of\n[API v3 Booking Server](/actions-center/verticals/reservations/e2e/integration-steps/implement-booking-server) based on PHP\n\nPrerequisites\n-------------\n\nRequires an installation of\n\n- [Apache](https://httpd.apache.org/)\n- [PHP](https://secure.php.net)\n\nGetting Started\n---------------\n\nThe Booking Server is implemented using PHP and Apache. To properly route\nthe requests, it makes use of the\n[.htaccess file](https://httpd.apache.org/docs/current/howto/htaccess.html), so make sure that\n[AllowOverride](https://httpd.apache.org/docs/current/mod/core.html#allowoverride) is enabled for the directory.\n\nYou must set up a SSL certificate, and have all requests served over HTTPS.\nIf your server does not already have an SSL certificate setup, you can\nreview the\n[Apache SSL/TLS documentation](https://httpd.apache.org/docs/2.4/ssl/ssl_howto.html).\n\nThe PHP implementation does not rely upon protocol buffer libraries, but\ninstead, relies on simple JSON serialization methods.\n\nTo download the project, execute the following command: \n\n```php\ngit clone https://maps-booking.googlesource.com/php-maps-booking-rest-server-v3-skeleton\n```\n\nThe entire code base consists of only three files:\n\n- .htaccess instructs apache to route all of the /v3/ requests through bookingserver.php\n- bookingserver.php handles the request logic, including authentication\n- apiv3methods.php has the methods implementing API v3 interface\n\nAfter you download the files, you should place them in a servable directory.\nNote that whichever directory you put them in will become the parent to the\n/v3/ directory, which you do not need to explicitly create.\n\nTesting your Booking Server\n---------------------------\n\nYou may download and run the [booking test utility](https://maps-booking.googlesource.com/maps-booking-v3/). To install it, follow the provided installation instructions in its README page.\n\n\u003cbr /\u003e"]]