All Classes Namespaces Files Functions Variables Pages
CleanerCommand Class Reference
Inheritance diagram for CleanerCommand:
CommandLineController 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=false, $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=[])
 cli_validateArgs ()
 cli_setArguments (array $argv=[])
 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 = []
 $cleanerModules = []
- Public Attributes inherited from CommandLineController
 $cli_args = []
 $stdin = null

Protected Attributes

 $recStats = []
 $workspaceIndex = [0 => true]

Detailed Description

Core functions for cleaning and analysing

Definition at line 28 of file CleanerCommand.php.

Constructor & Destructor Documentation

__construct ( )


Definition at line 68 of file CleanerCommand.php.

References $GLOBALS, and CommandLineController\cli_help().

Member Function Documentation

cli_noExecutionCheck (   $matchString)
string If string, it's the reason for not executing. Returning FALSE means it should execute.

Definition at line 204 of file CleanerCommand.php.

Referenced by VersionsCommand\main_autoFix().

cli_printInfo (   $header,

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

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

Definition at line 231 of file CleanerCommand.php.

References MathUtility\forceIntegerInRange().

Referenced by CleanerCommand\cli_main().

cli_referenceIndexCheck ( )

Checks reference index

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

Definition at line 168 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.

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...)
int$echoLevelIf >0, will echo information about the traversal process.
string$callBackCall back function (from this class or subclass)

Definition at line 294 of file CleanerCommand.php.

References ExtensionManagementUtility\isLoaded(), and GeneralUtility\makeInstance().

Referenced by VersionsCommand\main().

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

Recursive traversal of page tree:

int$rootIDPage root id (must be online, valid page record - or zero for page tree root)
int$echoLevelEcho Level
string$callBackCall back function (from this class or subclass)
bool$versionSwapmodeDON'T set from outside, internal. (indicates we are inside a version of a page)
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
void private

Definition at line 364 of file CleanerCommand.php.

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

infoStr (   $rec)

Compile info-string

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

Definition at line 587 of file CleanerCommand.php.

Member Data Documentation

$cleanerModules = []

Definition at line 53 of file CleanerCommand.php.

$genTree_traverseDeleted = true

Definition at line 33 of file CleanerCommand.php.

$genTree_traverseVersions = true

Definition at line 38 of file CleanerCommand.php.

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

Definition at line 43 of file CleanerCommand.php.

$pagetreePlugins = []

Definition at line 48 of file CleanerCommand.php.

$recStats = []

Definition at line 58 of file CleanerCommand.php.

$workspaceIndex = [0 => true]

Definition at line 63 of file CleanerCommand.php.