public function isRunning()
    {
        $processId = $this->getProcessId();

        if (OperatingSystem::isWindows()) {
            $pids = shell_exec("wmic process get processid | find \"{$processId}\"");
            $resource = array_filter(explode(' ', $pids));

            $isRunning = count($resource) > 0 && $processId == reset($resource);
        } else {
            $isRunning = (bool) posix_getsid($processId);
        }

        return $isRunning;
    }