changes
This commit is contained in:
77
plugin-file/all-in-one-wp-migration/lib/vendor/servmask/filesystem/class-ai1wm-directory.php
vendored
Normal file
77
plugin-file/all-in-one-wp-migration/lib/vendor/servmask/filesystem/class-ai1wm-directory.php
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2023 ServMask Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Directory {
|
||||
|
||||
/**
|
||||
* Create directory (recursively)
|
||||
*
|
||||
* @param string $path Path to the directory
|
||||
* @return boolean
|
||||
*/
|
||||
public static function create( $path ) {
|
||||
if ( @is_dir( $path ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return @mkdir( $path, 0777, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete directory (recursively)
|
||||
*
|
||||
* @param string $path Path to the directory
|
||||
* @return boolean
|
||||
*/
|
||||
public static function delete( $path ) {
|
||||
if ( @is_dir( $path ) ) {
|
||||
try {
|
||||
// Iterate over directory
|
||||
$iterator = new Ai1wm_Recursive_Directory_Iterator( $path );
|
||||
|
||||
// Recursively iterate over directory
|
||||
$iterator = new Ai1wm_Recursive_Iterator_Iterator( $iterator, RecursiveIteratorIterator::CHILD_FIRST, RecursiveIteratorIterator::CATCH_GET_CHILD );
|
||||
|
||||
// Remove files and directories
|
||||
foreach ( $iterator as $item ) {
|
||||
if ( $item->isDir() ) {
|
||||
@rmdir( $item->getPathname() );
|
||||
} else {
|
||||
@unlink( $item->getPathname() );
|
||||
}
|
||||
}
|
||||
} catch ( Exception $e ) {
|
||||
}
|
||||
|
||||
return @rmdir( $path );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
75
plugin-file/all-in-one-wp-migration/lib/vendor/servmask/filesystem/class-ai1wm-file-htaccess.php
vendored
Normal file
75
plugin-file/all-in-one-wp-migration/lib/vendor/servmask/filesystem/class-ai1wm-file-htaccess.php
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2023 ServMask Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_File_Htaccess {
|
||||
|
||||
/**
|
||||
* Create .htaccess file (ServMask)
|
||||
*
|
||||
* @param string $path Path to file
|
||||
* @return boolean
|
||||
*/
|
||||
public static function create( $path ) {
|
||||
return Ai1wm_File::create(
|
||||
$path,
|
||||
implode(
|
||||
PHP_EOL,
|
||||
array(
|
||||
'<IfModule mod_mime.c>',
|
||||
'AddType application/octet-stream .wpress',
|
||||
'</IfModule>',
|
||||
'<IfModule mod_dir.c>',
|
||||
'DirectoryIndex index.php',
|
||||
'</IfModule>',
|
||||
'<IfModule mod_autoindex.c>',
|
||||
'Options -Indexes',
|
||||
'</IfModule>',
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create .htaccess file (LiteSpeed)
|
||||
*
|
||||
* @param string $path Path to file
|
||||
* @return boolean
|
||||
*/
|
||||
public static function litespeed( $path ) {
|
||||
return Ai1wm_File::create_with_markers(
|
||||
$path,
|
||||
'LiteSpeed',
|
||||
array(
|
||||
'<IfModule Litespeed>',
|
||||
'SetEnv noabort 1',
|
||||
'</IfModule>',
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
41
plugin-file/all-in-one-wp-migration/lib/vendor/servmask/filesystem/class-ai1wm-file-index.php
vendored
Normal file
41
plugin-file/all-in-one-wp-migration/lib/vendor/servmask/filesystem/class-ai1wm-file-index.php
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2023 ServMask Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_File_Index {
|
||||
|
||||
/**
|
||||
* Create index file
|
||||
*
|
||||
* @param string $path Path to file
|
||||
* @return boolean
|
||||
*/
|
||||
public static function create( $path ) {
|
||||
return Ai1wm_File::create( $path, 'Kangaroos cannot jump here' );
|
||||
}
|
||||
}
|
51
plugin-file/all-in-one-wp-migration/lib/vendor/servmask/filesystem/class-ai1wm-file-robots.php
vendored
Normal file
51
plugin-file/all-in-one-wp-migration/lib/vendor/servmask/filesystem/class-ai1wm-file-robots.php
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2023 ServMask Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_File_Robots {
|
||||
|
||||
/**
|
||||
* Create robots.txt file
|
||||
*
|
||||
* @param string $path Path to file
|
||||
* @return boolean
|
||||
*/
|
||||
public static function create( $path ) {
|
||||
return Ai1wm_File::create(
|
||||
$path,
|
||||
implode(
|
||||
PHP_EOL,
|
||||
array(
|
||||
'User-agent: *',
|
||||
'Disallow: /ai1wm-backups/',
|
||||
'Disallow: /wp-content/ai1wm-backups/',
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2023 ServMask Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_File_Webconfig {
|
||||
|
||||
/**
|
||||
* Create web.config file
|
||||
*
|
||||
* @param string $path Path to file
|
||||
* @return boolean
|
||||
*/
|
||||
public static function create( $path ) {
|
||||
return Ai1wm_File::create(
|
||||
$path,
|
||||
implode(
|
||||
PHP_EOL,
|
||||
array(
|
||||
'<configuration>',
|
||||
'<system.webServer>',
|
||||
'<staticContent>',
|
||||
'<mimeMap fileExtension=".wpress" mimeType="application/octet-stream" />',
|
||||
'</staticContent>',
|
||||
'<defaultDocument>',
|
||||
'<files>',
|
||||
'<add value="index.php" />',
|
||||
'</files>',
|
||||
'</defaultDocument>',
|
||||
'<directoryBrowse enabled="false" />',
|
||||
'</system.webServer>',
|
||||
'</configuration>',
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
96
plugin-file/all-in-one-wp-migration/lib/vendor/servmask/filesystem/class-ai1wm-file.php
vendored
Normal file
96
plugin-file/all-in-one-wp-migration/lib/vendor/servmask/filesystem/class-ai1wm-file.php
vendored
Normal file
@ -0,0 +1,96 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2023 ServMask Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_File {
|
||||
|
||||
/**
|
||||
* Create a file with content
|
||||
*
|
||||
* @param string $path Path to the file
|
||||
* @param string $content Content of the file
|
||||
* @return boolean
|
||||
*/
|
||||
public static function create( $path, $content ) {
|
||||
if ( ! @file_exists( $path ) ) {
|
||||
if ( ! @is_writable( dirname( $path ) ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! @touch( $path ) ) {
|
||||
return false;
|
||||
}
|
||||
} elseif ( ! @is_writable( $path ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// No changes were added
|
||||
if ( function_exists( 'md5_file' ) ) {
|
||||
if ( @md5_file( $path ) === md5( $content ) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$is_written = false;
|
||||
if ( ( $handle = @fopen( $path, 'w' ) ) !== false ) {
|
||||
if ( @fwrite( $handle, $content ) !== false ) {
|
||||
$is_written = true;
|
||||
}
|
||||
|
||||
@fclose( $handle );
|
||||
}
|
||||
|
||||
return $is_written;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a file with marker and content
|
||||
*
|
||||
* @param string $path Path to the file
|
||||
* @param string $marker Name of the marker
|
||||
* @param string $content Content of the file
|
||||
* @return boolean
|
||||
*/
|
||||
public static function create_with_markers( $path, $marker, $content ) {
|
||||
return @insert_with_markers( $path, $marker, $content );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a file by path
|
||||
*
|
||||
* @param string $path Path to the file
|
||||
* @return boolean
|
||||
*/
|
||||
public static function delete( $path ) {
|
||||
if ( ! @file_exists( $path ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return @unlink( $path );
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user