mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 14:23:57 -07:00
Update install.php
This commit is contained in:
parent
893e065822
commit
c2000d788b
1 changed files with 38 additions and 6 deletions
44
install.php
44
install.php
|
@ -20,12 +20,6 @@ if (is_file(BB_ROOT . '.env')) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check readline extension
|
|
||||||
if (!extension_loaded('readline')) {
|
|
||||||
out('- ext-readline not found. Check out PHP instance', 'error');
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Colored console output
|
* Colored console output
|
||||||
*
|
*
|
||||||
|
@ -127,6 +121,44 @@ function chmod_r(string $dir, int $dirPermissions, int $filePermissions): void
|
||||||
// Welcoming message
|
// Welcoming message
|
||||||
out("--- TorrentPier Installer ---\n", 'info');
|
out("--- TorrentPier Installer ---\n", 'info');
|
||||||
|
|
||||||
|
// Checking extensions
|
||||||
|
define('CHECK_REQUIREMENTS', [
|
||||||
|
'status' => true,
|
||||||
|
'php_min_version' => '8.1.0',
|
||||||
|
'ext_list' => [
|
||||||
|
'json',
|
||||||
|
'curl',
|
||||||
|
'readline',
|
||||||
|
'mysqli',
|
||||||
|
'bcmath',
|
||||||
|
'mbstring',
|
||||||
|
'intl',
|
||||||
|
'xml',
|
||||||
|
'xmlwriter',
|
||||||
|
'zip'
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (CHECK_REQUIREMENTS['status']) {
|
||||||
|
out("- Checking installed extensions\n", 'info');
|
||||||
|
|
||||||
|
// [1] Check PHP Version
|
||||||
|
if (!\TorrentPier\Helpers\IsHelper::isPHP(CHECK_REQUIREMENTS['php_min_version'])) {
|
||||||
|
out("- TorrentPier requires PHP version " . CHECK_REQUIREMENTS['php_min_version'] . "+ Your PHP version " . PHP_VERSION, 'error');
|
||||||
|
}
|
||||||
|
|
||||||
|
// [2] Check installed PHP Extensions on server
|
||||||
|
$data = [];
|
||||||
|
foreach (CHECK_REQUIREMENTS['ext_list'] as $ext) {
|
||||||
|
if (!extension_loaded($ext)) {
|
||||||
|
out("- ext-$ext not installed!", 'error');
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
out("- ext-$ext installed!", 'success');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Setting permissions
|
// Setting permissions
|
||||||
out('- Setting permissions for folders...', 'info');
|
out('- Setting permissions for folders...', 'info');
|
||||||
chmod_r(BB_ROOT . 'data', 0755, 0644);
|
chmod_r(BB_ROOT . 'data', 0755, 0644);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue