示例#1
0
 /**
  * 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');
 }
示例#2
0
 /**
  * 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);
 }
示例#3
0
 /**
  * Set the Virtual Host Manager
  *
  * @param HostManager $hostManager
  */
 public function setHostManager(HostManager $hostManager)
 {
     $this->hostManager = $hostManager;
     $this->fileName = $this->hostManager->get('file-name');
 }
示例#4
0
 public function testReturnCompleteConfigurationList()
 {
     $configRepository = new Repository($this->defaults);
     $this->assertEquals($this->defaults, $configRepository->all());
 }