| Server IP : 199.250.200.62 / Your IP : 216.73.217.89 Web Server : Apache System : Linux vps37394.inmotionhosting.com 3.10.0-1160.119.1.vz7.224.4 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64 User : jasonp18 ( 1000) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /opt/dedrads/cms_tools/mods/ |
Upload File : |
#! /usr/lib/rads/venv/bin/python3
"""Subclass for MediaWiki CMS"""
# Author: Daniel K
import os
import logging
from typing import TYPE_CHECKING
from ..cms import CMS
from ..cms import VariableData
if TYPE_CHECKING:
from ..cms import CMSFind
LOGGER = logging.getLogger(__name__)
class MediaWiki(CMS):
'''
Class for MediaWiki installations
'''
def setup(self):
self.type = 'MediaWiki'
self.config = os.path.join(self.directory_root, 'LocalSettings.php')
self.db_name_data = VariableData(
'php_variable', 'wgDBname', self.config
)
self.db_user_data = VariableData(
'php_variable', 'wgDBuser', self.config
)
self.db_pass_data = VariableData(
'php_variable', 'wgDBpassword', self.config
)
self.db_pref_data = VariableData(
'php_variable', 'wgDBprefix', self.config
)
self.db_host_data = VariableData(
'php_variable', 'wgDBserver', self.config
)
self.cms_directories = [
"mw-config",
"skins",
"serialized",
"resources",
"includes",
"docs",
"languages",
"extensions",
"images",
"maintenance",
]
self.siteurl = VariableData(
'php_variable', 'wgServer', self.config
).get_value()
return True
def register_cms(cms_find_instance: 'CMSFind'):
'''
Register self with current cms_find_instance
'''
cms_find_instance.add_quick("MediaWiki", MediaWiki)