wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
BackupController Class Reference
+ Inheritance diagram for BackupController:

Public Member Functions

 validate ()
 
 initialize (&$request, &$response)
 
 getWorkPackage ($number)
 
 getAdditionalWorkPackage ($number, $action)
 
 backupFiles ()
 
 restoreFiles ()
 
 getBackupDir ()
 
- Public Member Functions inherited from BatchController
 initialize (&$request, &$response)
 
 addWorkPackage ($name, $size, $oids, $callback, $args=null)
 
 getWorkPackage ($number)
 
 getNumberOfSteps ()
 
 getDisplayText ($step)
 
 getSummaryText ()
 
 processPart ()
 
- Public Member Functions inherited from LongTaskController
 initialize (&$request, &$response)
 
 hasView ()
 
 executeKernel ()
 
 getStepNumber ()
 
 getNumberOfSteps ()
 
 getDisplayText ($step)
 
 getSummaryText ()
 
 initializeTask ()
 
 processPart ()
 
- Public Member Functions inherited from Controller
 Controller (&$delegate)
 
 initialize (&$request, &$response)
 
 validate ()
 
 hasView ()
 
 execute ()
 
 executeKernel ()
 
 getErrorMsg ()
 
 setErrorMsg ($msg)
 
 appendErrorMsg ($msg)
 
getRequest ()
 
getResponse ()
 
getView ()
 
getDelegate ()
 
 getViewTemplate ($controller, $context, $action)
 
 getCacheId ()
 
 assignViewDefaults (&$view)
 
 isLocalizedRequest ()
 

Public Attributes

 $BACKUP_NAME_VARNAME = 'BackupController.backupName'
 
 $SOURCE_DIR_VARNAME = 'BackupController.sourceDir'
 
- Public Attributes inherited from BatchController
 $WORK_PACKAGES_VARNAME = 'BatchController.workPackages'
 
 $NUM_STEPS_VARNAME = 'BatchController.numSteps'
 
 $_workPackages = array()
 
- Public Attributes inherited from LongTaskController
 $STEP_SESSION_VARNAME = 'LongTaskController.curStep'
 
 $ONE_CALL_SESSION_VARNAME = 'LongTaskController.oneCall'
 
 $_curStep = 1
 
- Public Attributes inherited from Controller
 $_request = null
 
 $_response = null
 
 $_errorMsg = ''
 
 $_view = null
 
 $_delegate = null
 

Detailed Description

This Controller creates a backup (action 'makebackup') from a directory and restores (action 'restorebackup') a created one to that directory respectively. It creates a directory named after the 'backupName' parameter in the backup directory whose name is determined by the configuration key 'backupDir' (section 'cms'). Then it copies all files found in the directory given in the 'sourceDir' parameter to that directory. Subclasses may add additional work packages by overriding the BackupController::getAdditionalWorkPackage method.

wCMF - wemove Content Management Framework Copyright (C) 2005-2014 wemove digital solutions GmbH

Licensed under the terms of any of the following licenses at your choice:

See the license.txt file distributed with this work for additional information.

Id:
class.BackupController.php 1462 2014-02-04 23:52:27Z iherwig

Input actions:

  • makebackup Create a backup
  • restorebackup Restore a backup
  • more actions see BatchController

Output actions:

Parameters
[in]backupNameThe name of the backup to create/restore.
[in]sourceDirThe name of the directory to backup.
[out]@seeBatchController
Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 48 of file class.BackupController.php.

Member Function Documentation

BackupController::validate ( )
See Also
Controller::validate()

Definition at line 57 of file class.BackupController.php.

References SessionData\getInstance(), and Controller\setErrorMsg().

+ Here is the call graph for this function:

BackupController::initialize ( $request,
$response 
)
See Also
Controller::initialize()

Definition at line 76 of file class.BackupController.php.

References SessionData\getInstance().

+ Here is the call graph for this function:

BackupController::getWorkPackage (   $number)
See Also
BatchController::getWorkPackage()

Definition at line 95 of file class.BackupController.php.

References getAdditionalWorkPackage().

+ Here is the call graph for this function:

BackupController::getAdditionalWorkPackage (   $number,
  $action 
)

Get definitions of additional work packages (

See Also
BatchController::getWorkPackage()). The default implementation returns null immediately.
Parameters
numberThe number of the work package (first number is 1, number is incremented on every call)
action'makebackup' or 'restorebackup'
Note
subclasses will override this method to implement special application requirements.

Definition at line 115 of file class.BackupController.php.

Referenced by getWorkPackage().

BackupController::backupFiles ( )

Copy all files from sourceDir to the backup location defined by backupDir and backupName.

Definition at line 123 of file class.BackupController.php.

References FileUtil\copyRecDir(), getBackupDir(), and SessionData\getInstance().

+ Here is the call graph for this function:

BackupController::restoreFiles ( )

Copy all files from the backup location defined by backupDir and backupName to sourceDir. It empties the source directory first.

Definition at line 134 of file class.BackupController.php.

References FileUtil\copyRecDir(), FileUtil\emptyDir(), Message\get(), getBackupDir(), SessionData\getInstance(), and Controller\setErrorMsg().

+ Here is the call graph for this function:

BackupController::getBackupDir ( )

Get the actual backup directory defined by the key 'backupDir' in configuration section 'cms' and the backup name.

Returns
The name of the actual backup directory

Definition at line 157 of file class.BackupController.php.

References InifileParser\getInstance(), SessionData\getInstance(), and WCMFException\throwEx().

Referenced by backupFiles(), MySQLBackupController\backupMySQL(), restoreFiles(), and MySQLBackupController\restoreMySQL().

+ Here is the call graph for this function:

Member Data Documentation

BackupController::$BACKUP_NAME_VARNAME = 'BackupController.backupName'

Definition at line 51 of file class.BackupController.php.

BackupController::$SOURCE_DIR_VARNAME = 'BackupController.sourceDir'

Definition at line 52 of file class.BackupController.php.


The documentation for this class was generated from the following file: