PHP 8.6.0 Beta 3 is available for testing

Yaf_Request_Abstract::isCli

(Yaf >=1.0.0)

Yaf_Request_Abstract::isCliDetermine if the request is a CLI request

Опис

public function Yaf_Request_Abstract::isCli(): bool

Checks whether the request was sent with the CLI method.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

Returns true if the request was made on the command line, false otherwise.

Приклади

Приклад #1 Yaf_Request_Abstract::isCli() example

<?php
// cron.php, executed with "php cron.php" from a crontab
$request = new Yaf_Request_Simple("CLI", "Index", "Cron", "Cleanup");

var_dump($request->isCli());
?>

Поданий вище приклад виведе щось схоже на:

bool(true)

Прогляньте також

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top