Файловый менеджер - Редактировать - /opt/cpmigrate/environments/README.md
Ðазад
# Environments This folder is for the modular addition of specific environment configuration that should be migrated over to the new server. ## Example Usage Below is an example of how to create a class which will automatically be included in the migration process and can be skipped using `--skipenv`. The check function is only to check what needs to be done. Actions must clearly describe what the Environment will change. The run function will perform any actions that need to be performed. The post_transfer function is called after user migration is completed. The capture state function is used for saving any neccesary variables from the environment. The load state function is to load any neccesary variables from the journal. ### example.py ```py from environments.base import Environment class Example(Environment): def __init__(self): Environment.__init__(self) self.priority = 1 # Optional, higher numbers are ran first, 1 is default. self.resync_relevant = False # Optional, only mark as True if an Environment is relevant for a resync. Only MySQL currently should be. def check(self, transfer): if self.check_something(): self.actions.append('+ Doing this action') def run(self, transfer): self.do_something() self.do_somethingelse() self.finallydothis() def post_transfer(self): self.after_mig_do_this() def capture_state(self): return super().capture_state() def load_state(self, loadstate): super().load_state(loadstate) ``` After adding the new environment, be sure to append it to `ENVIRONMENTS` in `environments/__init__.py`
| ver. 1.1 | |
.
| PHP 8.3.30 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка