-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathconfigure.php
70 lines (55 loc) · 2.19 KB
/
configure.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
require_once(__DIR__ . '/installer/DatabaseUtils.class.php');
require_once(__DIR__ . '/installer/OsUtils.class.php');
require_once(__DIR__ . '/installer/InstallReport.class.php');
require_once(__DIR__ . '/installer/AppConfig.class.php');
require_once(__DIR__ . '/installer/Installer.class.php');
require_once(__DIR__ . '/installer/Validator.class.php');
$options = getopt('hsvat:');
if(isset($options['h']))
{
echo 'Usage is php ' . __FILE__ . ' [arguments]'.PHP_EOL;
echo " -h - Show this help." . PHP_EOL;
echo " -s - Silent mode, no questions will be asked." . PHP_EOL;
echo " -v - Verbose output." . PHP_EOL;
echo " -t - Type TM/CE." . PHP_EOL;
// don't tell anyone it's possible
// echo "-a - Auto-generate activation key." . PHP_EOL;
echo PHP_EOL;
echo "Examples:" . PHP_EOL;
echo 'php ' . __FILE__ . PHP_EOL;
if(isset($options['h']))
exit(0);
exit(-1);
}
// installation might take a few minutes
ini_set('max_execution_time', 0);
ini_set('memory_limit', -1);
ini_set('max_input_time ', 0);
date_default_timezone_set(@date_default_timezone_get());
$silentRun = isset($options['s']);
$verbose = isset($options['v']);
$autoGenerateKey = isset($options['a']);
// start the log
$logPath = __DIR__ . '/configure.' . date("Y.m.d_H.i.s") . '.log';
$detailsLogPath = null;
Logger::init($logPath, $verbose);
Logger::logMessage(Logger::LEVEL_INFO, "Command: " . implode(' ', $argv));
if(!$verbose)
{
$detailsLogPath = __DIR__ . '/configure.' . date("Y.m.d_H.i.s") . '.details.log';
OsUtils::setLogPath($detailsLogPath);
}
OsUtils::setLogPath($detailsLogPath);
echo PHP_EOL;
Logger::logColorMessage(Logger::COLOR_LIGHT_BLUE, Logger::LEVEL_USER, "Kaltura Video Platform - Server Installation Configurator");
$type = AppConfig::K_TM_TYPE;
if(isset($options['t']))
$type = $options['t'];
AppConfig::init(__DIR__, $type);
AppConfig::set(AppConfigAttribute::VERBOSE, $verbose);
if($autoGenerateKey)
AppConfig::set(AppConfigAttribute::ACTIVATION_KEY, true);
AppConfig::configure($silentRun, true);
Logger::logColorMessage(Logger::COLOR_LIGHT_GREEN, Logger::LEVEL_USER, "Configuration available at " . AppConfig::getUserInputFilePath());
exit(0);