Exemplo n.º 1
0
	public function display($tpl = null)
	{
		$task = JRequest::getCmd('task','default');

		switch($task)
		{
			case 'step':
				$kettenrad =& AEFactory::getKettenrad();
				$array = $kettenrad->getStatusArray();
				$this->assign('array', $array);
				break;

			case 'error':
				$this->assign('errormessage', JRequest::getVar('error',''));
				break;

			case 'done':
				break;

			case 'default':
			default:
				$model =& $this->getModel();
				$this->assignRef('profilelist', $model->getProfiles());
				break;
		}

		parent::display(JRequest::getCmd('tpl',null));
	}
Exemplo n.º 2
0
 public function __construct()
 {
     $this->object = 'dir';
     $this->subtype = 'content';
     $this->method = 'direct';
     $this->filter_name = 'PlatformSkipfiles';
     if (AEFactory::getKettenrad()->getTag() == 'restorepoint') {
         $this->enabled = false;
     }
     // We take advantage of the filter class magic to inject our custom filters
     $configuration = AEFactory::getConfiguration();
     $jreg = JFactory::getConfig();
     if (version_compare(JVERSION, '3.0', 'ge')) {
         $tmpdir = $jreg->get('tmp_path');
     } else {
         $tmpdir = $jreg->getValue('config.tmp_path');
     }
     // Get the site's root
     if ($configuration->get('akeeba.platform.override_root', 0)) {
         $root = $configuration->get('akeeba.platform.newroot', '[SITEROOT]');
     } else {
         $root = '[SITEROOT]';
     }
     $this->filter_data[$root] = array(self::treatDirectory($configuration->get('akeeba.basic.output_directory')), self::treatDirectory($tmpdir), 'tmp', self::treatDirectory(JPATH_CACHE), self::treatDirectory(JPATH_ADMINISTRATOR . '/cache'), self::treatDirectory(JPATH_ROOT . '/cache'), 'cache', 'administrator/cache', self::treatDirectory(JPATH_ROOT . '/installation'), 'installation', self::treatDirectory(AEPlatform::getInstance()->get_site_root() . '/cache'), self::treatDirectory(AEPlatform::getInstance()->get_site_root() . '/administrator/cache'), 'administrator/components/com_akeeba/backup', self::treatDirectory(AEPlatform::getInstance()->get_site_root() . '/components/libraries/cmslib/cache'), 'components/libraries/cmslib/cache', 'logs');
     parent::__construct();
 }
Exemplo n.º 3
0
	function __construct()
	{
		$this->object	= 'file';
		$this->subtype	= 'all';
		$this->method	= 'api';
		
		if(AEFactory::getKettenrad()->getTag() == 'restorepoint') $this->enabled = false;
	}
Exemplo n.º 4
0
 public function onStep($tpl = null)
 {
     $this->setLayout('step');
     $kettenrad = AEFactory::getKettenrad();
     $array = $kettenrad->getStatusArray();
     $model = $this->getModel();
     $key = $model->getState('key', '');
     $this->array = $array;
     $this->key = $key;
     return true;
 }
 function __construct()
 {
     $this->object = 'dbobject';
     $this->subtype = 'content';
     $this->method = 'api';
     if (AEFactory::getKettenrad()->getTag() != 'restorepoint') {
         $this->enabled = false;
     } else {
         $this->init();
     }
 }
Exemplo n.º 6
0
	function __construct()
	{
		$this->object	= 'dbobject';
		$this->subtype	= 'all';
		$this->method	= 'direct';
		
		if(AEFactory::getKettenrad()->getTag() == 'restorepoint') $this->enabled = false;

		if(empty($this->filter_name)) $this->filter_name = strtolower(basename(__FILE__,'.php'));
		parent::__construct();
	}
Exemplo n.º 7
0
 public function __construct()
 {
     $this->object = 'dbobject';
     $this->subtype = 'content';
     $this->method = 'direct';
     $this->filter_name = 'PlatformTabledata';
     // We take advantage of the filter class magic to inject our custom filters
     $this->filter_data['[SITEDB]'] = array('#__session', '#__guardxt_runs');
     if (AEFactory::getKettenrad()->getTag() == 'restorepoint') {
         $this->enabled = false;
     }
     parent::__construct();
 }
Exemplo n.º 8
0
 public function __construct()
 {
     $this->object = 'components';
     $this->subtype = 'all';
     $this->method = 'direct';
     if (empty($this->filter_name)) {
         $this->filter_name = strtolower(basename(__FILE__, '.php'));
     }
     if (AEFactory::getKettenrad()->getTag() == 'restorepoint') {
         $this->enabled = false;
     }
     $this->joomla16 = !@file_exists(JPATH_SITE . '/includes/joomla.php');
     parent::__construct();
 }
Exemplo n.º 9
0
Arquivo: srpdirs.php Projeto: 01J/topm
 function __construct()
 {
     if (!defined('_JEXEC')) {
         $this->enabled = false;
         return;
     }
     $this->object = 'dir';
     $this->subtype = 'all';
     $this->method = 'api';
     if (AEFactory::getKettenrad()->getTag() != 'restorepoint') {
         $this->enabled = false;
     } else {
         $this->init();
     }
 }
Exemplo n.º 10
0
 function __construct()
 {
     $this->object = 'dir';
     $this->subtype = 'content';
     $this->method = 'api';
     if (AEFactory::getKettenrad()->getTag() != 'restorepoint') {
         $this->enabled = false;
     } else {
         $this->init();
     }
     // Make sure we exclude the current and default backup output directories
     $configuration = AEFactory::getConfiguration();
     if ($configuration->get('akeeba.platform.override_root', 0)) {
         $root = $configuration->get('akeeba.platform.newroot', '[SITEROOT]');
     } else {
         $root = '[SITEROOT]';
     }
     $this->filter_data[$root] = array(self::treatDirectory($configuration->get('akeeba.basic.output_directory')), 'administrator/components/com_akeeba/backup', self::treatDirectory(AEPlatform::getInstance()->get_site_root() . '/components/libraries/cmslib/cache'), 'components/libraries/cmslib/cache');
 }
 public function __construct()
 {
     $this->object = 'dir';
     $this->subtype = 'all';
     $this->method = 'direct';
     $this->filter_name = 'PlatformFolders';
     if (AEFactory::getKettenrad()->getTag() == 'restorepoint') {
         $this->enabled = false;
     }
     // Get the site's root
     $configuration = AEFactory::getConfiguration();
     if ($configuration->get('akeeba.platform.override_root', 0)) {
         $root = $configuration->get('akeeba.platform.newroot', '[SITEROOT]');
     } else {
         $root = '[SITEROOT]';
     }
     // We take advantage of the filter class magic to inject our custom filters
     $this->filter_data[$root] = array('awstats', 'cgi-bin');
     parent::__construct();
 }
Exemplo n.º 12
0
 function __construct()
 {
     $this->object = 'file';
     $this->subtype = 'all';
     $this->method = 'regex';
     if (empty($this->filter_name)) {
         $this->filter_name = strtolower(basename(__FILE__, '.php'));
     }
     if (AEFactory::getKettenrad()->getTag() == 'restorepoint') {
         $this->enabled = false;
     }
     parent::__construct();
     // Get the site's root
     $configuration = AEFactory::getConfiguration();
     if ($configuration->get('akeeba.platform.override_root', 0)) {
         $root = $configuration->get('akeeba.platform.newroot', '[SITEROOT]');
     } else {
         $root = '[SITEROOT]';
     }
     $this->filter_data[$root] = array('#/Thumbs.db$#', '#^Thumbs.db$#', '#/.DS_Store$#i', '#^.DS_Store$#i');
 }
Exemplo n.º 13
0
 public function __construct()
 {
     $this->object = 'dir';
     $this->subtype = 'inclusion';
     $this->method = 'direct';
     $this->filter_name = 'PlatformLibraries';
     if (AEFactory::getKettenrad()->getTag() == 'restorepoint') {
         $this->enabled = false;
     }
     // FIXME This filter doesn't work very well on many live hosts. Disabled for now.
     parent::__construct();
     return;
     if (empty($this->filter_name)) {
         $this->filter_name = strtolower(basename(__FILE__, '.php'));
     }
     // Get the saved library path and compare it to the default
     $jlibdir = AEPlatform::getInstance()->get_platform_configuration_option('jlibrariesdir', '');
     if (empty($jlibdir)) {
         if (defined('JPATH_LIBRARIES')) {
             $jlibdir = JPATH_LIBRARIES;
         } elseif (defined('JPATH_PLATFORM')) {
             $jlibdir = JPATH_PLATFORM;
         } else {
             $jlibdir = false;
         }
     }
     if ($jlibdir !== false) {
         $jlibdir = AEUtilFilesystem::TranslateWinPath($jlibdir);
         $defaultLibraries = AEUtilFilesystem::TranslateWinPath(JPATH_SITE . '/libraries');
         if ($defaultLibraries != $jlibdir) {
             // The path differs, add it here
             $this->filter_data['JPATH_LIBRARIES'] = $jlibdir;
         }
     } else {
         $this->filter_data = array();
     }
     parent::__construct();
 }
Exemplo n.º 14
0
 /**
  * Implements the _run() abstract method
  */
 protected function _run()
 {
     if ($this->getState() == 'postrun') {
         AEUtilLogger::WriteLog(_AE_LOG_DEBUG, __CLASS__ . " :: Already finished");
         $this->setStep('');
         $this->setSubstep('');
         return;
     } else {
         $this->setState('running');
     }
     // Load the version defines
     AEPlatform::getInstance()->load_version_defines();
     $registry = AEFactory::getConfiguration();
     // Write log file's header
     AEUtilLogger::WriteLog(_AE_LOG_INFO, "--------------------------------------------------------------------------------");
     AEUtilLogger::WriteLog(_AE_LOG_INFO, "Akeeba Backup " . AKEEBA_VERSION . ' (' . AKEEBA_DATE . ')');
     AEUtilLogger::WriteLog(_AE_LOG_INFO, "Got backup?");
     AEUtilLogger::WriteLog(_AE_LOG_INFO, "--------------------------------------------------------------------------------");
     // PHP configuration variables are tried to be logged only for debug and info log levels
     if ($registry->get('akeeba.basic.log_level') >= _AE_LOG_INFO) {
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "--- System Information ---");
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "PHP Version        :" . PHP_VERSION);
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "PHP OS             :" . PHP_OS);
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "PHP SAPI           :" . PHP_SAPI);
         if (function_exists('php_uname')) {
             AEUtilLogger::WriteLog(_AE_LOG_INFO, "OS Version         :" . php_uname('s'));
         }
         $db = AEFactory::getDatabase();
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "DB Version         :" . $db->getVersion());
         if (isset($_SERVER['SERVER_SOFTWARE'])) {
             $server = $_SERVER['SERVER_SOFTWARE'];
         } else {
             if ($sf = getenv('SERVER_SOFTWARE')) {
                 $server = $sf;
             } else {
                 $server = 'n/a';
             }
         }
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "Web Server         :" . $server);
         $platform = 'Unknown platform';
         $version = '(unknown version)';
         $platformData = AEPlatform::getInstance()->getPlatformVersion();
         AEUtilLogger::WriteLog(_AE_LOG_INFO, $platformData['name'] . " version    :" . $platformData['version']);
         if (isset($_SERVER['HTTP_USER_AGENT'])) {
             AEUtilLogger::WriteLog(_AE_LOG_INFO, "User agent         :" . phpversion() <= "4.2.1" ? getenv("HTTP_USER_AGENT") : $_SERVER['HTTP_USER_AGENT']);
         }
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "Safe mode          :" . ini_get("safe_mode"));
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "Display errors     :" . ini_get("display_errors"));
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "Error reporting    :" . self::error2string());
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "Error display      :" . self::errordisplay());
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "Disabled functions :" . ini_get("disable_functions"));
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "open_basedir restr.:" . ini_get('open_basedir'));
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "Max. exec. time    :" . ini_get("max_execution_time"));
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "Memory limit       :" . ini_get("memory_limit"));
         if (function_exists("memory_get_usage")) {
             AEUtilLogger::WriteLog(_AE_LOG_INFO, "Current mem. usage :" . memory_get_usage());
         }
         if (function_exists("gzcompress")) {
             AEUtilLogger::WriteLog(_AE_LOG_INFO, "GZIP Compression   : available (good)");
         } else {
             AEUtilLogger::WriteLog(_AE_LOG_INFO, "GZIP Compression   : n/a (no compression)");
         }
         AEPlatform::getInstance()->log_platform_special_directories();
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "Output directory   :" . $registry->get('akeeba.basic.output_directory'));
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "--------------------------------------------------------------------------------");
     }
     // Quirks reporting
     $quirks = AEUtilQuirks::get_quirks(true);
     if (!empty($quirks)) {
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "Akeeba Backup has detected the following potential problems:");
         foreach ($quirks as $q) {
             AEUtilLogger::WriteLog(_AE_LOG_INFO, '- ' . $q['code'] . ' ' . $q['description'] . ' (' . $q['severity'] . ')');
         }
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "You probably do not have to worry about them, but you should be aware of them.");
         AEUtilLogger::WriteLog(_AE_LOG_INFO, "--------------------------------------------------------------------------------");
     }
     if (!version_compare(PHP_VERSION, '5.3.0', 'ge')) {
         AEUtilLogger::WriteLog(_AE_LOG_WARNING, "You are using an outdated version of PHP. Akeeba Engine may not work properly. Please upgrade to PHP 5.3 or later.");
     }
     // Report profile ID
     $profile_id = AEPlatform::getInstance()->get_active_profile();
     AEUtilLogger::WriteLog(_AE_LOG_INFO, "Loaded profile #{$profile_id}");
     // Get archive name
     AEUtilFilesystem::get_archive_name($relativeArchiveName, $absoluteArchiveName);
     // ==== Stats initialisation ===
     $origin = AEPlatform::getInstance()->get_backup_origin();
     // Get backup origin
     $profile_id = AEPlatform::getInstance()->get_active_profile();
     // Get active profile
     $registry = AEFactory::getConfiguration();
     $backupType = $registry->get('akeeba.basic.backup_type');
     AEUtilLogger::WriteLog(_AE_LOG_DEBUG, "Backup type is now set to '" . $backupType . "'");
     // Substitute "variables" in the archive name
     $description = AEUtilFilesystem::replace_archive_name_variables($this->description);
     $comment = AEUtilFilesystem::replace_archive_name_variables($this->comment);
     if ($registry->get('volatile.writer.store_on_server', true)) {
         // Archive files are stored on our server
         $stat_relativeArchiveName = $relativeArchiveName;
         $stat_absoluteArchiveName = $absoluteArchiveName;
     } else {
         // Archive files are not stored on our server (FTP backup, cloud backup, sent by email, etc)
         $stat_relativeArchiveName = '';
         $stat_absoluteArchiveName = '';
     }
     $kettenrad = AEFactory::getKettenrad();
     $temp = array('description' => $description, 'comment' => $comment, 'backupstart' => AEPlatform::getInstance()->get_timestamp_database(), 'status' => 'run', 'origin' => $origin, 'type' => $backupType, 'profile_id' => $profile_id, 'archivename' => $stat_relativeArchiveName, 'absolute_path' => $stat_absoluteArchiveName, 'multipart' => 0, 'filesexist' => 1, 'tag' => $kettenrad->getTag());
     // Save the entry
     $statistics = AEFactory::getStatistics();
     $statistics->setStatistics($temp);
     if ($statistics->getError()) {
         $this->setError($statistics->getError());
         return;
     }
     $statistics->release_multipart_lock();
     // Initialize the archive.
     if (AEUtilScripting::getScriptingParameter('core.createarchive', true)) {
         AEUtilLogger::WriteLog(_AE_LOG_DEBUG, "Expanded archive file name: " . $absoluteArchiveName);
         AEUtilLogger::WriteLog(_AE_LOG_DEBUG, "Initializing archiver engine");
         $archiver = AEFactory::getArchiverEngine();
         $archiver->initialize($absoluteArchiveName);
         $archiver->setComment($comment);
         // Add the comment to the archive itself.
         $archiver->propagateToObject($this);
         if ($this->getError()) {
             return;
         }
     }
     $this->setState('postrun');
 }
Exemplo n.º 15
0
 /**
  * Loads the factory from the storage (if it exists) and returns a reference to the
  * Kettenrad object.
  *
  * @param $tag string The backup tag to load
  *
  * @return AECoreKettenrad A reference to the Kettenrad object
  */
 public static function &load($tag = null)
 {
     if (is_null($tag) && defined('AKEEBA_BACKUP_ORIGIN')) {
         $tag = AKEEBA_BACKUP_ORIGIN;
     }
     // In order to load anything, we need to have the correct profile loaded. Let's assume
     // that the latest backup record in this tag has the correct profile number set.
     $config = AEFactory::getConfiguration();
     if (empty($config->activeProfile)) {
         // Only bother loading a configuration if none has been already loaded
         $statList = AEPlatform::getInstance()->get_statistics_list(array('filters' => array(array('field' => 'tag', 'value' => $tag)), 'order' => array('by' => 'id', 'order' => 'DESC')));
         if (is_array($statList)) {
             $stat = array_pop($statList);
             $profile = $stat['profile_id'];
             AEPlatform::getInstance()->load_configuration($profile);
         }
     }
     AEUtilLogger::openLog($tag);
     AEUtilLogger::WriteLog(_AE_LOG_DEBUG, "Kettenrad :: Attempting to load from database ({$tag})");
     $serialized_factory = AEUtilTempvars::get($tag);
     if ($serialized_factory !== false) {
         AEUtilLogger::WriteLog(_AE_LOG_DEBUG, " -- Loaded stored Akeeba Factory ({$tag})");
         AEFactory::unserialize($serialized_factory);
     } else {
         // There is no serialized factory. Nuke the in-memory factory.
         AEUtilLogger::WriteLog(_AE_LOG_DEBUG, " -- Stored Akeeba Factory ({$tag}) not found - hard reset");
         AEFactory::nuke();
         AEPlatform::getInstance()->load_configuration();
     }
     unset($serialized_factory);
     return AEFactory::getKettenrad();
 }
Exemplo n.º 16
0
    public function execute()
    {
        // Load the language files
        $paths = array(JPATH_ADMINISTRATOR, JPATH_ROOT);
        $jlang = JFactory::getLanguage();
        $jlang->load('com_akeeba', $paths[0], 'en-GB', true);
        $jlang->load('com_akeeba', $paths[1], 'en-GB', true);
        $jlang->load('com_akeeba' . '.override', $paths[0], 'en-GB', true);
        $jlang->load('com_akeeba' . '.override', $paths[1], 'en-GB', true);
        // Get the backup profile and description
        $profile = $this->input->get('profile', 1, 'int');
        $description = $this->input->get('description', 'Command-line backup', 'string');
        $overrides = $this->getOption('override', array(), false);
        if (!empty($overrides)) {
            $override_message = "\nConfiguration variables overriden in the command line:\n";
            $override_message .= implode(', ', array_keys($overrides));
            $override_message .= "\n";
        } else {
            $override_message = "";
        }
        $debugmessage = '';
        if ($this->input->get('debug', -1, 'int') != -1) {
            if (!defined('AKEEBADEBUG')) {
                define('AKEEBADEBUG', 1);
            }
            $debugmessage = "*** DEBUG MODE ENABLED ***\n";
        }
        $version = AKEEBA_VERSION;
        $date = AKEEBA_DATE;
        $start_backup = time();
        $memusage = $this->memUsage();
        $phpversion = PHP_VERSION;
        $phpenvironment = PHP_SAPI;
        $phpos = PHP_OS;
        if ($this->input->get('quiet', -1, 'int') == -1) {
            $year = gmdate('Y');
            echo <<<ENDBLOCK
Akeeba Backup CLI {$version} ({$date})
Copyright (C) 2010-{$year} Nicholas K. Dionysopoulos
-------------------------------------------------------------------------------
Akeeba Backup is Free Software, distributed under the terms of the GNU General
Public License version 3 or, at your option, any later version.
This program comes with ABSOLUTELY NO WARRANTY as per sections 15 & 16 of the
license. See http://www.gnu.org/licenses/gpl-3.0.html for details.
-------------------------------------------------------------------------------
You are using PHP {$phpversion} ({$phpenvironment})
{$debugmessage}
Starting a new backup with the following parameters:
Profile ID  {$profile}
Description "{$description}"
{$override_message}
Current memory usage: {$memusage}


ENDBLOCK;
        }
        // Attempt to use an infinite time limit, in case you are using the PHP CGI binary instead
        // of the PHP CLI binary. This will not work with Safe Mode, though.
        $safe_mode = true;
        if (function_exists('ini_get')) {
            $safe_mode = ini_get('safe_mode');
        }
        if (!$safe_mode && function_exists('set_time_limit')) {
            if ($this->input->get('quiet', -1, 'int') == -1) {
                echo "Unsetting time limit restrictions.\n";
            }
            @set_time_limit(0);
        } elseif (!$safe_mode) {
            if ($this->input->get('quiet', -1, 'int') == -1) {
                echo "Could not unset time limit restrictions; you may get a timeout error\n";
            }
        } else {
            if ($this->input->get('quiet', -1, 'int') == -1) {
                echo "You are using PHP's Safe Mode; you may get a timeout error\n";
            }
        }
        if ($this->input->get('quiet', -1, 'int') == -1) {
            echo "\n";
        }
        // Log some paths
        if ($this->input->get('quiet', -1, 'int') == -1) {
            echo "Site paths determined by this script:\n";
            echo "JPATH_BASE : " . JPATH_BASE . "\n";
            echo "JPATH_ADMINISTRATOR : " . JPATH_ADMINISTRATOR . "\n\n";
        }
        // Load the engine
        $factoryPath = JPATH_ADMINISTRATOR . '/components/com_akeeba/akeeba/factory.php';
        define('JPATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . '/components/com_akeeba');
        define('AKEEBAROOT', JPATH_ADMINISTRATOR . '/components/com_akeeba/akeeba');
        if (!file_exists($factoryPath)) {
            echo "ERROR!\n";
            echo "Could not load the backup engine; file does not exist. Technical information:\n";
            echo "Path to " . basename(__FILE__) . ": " . __DIR__ . "\n";
            echo "Path to factory file: {$factoryPath}\n";
            die("\n");
        } else {
            try {
                require_once $factoryPath;
            } catch (Exception $e) {
                echo "ERROR!\n";
                echo "Backup engine returned an error. Technical information:\n";
                echo "Error message:\n\n";
                echo $e->getMessage() . "\n\n";
                echo "Path to " . basename(__FILE__) . ":" . __DIR__ . "\n";
                echo "Path to factory file: {$factoryPath}\n";
                die("\n");
            }
        }
        // Forced CLI mode settings
        define('AKEEBA_PROFILE', $profile);
        define('AKEEBA_BACKUP_ORIGIN', 'cli');
        // Force loading CLI-mode translation class
        $dummy = new AEUtilTranslate();
        // Load the profile
        AEPlatform::getInstance()->load_configuration($profile);
        // Reset Kettenrad and its storage
        AECoreKettenrad::reset(array('maxrun' => 0));
        AEUtilTempvars::reset(AKEEBA_BACKUP_ORIGIN);
        // Setup
        $kettenrad = AEFactory::getKettenrad();
        $options = array('description' => $description, 'comment' => '');
        if (!empty($overrides)) {
            AEPlatform::getInstance()->configOverrides = $overrides;
        }
        $kettenrad->setup($options);
        // Dummy array so that the loop iterates once
        $array = array('HasRun' => 0, 'Error' => '');
        $warnings_flag = false;
        while ($array['HasRun'] != 1 && empty($array['Error'])) {
            // Recycle the database conenction to minimise problems with database timeouts
            $db = AEFactory::getDatabase();
            $db->close();
            $db->open();
            AEUtilLogger::openLog(AKEEBA_BACKUP_ORIGIN);
            AEUtilLogger::WriteLog(true, '');
            // Apply overrides in the command line
            if (!empty($overrides)) {
                $config = AEFactory::getConfiguration();
                foreach ($overrides as $key => $value) {
                    $config->set($key, $value);
                }
            }
            // Apply engine optimization overrides
            $config = AEFactory::getConfiguration();
            $config->set('akeeba.tuning.min_exec_time', 0);
            $config->set('akeeba.tuning.nobreak.beforelargefile', 1);
            $config->set('akeeba.tuning.nobreak.afterlargefile', 1);
            $config->set('akeeba.tuning.nobreak.proactive', 1);
            $config->set('akeeba.tuning.nobreak.finalization', 1);
            $config->set('akeeba.tuning.settimelimit', 0);
            $config->set('akeeba.tuning.nobreak.domains', 0);
            $kettenrad->tick();
            AEFactory::getTimer()->resetTime();
            $array = $kettenrad->getStatusArray();
            AEUtilLogger::closeLog();
            $time = date('Y-m-d H:i:s \\G\\M\\TO (T)');
            $memusage = $this->memUsage();
            $warnings = "no warnings issued (good)";
            $stepWarnings = false;
            if (!empty($array['Warnings'])) {
                $warnings_flag = true;
                $warnings = "POTENTIAL PROBLEMS DETECTED; " . count($array['Warnings']) . " warnings issued (see below).\n";
                foreach ($array['Warnings'] as $line) {
                    $warnings .= "\t{$line}\n";
                }
                $stepWarnings = true;
                $kettenrad->resetWarnings();
            }
            if ($this->input->get('quiet', -1, 'int') == -1 || $stepWarnings) {
                echo <<<ENDSTEPINFO
Last Tick   : {$time}
Domain      : {$array['Domain']}
Step        : {$array['Step']}
Substep     : {$array['Substep']}
Memory used : {$memusage}
Warnings    : {$warnings}


ENDSTEPINFO;
            }
        }
        // Clean up
        AEUtilTempvars::reset(AKEEBA_BACKUP_ORIGIN);
        if (!empty($array['Error'])) {
            echo "An error has occurred:\n{$array['Error']}\n\n";
            $exitCode = 2;
        } else {
            if ($this->input->get('quiet', -1, 'int') == -1) {
                echo "Backup job finished successfully after approximately " . $this->timeago($start_backup, time(), '', false) . "\n";
            }
            $exitCode = 0;
        }
        if ($warnings_flag && $this->input->get('quiet', -1, 'int') == -1) {
            $exitCode = 1;
            echo "\n" . str_repeat('=', 79) . "\n";
            echo "!!!!!  W A R N I N G  !!!!!\n\n";
            echo "Akeeba Backup issued warnings during the backup process. You have to review them\n";
            echo "and make sure that your backup has completed successfully. Always test a backup with\n";
            echo "warnings to make sure that it is working properly, by restoring it to a local server.\n";
            echo "DO NOT IGNORE THIS MESSAGE! AN UNTESTED BACKUP IS AS GOOD AS NO BACKUP AT ALL.\n";
            echo "\n" . str_repeat('=', 79) . "\n";
        } elseif ($warnings_flag) {
            $exitCode = 1;
        }
        if ($this->input->get('quiet', -1, 'int') == -1) {
            echo "Peak memory usage: " . $this->peakMemUsage() . "\n\n";
        }
        $this->close($exitCode);
    }