Файловый менеджер - Редактировать - /opt/cpmigrate/environments/postgresql.py
Ðазад
"""PostgreSQL Environment Module""" from environments.base import Environment class PostgreSQL(Environment): """ Checks if PostgreSQL is installed on the origin and sets it up on the target server. """ def __init__(self): Environment.__init__(self) self.postgres_package = "postgresql" self.postgres_installed_origin = False self.postgres_installed_local = False def check(self, _): self.check_origin_postgresql() self.check_target_postgresql() if not self.postgres_installed_local: if self.postgres_installed_origin: self.actions.append("+ Install and configure PostgreSQL.") def run(self, _): if not self.postgres_installed_local: if self.postgres_installed_origin: self.install_postgresql() def check_origin_postgresql(self): """Checks if PostgreSQL is installed on the origin server.""" self.info("Checking if PostgreSQL is installed on origin.") self.postgres_installed_origin = self.xfer.check_origin_package( self.postgres_package ) if self.postgres_installed_origin: self.info("Origin server has PostgreSQL installed!") else: self.info("No PostgreSQL detected on origin.") def check_target_postgresql(self): """Checks if PostgreSQL is installed on the target server. We really do not want to reinstall again as it would wipe everything. """ self.info("Checking if PostgreSQL is installed on target.") self.postgres_installed_local = self.xfer.check_target_package( self.postgres_package ) if self.postgres_installed_local: self.info("Target server has PostgreSQL installed!") else: self.info("No PostgreSQL detected on target.") def install_postgresql(self): """Runs the installer on the target server for PostgreSQL.""" self.info("Installing PostgreSQL...") ret_code = self.xfer.local_command( ['/usr/local/cpanel/scripts/installpostgres', '--yes'], sleep=2 ) if ret_code == 0: self.info("Installed PostgreSQL successfully.")
| ver. 1.1 | |
.
| PHP 8.3.30 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка