Source for file database_backup.php

Documentation is available at database_backup.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Installation
  4.  * @subpackage  Controller
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * Controller class to backup the old database for the Joomla Installer.
  14.  *
  15.  * @package     Joomla.Installation
  16.  * @subpackage  Controller
  17.  * @since       3.1
  18.  */
  19. {
  20.     /**
  21.      * Execute the controller.
  22.      *
  23.      * @return  void 
  24.      *
  25.      * @since   3.1
  26.      */
  27.     public function execute()
  28.     {
  29.         // Get the application
  30.         /* @var InstallationApplicationWeb $app */
  31.         $app $this->getApplication();
  32.  
  33.         // Check for request forgeries.
  34.         JSession::checkToken(or $app->sendJsonResponse(new Exception(JText::_('JINVALID_TOKEN')403));
  35.  
  36.         // Get the setup model.
  37.         $model new InstallationModelSetup;
  38.  
  39.         // Get the options from the session
  40.         $options $model->getOptions();
  41.  
  42.         // Get the database model.
  43.         $db new InstallationModelDatabase;
  44.  
  45.         // Attempt to create the database tables.
  46.         $return $db->handleOldDatabase($options);
  47.  
  48.         $r new stdClass;
  49.         $r->view 'install';
  50.  
  51.         // Check if the database was initialised
  52.         if (!$return)
  53.         {
  54.             $r->view 'database';
  55.         }
  56.  
  57.         $app->sendJsonResponse($r);
  58.     }
  59. }

Documentation generated on Tue, 19 Nov 2013 14:57:53 +0100 by phpDocumentor 1.4.3