/** * Creates a new instance of the CUBE object and empties the temporary * database tables * * @param boolean $OnlyDBMode Should we backup only the database contents? * @return JoomlapackCUBE */ function JoomlapackCUBE($OnlyDBMode = false) { $configuration =& JoomlapackConfiguration::getInstance(); $this->_OnlyDBMode = $OnlyDBMode; // Remove old entries from 'packvars' table JoomlapackTables::DeleteMultipleVars('%CUBE%'); // Initialize internal variables $this->_currentDomain = "init"; // Current domain of operation $this->_currentObject = null; // Nullify current object $this->_isFinished = false; //$this->_Error = false; // Load the filters manager $this->FilterManager = new JoomlapackFilterManager(); // Create a lock time stamp JoomlapackTables::WriteVar('CUBELock', time()); // Get JoomlaPack version data JoomlapackAbstraction::getJoomlaPackVersion(); JoomlapackLogger::ResetLog(); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "--------------------------------------------------------------------------------"); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "JoomlaPack " . _JP_VERSION . ' (' . _JP_DATE . ')'); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Your one for all backup solution"); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "--------------------------------------------------------------------------------"); // PHP configuration variables are tried to be logged only for debug log levels if ($configuration->logLevel >= 3) { JoomlapackLogger::WriteLog(_JP_LOG_INFO, "--- PHP Configuration Values ---"); if (function_exists('php_version')) { JoomlapackLogger::WriteLog(_JP_LOG_INFO, "PHP Version :" . phpversion()); } if (function_exists('php_uname')) { JoomlapackLogger::WriteLog(_JP_LOG_INFO, "OS Version :" . php_uname('s')); } JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Safe mode :" . ini_get("safe_mode")); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Display errors :" . ini_get("display_errors")); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Disabled functions :" . ini_get("disable_functions")); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "open_basedir restr.:" . ini_get('open_basedir')); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Max. exec. time :" . ini_get("max_execution_time")); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Memory limit :" . ini_get("memory_limit")); if (function_exists("memory_get_usage")) { JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Current mem. usage :" . memory_get_usage()); } if (function_exists("gzcompress")) { JoomlapackLogger::WriteLog(_JP_LOG_INFO, "GZIP Compression : available (good)"); } else { JoomlapackLogger::WriteLog(_JP_LOG_INFO, "GZIP Compression : n/a (no compression)"); } JoomlapackLogger::WriteLog(_JP_LOG_INFO, "--------------------------------------------------------------------------------"); } if ($this->_OnlyDBMode) { JoomlapackLogger::WriteLog(_JP_LOG_INFO, "JoomlaPack is starting a new database backup"); } else { JoomlapackLogger::WriteLog(_JP_LOG_INFO, "JoomlaPack is starting a new full site backup"); // Instanciate archiver, only if not in DB only mode $archiver =& $this->getArchiverEngine(); $archiveFile = JoomlapackAbstraction::getExpandedTarName($this->_archiveExtension); JoomlapackLogger::WriteLog(_JP_LOG_DEBUG, "Expanded archive file name: " . $archiveFile); JoomlapackLogger::WriteLog(_JP_LOG_DEBUG, "Seeding archive with installer"); $installerPackage = JPATH_COMPONENT_ADMINISTRATOR . DS . 'assets' . DS . "installers" . DS . $configuration->AltInstaller->Package; $archiver->initialize($installerPackage, $archiveFile); if ($archiver->hasError()) { $this->_Error = $archiver->getError(); } } }
// Include Joomla! Version Abstraction Layer require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'frameworkabstraction.php'; // Include abstract classes definitions jpimport('classes.abstract.object'); jpimport('classes.abstract.filter'); jpimport('classes.abstract.enginearchiver'); jpimport('classes.abstract.engineparts'); // Get the parameters from the request global $act, $task; $act = JoomlapackAbstraction::getParam('act', 'default'); $task = JoomlapackAbstraction::getParam('task', ''); // Some bureaucracy is only useful for non-AJAX calls. For AJAX calls, it's just a waste of CPU and memory :) if (!JoomlapackAbstraction::isSAJAX()) { // 1. Get component version from its XML file // ------------------------------------------------------------------------ JoomlapackAbstraction::getJoomlaPackVersion(); // 2. HTML generation library for JoomlaPack's back-end // ------------------------------------------------------------------------ jpimport('helpers.html'); if (!defined('_JEXEC')) { require_once $mainframe->getPath('admin_html'); } else { require_once JApplicationHelper::getPath('admin_html'); } // 3. Localisation (language file loading) // ------------------------------------------------------------------------ jpimport('helpers.lang'); } // Configuration class jpimport('classes.core.utility.configuration'); // For AJAX calls, some required stuff