<title>Installation de la Base de donnée pour XI-PHP.</title>
</head>

<body>

<?php 
/**
 * Installation de la Base de donnée pour XI-PHP.
 */
require_once './inc/clsDB.php';
clsKernel::ShowInfoXIPHP();
echo " <h1>Installation de la requête SQL -> config.sql</h1> ";
echo ' <p>
    	Vérifier que vous avez bien configurer le fichier "connect.php" pour que
		la requête SQL s\'exécute correctement.
	</p><br />';
try {
    $oDB = new clsDB();
    if (!$oDB->RunQueryFromFile('./config/config.sql')) {
        throw new Exception(clsKernel::Lng('ERR_9111'), 9111);
    }
    echo 'Installation terminé avec succes.';
} catch (Exception $e) {
    clsKernel::ShowException($e);
}
$oDB = null;
?>

</body>

</html>
示例#2
0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<title>Test de la classe clsDB</title>
</head>

<body>
	<h1>Test de la classe clsDB</h1>

<?php 
require_once './inc/clsDB.php';
// Affichage des infos du projet
clsKernel::ShowInfoXIPHP();
$oDB = new clsDB();
$tData = array('txt' => 'Text Add 1', 'numb' => 455);
echo $oDB->Add('test', $tData);
$tData = array('txt' => 'Text Add 2', 'numb' => 456);
echo $oDB->Add('test', $tData);
$tData = array('txt' => 'Text Add 3', 'numb' => 457);
echo $oDB->Add('test', $tData);
$tData = array('txt' => 'Text Add 2b', 'numb' => 4561);
echo $oDB->Update('test', $tData, 'numb=456');
echo $oDB->Delete('test', 'id>2 and id<5');
$oDB = null;
?>

	<p>Requête exécuté.</p>

</body>
示例#3
0
 /**
  * Changement de la langue active.
  *
  * Prendre note que le fichier langue doit exister, sinon il y aura une exception. Si vide prend la langue par défaut
  *
  * @static
  * @author  Patrick Guay <*****@*****.**>
  * @since   2007/12/16 (v. 0.1)
  * @param   string [$sLangName] Nom de la nouvelle langue,
  * @return  boolean  Si le changement est effectué correctement, retourne "true"
  */
 static function SetLang($sLangName = DEFLANG)
 {
     try {
         if (!file_exists('./lang/' . $sLangName . '.php')) {
             throw new Exception(self::Lng('ERR_9020'), 9020);
         } else {
             self::$sActiveLang = $sLangName;
             return true;
         }
     } catch (Exception $e) {
         self::ShowException($e);
     }
 }