30 parent::__construct();
32 $this->cli_options[] = array(
'--echotree level',
'When "level" is set to 1 or higher you will see the page of the page tree outputted as it is traversed. A value of 2 for "level" will show even more information.');
33 $this->cli_options[] = array(
'--pid id',
'Setting start page in page tree. Default is the page tree root, 0 (zero)');
34 $this->cli_options[] = array(
'--depth int',
'Setting traversal depth. 0 (zero) will only analyse start page (see --pid), 1 will traverse one level of subpages etc.');
35 $this->
cli_help[
'name'] =
'cleanflexform -- Find flexform fields with unclean XML';
36 $this->
cli_help[
'description'] = trim(
' 37 Traversing page tree and finding records with FlexForm fields with XML that could be cleaned up. This will just remove obsolete data garbage. 40 Cleaning XML for FlexForm fields. 56 'message' => $this->
cli_help[
'name'] . LF . LF . $this->
cli_help[
'description'],
58 'dirty' => array(
'',
'', 2)
64 $this->cleanFlexForm_dirtyFields = &$resultArray[
'dirty'];
66 $this->genTree_traverseDeleted = FALSE;
67 $this->
genTree($startingPoint, $depth, (
int)$this->
cli_argValue(
'--echotree'),
'main_parseTreeCallBack');
84 foreach (
$GLOBALS[
'TCA'][$tableName][
'columns'] as $colName => $config) {
85 if ($config[
'config'][
'type'] ==
'flex') {
87 echo LF .
' [cleanflexform:] Field "' . $colName .
'" in ' . $tableName .
':' .
$uid .
' was a flexform and...';
91 if ($recRow[$colName]) {
93 $newXML = $flexObj->cleanFlexFormXML($tableName, $colName, $recRow);
94 if (md5($recRow[$colName]) != md5($newXML)) {
96 echo
' was DIRTY, needs cleanup!';
98 $this->cleanFlexForm_dirtyFields[\TYPO3\CMS\Core\Utility\GeneralUtility::shortMd5($tableName .
':' . $uid .
':' . $colName)] = $tableName .
':' . $uid .
':' . $colName;
100 if ($echoLevel > 2) {
104 } elseif ($echoLevel > 2) {
120 foreach ($resultArray[
'dirty'] as $fieldID) {
121 list($table,
$uid, $field) = explode(
':', $fieldID);
122 echo
'Cleaning XML in "' . $fieldID .
'": ';
130 if ($recRow[$field]) {
131 $data[$table][
$uid][$field] = $flexObj->cleanFlexFormXML($table, $field, $recRow);
135 $tce->stripslashes_values = FALSE;
136 $tce->dontProcessTransformations = TRUE;
137 $tce->bypassWorkspaceRestrictions = TRUE;
138 $tce->bypassFileHandling = TRUE;
140 $tce->start($data, array());
141 $tce->process_datamap();
143 if (count($tce->errorLog)) {
144 echo
' ERROR from "TCEmain":' . LF .
'TCEmain:' . implode((LF .
'TCEmain:'), $tce->errorLog);
static forceIntegerInRange($theInt, $min, $max=2000000000, $defaultValue=0)
static makeInstance($className)
cli_argValue($option, $idx=0)
cli_noExecutionCheck($matchString)
static getRecordRaw($table, $where='', $fields=' *')
genTree($rootID, $depth=1000, $echoLevel=0, $callBack='')
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]