load(); } private function load() { $config = getenv("HOME")."/.docker/config.json"; if (!file_exists($config)) return; $conf = json_decode(file_get_contents($config)); $this->auth = isset($conf->auths) ? (array)$conf->auths : []; } public function getCredentials(string $repo): ?array { if (!array_key_exists($repo, $this->auth)) return null; $auth = $this->auth[$repo]->auth; return explode(":", base64_decode($auth), 2); } }