<?php
namespace Claromentis\Admin\Sysadmin\UseCase;

$GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"] ?: array()) + array("_8f7d73e7" . "1f759595e" . "26c94678c" . "a29d85" => base64_decode("Y2ZnX3NlYXJjaF9lc192ZXJz" . "aW9u"));
use Claromentis\Admin\Sysadmin\ServiceStatus;
use Claromentis\Core\Config\Config;
use Claromentis\Search\DaemonControl;
use Claromentis\Search\Exception\SearchConfigException;
class GetIndexingStatus
{
    
    
    
    
    private Config $config;
    private DaemonControl $daemon_control;
    public function __construct(Config $config, DaemonControl $daemon_control)
    {
        $this->config = $config;
        $this->daemon_control = $daemon_control;
    }
    public function GetSummaryStatus()
    {
        $config_version = (string) $this->config->get($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_8f7d73e71f759595e26c94678" . "ca29d85"]);
        if (!$this->daemon_control->GetStatus()) {
            return ServiceStatus::ERROR;
        }
        try {
            $this->daemon_control->CheckVersionMatches($config_version);
        } catch (SearchConfigException $_fe441aa3ef350bfb1a1a1ad8520dd530) {
            return ServiceStatus::ERROR;
        }
        return ServiceStatus::OK;
    }
}