public function __construct($file, array $arguments = array()) { foreach ($arguments as $argument => $value) { $arguments[$argument] = '--' . $argument; if ($value !== true) { if (!is_string($value)) { $value = var_export($value, true); } $arguments[$argument] .= '=' . escapeshellarg($value); } } $this->errorFile = tempnam(sys_get_temp_dir(), 'lime'); // see http://trac.symfony-project.org/ticket/5437 for the explanation on the weird "cd" thing $this->command = sprintf('cd & %s %s %s 2>%s', escapeshellarg(LimeShell::getExecutable()), escapeshellarg($file), implode(' ', $arguments), $this->errorFile); }