-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathverify.php
73 lines (57 loc) · 2.04 KB
/
verify.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
71
72
73
<?php
include_once('installer/OsUtils.class.php');
include_once('installer/Log.php');
include_once('installer/AppConfig.class.php');
include_once('installer/Installer.class.php');
// 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());
$options = getopt('hrv');
if(isset($options['h']))
{
echo 'Usage is php ' . __FILE__ . ' [arguments]'.PHP_EOL;
echo " -h - Show this help." . PHP_EOL;
echo " -r - Reconfigure." . PHP_EOL;
echo " -v - Verbose output." . PHP_EOL;
echo PHP_EOL;
echo "Examples:" . PHP_EOL;
echo 'php ' . __FILE__ . ' -s' . PHP_EOL;
exit(0);
}
$silentRun = !isset($options['r']);
$verbose = isset($options['v']);
// start the log
$logPath = __DIR__ . '/verify.' . 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__ . '/verify.' . date("Y.m.d_H.i.s") . '.details.log';
OsUtils::setLogPath($detailsLogPath);
}
echo PHP_EOL;
Logger::logColorMessage(Logger::COLOR_LIGHT_BLUE, Logger::LEVEL_USER, "Kaltura Video Platform - Server Installation");
$packageDir = realpath(__DIR__ . '/../package');
if($packageDir)
AppConfig::init($packageDir);
AppConfig::set(AppConfigAttribute::VERBOSE, $verbose);
AppConfig::configure($silentRun);
echo PHP_EOL;
$installer = new Installer();
Logger::logColorMessage(Logger::COLOR_YELLOW, Logger::LEVEL_USER, "Verifying Kaltura Server Installation");
if($installer->verifyInstallation(true))
{
Logger::logColorMessage(Logger::COLOR_LIGHT_GREEN, Logger::LEVEL_USER, "Server Installation Verified Successfully");
}
else
{
Logger::logMessage(Logger::LEVEL_USER, "Verification log files:");
Logger::logMessage(Logger::LEVEL_USER, "\t - $logPath");
if($detailsLogPath)
Logger::logMessage(Logger::LEVEL_USER, "\t - $detailsLogPath");
exit(1);
}
exit(0);