Rearrangement of refindex
authorKasper Skårhøj <kasper@typo3.org>
Thu, 12 Jan 2006 12:08:15 +0000 (12:08 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Thu, 12 Jan 2006 12:08:15 +0000 (12:08 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@998 709f56b5-9817-0410-a4d7-c38de5d9e867

typo3/sysext/lowlevel/dbint/cli/conf.php [new file with mode: 0644]
typo3/sysext/lowlevel/dbint/cli/refindex_cli.phpsh [new file with mode: 0644]

diff --git a/typo3/sysext/lowlevel/dbint/cli/conf.php b/typo3/sysext/lowlevel/dbint/cli/conf.php
new file mode 100644 (file)
index 0000000..9f6b544
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+
+// DO NOT REMOVE OR CHANGE THESE 3 LINES:
+define('TYPO3_MOD_PATH', 'sysext/lowlevel/dbint/cli/');
+$BACK_PATH = '../../../../';
+$MCONF['name'] = '_CLI_lowlevel';
+
+?>
diff --git a/typo3/sysext/lowlevel/dbint/cli/refindex_cli.phpsh b/typo3/sysext/lowlevel/dbint/cli/refindex_cli.phpsh
new file mode 100644 (file)
index 0000000..2484870
--- /dev/null
@@ -0,0 +1,41 @@
+#! /usr/bin/php -q
+<?php
+
+// *****************************************
+// Standard initialization of a CLI module:
+// *****************************************
+
+       // Defining circumstances for CLI mode:
+define('TYPO3_cliMode', TRUE);
+
+       // Defining PATH_thisScript here: Must be the ABSOLUTE path of this script in the right context:
+       // This will work as long as the script is called by it's absolute path!
+define('PATH_thisScript',$_ENV['_']?$_ENV['_']:$_SERVER['_']);
+
+       // Include configuration file:
+require(dirname(PATH_thisScript).'/conf.php');
+
+       // Include init file:
+require(dirname(PATH_thisScript).'/'.$BACK_PATH.'init.php');
+
+
+
+# HERE you run your application!
+require_once(PATH_t3lib.'class.t3lib_refindex.php');
+
+if (in_array('-h',$_SERVER["argv"]))   {
+       echo "
+Options:
+-e = Update refindex, otherwise testing
+-h = This help screen.
+-s = Silent
+";
+       exit;
+}
+
+       // Call the functionality
+$testOnly = !in_array('-e',$_SERVER["argv"]);
+$refIndexObj = t3lib_div::makeInstance('t3lib_refindex');
+list($headerContent,$bodyContent) = $refIndexObj->updateIndex($testOnly,!in_array('-s',$_SERVER["argv"]));
+
+?>