Version Description
Download this release
Release Info
Developer | boldgrid |
Plugin | Total Upkeep – WordPress Backup Plugin plus Restore & Migrate by BoldGrid |
Version | issue-494-202112011135 |
Comparing to | |
See all releases |
Code changes from version issue-494-202111301447 to issue-494-202112011135
admin/class-boldgrid-backup-admin-core.php
CHANGED
@@ -1377,47 +1377,35 @@ class Boldgrid_Backup_Admin_Core {
|
|
1377 |
* @return array A single-dimension filelist array for use in this class.
|
1378 |
*/
|
1379 |
public function get_filelist( $dirpath ) {
|
1380 |
-
|
1381 |
// If this is a node_modules folder, do not iterate through it.
|
1382 |
-
|
1383 |
if ( false !== strpos( $dirpath, '/node_modules' ) ) {
|
1384 |
return [];
|
1385 |
}
|
1386 |
-
$this->logger->add( 'after node_modules folder check' );
|
1387 |
|
1388 |
// Connect to the WordPress Filesystem API.
|
1389 |
-
|
1390 |
global $wp_filesystem;
|
1391 |
-
$this->logger->add( 'after $wp_filesystem global' );
|
1392 |
|
1393 |
// Validate input.
|
1394 |
-
$this->logger->add( 'before validate input' );
|
1395 |
if ( empty( $dirpath ) || ! $wp_filesystem->is_readable( $dirpath ) ) {
|
1396 |
return [];
|
1397 |
}
|
1398 |
-
$this->logger->add( 'after validate input' );
|
1399 |
|
1400 |
// Remove any training slash in dirpath.
|
1401 |
-
$this->logger->add( 'before remove trailing slash dirpath' );
|
1402 |
$dirpath = untrailingslashit( $dirpath );
|
1403 |
-
$this->logger->add( 'after remove trailing slash dirpath' );
|
1404 |
|
1405 |
// Mark the base directory, if not set (the first run).
|
1406 |
-
$this->logger->add( 'before mark the base directory' );
|
1407 |
if ( empty( $this->filelist_basedir ) ) {
|
1408 |
$this->filelist_basedir = $dirpath;
|
1409 |
}
|
1410 |
-
$this->logger->add( 'after mark the base directory' );
|
1411 |
|
1412 |
// Get the non-recursive directory listing for the specified path.
|
1413 |
-
$this->logger->add( 'before get-nonrecursive directory listing' );
|
1414 |
$dirlist = $wp_filesystem->dirlist( $dirpath, true, false );
|
1415 |
-
$this->logger->add( 'after get-nonrecursive directory listing' );
|
1416 |
|
1417 |
// Initialize $filelist.
|
1418 |
-
$this->logger->add( 'before initialize $filelist' );
|
1419 |
$filelist = [];
|
1420 |
-
$this->logger->add( 'after initialize $filelist' );
|
1421 |
|
1422 |
/*
|
1423 |
* Add empty directory.
|
@@ -1428,7 +1416,6 @@ class Boldgrid_Backup_Admin_Core {
|
|
1428 |
* Previously we used Boldgrid_Backup_Admin_Compressor_Php_Zip::add_dirs
|
1429 |
* to add all empty directories, but that method is no longer needed.
|
1430 |
*/
|
1431 |
-
$this->logger->add( 'before add empty directory' );
|
1432 |
if ( empty( $dirlist ) ) {
|
1433 |
$filelist[] = [
|
1434 |
$dirpath,
|
@@ -1438,10 +1425,8 @@ class Boldgrid_Backup_Admin_Core {
|
|
1438 |
'd',
|
1439 |
];
|
1440 |
}
|
1441 |
-
$this->logger->add( 'after add empty directory' );
|
1442 |
|
1443 |
// Sort the dirlist array by filename.
|
1444 |
-
$this->logger->add( 'before sort dirlist array by filename' );
|
1445 |
uasort(
|
1446 |
$dirlist,
|
1447 |
function ( $a, $b ) {
|
@@ -1456,10 +1441,8 @@ class Boldgrid_Backup_Admin_Core {
|
|
1456 |
return 0;
|
1457 |
}
|
1458 |
);
|
1459 |
-
$this->logger->add( 'after sort dirlist array by filename' );
|
1460 |
|
1461 |
// Perform conversion.
|
1462 |
-
$this->logger->add( 'before perform conversion' );
|
1463 |
foreach ( $dirlist as $fileinfo ) {
|
1464 |
// If item is a directory, then recurse, merge, and continue.
|
1465 |
if ( 'd' === $fileinfo['type'] ) {
|
@@ -1483,10 +1466,8 @@ class Boldgrid_Backup_Admin_Core {
|
|
1483 |
$fileinfo['size'],
|
1484 |
];
|
1485 |
}
|
1486 |
-
$this->logger->add( 'after perform conversion' );
|
1487 |
|
1488 |
// Return the array.
|
1489 |
-
$this->logger->add( 'before array return' );
|
1490 |
return $filelist;
|
1491 |
}
|
1492 |
|
1377 |
* @return array A single-dimension filelist array for use in this class.
|
1378 |
*/
|
1379 |
public function get_filelist( $dirpath ) {
|
1380 |
+
$this->logger->add( '-------> ' . $dirpath );
|
1381 |
// If this is a node_modules folder, do not iterate through it.
|
1382 |
+
|
1383 |
if ( false !== strpos( $dirpath, '/node_modules' ) ) {
|
1384 |
return [];
|
1385 |
}
|
|
|
1386 |
|
1387 |
// Connect to the WordPress Filesystem API.
|
1388 |
+
|
1389 |
global $wp_filesystem;
|
|
|
1390 |
|
1391 |
// Validate input.
|
|
|
1392 |
if ( empty( $dirpath ) || ! $wp_filesystem->is_readable( $dirpath ) ) {
|
1393 |
return [];
|
1394 |
}
|
|
|
1395 |
|
1396 |
// Remove any training slash in dirpath.
|
|
|
1397 |
$dirpath = untrailingslashit( $dirpath );
|
|
|
1398 |
|
1399 |
// Mark the base directory, if not set (the first run).
|
|
|
1400 |
if ( empty( $this->filelist_basedir ) ) {
|
1401 |
$this->filelist_basedir = $dirpath;
|
1402 |
}
|
|
|
1403 |
|
1404 |
// Get the non-recursive directory listing for the specified path.
|
|
|
1405 |
$dirlist = $wp_filesystem->dirlist( $dirpath, true, false );
|
|
|
1406 |
|
1407 |
// Initialize $filelist.
|
|
|
1408 |
$filelist = [];
|
|
|
1409 |
|
1410 |
/*
|
1411 |
* Add empty directory.
|
1416 |
* Previously we used Boldgrid_Backup_Admin_Compressor_Php_Zip::add_dirs
|
1417 |
* to add all empty directories, but that method is no longer needed.
|
1418 |
*/
|
|
|
1419 |
if ( empty( $dirlist ) ) {
|
1420 |
$filelist[] = [
|
1421 |
$dirpath,
|
1425 |
'd',
|
1426 |
];
|
1427 |
}
|
|
|
1428 |
|
1429 |
// Sort the dirlist array by filename.
|
|
|
1430 |
uasort(
|
1431 |
$dirlist,
|
1432 |
function ( $a, $b ) {
|
1441 |
return 0;
|
1442 |
}
|
1443 |
);
|
|
|
1444 |
|
1445 |
// Perform conversion.
|
|
|
1446 |
foreach ( $dirlist as $fileinfo ) {
|
1447 |
// If item is a directory, then recurse, merge, and continue.
|
1448 |
if ( 'd' === $fileinfo['type'] ) {
|
1466 |
$fileinfo['size'],
|
1467 |
];
|
1468 |
}
|
|
|
1469 |
|
1470 |
// Return the array.
|
|
|
1471 |
return $filelist;
|
1472 |
}
|
1473 |
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInitaf2880f10c75e0c515b85a1b1be35b5e::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit235de110f33275ba5db550f7cc69ef28
|
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
-
spl_autoload_register(array('
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
-
spl_autoload_unregister(array('
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
-
call_user_func(\Composer\Autoload\
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
@@ -51,19 +51,19 @@ class ComposerAutoloaderInit235de110f33275ba5db550f7cc69ef28
|
|
51 |
$loader->register(true);
|
52 |
|
53 |
if ($useStaticLoader) {
|
54 |
-
$includeFiles = Composer\Autoload\
|
55 |
} else {
|
56 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
57 |
}
|
58 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
59 |
-
|
60 |
}
|
61 |
|
62 |
return $loader;
|
63 |
}
|
64 |
}
|
65 |
|
66 |
-
function
|
67 |
{
|
68 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
69 |
require $file;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInitaf2880f10c75e0c515b85a1b1be35b5e
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInitaf2880f10c75e0c515b85a1b1be35b5e', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitaf2880f10c75e0c515b85a1b1be35b5e', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInitaf2880f10c75e0c515b85a1b1be35b5e::getInitializer($loader));
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
51 |
$loader->register(true);
|
52 |
|
53 |
if ($useStaticLoader) {
|
54 |
+
$includeFiles = Composer\Autoload\ComposerStaticInitaf2880f10c75e0c515b85a1b1be35b5e::$files;
|
55 |
} else {
|
56 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
57 |
}
|
58 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
59 |
+
composerRequireaf2880f10c75e0c515b85a1b1be35b5e($fileIdentifier, $file);
|
60 |
}
|
61 |
|
62 |
return $loader;
|
63 |
}
|
64 |
}
|
65 |
|
66 |
+
function composerRequireaf2880f10c75e0c515b85a1b1be35b5e($fileIdentifier, $file)
|
67 |
{
|
68 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
69 |
require $file;
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php',
|
@@ -91,9 +91,9 @@ class ComposerStaticInit235de110f33275ba5db550f7cc69ef28
|
|
91 |
public static function getInitializer(ClassLoader $loader)
|
92 |
{
|
93 |
return \Closure::bind(function () use ($loader) {
|
94 |
-
$loader->prefixLengthsPsr4 =
|
95 |
-
$loader->prefixDirsPsr4 =
|
96 |
-
$loader->classMap =
|
97 |
|
98 |
}, null, ClassLoader::class);
|
99 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInitaf2880f10c75e0c515b85a1b1be35b5e
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php',
|
91 |
public static function getInitializer(ClassLoader $loader)
|
92 |
{
|
93 |
return \Closure::bind(function () use ($loader) {
|
94 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInitaf2880f10c75e0c515b85a1b1be35b5e::$prefixLengthsPsr4;
|
95 |
+
$loader->prefixDirsPsr4 = ComposerStaticInitaf2880f10c75e0c515b85a1b1be35b5e::$prefixDirsPsr4;
|
96 |
+
$loader->classMap = ComposerStaticInitaf2880f10c75e0c515b85a1b1be35b5e::$classMap;
|
97 |
|
98 |
}, null, ClassLoader::class);
|
99 |
}
|