summaryrefslogtreecommitdiff
path: root/adodb-active-record.inc.php
diff options
context:
space:
mode:
authorMerijn <merijnvdk@users.noreply.github.com>2017-08-09 14:31:00 +0200
committerDamien Regad <dregad@mantisbt.org>2017-08-09 14:31:00 +0200
commit7efd822292db00ab76f0144987b46896b762a77d (patch)
treef4df3b315d90aba0b6374b87fe296db2a51cab38 /adodb-active-record.inc.php
parent9ece137d269db186c34ffb987c3758350e1e08b3 (diff)
downloadadodb-7efd822292db00ab76f0144987b46896b762a77d.tar.gz
adodb-7efd822292db00ab76f0144987b46896b762a77d.tar.bz2
adodb-7efd822292db00ab76f0144987b46896b762a77d.zip
Use include_once instead of include (#361)
Most of the includes in adodb.inc.php are done with include_once but in a couple locations its still done with include. This is the case for adodb-lib.inc.php which is conditionally included based on a global var. I ran into problems with running adodb in debug mode while running phpunit tests. Phpunit will reset the global vars and thus break the include mechanism. This is a problem of phpunit and can be worked around. However it would make adodb more robust to just use include_once everywhere. It will remove the dependency on the $ADODB_INCLUDED_LIB global var. I also replaced one include statement in adodb-time.inc.php, in various drivers and other files too, so include_once is used everywhere. Signed-off-by: Damien Regad <dregad@mantisbt.org>
Diffstat (limited to 'adodb-active-record.inc.php')
-rw-r--r--adodb-active-record.inc.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/adodb-active-record.inc.php b/adodb-active-record.inc.php
index 9a098ada..64c73c48 100644
--- a/adodb-active-record.inc.php
+++ b/adodb-active-record.inc.php
@@ -522,7 +522,7 @@ class ADODB_Active_Record {
$activetab->_created = time();
$s = serialize($activetab);
if (!function_exists('adodb_write_file')) {
- include(ADODB_DIR.'/adodb-csvlib.inc.php');
+ include_once(ADODB_DIR.'/adodb-csvlib.inc.php');
}
adodb_write_file($fname,$s);
}