exists(ABSPATH . $file)) { return ''; } return $wfs->get_contents(ABSPATH . $file); } public static function writeHtaccess(string $value, $file = self::HTACCESS_MAIN) : bool { $wfs = new self(); $wfs->put_contents(ABSPATH . $file, $value); return true; } public static function insertInHtaccess(string $element, $file = self::HTACCESS_MAIN) : bool { if (FileAccess::htaccessContains($element, $file)) { return true; } $htaccessFile = FileAccess::readHtaccess($file); $htaccessFile .= PHP_EOL . $element . PHP_EOL; FileAccess::writeHtaccess($htaccessFile, $file); return true; } public static function deleteFromHtaccess(string $element, $file = self::HTACCESS_MAIN) : bool { $htaccessFile = str_replace($element . PHP_EOL, '', FileAccess::readHtaccess($file)); return FileAccess::writeHtaccess($htaccessFile, $file); } }