public function getConsoleCommand($env = null, $unescaped = false)
    {
        $phpFinder = new PhpExecutableFinder;
        if (!$php = $phpFinder->find()) {
            throw new \RuntimeException('The php executable could not be found, add it to your PATH environment variable and try again');
        }

        $out = $php . ' ' . escapeshellcmd($this->kernelRootDir . DIRECTORY_SEPARATOR . "console");
        if ($env != '') {
            $out .= ' --env=' . ($unescaped ? $env : escapeshellarg($env));
        }
        return $out;
    }