Add usage documentation and support for command line argument language in settings2csv script

pull/2487/head
Yannick Warnier 9 years ago
parent 9db3829c42
commit d201ed5490
  1. 20
      tests/scripts/settings2csv.php

@ -13,12 +13,22 @@
* Init
*/
// comment exit statement before executing
//exit;
$language = 'french';
$_GET['language'] = $language;
require __DIR__ . '/../../main/inc/global.inc.php';
exit;
/* Usage doc */
if ($argc <= 1) {
echo 'Usage: php settings2csv.php [language]'.PHP_EOL;
echo ' Where the language name is supported by Chamilo. e.g. french, spanish, ...'.PHP_EOL;
echo ' (defaults to "english").'.PHP_EOL;
echo ' The resulting filepath will appear on the output line'.PHP_EOL.PHP_EOL;
}
$debug = 1;
$language = 'english';
if (!empty($argv[1])) {
$language = $argv[1];
}
$_GET['language'] = $language;
@require __DIR__ . '/../../main/inc/global.inc.php';
// Categories, in order of appearance in the Chamilo settings page
// Check the end of main/admin/settings.php for the initial list

Loading…
Cancel
Save