All notable changes to this project will be documented in this file.
DatabaseBackup::create()andFileBackup::create()now accept an optional trailing?bool $deleteOnFail = nullargument, which maps to the API'sdeleteOnFailfield ("delete the local backup file when the backup fails"). Existing calls are unaffected.
All source files now declare strict_types=1. PHP will throw TypeError on type mismatches instead of silently coercing. For example, passing a string "123" where an int is expected will now fail.
// v1
create(string $domain, string $webDirectory = '/public', string $projectRoot = '/', string $systemUser = 'ploi', ?string $systemUserPassword = null, ?string $webserverTemplate = null, ?string $projectType = null)
// v2
create(string $domain, string $webDirectory = '/public', ?string $projectRoot = null, ?string $systemUser = null, ?int $webserverTemplate = null, ?string $projectType = null, ?string $webhookUrl = null)- Removed
$systemUserPassword— does not exist in the Ploi API. - Changed
$webserverTemplatetype fromstringtoint— it accepts a webserver template ID. - Changed
$projectRootdefault from'/'tonull. - Changed
$systemUserdefault from'ploi'tonull.
Migration: Remove any $systemUserPassword argument. If you relied on the $projectRoot or $systemUser defaults, pass them explicitly:
// v1
$ploi->servers(1)->sites()->create('example.com');
// v2 — to preserve v1 behavior
$ploi->servers(1)->sites()->create('example.com', '/public', '/', 'ploi');The endpoint changed from servers/{id}/databases/{id}/backups to backups/database to match the current Ploi API.
// v1
create(int $interval, string $type, ?string $table_exclusions = null, ?string $locations = null, ?string $path = null)
// v2
create(int $interval, int $backup_configuration, ?array $databases = null, ?string $table_exclusions = null, ?string $locations = null, ?string $path = null, ?int $keep_backup_amount = null, ?string $custom_name = null, ?string $password = null)- Removed
$type— does not exist in the Ploi API. - Added
$backup_configuration(required) — the ID of your backup configuration from your Ploi profile. - Added
$databases(optional) — array of database IDs to back up. Defaults to the database from the chain. - Added
$keep_backup_amount,$custom_name,$password(optional). - The
serverID is automatically passed from the fluent chain.
Migration:
// v1
$ploi->servers(1)->databases(2)->backups()->create(60, 'to_server');
// v2
$ploi->servers(1)->databases(2)->backups()->create(60, $backupConfigurationId);Site::clone(int $cloneToServer, ?string $domain)— clone a site to another server.Site::resetPermissions(?int $id)— reset file permissions on a site.Site::create()now accepts$webhookUrlto receive a notification when the site has been installed.DatabaseBackup::create()now supports$keep_backup_amount,$custom_name, and$passwordparameters.
- Migrated autoloading from PSR-0 to PSR-4.
- Updated code standard from PSR-2 to PSR-12.
- Removed obsolete
.travis.yml(GitHub Actions is used for CI).
- Fixed
StreamInterfacebeing passed wherestringwas expected in exception constructors (Ploi.php) andjson_decode()(Response.php). DatabaseBackupendpoint and parameters now match the current Ploi API documentation.Site::create()parameters now match the current Ploi API documentation.