Source of file GoOnline.php
Size: 0,952 Bytes - Last Modified: 2021-12-23T10:47:22+00:00
/var/www/docs.ssmods.com/process/src/src/Tasks/GoOnline.php
123456789101112131415161718192021222324252627282930 | <?php namespace Sunnysideup\UnderConstruction\Tasks; class GoOnline extends GoOffline { protected $title = 'Go Online / End Under Construction Period'; private static $segment = 'go-online-or-finish-construction'; /** * @param \SilverStripe\Control\HTTPRequest $request * @throws \ReflectionException */ public function run($request) { $path = $this->getHtAccessPath(); $currentContent = file_get_contents($path); $contentToRemove = $this->getHtAccessContent(); if (strpos($currentContent, $contentToRemove) !== false) { $currentContent = str_replace($contentToRemove, '', $currentContent); $currentContent = str_replace($contentToRemove, '', $currentContent); $currentContent = str_replace($contentToRemove, '', $currentContent); } file_put_contents($path, $currentContent); return 'Your site is now offline.'; } } |