/** * HostsFileManager constructor. * * @param Filesystem $filesystem * @param ConfigRepository $configRepository */ public function __construct(Filesystem $filesystem, ConfigRepository $configRepository) { $this->filesystem = $filesystem; $this->configRepository = $configRepository; $this->filePath = $this->configRepository->get('hostsfile.path'); $this->tempDir = $this->configRepository->get('app.temporary-dir'); }
/** * Create a temporary file containing virtual host configurations * * @return bool */ public function create() { $apache = $this->configRepository->get('apache'); $defaults = $this->configRepository->get('defaults'); $tags = array_merge($defaults, $apache); return $this->template->compile($this); }
/** * Set the Virtual Host Manager * * @param HostManager $hostManager */ public function setHostManager(HostManager $hostManager) { $this->hostManager = $hostManager; $this->fileName = $this->hostManager->get('file-name'); }
public function testReturnCompleteConfigurationList() { $configRepository = new Repository($this->defaults); $this->assertEquals($this->defaults, $configRepository->all()); }