private function commandExists($command)
    {
        $response = trim(shell_exec(sprintf(
            'which %s',
            escapeshellarg($command)
        )));
        return !empty($response);
    }