PHP 5 telah mencapai akhir dukungan dan akan
dihentikan penggunaannya
pada 31 Januari 2026. Setelah penghentian penggunaan, Anda tidak akan dapat men-deploy aplikasi PHP 5, meskipun organisasi Anda sebelumnya menggunakan kebijakan organisasi untuk mengaktifkan kembali deployment runtime lama. Aplikasi PHP 5 yang sudah ada akan terus berjalan dan menerima traffic setelah
tanggal penghentiannya. Sebaiknya Anda bermigrasi ke versi PHP terbaru yang didukung.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Kode berikut membuat tugas yang akan dikirim sebagai permintaan POST ke pengendali /worker aplikasi. Tugas berisi data nama dan tindakan, serta akan diproses oleh antrean default:
Anda juga dapat menambahkan tugas secara massal ke antrean menggunakan PushQueue. Dalam contoh berikut, dua objek PushTask ditambahkan ke PushQueue menggunakan metode addTasks().
$task1 = new PushTask('/someUrl');$task2 = new PushTask('/someOtherUrl');$queue = new PushQueue();$queue->addTasks([$task1, $task2]);
Saat Anda menggunakan PushTask dan PushQueue, sertakan pernyataan berikut di bagian atas file PHP Anda:
use google\appengine\api\taskqueue\PushTask;use google\appengine\api\taskqueue\PushQueue;
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-19 UTC."],[[["\u003cp\u003eThis page provides instructions on using legacy bundled services and APIs, specifically within the first-generation runtimes of the App Engine standard environment.\u003c/p\u003e\n"],["\u003cp\u003eA task can be created and sent as a POST request to a designated handler using the \u003ccode\u003ePushTask\u003c/code\u003e class, including the name and action parameters that will be processed by the default queue.\u003c/p\u003e\n"],["\u003cp\u003eMultiple tasks can be added in bulk to a queue by creating \u003ccode\u003ePushTask\u003c/code\u003e objects and using the \u003ccode\u003eaddTasks()\u003c/code\u003e method within the \u003ccode\u003ePushQueue\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eTo utilize the \u003ccode\u003ePushTask\u003c/code\u003e and \u003ccode\u003ePushQueue\u003c/code\u003e classes, you must include specific \u003ccode\u003euse\u003c/code\u003e statements at the beginning of your PHP file.\u003c/p\u003e\n"]]],[],null,["# A PHP Task Queue Example\n\nThe following code creates a task that will be sent as a POST request to the `/worker` handler of the application. The task contains name and action data, and will be processed by the default queue:\n| This page describes how to use the legacy bundled services and APIs. This API can only run in first-generation runtimes in the App Engine standard environment. If you are updating to the App Engine PHP 7/8 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/php-differences) to learn about your migration options for legacy bundled services.\n\n\u003cbr /\u003e\n\n $task = new PushTask(\n '/worker',\n ['name' =\u003e 'john doe', 'action' =\u003e 'send_reminder']);\n $task_name = $task-\u003eadd();\n\nYou can also add tasks in bulk to a queue using [PushQueue](/appengine/docs/legacy/standard/php/refdocs/classes/google.appengine.api.taskqueue.PushQueue). In the following example, two [PushTask](/appengine/docs/legacy/standard/php/refdocs/classes/google.appengine.api.taskqueue.PushTask) objects are added to a [PushQueue](/appengine/docs/legacy/standard/php/refdocs/classes/google.appengine.api.taskqueue.PushQueue) using the `addTasks()` method. \n\n $task1 = new PushTask('/someUrl');\n $task2 = new PushTask('/someOtherUrl');\n $queue = new PushQueue();\n $queue-\u003eaddTasks([$task1, $task2]);\n\nWhen you use `PushTask` and `PushQueue`, include these statements at the top of your PHP file: \n\n use google\\appengine\\api\\taskqueue\\PushTask;\n use google\\appengine\\api\\taskqueue\\PushQueue;"]]