Piwik\Plugins\Installation\ServerFilesGenerator::createHtAccess PHP Method

createHtAccess() protected static method

Apache-specific; for IIS @see web.config .htaccess files are created on all webservers even Nginx, as sometimes Nginx knows how to handle .htaccess files
protected static createHtAccess ( string $path, boolean $overwrite = true, string $content )
$path string without trailing slash
$overwrite boolean whether to overwrite an existing file or not
$content string
    protected static function createHtAccess($path, $overwrite = true, $content)
    {
        $file = $path . '/.htaccess';
        $content = "# This file is auto generated by Piwik, do not edit directly\n# Please report any issue or improvement directly to the Piwik team.\n\n" . $content;
        if ($overwrite || !file_exists($file)) {
            @file_put_contents($file, $content);
        }
    }