Esempio n. 1
0
 /**
  * Extend the bootstrap code to add some define's used by the JPS format engine
  * @see backend/akeeba/abstract/AEAbstractArchiver#__bootstrap_code()
  */
 protected function __bootstrap_code()
 {
     if (!defined('_JPS_MAJOR')) {
         define('_JPS_MAJOR', 1);
         // JPS Format major version number
         define('_JPS_MINOR', 9);
         // JPS Format minor version number
     }
     parent::__bootstrap_code();
 }
Esempio n. 2
0
	/**
	 * Extend the bootstrap code to add some define's used by the ZIP format engine
	 * @see backend/akeeba/abstract/AEAbstractArchiver#__bootstrap_code()
	 */
	protected function __bootstrap_code()
	{
		if(!defined('_AKEEBA_COMPRESSION_THRESHOLD'))
		{
			$config =& AEFactory::getConfiguration();
			define("_AKEEBA_COMPRESSION_THRESHOLD", $config->get('engine.archiver.common.big_file_threshold')); // Don't compress files over this size
			define("_AKEEBA_DIRECTORY_READ_CHUNK", $config->get('engine.archiver.zip.cd_glue_chunk_size')); // How much data to read at once when finalizing ZIP archives
		}
		parent::__bootstrap_code();
	}
Esempio n. 3
0
	public function  __bootstrap_code() {
		parent::__bootstrap_code();

		// So that the first run doesn't crash!
		if(empty($this->_dataFileName)) return;

		// Try to reopen the ZIP
		$this->zip = new ZipArchive;
		if(!file_exists($this->_dataFileName)) {
			$res = $this->zip->open($this->_dataFileName, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE);
		} else {
			$res = $this->zip->open($this->_dataFileName);
		}

		if($res !== TRUE) {
			switch($res) {
				case ZipArchive::ER_EXISTS:
					$this->setError("The archive {$this->_dataFileName} already exists");
					break;
				case ZipArchive::ER_INCONS:
					$this->setError("Inconsistent archive {$this->_dataFileName} detected");
					break;
				case ZipArchive::ER_INVAL:
					$this->setError("Invalid archive {$this->_dataFileName} detected");
					break;
				case ZipArchive::ER_MEMORY:
					$this->setError("Not enough memory to process archive {$this->_dataFileName}");
					break;
				case ZipArchive::ER_NOENT:
					$this->setError("Unexpected ZipArchive::ER_NOENT error processing archive {$this->_dataFileName}");
					break;
				case ZipArchive::ER_NOZIP:
					$this->setError("File {$this->_dataFileName} is not a ZIP archive!");
					break;
				case ZipArchive::ER_OPEN:
					$this->setError("Could not open archive file {$this->_dataFileName} for writing");
					break;
				case ZipArchive::ER_READ:
					$this->setError("Could not read from archive file {$this->_dataFileName}");
					break;
				case ZipArchive::ER_SEEK:
					$this->setError("Could not seek into position while processing archive file {$this->_dataFileName}");
					break;

			}

			return false;
		}
	}
Esempio n. 4
0
 /**
  * Extend the bootstrap code to add some define's used by the JPA format engine
  * @see backend/akeeba/abstract/AEAbstractArchiver#__bootstrap_code()
  */
 protected function __bootstrap_code()
 {
     if (!defined('_AKEEBA_COMPRESSION_THRESHOLD')) {
         $config =& AEFactory::getConfiguration();
         define("_AKEEBA_COMPRESSION_THRESHOLD", $config->get('engine.archiver.common.big_file_threshold'));
         // Don't compress files over this size
         /**
          * Akeeba Backup and JPA Format version change chart:
          * Akeeba Backup 3.0: JPA Format 1.1 is used
          * Akeeba Backup 3.1: JPA Format 1.2 with file modification timestamp is used
          */
         define('_JPA_MAJOR', 1);
         // JPA Format major version number
         define('_JPA_MINOR', 2);
         // JPA Format minor version number
     }
     parent::__bootstrap_code();
 }