Skip to content

Commit

Permalink
Merge pull request #34 from plesk/18.0.60
Browse files Browse the repository at this point in the history
Update stubs with 18.0.60 SDK
  • Loading branch information
espitsyna authored Apr 4, 2024
2 parents 3362a63 + 2f25607 commit 589949e
Show file tree
Hide file tree
Showing 123 changed files with 348 additions and 130 deletions.
2 changes: 1 addition & 1 deletion SDK/Certificate.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK;
/**
* Certificate wrapper
Expand Down
2 changes: 1 addition & 1 deletion SDK/Hook/Dns/Dnssec.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Hook\Dns;

abstract class Dnssec implements \Plesk\SDK\Hook\HookInterface
Expand Down
2 changes: 1 addition & 1 deletion SDK/Hook/ExternalDns.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Hook;

abstract class ExternalDns implements \Plesk\SDK\Hook\HookInterface
Expand Down
19 changes: 19 additions & 0 deletions SDK/Hook/Home.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Hook;
/**
* Hook for embedding custom blocks into administrator's Home page in SPV
*
* @since 18.0.60
*/
abstract class Home implements \Plesk\SDK\Hook\HookInterface
{

/**
* Retrieve blocks for Home page in SPV
*
* @return Home\Block[]
*/
abstract public function getBlocks(): array;

}
130 changes: 130 additions & 0 deletions SDK/Hook/Home/Block.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<?php
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Hook\Home;
/**
* Custom block to be embedded into administrator's Home page in SPV
*
* @since 18.0.60
*/
abstract class Block
{

public const SECTION_PLESK = 'plesk';

public const SECTION_SERVER = 'server';

public const SECTION_SECURITY = 'security';

/**
* Define block unique ID
*
* Classname by default.
*
* @return string
*/
public function getId(): string { }

/**
* Define block title
*
* Attention: unescaped HTML. Extension title by default.
*
* @return string
*/
public function getTitle(): string { }

/**
* Define block content
*
* Attention: unescaped HTML. Extension description by default.
*
* @return string
*/
public function getContent(): string { }

/**
* Define column the block should be placed to
*
* Possible values: 0, 1, 2. Last column by default.
*
* @return int
*/
public function getColumn(): int { }

/**
* Define order within the column the block should be placed to
*
* Last block in column by default.
*
* @return int
*/
public function getOrder(): int { }

/**
* Define if the block content should be loaded asynchronously
*
* True by default.
*
* @return bool
*/
public function isAsyncLoaded(): bool { }

/**
* Define size of the skeleton (content placeholder) to be shown while content is loaded
*
* Applied only to asynchronously loaded blocks.
* 2 by default.
*
* @return int
*/
public function getSkeletonSize(): int { }

/**
* Define if the block is enabled by default
*
* true by default.
*
* @return bool
*/
public function isEnabled(): bool { }

/**
* Define section the block belongs to
*
* To be shown when customizing Home page.
* SECTION_PLESK by default.
*
* @return string
*/
public function getSection(): string { }

/**
* Define order within the section the block should be placed to
*
* To be shown when customizing Home page.
* Last block in section by default.
*
* @return int
*/
public function getSectionOrder(): int { }

/**
* Define block name
*
* To be shown when customizing Home page.
* Extension title by default.
*
* @return string
*/
public function getName(): string { }

/**
* Define block icon
*
* To be shown when customizing Home page.
*
* @return string
*/
public function getIcon(): string { }

}
2 changes: 1 addition & 1 deletion SDK/Hook/HookInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Hook;

interface HookInterface extends \pm_Hook_Interface
Expand Down
2 changes: 1 addition & 1 deletion SDK/Hook/Repair/Mail.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Hook\Repair;

abstract class Mail implements \Plesk\SDK\Hook\HookInterface
Expand Down
2 changes: 1 addition & 1 deletion SDK/Hook/Webmail.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Hook;

abstract class Webmail implements \Plesk\SDK\Hook\HookInterface
Expand Down
2 changes: 1 addition & 1 deletion SDK/Mailname.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK;
/**
* Mailname wrapper
Expand Down
2 changes: 1 addition & 1 deletion SDK/Middleware/Access/Client.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Middleware\Access;
/**
* Validates that access was performed by specified user or any user that can impersonate as this user.
Expand Down
2 changes: 1 addition & 1 deletion SDK/Middleware/Access/Cors.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Middleware\Access;
/**
* Adds cross-origin resource sharing headers as configured server-wide.
Expand Down
2 changes: 1 addition & 1 deletion SDK/Middleware/Access/Csrf.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Middleware\Access;
/**
* Validates that request has proper forgery protection token.
Expand Down
2 changes: 1 addition & 1 deletion SDK/Middleware/Access/Domain.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Middleware\Access;
/**
* Validates that access was performed by user that has access to the specified domain.
Expand Down
2 changes: 1 addition & 1 deletion SDK/Middleware/Access/Session.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Middleware\Access;
/**
* Returns HTTP 401 if no session is defined by other means like BasicAuth, or KeyHeaderAuth.
Expand Down
2 changes: 1 addition & 1 deletion SDK/Middleware/Access/UserRole.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Middleware\Access;
/**
* Validates that access was performed by user with the specified role.
Expand Down
2 changes: 1 addition & 1 deletion SDK/Middleware/Auth/ApiKey.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Middleware\Auth;
/**
* Initializes Plesk session from the "X-API-Key" header.
Expand Down
2 changes: 1 addition & 1 deletion SDK/Middleware/Auth/Basic.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Middleware\Auth;
/**
* Initializes Plesk session from the "Authorization: Basic" header.
Expand Down
2 changes: 1 addition & 1 deletion SDK/Middleware/ErrorHandler.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Middleware;
/**
* Wraps uncaught exceptions into a JSON response.
Expand Down
2 changes: 1 addition & 1 deletion SDK/Middleware/HttpsRedirect.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Middleware;
/**
* Returns 301/308 in case the request was made to plain HTTP.
Expand Down
2 changes: 1 addition & 1 deletion SDK/Middleware/Server/ApiAllowed.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Middleware\Server;
/**
* Validates that remote API access is allowed for the remote IP.
Expand Down
2 changes: 1 addition & 1 deletion SDK/Middleware/Server/ApiEnabled.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Middleware\Server;
/**
* Validates that remote API is allowed on the server.
Expand Down
2 changes: 1 addition & 1 deletion SDK/Middleware/Server/Initialized.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Middleware\Server;
/**
* Validates that Plesk is initialized.
Expand Down
2 changes: 1 addition & 1 deletion SDK/Repair/Context.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Repair;

class Context
Expand Down
2 changes: 1 addition & 1 deletion SDK/Server/Components.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK\Server;
/**
* @since 18.0.52
Expand Down
2 changes: 1 addition & 1 deletion SDK/Webmail.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
namespace Plesk\SDK;

final class Webmail
Expand Down
8 changes: 4 additions & 4 deletions pm/ActionLog.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
/**
* Wrapper for ActionLog.
*
Expand All @@ -18,14 +18,14 @@ class pm_ActionLog
*
* @param int|null $objectId ID of the object mentioned in the event. 0 if not applicable (singleton object like 'admin').
*
* @param array|null $oldValues
* @param string[] $oldValues
* @example array('contact_name' => 'John Smith', 'email' => '[email protected]', 'login_name' => 'user1')
* @param array|null $newValues
* @param string[] $newValues
* @example array('contact_name' => 'John Smith', 'email' => '[email protected]', 'login_name' => 'user1')
* @return void
*
* @throws Exception
*/
public static function submit($actionId, $objectId = null, $oldValues = null, $newValues = null) { }
public static function submit($actionId, $objectId = null, $oldValues = [], $newValues = []) { }

}
2 changes: 1 addition & 1 deletion pm/ApiCli.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
/**
* Gateway for execution of CLI utilities
*
Expand Down
2 changes: 1 addition & 1 deletion pm/ApiRpc.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
/**
* Wrapper to simplify execution of API-RPC calls inside modules
*
Expand Down
2 changes: 1 addition & 1 deletion pm/Application.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
/**
* Class for initialization Plesk renderers
*
Expand Down
2 changes: 1 addition & 1 deletion pm/Auth.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
/**
* Authentication helper methods
*
Expand Down
2 changes: 1 addition & 1 deletion pm/Backup/Manager.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
/**
* Manager of backups for extension.
*
Expand Down
2 changes: 1 addition & 1 deletion pm/Bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
/**
* Class for initialization Plesk objects
*
Expand Down
Loading

0 comments on commit 589949e

Please sign in to comment.