/**
* cmsdAm is a powerful, simple, scalable, quick, secure, GPL released, PHP4 written from scratch
* Content Management System framework. It is specially designed for people having some basic
* PHP knowledge. You can create powerful professional sites in a while using cmsdAm, and you
* don't have to rewrite each time php code for handle each section, users, search engine, ecc.
* cmsdAm do all the work for you! You just have to configure it, and write HTML or PHP code
* for your sections. You don't have to care about mails, HTTP headers, HTML strange tags, META
* tags, HTTP cache mechanisms, ecc, just write HTML or PHP code for your sections.
*
* Enjoy!!! Dino Ciuffetti - dam2k@users.sourceforge.net
*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program (COPYING); if not, go to http://www.fsf.org/ or write
* to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*
*/
// Database check
$db_ok = false;
switch ($db_type) {
case "mysql":
$error = "Problema sconosciuto con il DB server MySQL";
// User want to use mysql RDBMS
include ("mysql_check.php");
$db_not_supported = "0"; // For now, this RDBMS is supported.
// ******* Checking PHP MySQL support availability
$db_handle = "mysql_connect";
if (!is_callable($db_handle)) { // MySQL support is NOT available
echo "
Supporto MySQL in PHP
";
echo "Problema: Problemi con il supporto MySQL in PHP, impossibile continuare l'installazione
";
echo "Soluzione: Controllare se l'interprete PHP e' configurato con il supporto MySQL.
";
break;
} // MySQL support is available
echo "
Supporto MySQL in PHP
";
ob_flush();
flush();
// ******* Checking RDBMS connection
$db_handle = db_connect ($db_server, $db_user, $db_password);
if ($db_handle === false) {
echo "
Connessione all'RDBMS MySQL
";
echo "Problema: Problemi con MySQL server, impossibile continuare l'installazione
";
echo "Soluzione: Controllare se il nome dell'host, l'indirizzo IP del server MySQL, l'username e la password sono impostati correttamente e se il server e' up e accetta correttamente le connessioni.
";
echo "Errore del server: $error";
break;
}
echo "
Connessione all'RDBMS MySQL
";
ob_flush();
flush();
// ******* Checking DB availability
$err = db_select ($db_handle, $db_name);
if ($err === false) { // DB name not valid, user or password not valid
echo "
Selezione del database
";
echo "Problema: Problemi con il database. Il nome del DB e' errato o inesistente.
";
echo "Soluzione: Controllare se il database e' stato creato correttamente ed i relativi parametri di connessione siano stati impostati correttamente. Controllare inoltre i permessi utente lato database.
";
echo "Errore del server: $error";
break;
}
echo "
Selezione del database
";
ob_flush();
flush();
// ******* Creating test table
$err = db_create_sampletable ($db_handle);
if ($err === false) { // Create table failed
echo "
Controllo permessi di creazione tabelle
";
echo "Problema: Problemi con le tabelle. Impossibile creare le tabelle.
";
echo "Soluzione: Controllare i permessi utente lato database.
";
echo "Errore del server: $error";
break;
}
echo "
Controllo permessi di creazione tabelle
";
ob_flush();
flush();
// ******* Insert rows
$err = db_insert_sampletable ($db_handle);
if ($err === false) { // Insert failed
echo "
Controllo permessi di inserimento dati
";
echo "Problema: Problemi con le tabelle. Impossibile inserire dati nelle tabelle.
";
echo "Soluzione: Controllare i permessi utente lato database.
";
echo "Errore del server: $error";
break;
}
echo "
Controllo permessi di inserimento dati
";
ob_flush();
flush();
// ******* Delete rows
$err = db_delete_sampletable ($db_handle);
if ($err === false) { // Delete failed
echo "
Controllo permessi di cancellazione dati
";
echo "Problema: Problemi con le tabelle. Impossibile cancellare dati nelle tabelle.
";
echo "Soluzione: Controllare i permessi utente lato database.
";
echo "Errore del server: $error";
break;
}
echo "
Controllo permessi di cancellazione dati
";
ob_flush();
flush();
// ******* Dropping test table
$err = db_drop_sampletable ($db_handle);
if ($err === false) { // Drop table failed
echo "
Controllo permessi di cancellazione tabelle
";
echo "Problema: Problemi con le tabelle. Impossibile cancellare le tabelle.
";
echo "Soluzione: Controllare i permessi utente lato database.
";
echo "Errore del server: $error";
break;
}
echo "
Controllo permessi di cancellazione tabelle
";
ob_flush();
flush();
// ******* Creating cmsdam DB Structure
$err = db_create_cmsdam_structure ($db_handle);
if ($err === false) { // Create cmsdam tables error
echo "
Creazione struttura DB di cmsdAm
";
echo "Problema: Problemi con la creazione delle tabelle di cmsdAm.
";
echo "Soluzione: Controllare che le tabelle di cmsdAm non siano gia esistenti, esse non verranno automaticamente cancellate.
";
echo "Errore del server: $error";
break;
}
echo "
Creazione struttura DB di cmsdAm
";
ob_flush();
flush();
// We are OK with the DB
$db_ok = true;
break;
default: // DB is not supported
$db_not_supported = "1";
break;
}
//!! $db_ok variable contains TRUE if DB is populated, FALSE on errors
?>