HEX
Server: LiteSpeed
System: Linux shams.tasjeel.ae 5.14.0-611.5.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 08:09:09 EST 2025 x86_64
User: infowars (1469)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /home/infowars/www/wp-content/plugins/backup/src/JetBackup/Export/Export.php
<?php

namespace JetBackup\Export;

use JetBackup\Cron\Task\Task;
use JetBackup\Exception\IOException;
use JetBackup\Export\Vendor\CPanel;
use JetBackup\Export\Vendor\DirectAdmin;
use JetBackup\Export\Vendor\Vendor;
use JetBackup\Wordpress\Helper;
use JetBackup\Wordpress\Wordpress;

if (!defined( '__JETBACKUP__')) die('Direct access is not allowed');

class Export {

	private Task $_task;
	
	public function __construct(Task $task) {
		$this->_task = $task;
	}
	
	public function build(int $type, string $homedir, array $database_tables, string $destination):string {

		if(!is_dir($destination)) throw new IOException("The provided destination not exists");

		switch($type) {
			default: throw new IOException("Invalid type provided");
			case Vendor::TYPE_CPANEL: $obj = new CPanel($this->_task); break;
			case Vendor::TYPE_DIRECT_ADMIN: $obj = new DirectAdmin($this->_task); break;
		}
		
		$obj->setPassword(DB_PASSWORD);
		$obj->setDomain(Wordpress::getSiteDomain());
		$obj->setEmailAddress(Helper::getUserEmail());
		$obj->setDestination($destination);
		$obj->setHomedir($homedir);
		$obj->setDatabaseTables($database_tables);
		
		return $obj->build();
	}
}