Documentation

pm_Domain
in package

Domain wrapper

Tags
since
11.5

Table of Contents

__construct()  : mixed
Create new domain wrapper
deleteSettings()  : void
Delete all domain custom settings
getAllDomains()  : array<string|int, pm_Domain>
Retrieve all domains
getByDomainId()  : pm_Domain
Retrieve domain by known id
getByGuid()  : pm_Domain
Retrieve domain by GUID
getByName()  : pm_Domain
Retrieve domain by display name
getClient()  : pm_Client
Retrieve owner of domain
getCoreLimit()  : mixed
Retrieve Plesk core limit value by name
getDisplayName()  : string
Retrieve domain name to be displayed in UI
getDnsZone()  : pm_Dns_Zone
Return DNS zone of domain
getDocumentRoot()  : string
Retrieve domain document root directory. Available for domains with web hosting
getDomainsByClient()  : array<string|int, pm_Domain>
Retrieve all client domains
getGuid()  : string
Retrieve domain GUID
getHomePath()  : string
Retrieve domain home path
getHostingCertificate()  : Certificate|null
Returns an SSL/TLS certificate of the domain
getId()  : int
Retrieve domain id
getIpAddresses()  : array<string|int, string>
Retrieve domain IP addresses
getLimit()  : mixed
Retrieve limit value by name
getMailCertificate()  : Certificate|null
Returns an SSL/TLS certificate of mail
getName()  : string
Retrieve domain name in ASCII format
getPlanItems()  : array<string|int, string>
Get included plan items
getProperty()  : string
Retrieve property of domain
getScreenshotUrl()  : string
Get URL to screenshot of specified path on domain
getSetting()  : string|null
Return value of domain custom setting by given name
getSysUserLogin()  : string
Retrieve domain system user login
getVhostSystemPath()  : string
Retrieve domain vhost system directory. Available for domains with web hosting
getWebmailCertificate()  : Certificate|null
Returns an SSL/TLS certificate of webmail
hasCorePermission()  : mixed
Retrieve Plesk core permission value by name
hasForwarding()  : bool
Check if domain has forwarding hosting configured
hasHosting()  : bool
Check if domain has physical hosting configured
hasPermission()  : mixed
Retrieve permission value by name
hasSsl()  : bool
Check if domain has SSL support for web hosting
hasSslRedirect()  : bool
Check if domain has redirect from HTTP to HTTPS
isActive()  : bool
Check if domain is active
isDisabled()  : bool
Check if domain is disabled
isResolved()  : bool
Check if domain is resolved to assigned IP
isSuspended()  : bool
Check if domain is suspended
setSetting()  : void
Define value of domain custom setting

Methods

__construct()

Create new domain wrapper

public __construct(int $domainId) : mixed
Parameters
$domainId : int
Tags
throws
pm_Exception
Return values
mixed

deleteSettings()

Delete all domain custom settings

public deleteSettings([string $prefix = '' ]) : void
Parameters
$prefix : string = ''

Settings name prefix

Tags
since
17.0
Return values
void

getAllDomains()

Retrieve all domains

public static getAllDomains([bool $mainDomainsOnly = false ]) : array<string|int, pm_Domain>
Parameters
$mainDomainsOnly : bool = false

[optional] Return only main domains. Default is false.

Tags
since
17.0
Return values
array<string|int, pm_Domain>

getByDomainId()

Retrieve domain by known id

public static getByDomainId(int $domainId) : pm_Domain
Parameters
$domainId : int
Tags
throws
pm_Exception
since
17.0
Return values
pm_Domain

getByGuid()

Retrieve domain by GUID

public static getByGuid(string $domainGuid) : pm_Domain
Parameters
$domainGuid : string
Tags
throws
pm_Exception
since
17.0
Return values
pm_Domain

getByName()

Retrieve domain by display name

public static getByName(string $domainName) : pm_Domain
Parameters
$domainName : string
Tags
throws
pm_Exception
since
17.0
Return values
pm_Domain

getCoreLimit()

Retrieve Plesk core limit value by name

public getCoreLimit(string $name) : mixed
Parameters
$name : string

Limit name

Tags
since
17.0
Return values
mixed

getDisplayName()

Retrieve domain name to be displayed in UI

public getDisplayName() : string
Tags
since
17.0
Return values
string

getDocumentRoot()

Retrieve domain document root directory. Available for domains with web hosting

public getDocumentRoot([bool $relative = false ]) : string
Parameters
$relative : bool = false

[optional] Return root directory relative to home path. Default is false.

Tags
throws
pm_Exception
since
17.0
Return values
string

getDomainsByClient()

Retrieve all client domains

public static getDomainsByClient(pm_Client $client[, bool $mainDomainsOnly = false ]) : array<string|int, pm_Domain>
Parameters
$client : pm_Client

Domains owner

$mainDomainsOnly : bool = false

[optional] Return only main domains. Default is false.

Tags
since
17.0
Return values
array<string|int, pm_Domain>

getGuid()

Retrieve domain GUID

public getGuid() : string
Tags
since
17.0
Return values
string

getHomePath()

Retrieve domain home path

public getHomePath() : string
Tags
since
17.0
Return values
string

getHostingCertificate()

Returns an SSL/TLS certificate of the domain

public getHostingCertificate() : Certificate|null
Tags
throws
pm_Exception
since
18.0.55
Return values
Certificate|null

getId()

Retrieve domain id

public getId() : int
Return values
int

getIpAddresses()

Retrieve domain IP addresses

public getIpAddresses([bool $public = true ]) : array<string|int, string>
Parameters
$public : bool = true

Return public IP addresses. For Plesk servers behind NAT private IP addresses are matched to corresponding public ones. Default is true.

Tags
since
17.0
Return values
array<string|int, string>

getLimit()

Retrieve limit value by name

public getLimit(string $name) : mixed
Parameters
$name : string

Limit name

Tags
since
17.0
Return values
mixed

getMailCertificate()

Returns an SSL/TLS certificate of mail

public getMailCertificate() : Certificate|null
Tags
throws
pm_Exception
since
18.0.55
Return values
Certificate|null

getName()

Retrieve domain name in ASCII format

public getName() : string
Return values
string

getPlanItems()

Get included plan items

public getPlanItems() : array<string|int, string>
Tags
since
17.0
Return values
array<string|int, string>

getProperty()

Retrieve property of domain

public getProperty(string $name) : string
Parameters
$name : string
Tags
throws
pm_Exception
Return values
string

getScreenshotUrl()

Get URL to screenshot of specified path on domain

public getScreenshotUrl([string $path = '/' ][, array<string|int, mixed> $options = [] ]) : string

Available screenshot options:

[
    'type' => string, // Image type, can be either png or jpeg. Default: 'png'.
    'width' => int, // Browser window width, between 16-2048. Default: 1600.
    'height' => int, // Browser window height, between 16-2048. Default: 1200.
    'scale' => float, // Browser scale factor, between 0.01-1. Default: 1.
    'delay' => int, // Time in seconds, to delay the rendering of the snapshot, between 0-45. Default: 0.
    'cache' => int, // Time in seconds, after which the screenshot is considered obsolete and will be generated again. Default: 3600.
]
Parameters
$path : string = '/'
$options : array<string|int, mixed> = []
Tags
since
18.0
Return values
string

getSetting()

Return value of domain custom setting by given name

public getSetting(string $name[, string|null $default = null ]) : string|null
Parameters
$name : string

Setting name

$default : string|null = null

Default value of setting

Tags
since
17.0
Return values
string|null

getSysUserLogin()

Retrieve domain system user login

public getSysUserLogin() : string
Tags
since
17.0
Return values
string

getVhostSystemPath()

Retrieve domain vhost system directory. Available for domains with web hosting

public getVhostSystemPath() : string
Tags
throws
pm_Exception
since
17.0
Return values
string

getWebmailCertificate()

Returns an SSL/TLS certificate of webmail

public getWebmailCertificate() : Certificate|null
Tags
throws
pm_Exception
since
18.0.55
Return values
Certificate|null

hasCorePermission()

Retrieve Plesk core permission value by name

public hasCorePermission(string $name) : mixed
Parameters
$name : string

Permission name

Tags
since
17.0
Return values
mixed

hasForwarding()

Check if domain has forwarding hosting configured

public hasForwarding() : bool
Tags
since
18.0.26
Return values
bool

hasHosting()

Check if domain has physical hosting configured

public hasHosting() : bool
Tags
since
17.0
Return values
bool

hasPermission()

Retrieve permission value by name

public hasPermission(string $name) : mixed
Parameters
$name : string

Permission name

Tags
since
17.0
Return values
mixed

hasSsl()

Check if domain has SSL support for web hosting

public hasSsl() : bool
Tags
throws
pm_Exception
since
18.0.24
Return values
bool

hasSslRedirect()

Check if domain has redirect from HTTP to HTTPS

public hasSslRedirect() : bool
Tags
throws
pm_Exception
since
18.0.24
Return values
bool

isActive()

Check if domain is active

public isActive() : bool
Tags
since
17.0
Return values
bool

isDisabled()

Check if domain is disabled

public isDisabled() : bool
Tags
since
17.0
Return values
bool

isResolved()

Check if domain is resolved to assigned IP

public isResolved() : bool
Tags
since
18.0.32
since
18.0.46

Returns false by default if there is no an explicit value

Return values
bool

isSuspended()

Check if domain is suspended

public isSuspended() : bool
Tags
since
17.0
Return values
bool

setSetting()

Define value of domain custom setting

public setSetting(string $name, string|null $value) : void
Parameters
$name : string

Setting name

$value : string|null

Setting value or null to delete setting

Tags
since
17.0
Return values
void

Search results