|
|
@@ -4,7 +4,23 @@ namespace App\Service\Typo3;
|
|
|
|
|
|
class BindFileService
|
|
|
{
|
|
|
- public function registerSubdomain(string $subdomain) {
|
|
|
- throw new \RuntimeException('not implemented');
|
|
|
+ public function __construct(
|
|
|
+ private string $bindfileBufferFile
|
|
|
+ ) {}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Append the subdomain to the buffer file
|
|
|
+ *
|
|
|
+ * A cron consumes this file each 5 minutes to complete the bind file /etc/bind/zones/opentalent.fr.db
|
|
|
+ *
|
|
|
+ * @param string $subdomain
|
|
|
+ */
|
|
|
+ public function registerSubdomain(string $subdomain): void
|
|
|
+ {
|
|
|
+ var_dump($this->bindfileBufferFile);
|
|
|
+ $fsd = @fopen($this->bindfileBufferFile, 'ab+');
|
|
|
+ fwrite($fsd, $subdomain);
|
|
|
+ fwrite($fsd, "\n");
|
|
|
+ fclose($fsd);
|
|
|
}
|
|
|
}
|