Viewing File: /usr/local/cpanel/base/frontend/jupiter/ls_web_cache_manager/core/Lsc/UserLscwpPlugin.php

<?php

/** *********************************************
 * LiteSpeed Web Cache Management Plugin for cPanel
 *
 * @author    Michael Alegre
 * @copyright 2019-2023 LiteSpeed Technologies, Inc.
 * *******************************************
 */

namespace LsUserPanel\Lsc;

use LsUserPanel\CPanelWrapper;

class UserLscwpPlugin
{

    /**
     *
     * @param string $locale
     * @param string $pluginVer
     *
     * @return bool
     *
     * @throws UserLSCMException  Thrown indirectly by UserLogger::info() call.
     */
    public static function retrieveTranslation( $locale, $pluginVer )
    {
        UserLogger::info(
            "Downloading LSCache for WordPress $locale translation..."
        );

        $cpanel = CPanelWrapper::getCpanelObj();

        $result = $cpanel->uapi(
            'lsws',
            'retrieveLscwpTranslation',
            array( 'locale' => $locale, 'pluginVer' => $pluginVer )
        );

        return (bool)$result['cpanelresult']['result']['data']['result'];
    }

    /**
     *
     * @param string $locale
     * @param string $pluginVer
     *
     * @throws UserLSCMException  Thrown indirectly by UserLogger::info() call.
     */
    public static function removeTranslationZip( $locale, $pluginVer )
    {
        UserLogger::info(
            "Removing LSCache for WordPress $locale translation..."
        );

        $cpanel = CPanelWrapper::getCpanelObj();

        $cpanel->uapi(
            'lsws',
            'removeLscwpTranslationZip',
            array( 'locale' => $locale, 'pluginVer' => $pluginVer )
        );
    }

}
Back to Directory File Manager