diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 1ff8878c03f..d8e33f6e648 100755 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -53,10 +53,8 @@ if (! defined('LOG_DEBUG')) } } -// Force PHP error_reporting setup (Dolibarr may report warning without this) -if (! defined('E_DEPRECATED')) define('E_DEPRECATED',0); // For PHP < 5.3.0 compatibility -error_reporting(E_ALL & ~(E_STRICT|E_NOTICE|E_DEPRECATED)); -//error_reporting(E_ALL | E_STRICT); +// End of common declaration part +if (defined('DOL_INC_FOR_VERSION_ERROR')) return; // Define vars @@ -77,12 +75,19 @@ if (! $result && ! empty($_SERVER["GATEWAY_INTERFACE"])) // If install not do exit; } +// Force PHP error_reporting setup (Dolibarr may report warning without this) +if (! empty($dolibarr_strict_mode)) +{ + error_reporting(E_ALL | E_STRICT); +} +else +{ + if (! defined('E_DEPRECATED')) define('E_DEPRECATED',0); // For PHP < 5.3.0 compatibility + error_reporting(E_ALL & ~(E_STRICT|E_NOTICE|E_DEPRECATED)); +} // Disable php display errors -if (! empty($dolibarr_main_prod)) -{ - ini_set('display_errors','Off'); -} +if (! empty($dolibarr_main_prod)) ini_set('display_errors','Off'); // Clean parameters $dolibarr_main_data_root=trim($dolibarr_main_data_root); diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index f24c4e2ab7f..a51965baedc 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -74,6 +74,8 @@ if (! empty($dolibarr_main_document_root_alt)) } // Force db type (for test purpose) if (defined('TEST_DB_FORCE_TYPE')) $conf->db->type=constant('TEST_DB_FORCE_TYPE'); +// Force php strict mode (for debug) +$conf->file->strict_mode = empty($dolibarr_strict_mode)?'':$dolibarr_strict_mode; // Force Multi-Company transverse mode $conf->multicompany->transverse_mode = empty($multicompany_transverse_mode)?'':$multicompany_transverse_mode; // Force entity in login page