[TASK] EXT:lowlevel Uniform extension directory structure
[Packages/TYPO3.CMS.git] / typo3 / sysext / lowlevel / Resources / PHP / refindex_cli.php
1 <?php
2 if (!defined('TYPO3_cliMode')) {
3 die('You cannot run this script directly!');
4 }
5 // Call the functionality
6 if (in_array('-e', $_SERVER['argv']) || in_array('-c', $_SERVER['argv'])) {
7 $testOnly = in_array('-c', $_SERVER['argv']);
8 $refIndexObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ReferenceIndex::class);
9 list($headerContent, $bodyContent) = $refIndexObj->updateIndex($testOnly, !in_array('-s', $_SERVER['argv']));
10 $bodyContent = str_replace('##LF##', LF, $bodyContent);
11 } else {
12 echo '
13 Options:
14 -c = Check refindex
15 -e = Update refindex
16 -s = Silent
17 ';
18 die;
19 }