예제 #1
0
	function botJombackup()
	{
		hwdvs_fileManagement::checkDirectoryStructure();
		require_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_hwdvideoshare'.DS.'models'.DS.'exports.php');
		hwdvids_BE_exports::botJombackup();
		return;
	}
예제 #2
0
	/**
	*  The backup process controller
	*/
	function botJombackup()
	{
		$app = & JFactory::getApplication();
		$config = new JConfig;

		$jb_abspath		= JPATH_SITE;
		$jb_host		= $config->host;
		$jb_user		= $config->user;
		$jb_password	= $config->password;
		$jb_db			= $config->db;
		$jb_mailfrom	= $config->mailfrom;
		$jb_fromname	= $config->fromname;
		$jb_livesite	= JURI::root();

		$bkuparray = array(
		'testing' => 1,
		'deletefile' => true,
		'compress' => 1,
		'backuppath' => 0,
		'recipient' => '',
		'subject' => 'Mysql backup',
		'fromname' => $jb_fromname,
		'body' => 'Mysql backup from '.$jb_fromname,
		'drop_tables' => 1,
		'create_tables' => 1,
		'struct_only' => 0,
		'locks' => 0,
		'comments' => 1,
		);

		$testing 			= $bkuparray['testing'];
		$compress			= $bkuparray['compress'];
		$deletefile			= $bkuparray['deletefile'];
		$drop_tables 		= $bkuparray['drop_tables'];
		$create_tables 		= $bkuparray['create_tables'];
		$struct_only 		= $bkuparray['struct_only'];
		$locks 				= $bkuparray['locks'];
		$comments 			= $bkuparray['comments'];
		$ToEmail 			= $bkuparray['recipient'];
		$Subject 			= $bkuparray['subject'];
		$Body 				= $bkuparray['body'];
		$backuppath			= $bkuparray['backuppath'];
		$FromName 			= $bkuparray['fromname'];

		$mediaPath          = JPATH_SITE.DS."media";
		$checkfileName      = "jombackup_checkfile_";
		$today              = date("Y-m-d");
		$dateCheckFile      = $checkfileName.$today;
		$okToContinue       = true;

		if ($okToContinue)
		{
			require_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_hwdvideoshare'.DS.'libraries'.DS.'mysql_backup.class.php');

			$backup_obj = new Jombackup_MySQL_DB_Backup();
			$result = hwdvids_BE_exports::jombackupBackup($backup_obj,$jb_host,$jb_user,$jb_password,$jb_db,$bkuparray,$mediaPath,$jb_fromname,$compress,$backuppath);
			$backupFile = $backup_obj->jombackup_file_name;

			$EmailResult=hwdvids_BE_exports::jombackupEmail($bkuparray,$jb_mailfrom,$jb_fromname,$backupFile,$result['output'],$jb_livesite);
			if (!empty($backupFile))
			{
				$msg = _HWDVIDS_EXPORT_SUCCESS;
				unlink($backupFile);
				$app->enqueueMessage($msg);
				$app->redirect( JURI::root( true ) . '/administrator/index.php?option=com_hwdvideoshare&task=export' );
				return;
			}
		}
	}