Opengist

Explore

  • All gists
  • Topics
  • Users
Give feedback on the new UI Powered by Opengist ⋅ 33ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login Register
p

php

Recently created Least recently created Recently updated Least recently updated
anthony

anthony / Проверить запущен ли скрипт из терминала

Last active 1 month ago php

Checks if script running under php-cli

0 0 1
1 /**
2 * Определяет запущен ли скрипт через php-cli
3 * Checks if script running under php-cli
4 *
5 * @return bool
6 */
7 function is_cli(): bool
8 {
9 return PHP_SAPI === 'cli'
10 || (!isset($_SERVER['DOCUMENT_ROOT']) && !isset($_SERVER['REQUEST_URI']));
Newer Older