هيكل خادم الحجز لبرنامج PHP
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
هذا هو تطبيق مرجعي ل
خادم الحجز في الإصدار 3 من واجهة برمجة التطبيقات استنادًا إلى PHP.
المتطلبات الأساسية
يتطلب تثبيت
البدء
يتم تنفيذ خادم الحجز باستخدام 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 على الطرق التي تنفِّذ واجهة برمجة التطبيقات من الإصدار 3.
بعد تنزيل الملفات، يجب وضعها في دليل قابل للعرض.
يُرجى العِلم أنّ أي دليل تضعها فيه سيصبح الدليل الرئيسي للدليل
/v3/ ، والذي لا تحتاج إلى إنشائه صراحةً.
اختبار خادم الحجز
يمكنك تنزيل
أداة اختبار الحجز وتشغيلها. لتثبيته، اتّبِع تعليمات التثبيت
المقدَّمة في صفحة README.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\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"]]