` as that account. * * Environment values are passed on the docker invocation itself and handed * through with `-e`, because an assignment placed before the `cd` would not * survive the `&&` — this is how OC_PASS reaches `user:add * --password-from-env` without the password ever appearing in an occ * argument (and so in the guest's process list). * * @param array $env */ public static function command(string $arguments, array $env = []): string { $assignments = ''; $forwards = ''; foreach ($env as $name => $value) { $assignments .= $name.'='.escapeshellarg($value).' '; $forwards .= '-e '.$name.' '; } return 'cd '.self::DIRECTORY.' && '.$assignments .'docker compose exec -T -u '.self::USER.' '.$forwards.'app php occ '.$arguments; } }