diff options
| author | Merijn <merijnvdk@users.noreply.github.com> | 2017-08-09 14:31:00 +0200 |
|---|---|---|
| committer | Damien Regad <dregad@mantisbt.org> | 2017-08-09 14:31:00 +0200 |
| commit | 7efd822292db00ab76f0144987b46896b762a77d (patch) | |
| tree | f4df3b315d90aba0b6374b87fe296db2a51cab38 /adodb-active-recordx.inc.php | |
| parent | 9ece137d269db186c34ffb987c3758350e1e08b3 (diff) | |
| download | adodb-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-recordx.inc.php')
| -rw-r--r-- | adodb-active-recordx.inc.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/adodb-active-recordx.inc.php b/adodb-active-recordx.inc.php index 00697506..986cbf96 100644 --- a/adodb-active-recordx.inc.php +++ b/adodb-active-recordx.inc.php @@ -551,7 +551,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); } @@ -1300,7 +1300,7 @@ function adodb_GetActiveRecordsClass(&$db, $class, $tableObj,$whereOrderBy,$bind if (!isset($_ADODB_ACTIVE_DBS)) { - include(ADODB_DIR.'/adodb-active-record.inc.php'); + include_once(ADODB_DIR.'/adodb-active-record.inc.php'); } if (!class_exists($class)) { $db->outp_throw("Unknown class $class in GetActiveRecordsClass()",'GetActiveRecordsClass'); |
