TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Lowlevel\CleanerCommand Class Reference
Inheritance diagram for TYPO3\CMS\Lowlevel\CleanerCommand:
TYPO3\CMS\Core\Controller\CommandLineController tx_lowlevel_cleaner_core TYPO3\CMS\Lowlevel\CleanFlexformCommand TYPO3\CMS\Lowlevel\DeletedRecordsCommand TYPO3\CMS\Lowlevel\DoubleFilesCommand TYPO3\CMS\Lowlevel\LostFilesCommand TYPO3\CMS\Lowlevel\MissingFilesCommand TYPO3\CMS\Lowlevel\MissingRelationsCommand TYPO3\CMS\Lowlevel\OrphanRecordsCommand TYPO3\CMS\Lowlevel\RteImagesCommand TYPO3\CMS\Lowlevel\SyslogCommand TYPO3\CMS\Lowlevel\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 TYPO3\CMS\Core\Controller\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 TYPO3\CMS\Core\Controller\CommandLineController
 $cli_args = array()
 
 $cli_options
 
 $cli_help
 
 $stdin = NULL
 

Protected Attributes

 $workspaceIndex = array()
 

Detailed Description

Core functions for cleaning and analysing

Author
Kasper Skårhøj kaspe.nosp@m.rYYY.nosp@m.Y@typ.nosp@m.o3.c.nosp@m.om Core functions for cleaning and analysing
Kasper Skårhøj kaspe.nosp@m.rYYY.nosp@m.Y@typ.nosp@m.o3.c.nosp@m.om

Definition at line 30 of file CleanerCommand.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Lowlevel\CleanerCommand::__construct ( )

Constructor

Todo:
Define visibility

Definition at line 69 of file CleanerCommand.php.

References $GLOBALS, and TYPO3\CMS\Core\Controller\CommandLineController\cli_help().

Member Function Documentation

◆ cli_main()

◆ cli_noExecutionCheck()

◆ cli_printInfo()

TYPO3\CMS\Lowlevel\CleanerCommand::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.
Todo:
Define visibility

Definition at line 233 of file CleanerCommand.php.

References TYPO3\CMS\Core\Controller\CommandLineController\cli_argValue(), TYPO3\CMS\Core\Controller\CommandLineController\cli_echo(), TYPO3\CMS\Core\Controller\CommandLineController\cli_isArg(), and TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange().

Referenced by TYPO3\CMS\Lowlevel\CleanerCommand\cli_main().

◆ cli_referenceIndexCheck()

TYPO3\CMS\Lowlevel\CleanerCommand::cli_referenceIndexCheck ( )

Checks reference index

Returns
boolean TRUE if reference index was OK (either OK, updated or ignored)
Todo:
Define visibility

Definition at line 170 of file CleanerCommand.php.

◆ genTree()

TYPO3\CMS\Lowlevel\CleanerCommand::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
integer$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)
integer$depthDepth to traverse. zero is do not traverse at all. 1 = 1 sublevel, 1000= 1000 sublevels (all...)
boolean$echoLevelIf >0, will echo information about the traversal process.
string$callBackCall back function (from this class or subclass)
Returns
void
Todo:
Define visibility

Definition at line 296 of file CleanerCommand.php.

References $GLOBALS, TYPO3\CMS\Backend\Utility\BackendUtility\deleteClause(), TYPO3\CMS\Lowlevel\CleanerCommand\genTree_traverse(), and TYPO3\CMS\Core\Utility\GeneralUtility\milliseconds().

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

◆ genTree_traverse()

TYPO3\CMS\Lowlevel\CleanerCommand::genTree_traverse (   $rootID,
  $depth,
  $echoLevel = 0,
  $callBack = '',
  $versionSwapmode = '',
  $rootIsVersion = 0,
  $accumulatedPath = '' 
)

Recursive traversal of page tree:

Parameters
integer$rootIDPage root id (must be online, valid page record - or zero for page tree root)
integer$depthDepth
integer$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
integer$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

Define visibility

Definition at line 373 of file CleanerCommand.php.

References $GLOBALS, TYPO3\CMS\Backend\Utility\BackendUtility\deleteClause(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecordRaw(), TYPO3\CMS\Core\Utility\GeneralUtility\milliseconds(), and TYPO3\CMS\Backend\Utility\BackendUtility\selectVersionsOfRecord().

Referenced by TYPO3\CMS\Lowlevel\CleanerCommand\genTree().

◆ infoStr()

TYPO3\CMS\Lowlevel\CleanerCommand::infoStr (   $rec)

Compile info-string

Parameters
array$recInput record from sys_refindex
Returns
string String identifying the main record of the reference
Todo:
Define visibility

Definition at line 563 of file CleanerCommand.php.

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

Member Data Documentation

◆ $cleanerModules

TYPO3\CMS\Lowlevel\CleanerCommand::$cleanerModules = array()
Todo:
Define visibility

Definition at line 55 of file CleanerCommand.php.

Referenced by TYPO3\CMS\Lowlevel\RteImagesCommand\main().

◆ $genTree_traverseDeleted

TYPO3\CMS\Lowlevel\CleanerCommand::$genTree_traverseDeleted = TRUE
Todo:
Define visibility

Definition at line 35 of file CleanerCommand.php.

◆ $genTree_traverseVersions

TYPO3\CMS\Lowlevel\CleanerCommand::$genTree_traverseVersions = TRUE
Todo:
Define visibility

Definition at line 40 of file CleanerCommand.php.

◆ $label_infoString

TYPO3\CMS\Lowlevel\CleanerCommand::$label_infoString = 'The list of records is organized as [table]:[uid]:[field]:[flexpointer]:[softref_key]'

◆ $pagetreePlugins

TYPO3\CMS\Lowlevel\CleanerCommand::$pagetreePlugins = array()
Todo:
Define visibility

Definition at line 50 of file CleanerCommand.php.

◆ $performanceStatistics

TYPO3\CMS\Lowlevel\CleanerCommand::$performanceStatistics = array()
Todo:
Define visibility

Definition at line 60 of file CleanerCommand.php.

◆ $workspaceIndex

TYPO3\CMS\Lowlevel\CleanerCommand::$workspaceIndex = array()
protected

Definition at line 62 of file CleanerCommand.php.