You are here

public static function Utilities::drupal_is_cli in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 8

1 call to Utilities::drupal_is_cli()
miniorange_saml_uninstall in ./miniorange_saml.install
hook_uninstall not needed. Configure variables are cleared when module is uninstalled.

File

src/Utilities.php, line 887

Class

Utilities
This file is part of miniOrange SAML plugin.

Namespace

Drupal\miniorange_saml

Code

public static function drupal_is_cli() {
  $server = \Drupal::request()->server;
  $server_software = $server
    ->get('SERVER_SOFTWARE');
  $server_argc = $server
    ->get('argc');
  if (!isset($server_software) && (php_sapi_name() == 'cli' || is_numeric($server_argc) && $server_argc > 0)) {
    return TRUE;
  }
  else {
    return FALSE;
  }
}