Your IP : 216.73.216.68


Current Path : /home/sunflowe/www2/j15/tmp/install_4f118f48ca3c3/backend/akeeba/abstract/
Upload File :
Current File : /home/sunflowe/www2/j15/tmp/install_4f118f48ca3c3/backend/akeeba/abstract/postproc.php

<?php
/**
 * Akeeba Engine
 * The modular PHP5 site backup engine
 * @copyright Copyright (c)2009-2012 Nicholas K. Dionysopoulos
 * @license GNU GPL version 3 or, at your option, any later version
 * @package akeebaengine
 * @version $Id: postproc.php 409 2011-01-24 09:30:22Z nikosdion $
 */

// Protection against direct access
defined('AKEEBAENGINE') or die('Restricted access');

/**
 * Akeeba Engine post processing abstract class
 * @author Nicholas
 *
 */
abstract class AEAbstractPostproc extends AEAbstractObject
{
	/** @var bool Should we break the step before post-processing? */
	public $break_before = true;

	/** @var bool Should we break the step after post-processing? */
	public $break_after = true;

	/** @var bool Does this engine processes the files in a way that makes deleting the originals safe? */
	public $allow_deletes = true;
	
	/** @var bool Does this engine support remote file deletes? */
	public $can_delete = false;
	
	/** @var bool Does this engine support downloads to files? */
	public $can_download_to_file = false;
	
	/** @var bool Does this engine support downloads to browser? */
	public $can_download_to_browser = false;
	
	/** @var bool Set to true if raw data will be dumped to the browser when downloading the file to the browser. Set to false if a URL is returned instead. */
	public $downloads_to_browser_inline = false;
	
	/**
	 * The remote absolute path to the file which was just processed. Leave null if the file is meant to
	 * be non-retrievable, i.e. sent to email or any other one way service.
	 * @var string
	 */
	public $remote_path = null;

	/**
	 * This function takes care of post-processing a backup archive's part, or the
	 * whole backup archive if it's not a split archive type. If the process fails
	 * it should return false. If it succeeds and the entirety of the file has been
	 * processed, it should return true. If only a part of the file has been uploaded,
	 * it must return 1.
	 * @param string $absolute_filename Absolute path to the part we'll have to process
	 * @return bool|int False on failure, true on success, 1 if more work is required
	 */
	public abstract function processPart($absolute_filename);
	
	/**
	 * Deletes a remote file
	 * @param $path string Absolute path to the file we're deleting
	 * @return bool|int False on failure, true on success, 1 if more work is required
	 */
	public function delete($path)
	{
		return false;
	}
	
	/**
	 * Downloads a remote file to a local file, optionally doing a range download. If the
	 * download fails we return false. If the download succeeds we return true. If range
	 * downloads are not supported, -1 is returned and nothing is written to disk.
	 * 
	 * @param $remotePath string The path to the remote file
	 * @param $localFile string The absolute path to the local file we're writing to
	 * @param $fromOffset int|null The offset (in bytes) to start downloading from
	 * @param $toOffset int|null The amount of data (in bytes) to download
	 * @return bool|int True on success, false on failure, -1 if ranges are not supported
	 */
	public function downloadToFile($remotePath, $localFile, $fromOffset = null, $length = null)
	{
		return false;
	}
	
	/**
	 * Returns a public download URL or starts a browser-side download of a remote file.
	 * In the case of a public download URL, a string is returned. If a browser-side
	 * download is initiated, it returns true. In any other case (e.g. unsupported, not
	 * found, etc) it returns false.
	 * 
	 * @param $remotePath string The file to download
	 * @return string|bool 
	 */
	public function downloadToBrowser($remotePath)
	{
		return false;
	}
}