Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Dec 30, 2024
1 parent 86cd424 commit a095691
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions install/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@
$siteURL = trim(readline(""));
}
$siteURL = rtrim($siteURL, '/') . '/';
$databaseName = ("AVideoEncoder_".preg_replace("/[^0-9a-z]/i", "", parse_url($siteURL, PHP_URL_HOST)));

// Determine the folder name based on the current script directory
$folderName = basename(dirname(getcwd()));
$databaseName = "AVideoEncoder_" . preg_replace("/[^0-9a-z]/i", "", $folderName);
$webSiteRootURL = $siteURL . "Encoder/";

$databaseUser = empty($argv[2])?$databaseUser:$argv[2];
$databasePass = empty($argv[3])?$databasePass:$argv[3];
$databaseUser = empty($argv[2]) ? $databaseUser : $argv[2];
$databasePass = empty($argv[3]) ? $databasePass : $argv[3];
$systemAdminPass = empty($argv[4]) ? "123" : $argv[4];
$databaseName = empty($argv[5]) ? $databaseName : $argv[5];
$webSiteRootURL = empty($argv[6]) ? $webSiteRootURL : $argv[6];
Expand All @@ -39,13 +42,13 @@
// install.php siteURL databaseUser databasePass systemAdminPass databaseName webSiteRootURLEncoder databaseHost databasePort

$_POST['systemRootPath'] = str_replace("install", "", getcwd());
if(!is_dir($_POST['systemRootPath'])) {
if (!is_dir($_POST['systemRootPath'])) {
$_POST['systemRootPath'] = "/var/www/html/YouPHPTube/Encoder/";
if(!is_dir($_POST['systemRootPath'])) {
if (!is_dir($_POST['systemRootPath'])) {
$_POST['systemRootPath'] = "/var/www/html/AVideo/Encoder/";
}
}
echo "Installing in {$_POST['systemRootPath']}".PHP_EOL;
echo "Installing in {$_POST['systemRootPath']}" . PHP_EOL;
$_POST['databaseHost'] = $databaseHost;
$_POST['databaseUser'] = $databaseUser;
$_POST['databasePass'] = $databasePass;
Expand All @@ -72,5 +75,5 @@

$global['mysqli']->query($sql);
} else {
echo PHP_EOL."File not found {$streamerConfiguration}".PHP_EOL;
echo PHP_EOL . "File not found {$streamerConfiguration}" . PHP_EOL;
}

0 comments on commit a095691

Please sign in to comment.