nginx_conf = $nginx_conf; $this->filesystem = $filesystem; } /** * Acquire a read lock and read the contents of the swpsp-nginx.conf file. * * @throws CacheDeliveryReadException If we are unable to open or lock the swpsp-nginx.conf file for reading. * * @return string */ public function read(): string { try { if ( ! $this->nginx_conf->exists() ) { return ''; } return $this->filesystem->read( $this->nginx_conf->get_file_path() ); } catch ( RuntimeException $e ) { throw new CacheDeliveryReadException( $e->getMessage(), $e->getCode(), $e ); } } }