.
*
* Attribution: This code is part of the All-in-One WP Migration plugin, developed by
*
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
*/
if ( ! defined( 'ABSPATH' ) ) {
die( 'Kangaroos cannot jump here' );
}
class Ai1wm_File_Htaccess {
/**
* Create backups .htaccess file
*
* @param string $path Path to file
* @return boolean
*/
public static function backups( $path ) {
return Ai1wm_File::create(
$path,
implode(
PHP_EOL,
array(
'',
' AddType application/octet-stream .wpress',
'',
'',
' DirectoryIndex index.php',
'',
'',
' Options -Indexes',
'',
)
)
);
}
/**
* Create storage .htaccess file
*
* @param string $path Path to file
* @return boolean
*/
public static function storage( $path ) {
return Ai1wm_File::create(
$path,
implode(
PHP_EOL,
array(
'',
' ',
' Require all denied',
' ',
' ',
' Require all granted',
' ',
'',
'',
' Order allow,deny',
' Deny from all',
' ',
' Order allow,deny',
' Allow from all',
' ',
'',
'',
' AddType text/plain .log',
'',
'',
' DirectoryIndex index.php',
'',
'',
' Options -Indexes',
'',
)
)
);
}
/**
* Create LiteSpeed .htaccess file
*
* @param string $path Path to file
* @return boolean
*/
public static function litespeed( $path ) {
return Ai1wm_File::insert_with_markers(
$path,
'LiteSpeed',
array(
'',
' SetEnv noabort 1',
'',
)
);
}
}