From 0419106e2882a62d9ebc4b3b73f1c3cf3ce73bf6 Mon Sep 17 00:00:00 2001 From: jangliss Date: Mon, 25 Aug 2003 05:32:58 +0000 Subject: [PATCH] PHP 5 fix, cure for the error about undeclared extension of class. This code is the logicial way for it to be setup. You shouldn't be able to extend a class without the class first being made. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5561 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/addressbook.php | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/functions/addressbook.php b/functions/addressbook.php index 2099ec47..a6f916b4 100644 --- a/functions/addressbook.php +++ b/functions/addressbook.php @@ -27,24 +27,10 @@ global $data_dir, $address_book_global_filename; $address_book_global_filename = "$data_dir/global.abook"; - Include backends here. */ -require_once(SM_PATH . 'functions/abook_local_file.php'); -require_once(SM_PATH . 'functions/abook_ldap_server.php'); - global $addrbook_dsn; -/* Use this if you wanna have a global address book */ -if (isset($address_book_global_filename)) { - include_once(SM_PATH . 'functions/abook_global_file.php'); -} - -/* Only load database backend if database is configured */ -if(isset($addrbook_dsn) && !empty($addrbook_dsn)) { - include_once(SM_PATH . 'functions/abook_database.php'); -} - /* Create and initialize an addressbook object. Returns the created object @@ -545,4 +531,24 @@ function alistcmp($a,$b) { return (strtolower($a['name']) > strtolower($b['name'])) ? 1 : -1; } + +/* + PHP 5 requires that the class be made first, which seems rather + logical, and should have been the way it was generated the first time. +*/ + +require_once(SM_PATH . 'functions/abook_local_file.php'); +require_once(SM_PATH . 'functions/abook_ldap_server.php'); + +/* Use this if you wanna have a global address book */ +if (isset($address_book_global_filename)) { + include_once(SM_PATH . 'functions/abook_global_file.php'); +} + +/* Only load database backend if database is configured */ +if(isset($addrbook_dsn) && !empty($addrbook_dsn)) { + include_once(SM_PATH . 'functions/abook_database.php'); +} + + ?> -- 2.25.1