HEX
Server: Apache
System: Linux p3plzcpnl489499.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: dwauav0tm6jp (6177017)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/dwauav0tm6jp/www/newvsi/wp-content/plugins/duplicator/lib/fileops/class.fileops.u.delete.php
<?php
if (!defined("ABSPATH") && !defined("DUPXABSPATH"))
	die("");
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

class FileOpsDeleteConfig
{
	public $workerTime;
	public $directories;
	public $throttleDelayInUs;
	public $excludedDirectories;
	public $excludedFiles;
	public $fileLock;

}

class FileOpsDeleteU
{

	// Move $directories, $files, $excludedFiles to $destination directory. Throws exception if it can't do something and $exceptionOnFaiure is true
	// $exludedFiles can include * wildcard
	// returns: array with list of failures
	public static function delete($currentDirectory, &$deleteConfig)
	{
		$timedOut = false;
		
		if (is_dir($currentDirectory)) {
			$objects = scandir($currentDirectory);
			foreach ($objects as $object) {
				if ($object != "." && $object != "..") {
					if (is_dir($currentDirectory."/".$object)) {
						self::delete($currentDirectory."/".$object, $deleteConfig);
					}
					else {
						@unlink($currentDirectory."/".$object);
					}
				}
			}
			@rmdir($currentDirectory);
		}
	}
}