'; else { print ("

$a has a bad value !!!

"); } } if ( ereg("\.\.\/include",ini_get('include_path')) == false ) print ("

include_path incorrect !!!".ini_get('include_path')."

"); else print 'include_path : ok ('.ini_get('include_path').')
'; $cn=DbConnect(-2,'phpcompta'); if ($cn == false ) { print "

Vous devez absolument taper dans une console la commande 'createuser -d phpcompta' puis la commande 'createdb -O phpcompta phpcompta'.

Ces commandes créeront l'utilisateur phpcompta puis la base de données par défaut de phpcompta.

"; exit(); } // Check if account_repository exists $account=CountSql($cn, "select * from pg_database where datname='account_repository'"); // Create the account_repository if ($account == 0 ) { ob_start(); echo "Creation of account_repository"; ExecSql($cn,"create database account_repository encoding='latin1'"); $r=system("$psql -U phpcompta account_repository -f sql/account_repository/schema.sql",$r); $r=system("$psql -U phpcompta account_repository -f sql/account_repository/data.sql",$r); echo "Creation of Démo"; ExecSql($cn,"create database dossier1 encoding='latin1'"); $r=system("$psql -U phpcompta dossier1 -f sql/dossier1/schema.sql",$r); $r=system("$psql -U phpcompta dossier1 -f sql/dossier1/data.sql",$r); echo "Creation of Modele1"; ExecSql($cn,"create database mod1 encoding='latin1'"); $r=system("$psql -U phpcompta mod1 -f sql/mod1/schema.sql",$r); $r=system("$psql -U phpcompta mod1 -f sql/mod1/data.sql",$r); ob_end_clean(); } // _SERVER["DOCUMENT_ROOT"] // Test the connection $a=DbConnect(); if ( $a==false) { exit ("

".__LINE__." test has failed !!!

"); } if ( ($Res=ExecSql($a,"select * from ac_users") ) == false ) { exit ("

".__LINE__." test has failed !!!

"); } else print "Connect to database success
"; echo "

Congratulation : Test successfull

";