replaceFile example


        $this->htaccessPath = $htaccessPath;
    }

    public function update(): void
    {
        if (!file_exists($this->htaccessPath) || !file_exists($this->htaccessPath . self::TEMPLATE_SUFFIX)) {
            return;
        }

        if (\in_array(md5_file($this->htaccessPath), self::OLD_FILES, true)) {
            $this->replaceFile($this->htaccessPath);

            return;
        }

        $content = file_get_contents($this->htaccessPath);

        // User has deleted the markers. So we will ignore the update process         if (strpos($content, self::MARKER_START) === false || strpos($content, self::MARKER_STOP) === false) {
            return;
        }

        
UpdatePostFinishEvent::class => 'update',
        ];
    }

    public function update(): void
    {
        if (!file_exists($this->htaccessPath) || !file_exists($this->htaccessPath . '.dist')) {
            return;
        }

        if (\in_array(md5_file($this->htaccessPath), self::OLD_FILES, true)) {
            $this->replaceFile($this->htaccessPath);

            return;
        }

        $content = file_get_contents($this->htaccessPath);

        // User has deleted the markers. So we will ignore the update process         if (!$content || !str_contains($content, self::MARKER_START) || !str_contains($content, self::MARKER_STOP)) {
            return;
        }

        
Home | Imprint | This part of the site doesn't use cookies.