Menu

## NationalCloud
in package

NationalCloud.php : 20

Class NationalCloud

Defines Graph hosts for the various national clouds

##### Tags

copyright

  2021 Microsoft Corporation

license

  https://opensource.org/licenses/MIT MIT License

link
  https://developer.microsoft.com/graph

### Table of Contents

CHINA = "https://microsoftgraph.chinacloudapi.cn"
GERMANY = "https://graph.microsoft.de"
GLOBAL = "https://graph.microsoft.com"
US_DOD = "https://dod-graph.microsoft.us"
US_GOV = "https://graph.microsoft.us"
$hosts : array<string|int, mixed>
  Unique hostnames from constant values [graph.microsoft.com, graph.microsoft.us, ...]
containsNationalCloudHost() : bool
  Checks if url contains a valid National Cloud host
containsNationalCloudHostFromUrlParts() : bool
  Checks if $urlParts contain a valid National Cloud host
initHosts() : void
  Extracts hostnames from constant values to an array with unique keys for optimal lookup

### Constants

#### CHINA

NationalCloud.php : 26
`public mixed CHINA = "https://microsoftgraph.chinacloudapi.cn"`

#### GERMANY

NationalCloud.php : 25
`public mixed GERMANY = "https://graph.microsoft.de"`

#### GLOBAL

NationalCloud.php : 22
`public mixed GLOBAL = "https://graph.microsoft.com"`

#### US_DOD

NationalCloud.php : 24
`public mixed US_DOD = "https://dod-graph.microsoft.us"`

#### US_GOV

NationalCloud.php : 23
`public mixed US_GOV = "https://graph.microsoft.us"`

### Properties

#### $hosts

NationalCloud.php : 33

Unique hostnames from constant values [graph.microsoft.com, graph.microsoft.us, ...]

`private static array<string|int, mixed> $hosts = []`

### Methods

#### containsNationalCloudHost()

NationalCloud.php : 41

Checks if url contains a valid National Cloud host

`public static containsNationalCloudHost(string $url) : bool`

##### Parameters

$url : string

##### Return values

bool —

#### containsNationalCloudHostFromUrlParts()

NationalCloud.php : 52

Checks if $urlParts contain a valid National Cloud host

`public static containsNationalCloudHostFromUrlParts(array<string, string>|false $urlParts) : bool`

##### Parameters

$urlParts : array<string, string>|false

  return value of parse_url()

##### Return values

bool —

#### initHosts()

NationalCloud.php : 64

Extracts hostnames from constant values to an array with unique keys for optimal lookup

`private static initHosts() : void`

##### Return values

void —

## Search results