TYPO3  7.6
Public Member Functions | Public Attributes | Protected Attributes | List of all members
CleanerCommand Class Reference
Inheritance diagram for CleanerCommand:
CommandLineController CleanFlexformCommand DeletedRecordsCommand DoubleFilesCommand LostFilesCommand MissingFilesCommand MissingRelationsCommand OrphanRecordsCommand RteImagesCommand SyslogCommand VersionsCommand

Public Member Functions

 __construct ()
 
 cli_main ($argv)
 
 cli_referenceIndexCheck ()
 
 cli_noExecutionCheck ($matchString)
 
 cli_printInfo ($header, $res)
 
 genTree ($rootID, $depth=1000, $echoLevel=0, $callBack= '')
 
 genTree_traverse ($rootID, $depth, $echoLevel=0, $callBack= '', $versionSwapmode= '', $rootIsVersion=0, $accumulatedPath= '')
 
 infoStr ($rec)
 
- Public Member Functions inherited from CommandLineController
 __construct ()
 
 cli_getArgArray ($option, $argv)
 
 cli_isArg ($option)
 
 cli_argValue ($option, $idx=0)
 
 cli_getArgIndex (array $argv=array())
 
 cli_validateArgs ()
 
 cli_setArguments (array $argv=array())
 
 cli_keyboardInput ()
 
 cli_keyboardInput_yes ($msg= '')
 
 cli_echo ($string= '', $force=false)
 
 cli_help ()
 
 cli_indent ($str, $indent)
 

Public Attributes

 $genTree_traverseDeleted = true
 
 $genTree_traverseVersions = true
 
 $label_infoString = 'The list of records is organized as [table]:[uid]:[field]:[flexpointer]:[softref_key]'
 
 $pagetreePlugins = array()
 
 $cleanerModules = array()
 
 $performanceStatistics = array()
 
- Public Attributes inherited from CommandLineController
 $cli_args = array()
 
 $cli_options
 
 $cli_help
 
 $stdin = null
 

Protected Attributes

 $workspaceIndex = array()
 

Detailed Description

Core functions for cleaning and analysing

Definition at line 23 of file CleanerCommand.php.

Constructor & Destructor Documentation

__construct ( )

Constructor

Definition at line 63 of file CleanerCommand.php.

References $GLOBALS, and CommandLineController\cli_help().

Member Function Documentation

cli_main (   $argv)
cli_noExecutionCheck (   $matchString)
cli_printInfo (   $header,
  $res 
)

Formats a result array from a test so it fits output in the shell

Parameters
string$headerName of the test (eg. function name)
array$resResult array from an analyze function
Returns
void Outputs with echo - capture content with output buffer if needed.

Definition at line 226 of file CleanerCommand.php.

Referenced by CleanerCommand\cli_main().

cli_referenceIndexCheck ( )

Checks reference index

Returns
bool TRUE if reference index was OK (either OK, updated or ignored)

Definition at line 163 of file CleanerCommand.php.

genTree (   $rootID,
  $depth = 1000,
  $echoLevel = 0,
  $callBack = '' 
)

Traverses the FULL/part of page tree, mainly to register ALL validly connected records (to find orphans) but also to register deleted records, versions etc. Output (in $this->recStats) can be useful for multiple purposes.

Parameters
int$rootIDRoot page id from where to start traversal. Use "0" (zero) to have full page tree (necessary when spotting orphans, otherwise you can run it on parts only)
int$depthDepth to traverse. zero is do not traverse at all. 1 = 1 sublevel, 1000= 1000 sublevels (all...)
bool$echoLevelIf >0, will echo information about the traversal process.
string$callBackCall back function (from this class or subclass)
Returns
void

Definition at line 289 of file CleanerCommand.php.

References $GLOBALS, BackendUtility\deleteClause(), and GeneralUtility\milliseconds().

Referenced by CleanFlexformCommand\main(), DeletedRecordsCommand\main(), VersionsCommand\main(), and OrphanRecordsCommand\main().

genTree_traverse (   $rootID,
  $depth,
  $echoLevel = 0,
  $callBack = '',
  $versionSwapmode = '',
  $rootIsVersion = 0,
  $accumulatedPath = '' 
)

Recursive traversal of page tree:

Parameters
int$rootIDPage root id (must be online, valid page record - or zero for page tree root)
int$depthDepth
int$echoLevelEcho Level
string$callBackCall back function (from this class or subclass)
string$versionSwapmodeDON'T set from outside, internal. (indicates we are inside a version of a page) - will be "SWAPMODE:-1" or empty
int$rootIsVersionDON'T set from outside, internal. (1: Indicates that rootID is a version of a page, 2: ...that it is even a version of a version (which triggers a warning!)
string$accumulatedPathInternal string that accumulates the path
Returns
void private
Todo:
$versionSwapmode needs to be cleaned up, since page and branch version (0, 1) does not exist anymore

Definition at line 366 of file CleanerCommand.php.

References $GLOBALS, BackendUtility\deleteClause(), BackendUtility\getRecordRaw(), GeneralUtility\milliseconds(), and BackendUtility\selectVersionsOfRecord().

infoStr (   $rec)

Compile info-string

Parameters
array$recInput record from sys_refindex
Returns
string String identifying the main record of the reference

Definition at line 556 of file CleanerCommand.php.

Referenced by DoubleFilesCommand\main(), MissingFilesCommand\main(), MissingRelationsCommand\main(), and RteImagesCommand\main().

Member Data Documentation

$cleanerModules = array()

Definition at line 48 of file CleanerCommand.php.

Referenced by RteImagesCommand\main().

$genTree_traverseDeleted = true

Definition at line 28 of file CleanerCommand.php.

$genTree_traverseVersions = true

Definition at line 33 of file CleanerCommand.php.

$label_infoString = 'The list of records is organized as [table]:[uid]:[field]:[flexpointer]:[softref_key]'

Definition at line 38 of file CleanerCommand.php.

Referenced by MissingFilesCommand\main(), and MissingRelationsCommand\main().

$pagetreePlugins = array()

Definition at line 43 of file CleanerCommand.php.

$performanceStatistics = array()

Definition at line 53 of file CleanerCommand.php.

$workspaceIndex = array()
protected

Definition at line 58 of file CleanerCommand.php.