Mini Shell

Direktori : /proc/self/root/opt/sharedrads/cms_tools/mods/
Upload File :
Current File : //proc/self/root/opt/sharedrads/cms_tools/mods/phpbb.py

#! /opt/imh-python/bin/python3
""" Subclass for phpBB CMS """
# Author: Daniel K

import os
import logging
from cms_tools.cms import CMS
from cms_tools.cms import VariableData
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from cms_tools.cms import CMSFind

LOGGER = logging.getLogger(__name__)


class PhpBB(CMS):
    '''
    Class for phpBB installations
    '''

    def setup(self):

        self.type = 'phpBB'

        self.config = os.path.join(self.directory_root, 'config.php')

        self.db_name_data = VariableData('php_variable', 'dbname', self.config)
        self.db_user_data = VariableData('php_variable', 'dbuser', self.config)
        self.db_pass_data = VariableData(
            'php_variable', 'dbpasswd', self.config
        )
        self.db_pref_data = VariableData(
            'php_variable', 'table_prefix', self.config
        )
        self.db_host_data = VariableData('php_variable', 'dbhost', self.config)

        self.cms_directories = [
            "language",
            "vendor",
            "phpbb",
            "bin",
            "includes",
            "download",
            "styles",
            "docs",
            "assets",
            "store",
            "files",
            "config",
            "ext",
            "adm",
            "cache",
            "images",
        ]

        return True


def register_cms(cms_find_instance: 'CMSFind'):
    '''
    Register self with current cms_find_instance
    '''

    cms_find_instance.add_quick("phpBB", PhpBB)

Zerion Mini Shell 1.0