Methods |
public
|
__construct()
{{{ void __construct(void)
{{{ void __construct(void)
|
#
|
public
|
__destruct()
|
#
|
public
|
user_exists(string $user, string $host = 'localhost'): bool
Verify if PostgreSQL user exists
Verify if PostgreSQL user exists
Parameters
$user |
username
|
$host |
unused
|
Throws
|
#
|
public
|
get_prefix()
|
#
|
public
|
delete_user(string $user, bool $cascade = false): bool
bool delete_user(string[, bool = false])
Delete a PostgreSQL user
bool delete_user(string[, bool = false])
Delete a PostgreSQL user
Parameters
$user |
username
|
$cascade |
casecade delete
|
|
#
|
public
|
get_tablespace(): null|string
Get tablespace name for domain
Get tablespace name for domain
|
#
|
public
|
site_from_tablespace(string $tblspace): null|string
Get site from tablespace
|
#
|
public
|
set_username($user)
|
#
|
public
|
get_password($user = null)
|
#
|
public
|
get_elevated_password_backend()
|
#
|
public
|
change_prefix(string $prefix): bool
Change account database prefix
Change account database prefix
|
#
|
public
|
get_sql_prefix()
|
#
|
public
|
service_enabled(): bool
bool service_enabled (string)
bool service_enabled (string)
Checks to see if a service is enabled
Deprecated
|
#
|
public
|
enabled(): bool
MySQL/PostgreSQL service enabled on account
MySQL/PostgreSQL service enabled on account
Checks to see if either MySQL or PostgreSQL is enabled on an account
|
#
|
public
|
create_database(string $db): bool
bool create_database (string)
bool create_database (string)
Returns
|
#
|
public
|
database_exists(string $db): bool
Query PostgreSQL system table for existence of database
Query PostgreSQL system table for existence of database
Parameters
|
#
|
public
|
prep_tablespace()
void prep_tablespace ()
Checks to see if tablespace exists, if not, creates it
void prep_tablespace ()
Checks to see if tablespace exists, if not, creates it
|
#
|
public
|
add_extension(string $db, string $extension): bool
Enable extension on database
Enable extension on database
|
#
|
public
|
list_databases(): array
array list_databases ()
Queries the db table in the pgsql database for applicable grants
array list_databases ()
Queries the db table in the pgsql database for applicable grants
Returns
|
#
|
public
|
set_owner(string $db, string $owner): bool
Set database owner
|
#
|
public
|
list_users(): array
array list_users ()
Lists all created users for PostgreSQL
array list_users ()
Lists all created users for PostgreSQL
|
#
|
public
|
set_privileges(string $user, string $host, string $db, array $privileges): bool
Assign privileges for database to user
Assign privileges for database to user
|
#
|
public
|
change_owner(string $db, string $newowner): bool
Change database owner
|
#
|
public
|
get_owner(string $database): string|null
Get owner from database
|
#
|
public
|
prep_tablespace_backend($location): bool
void prep_tablespace_backend ()
{@link prep_tablespace}
void prep_tablespace_backend ()
{@link prep_tablespace}
|
#
|
public
|
add_user_permissions(string $user, string $db, array $opts)
bool add_user_permissions (string, string, string, array)
Add/removes privileges for a user to a table, any value…
bool add_user_permissions (string, string, string, array)
Add/removes privileges for a user to a table, any value listed as
false or not supplied as an array key will revoke the privilege
|
#
|
public
|
delete_user_permissions($user, $db)
|
#
|
public
|
get_user_permissions($user, $db): void
void get_user_permissions(string, string)
Function not implemented in PostgreSQL
void get_user_permissions(string, string)
Function not implemented in PostgreSQL
|
#
|
public
|
delete_database(string $db): bool
bool delete_database(string)
Drops the database and revokes all permssions
bool delete_database(string)
Drops the database and revokes all permssions
Returns
|
#
|
public
|
delete_backup(string $db): bool
Remove PostgreSQL Backup
|
#
|
public
|
edit_user(string $user, string $password, int $maxconn = null): bool
Modify use password and connection limit
Modify use password and connection limit
NOTE: Not implemented with PostgreSQL, owner of database automatically
receives grants. Varying degrees of grants impact the usability of
this function, i.e. common grants [SELECT, INSERT, UPDATE, DELETE] exist
solely on the table level, while [CREATE, TEMP] exist on the database
level
Parameters
$user |
user
|
$maxconn |
connection limit
|
Returns
|
#
|
public
|
get_username()
|
#
|
public
|
set_password($password)
|
#
|
public
|
vacuum($db): string
string pg_vacuum_db (string)
Vacuums a database
string pg_vacuum_db (string)
Vacuums a database
Returns
|
#
|
public
|
vacuum_backend($db)
|
#
|
public
|
truncate_database($db)
|
#
|
public
|
add_user(string $user, string $password, int $maxconn = self::DEFAULT_CONCURRENCY_LIMIT): bool
bool add_user(string, string[, int])
bool add_user(string, string[, int])
|
#
|
public
|
version(bool $pretty = false): int|string
|
#
|
public
|
empty($db): bool
Database is empty
|
#
|
public
|
empty_database($db)
|
#
|
public
|
import($db, $file)
bool pgsql_import(string, string, string, strin)
bool pgsql_import(string, string, string, strin)
|
#
|
public
|
export($db, $file = null)
|
#
|
public
|
get_database_size(string $db): int
Get disk space occupied by database
Get disk space occupied by database
Parameters
Returns
|
#
|
public
|
clone(string $from, string $to): bool
Clone a database
Parameters
$from |
source database
|
$to |
target database
|
|
#
|
public
|
export_pipe($db): bool|void
Export a PGSQL db to a named pipe for immediate download
Export a PGSQL db to a named pipe for immediate download
|
#
|
public
|
resolve_site_from_database(string $db): string|null
Resolve database from site
Resolve database from site
|
#
|
public
|
export_pipe_real($db, $user): bool|string|void
Export a PGSQL database to a named pipe
Export a PGSQL database to a named pipe
Differs from export_pipe in that it may only be called internally
or from backend, no API access
|
#
|
public
|
get_uptime(): int
int get_uptime
|
#
|
public
|
add_backup(
string $db,
string $extension = DATABASE_BACKUP_EXTENSION,
int $span = DATABASE_BACKUP_SPAN,
int $preserve = DATABASE_BACKUP_PRESERVE,
$email = '',
)
|
#
|
public
|
edit_backup(
string $db,
string $extension = DATABASE_BACKUP_EXTENSION,
int $span = DATABASE_BACKUP_SPAN,
int $preserve = DATABASE_BACKUP_PRESERVE,
$email = '',
)
|
#
|
public
|
list_backups()
|
#
|
public
|
get_backup_config(string $db): array
Fetch MySQL backup task information
Fetch MySQL backup task information
span => (integer) days between backups
hold => (integer) number of backups to preserve
next => (integer) unix timestamp of next backup
ext => (string) extension of backup
email => (string) notify address after backup
Parameters
|
#
|