Skip to content

Commit

Permalink
Rename $path variable
Browse files Browse the repository at this point in the history
  • Loading branch information
callapa committed May 17, 2024
1 parent db496b9 commit c4543c7
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions centreon/tools/update_centreon_storage_logs.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,19 @@
/**
* Check if the directory exist and add the character / at the end if it not exist
*
* @param string &$path Path to check
* @param string &$temporaryPath Path to check
*
* @throws \Exception
*/
function checkTemporaryDirectory(&$path)
function checkTemporaryDirectory(&$temporaryPath)
{
if (is_dir($path) === false) {
if (is_dir($temporaryPath) === false) {
throw new \Exception(
'This path for temporary files (' . $path . ') does not exist'
'This path for temporary files (' . $temporaryPath . ') does not exist'
);
}
if (substr($path, -1, 1) != '/') {
$path .= '/';
if (substr($temporaryPath, -1, 1) != '/') {
$temporaryPath .= '/';
}
}

Expand Down Expand Up @@ -309,11 +310,11 @@ function isInCompatibleMode(\PDO $db)
if (is_dir(TEMP_DIRECTORY) === false) {
$temporaryPath = __DIR__;
}
$path = askQuestion(
$pathDirectory = askQuestion(
"Please to give the directory for temporary files [$temporaryPath]\n",
false
);
$temporaryPath = empty($path) ? $temporaryPath : $path;
$temporaryPath = empty($pathDirectory) ? $temporaryPath : $pathDirectory;
}

checkTemporaryDirectory($temporaryPath);
Expand Down

0 comments on commit c4543c7

Please sign in to comment.