/** * Save the environment variables. */ protected function saveEnvironmentVariables() { $environManipulator = $this->environManipulatorFactory->getSystemManipulator(); $environmentDeclaration = $this->dockerMachineCli->getEnvironmentDeclaration(); if (!$environManipulator->has($environmentDeclaration)) { $environManipulator->save($environmentDeclaration); } }
private function setupDinghyEnvironmentVariables() { $userHome = getenv('HOME'); $environmentVariables = [new EnvironmentVariable('DOCKER_HOST', 'tcp://127.0.0.1:2376'), new EnvironmentVariable('DOCKER_CERT_PATH', $userHome . '/.dinghy/certs'), new EnvironmentVariable('DOCKER_TLS_VERIFY', '1')]; $environManipulatorFactory = new EnvironManipulatorFactory(); $environManipulator = $environManipulatorFactory->getSystemManipulator($this->processRunner); foreach ($environmentVariables as $environmentVariable) { if (!$environManipulator->has($environmentVariable)) { $environManipulator->save($environmentVariable); } } }