src/lib/CronFileWriter.php
public function update($delim = '#', $data = PHP_EOL)
    {
        $data = str_replace(
            array('$1','$2','$3','$4','$5'),
            array('\$1','\$2','\$3','\$4','\$5'),
            $data
        );

        $delim = preg_quote($delim);

        file_put_contents(
            $this->file,
            trim(
                preg_replace(
                    "/#\s$delim\s(.*?)\s#\s\\\\$delim/s",
                    '# '.$delim.PHP_EOL.$data.PHP_EOL.'# \\'.$delim,
                    file_get_contents($this->file)
                )
            )
        );
    }
public function update($delim = '#', $data = PHP_EOL)
    {
        $data = str_replace(
            array('$1','$2','$3','$4','$5'),
            array('\$1','\$2','\$3','\$4','\$5'),
            $data
        );

        $delim = preg_quote($delim);

        file_put_contents(
            $this->file,
            trim(
                preg_replace(
                    "/#\s$delim\s(.*?)\s#\s\\\\$delim/s",
                    '# '.$delim.PHP_EOL.$data.PHP_EOL.'# \\'.$delim,
                    file_get_contents($this->file)
                )
            )
        );
    }
public function update ( $ delim = '#' , $ data = PHP_EOL ) { $ data = str_replace ( array ( '$1' , '$2' , '$3' , '$4' , '$5' ) , array ( '\$1' , '\$2' , '\$3' , '\$4' , '\$5' ) , $ data ) ; $ delim = preg_quote ( $ delim ) ; file_put_contents ( $ this -> file , trim ( preg_replace ( "/#\s$delim\s(.*?)\s#\s\\\\$delim/s" , '# ' . $ delim . PHP_EOL . $ data . PHP_EOL . '# \\' . $ delim , file_get_contents ( $ this -> file ) ) ) ) ; }
Update entry in .htaccess file

@param string $data
@param string $delim
Update entry in . htaccess file