Task 0001912: Developpement DEBUG new system with level
This commit is contained in:
parent
5956d4620c
commit
a2c0e116fa
23 changed files with 96 additions and 70 deletions
|
|
@ -70,7 +70,7 @@ if ( ! $cn->exist_table('version')) {
|
|||
$style_user=$http->post("style_user","string",$_SESSION[SESSION_KEY.'g_theme']);
|
||||
|
||||
html_page_start($style_user);
|
||||
if ( DEBUG ) {
|
||||
if ( DEBUGNOALYSS > 1 ) {
|
||||
/**
|
||||
* Debug Design
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ $my_domain="";
|
|||
require_once '../include/constant.php';
|
||||
require_once '../include/config.inc.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/ac_common.php';
|
||||
if (file_exists("install.php")&&!DEBUG)
|
||||
if ( file_exists("install.php")&& DEBUGNOALYSS == 0 )
|
||||
{
|
||||
// At the end of the installation procedure , the install file must be removed
|
||||
if (isset($_GET['remove_install']))
|
||||
|
|
@ -186,7 +186,7 @@ if (file_exists("install.php")&&!DEBUG)
|
|||
/**
|
||||
* Debug Design
|
||||
*/
|
||||
if (DEBUG)
|
||||
if ( DEBUGNOALYSS == 0 )
|
||||
{
|
||||
echo <<<EOF
|
||||
<div class="d-none d-sm-block d-md-none d-lg-none d-xl-none bg-info">Small</div>
|
||||
|
|
|
|||
|
|
@ -555,7 +555,7 @@ else
|
|||
if ($account == 0 ) {
|
||||
|
||||
echo "Creation of ".domaine."account_repository";
|
||||
if ( ! DEBUG) ob_start();
|
||||
if ( DEBUGNOALYSS == 0 ) ob_start();
|
||||
$cn->exec_sql("create database ".domaine."account_repository encoding='utf8'");
|
||||
$cn=new Database();
|
||||
$cn->start();
|
||||
|
|
@ -570,13 +570,13 @@ if ($account == 0 ) {
|
|||
|
||||
$cn->commit($cn);
|
||||
|
||||
if (!DEBUG)
|
||||
if ( DEBUGNOALYSS == 0 )
|
||||
{
|
||||
ob_end_clean();
|
||||
}
|
||||
|
||||
echo _("Creation of Modele 1");
|
||||
if (!DEBUG)
|
||||
if ( DEBUGNOALYSS == 0 )
|
||||
{
|
||||
ob_start();
|
||||
}
|
||||
|
|
@ -589,7 +589,7 @@ if ($account == 0 ) {
|
|||
$cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/constraint.sql');
|
||||
$cn->commit();
|
||||
|
||||
if (!DEBUG)
|
||||
if ( DEBUGNOALYSS == 0 )
|
||||
{
|
||||
ob_end_clean();
|
||||
}
|
||||
|
|
@ -598,13 +598,13 @@ if ($account == 0 ) {
|
|||
$cn->exec_sql("create database ".domaine."mod2 encoding='utf8'");
|
||||
$cn=new Database(2,'mod');
|
||||
$cn->start();
|
||||
if ( ! DEBUG) { ob_start(); }
|
||||
if ( DEBUGNOALYSS == 0 ) { ob_start(); }
|
||||
$cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/schema.sql');
|
||||
$cn->execute_script(NOALYSS_INCLUDE.'/sql/mod2/data.sql');
|
||||
$cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/constraint.sql');
|
||||
$cn->commit();
|
||||
|
||||
if ( ! DEBUG) ob_end_clean();
|
||||
if ( DEBUGNOALYSS == 0 ) ob_end_clean();
|
||||
echo '<h1>'._('Important').'</h1>';
|
||||
echo '<p>'._('Utilisateur administrateur'),' ',NOALYSS_ADMINISTRATOR,'</p>';
|
||||
echo '<p>',_('Mot de passe')," ",NOALYSS_ADMIN_PASSWORD,'</p>';
|
||||
|
|
@ -623,10 +623,10 @@ if (defined("MULTI") && MULTI == 0)
|
|||
$db = new Database();
|
||||
if ($db->exist_table("repo_version") == false)
|
||||
{
|
||||
if ( ! DEBUG) { ob_start(); }
|
||||
if ( DEBUGNOALYSS > 0 ) { ob_start(); }
|
||||
$db->execute_script(NOALYSS_INCLUDE.'/sql/mono/mono.sql');
|
||||
|
||||
if ( ! DEBUG) ob_end_clean();
|
||||
if ( DEBUGNOALYSS > 0 ) ob_end_clean();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -651,7 +651,7 @@ if (defined("MULTI") && MULTI == 0)
|
|||
echo "<p class=\"info\">"._("Tout est installé"). $succeed;
|
||||
|
||||
echo "<h2>"._("Mise à jour Repository")."</h2>";
|
||||
if ( DEBUG == false ) ob_start();
|
||||
if ( DEBUGNOALYSS == 0 ) ob_start();
|
||||
$MaxVersion=DBVERSIONREPO-1;
|
||||
for ($i=4;$i<= $MaxVersion;$i++)
|
||||
{
|
||||
|
|
@ -662,6 +662,9 @@ if (defined("MULTI") && MULTI == 0)
|
|||
|
||||
$db->exec_sql("update ac_users set use_login=$1,use_pass=md5($2) where use_id=1",
|
||||
array(strtolower(NOALYSS_ADMINISTRATOR),NOALYSS_ADMIN_PASSWORD));
|
||||
|
||||
if ( DEBUGNOALYSS == 0 ) ob_end_clean();
|
||||
|
||||
echo '<h1>'._('Important').'</h1>';
|
||||
echo '<p>'._('Utilisateur administrateur'),' ',NOALYSS_ADMINISTRATOR,'</p>';
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ echo HtmlInput::button_anchor(_("Export CSV"), $csv,"",' title="Export Contacts
|
|||
echo HtmlInput::button_close("action_concerned_list_dv");
|
||||
$response = ob_get_clean();
|
||||
|
||||
if ( headers_sent() && DEBUG) {
|
||||
if ( headers_sent() && DEBUGNOALYSS > 0) {
|
||||
echo $response;
|
||||
}
|
||||
$html = escape_xml($response);
|
||||
|
|
@ -63,4 +63,4 @@ echo <<<EOF
|
|||
<code>$html</code>
|
||||
</data>
|
||||
EOF;
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ echo $follow->button_action_add_concerned_card( );
|
|||
|
||||
$response = ob_get_clean();
|
||||
|
||||
if (headers_sent() && DEBUG) {
|
||||
if (headers_sent() && DEBUGNOALYSS > 0) {
|
||||
echo $response;
|
||||
}
|
||||
$html = escape_xml($response);
|
||||
|
|
@ -72,4 +72,4 @@ echo <<<EOF
|
|||
<code>$html</code>
|
||||
</data>
|
||||
EOF;
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -354,10 +354,10 @@ if ($op=='upgradeCore')
|
|||
$progress->set_value(5);
|
||||
$core->download();
|
||||
$progress->set_value(55);
|
||||
if (!DEBUG )
|
||||
if ( DEBUGNOALYSS > 0 )
|
||||
{
|
||||
$core->install();
|
||||
}
|
||||
}
|
||||
$progress->set_value(100);
|
||||
|
||||
$url=sprintf('<a href="%s"> install.php</a>', NOALYSS_URL."/install.php");
|
||||
|
|
@ -414,4 +414,4 @@ if ($op=="installTemplate")
|
|||
echo _("Modèle installé");
|
||||
return;
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ case 'st':
|
|||
if ( empty($array))
|
||||
{
|
||||
$html=_("Aucune catégorie de fiche ne correspond à votre demande");
|
||||
if ( DEBUG ) $html.=$sql;
|
||||
if ( DEBUGNOALYSS > 0 ) $html.=$sql;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -793,7 +793,7 @@ case 'upr':
|
|||
|
||||
} // switch
|
||||
$xml=escape_xml($html);
|
||||
if (DEBUG && headers_sent()) {
|
||||
if (DEBUGNOALYSS > 0 && headers_sent()) {
|
||||
echo $html;return;
|
||||
}
|
||||
header('Content-type: text/xml; charset=UTF-8');
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ if ( isset($_REQUEST['pcm_val']))
|
|||
}
|
||||
}
|
||||
$xml=escape_xml($html);
|
||||
if (DEBUG && headers_sent()) {
|
||||
if (DEBUGNOALYSS > 0 && headers_sent()) {
|
||||
echo $html;return;
|
||||
}
|
||||
header('Content-type: text/xml; charset=UTF-8');
|
||||
|
|
|
|||
|
|
@ -514,7 +514,7 @@ case 'save':
|
|||
catch (Exception $e)
|
||||
{
|
||||
record_log($e);
|
||||
if ( DEBUG ) echo $e->getMessage();
|
||||
if ( DEBUGNOALYSS > 0 ) echo $e->getMessage();
|
||||
alert(_( "Changement impossible: on ne peut pas changer la date dans une période fermée"));
|
||||
}
|
||||
$html=ob_get_contents();
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ switch ($op)
|
|||
echo HtmlInput::button_close("tag_div");
|
||||
|
||||
$response=ob_get_clean();
|
||||
if (headers_sent()&&DEBUG)
|
||||
if (headers_sent()&& DEBUGNOALYSS > 0 )
|
||||
{
|
||||
echo $response;
|
||||
}
|
||||
|
|
@ -116,7 +116,7 @@ EOF;
|
|||
$tag_operation->tag_cell($ctl);
|
||||
|
||||
$response=ob_get_clean();
|
||||
if (headers_sent()&&DEBUG)
|
||||
if (headers_sent()&& DEBUGNOALYSS > 0)
|
||||
{
|
||||
echo $response;
|
||||
}
|
||||
|
|
@ -145,7 +145,7 @@ EOF;
|
|||
$tag_operation->tag_cell($pref);
|
||||
|
||||
$response=ob_get_clean();
|
||||
if (headers_sent()&&DEBUG)
|
||||
if (headers_sent()&& DEBUGNOALYSS > 0)
|
||||
{
|
||||
echo $response;
|
||||
}
|
||||
|
|
@ -163,4 +163,4 @@ EOF;
|
|||
EOF;
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ case "sf":
|
|||
break;
|
||||
}
|
||||
$xml=escape_xml($html);
|
||||
if (headers_sent() && DEBUG ) {
|
||||
if (headers_sent() && DEBUGNOALYSS > 0) {
|
||||
echo $html;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ else :
|
|||
</form>
|
||||
<?php
|
||||
$response= ob_get_clean();
|
||||
if (headers_sent() && DEBUG ) {
|
||||
if (headers_sent() && DEBUGNOALYSS > 0 ) {
|
||||
echo $response;
|
||||
}else {
|
||||
header('Content-type: text/xml; charset=UTF-8');
|
||||
|
|
@ -59,4 +59,4 @@ if (headers_sent() && DEBUG ) {
|
|||
</data>
|
||||
EOF;
|
||||
exit();
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ if ( $g_user->check_action(TAGADD) == 1) { echo HtmlInput::button("tag_add", _("
|
|||
echo HtmlInput::button_close("tag_div");
|
||||
|
||||
$response= ob_get_clean();
|
||||
if (headers_sent() && DEBUG ){
|
||||
if (headers_sent() && DEBUGNOALYSS > 0 ){
|
||||
echo $response;
|
||||
} else {
|
||||
header('Content-type: text/xml; charset=UTF-8');
|
||||
|
|
|
|||
|
|
@ -773,12 +773,12 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
$operation_currency->insert();
|
||||
$tot_amount_cur=round(bcadd($tot_amount_cur,$acc_amount->amount_currency),2);
|
||||
$tot_amount_cur=round(bcadd($tot_amount_cur,$acc_amount->amount_vat_currency),2);
|
||||
if (DEBUG ) {
|
||||
if ( DEBUGNOALYSS > 0 ) {
|
||||
echo __LINE__." insert into operation currency oc_amount:{$acc_amount->amount_currency} oc_vat_amount {$acc_amount->amount_vat_currency} <br>";
|
||||
}
|
||||
} // end loop : save all items
|
||||
/* save total customer */
|
||||
if ( DEBUG ) {
|
||||
if ( DEBUGNOALYSS > 0 ) {
|
||||
echo __LINE__." tot_amount $tot_amount<br>";
|
||||
echo __LINE__." tot_tva $tot_tva<br>";
|
||||
|
||||
|
|
@ -861,7 +861,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
// Total DEB
|
||||
$acc_operation->amount=$this->db->get_value("select sum(j_montant) from jrnx where j_grpt = $1 and j_debit='t'",
|
||||
array($seq));
|
||||
if ( DEBUG ) {
|
||||
if ( DEBUGNOALYSS > 0 ) {
|
||||
echo __LINE__." amount ".$acc_operation->amount."<br>";
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
|
|||
|
||||
$tot_amount = bcadd($tot_amount, $amount);
|
||||
$tot_amount = round($tot_amount, 2);
|
||||
if ( DEBUG ) { echo __LINE__." tot_amount $tot_amount<br>";}
|
||||
if ( DEBUGNOALYSS > 0 ) { echo __LINE__." tot_amount $tot_amount<br>";}
|
||||
$acc_operation = new Acc_Operation($this->db);
|
||||
$acc_operation->date = $e_date;
|
||||
$sposte = $fiche->strAttribut(ATTR_DEF_ACCOUNT);
|
||||
|
|
@ -462,7 +462,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
|
|||
/* save total customer */
|
||||
$cust_amount = bcadd($tot_amount, $tot_tva);
|
||||
$cust_amount = round($cust_amount,2);
|
||||
if ( DEBUG ) {
|
||||
if ( DEBUGNOALYSS > 0 ) {
|
||||
echo __LINE__." cust_amount $cust_amount<br>";
|
||||
echo __LINE__." tot_amount $tot_amount<br>";
|
||||
echo __LINE__." tot_tva $tot_tva<br>";
|
||||
|
|
@ -499,7 +499,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
|
|||
* if if ($g_parameter->MY_TVA_USE == 'Y' )
|
||||
*/
|
||||
if ($g_parameter->MY_TVA_USE == 'Y') {
|
||||
if (DEBUG ) {
|
||||
if ( DEBUGNOALYSS > 0 ) {
|
||||
var_dump($tva);
|
||||
}
|
||||
foreach ($tva as $i => $value) {
|
||||
|
|
@ -524,7 +524,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
|
|||
$tot_debit=round($tot_debit, 2);
|
||||
}
|
||||
$acc_operation->insert_jrnx();
|
||||
if ( DEBUG ) {
|
||||
if ( DEBUGNOALYSS > 0 ) {
|
||||
echo __LINE__." tot_tva $tot_tva<br>";
|
||||
|
||||
}
|
||||
|
|
@ -553,7 +553,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
|
|||
*/
|
||||
|
||||
/* insert into jrn */
|
||||
if ( DEBUG ) { echo __LINE__." tot_debit ".round($tot_debit,2)."<br>"; }
|
||||
if ( DEBUGNOALYSS > 0 ) { echo __LINE__." tot_debit ".round($tot_debit,2)."<br>"; }
|
||||
$acc_operation = new Acc_Operation($this->db);
|
||||
$acc_operation->date = $e_date;
|
||||
$acc_operation->echeance = $e_ech;
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ class Acc_Operation
|
|||
{
|
||||
$this->type=($this->type=='d')?'c':'d';
|
||||
}
|
||||
if ( DEBUG ) {
|
||||
if ( DEBUGNOALYSS > 0 ) {
|
||||
echo "insert_jrnx = [{ $this->poste}] {$this->amount} rounded ".round($this->amount,2)." type {$this->type}<br>";
|
||||
}
|
||||
$this->amount=abs($this->amount);
|
||||
|
|
@ -284,7 +284,7 @@ class Acc_Operation
|
|||
function insert_jrn()
|
||||
{
|
||||
$p_comment=$this->desc;
|
||||
if (DEBUG ) {
|
||||
if ( DEBUGNOALYSS > 0 ) {
|
||||
echo "insert_jrn = {$this->amount} <br>";
|
||||
}
|
||||
$diff=$this->db->get_value("select check_balance ($1)",array($this->grpt));
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ class Anc_Key
|
|||
catch (Exception $e)
|
||||
{
|
||||
|
||||
if ( DEBUG ) { echo $e->getTraceAsString(); } else { echo _('erreur').$e->getMessage();}
|
||||
if ( DEBUGNOALYSS > 0 ) { echo $e->getTraceAsString(); } else { echo _('erreur').$e->getMessage();}
|
||||
record_log($e);
|
||||
$cn->rollback();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ class Database extends DatabaseCore
|
|||
$this->execute_script(NOALYSS_INCLUDE . '/sql/patch/upgrade' . $i . '.sql');
|
||||
echo $succeed;
|
||||
|
||||
if (!DEBUG)
|
||||
if ( DEBUGNOALYSS == 0)
|
||||
ob_start();
|
||||
// specific for version 4
|
||||
if ($i == 4) {
|
||||
|
|
@ -224,7 +224,7 @@ class Database extends DatabaseCore
|
|||
$this->execute_script(NOALYSS_INCLUDE . "/sql/patch/upgrade141." . $country . ".sql");
|
||||
}
|
||||
|
||||
if (!DEBUG)
|
||||
if (DEBUGNOALYSS == 0 )
|
||||
ob_end_clean();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ class Dossier
|
|||
//----------------------------------------------------------------------
|
||||
echo "<h2>"._("Mise à jour de la base de données principale")."</h2>";
|
||||
$cn=new Database();
|
||||
if (DEBUG==false)
|
||||
if (DEBUGNOALYSS == 0)
|
||||
ob_start();
|
||||
$MaxVersion=DBVERSIONREPO-1;
|
||||
for ($i=4; $i<=$MaxVersion; $i++)
|
||||
|
|
@ -359,7 +359,7 @@ class Dossier
|
|||
$cn->execute_script(NOALYSS_INCLUDE.'/sql/patch/ac-upgrade'.$i.'.sql');
|
||||
}
|
||||
}
|
||||
|
||||
if (DEBUGNOALYSS == 0) ob_end_clean();
|
||||
//----------------------------------------------------------------------
|
||||
// Upgrade the folders
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -88,9 +88,10 @@ define ('SMALLX','×');
|
|||
define ('BUTTONADD',"✚");
|
||||
|
||||
define ('SVNINFO',NOALYSS_VERSION);
|
||||
if ( ! defined ('DEBUG')) {
|
||||
define ("DEBUG",false);
|
||||
if ( ! defined ('DEBUGNOALYSS')) {
|
||||
define ("DEBUGNOALYSS",0);
|
||||
}
|
||||
|
||||
if ( ! defined ('LOGINPUT')) {
|
||||
define ("LOGINPUT",false);
|
||||
}
|
||||
|
|
@ -132,21 +133,31 @@ if ( ! defined ('MAX_SEARCH_CARD') ) {
|
|||
define ('MAX_FOLDER_TO_SHOW',80);
|
||||
define ('MAX_ACTION_SHOW',20);
|
||||
|
||||
if ( DEBUG ) {
|
||||
if ( DEBUGNOALYSS == 0 ) {
|
||||
// PRODUCTION : nothing is displaid , report only errors and warning
|
||||
// Rapporte les erreurs d'exécution de script
|
||||
error_reporting(E_ERROR | E_WARNING );
|
||||
ini_set("display_errors",0);
|
||||
ini_set("html_errors",0);
|
||||
ini_set('log_errors',1);
|
||||
ini_set('log_errors_max_len',0);
|
||||
}elseif (DEBUGNOALYSS==1) {
|
||||
/* DEVELOPPEMENT : display all errors warning notice deprecated ...*/
|
||||
error_reporting(2147483647);
|
||||
ini_set("display_errors",1);
|
||||
ini_set("display_startup_errors",1);
|
||||
ini_set("html_errors",1);
|
||||
ini_set('log_errors',1);
|
||||
ini_set('log_errors_max_len',0);
|
||||
}
|
||||
else {
|
||||
// Rapporte les erreurs d'exécution de script
|
||||
error_reporting(E_ERROR | E_WARNING | E_PARSE|E_NOTICE);
|
||||
ini_set("display_errors",0);
|
||||
ini_set("html_errors",0);
|
||||
} elseif (DEBUGNOALYSS == 2 ) {
|
||||
// like level 1 plus extra info (filename, ...)
|
||||
error_reporting(2147483647);
|
||||
ini_set("display_errors",1);
|
||||
ini_set("display_startup_errors",1);
|
||||
ini_set("html_errors",1);
|
||||
ini_set('log_errors',1);
|
||||
ini_set('log_errors_max_len',0);
|
||||
|
||||
}
|
||||
// Erreur
|
||||
define ("NOERROR",0);
|
||||
|
|
@ -339,4 +350,4 @@ if ( ! defined ("NOALYSS_URL")) {
|
|||
}
|
||||
if (!defined ("DEFAULT_SERVER_VIDEO_CONF")) {
|
||||
define ("DEFAULT_SERVER_VIDEO_CONF","https://www.free-solutions.org/");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1180,7 +1180,11 @@ function display_menu($p_menuid)
|
|||
}
|
||||
tracedebug("'menu", $file[0]['me_file'],__FUNCTION__.__LINE__."line");
|
||||
tracedebug("'menu", $file[0]['me_parameter'],__FUNCTION__.__LINE__."parm ");
|
||||
if ( DEBUG ) { echo $file[0]['me_file']," param : ",$file[0]['me_parameter'] ;}
|
||||
if ( DEBUGNOALYSS == 2)
|
||||
{
|
||||
echo $file[0]['me_file']," param : ",$file[0]['me_parameter'] ;
|
||||
|
||||
}
|
||||
/*
|
||||
* Log the file we input to put in the folder test-noalyss for replaying it
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -172,7 +172,19 @@ function display_file_config($p_array,$from_setup=1,$p_os=1)
|
|||
|
||||
print ( 'define ("LOCALE",'.$clocale.');');
|
||||
print ("\r\n");
|
||||
|
||||
echo <<<EOF
|
||||
/*
|
||||
* DEBUGNOALYSS let you see more information when you develop.
|
||||
* 0 = for production
|
||||
* 1 = display all errors
|
||||
* 2 = display all errors + more information
|
||||
*/
|
||||
EOF;
|
||||
|
||||
print ("\r\n");
|
||||
print ( 'define ("DEBUGNOALYSS",0);');
|
||||
print ("\r\n");
|
||||
|
||||
print ( 'define ("domaine","");');
|
||||
print ("\r\n");
|
||||
if (isset($multi))
|
||||
|
|
@ -187,10 +199,6 @@ function display_file_config($p_array,$from_setup=1,$p_os=1)
|
|||
print ( 'define ("dbname","'.$cdbname.'");');
|
||||
print ("\r\n");
|
||||
|
||||
print (' // Uncomment to DEBUG');
|
||||
print ("\r\n");
|
||||
print ( '// define ("DEBUG",TRUE);');
|
||||
print ("\r\n");
|
||||
print (' // Uncomment to log your input');
|
||||
print ("\r\n");
|
||||
print ( '// define ("LOGINPUT",TRUE);');
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class DatabaseCore
|
|||
$this->db = pg_connect("dbname=$p_dbname host='$p_host' user='$p_user'
|
||||
password='$p_password' port=$p_port");
|
||||
if ($this->db == false) {
|
||||
if (DEBUG) {
|
||||
if ( DEBUGNOALYSS > 0 ) {
|
||||
|
||||
echo '<h2 class="error">'._('Impossible de se connecter à postgreSql').'</h2>';
|
||||
echo '<p>';
|
||||
|
|
@ -160,7 +160,7 @@ class DatabaseCore
|
|||
$this->array = $p_array;
|
||||
|
||||
if ($p_array == null) {
|
||||
if (!DEBUG)
|
||||
if ( DEBUGNOALYSS == 0 )
|
||||
$this->ret = pg_query($this->db, $p_string);
|
||||
else
|
||||
$this->ret = @pg_query($this->db, $p_string);
|
||||
|
|
@ -169,7 +169,7 @@ class DatabaseCore
|
|||
if (!is_array($p_array)) {
|
||||
throw new Exception(_("Erreur : exec_sql attend un array"));
|
||||
}
|
||||
if (!DEBUG)
|
||||
if ( DEBUGNOALYSS == 0 )
|
||||
$this->ret =@pg_query_params($this->db, $p_string, $p_array);
|
||||
else
|
||||
$this->ret = pg_query_params($this->db, $p_string, $p_array);
|
||||
|
|
@ -179,7 +179,7 @@ class DatabaseCore
|
|||
throw new Exception(" SQL ERROR $p_string " . $str_error, 1);
|
||||
}
|
||||
} catch (Exception $a) {
|
||||
if (DEBUG) {
|
||||
if ( DEBUGNOALYSS > 0 ) {
|
||||
print_r($p_string);
|
||||
print_r($p_array);
|
||||
echo $a->getMessage();
|
||||
|
|
@ -277,7 +277,7 @@ class DatabaseCore
|
|||
function execute_script($script)
|
||||
{
|
||||
|
||||
if (!DEBUG) {
|
||||
if ( DEBUGNOALYSS == 0 ) {
|
||||
ob_start();
|
||||
} else {
|
||||
$debug = fopen("/tmp/debug.log", "w+");
|
||||
|
|
@ -335,11 +335,11 @@ class DatabaseCore
|
|||
$buffer = str_replace(';', '', $buffer);
|
||||
}
|
||||
$sql .= $buffer;
|
||||
if (DEBUG) fwrite($debug, $sql);
|
||||
if ( DEBUGNOALYSS > 0 ) fwrite($debug, $sql);
|
||||
if ($this->exec_sql($sql) == false) {
|
||||
|
||||
$this->rollback();
|
||||
if (!DEBUG)
|
||||
if ( DEBUGNOALYSS == 0 )
|
||||
ob_end_clean();
|
||||
print "ERROR : $sql";
|
||||
throw new Exception("ERROR : $sql");
|
||||
|
|
@ -349,7 +349,7 @@ class DatabaseCore
|
|||
print "<hr>";
|
||||
} // while (feof)
|
||||
fclose($hf);
|
||||
if (!DEBUG)
|
||||
if ( DEBUGNOALYSS == 0 )
|
||||
ob_end_clean();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue