diff options
author | Nils Adermann <naderman@naderman.de> | 2011-08-15 20:00:47 -0400 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2011-09-29 15:42:40 +0200 |
commit | dcc5ca53778184f0719b9ac0c221688ad03bd57e (patch) | |
tree | ab61c555eecd1f38d92bfd103d23dbec3b940d87 /phpBB/search.php | |
parent | fb943d4d6b39cea9825aab78e397eefe26cf7bdf (diff) | |
download | forums-dcc5ca53778184f0719b9ac0c221688ad03bd57e.tar forums-dcc5ca53778184f0719b9ac0c221688ad03bd57e.tar.gz forums-dcc5ca53778184f0719b9ac0c221688ad03bd57e.tar.bz2 forums-dcc5ca53778184f0719b9ac0c221688ad03bd57e.tar.xz forums-dcc5ca53778184f0719b9ac0c221688ad03bd57e.zip |
[feature/extension-manager] Make search backends loadable from extensions
Search backends are now required to be autoloadable. The database updater to
3.1 tries to guess the class name as phpbb_search_<oldname> which works for
the default backends we ship.
PHPBB3-10323
Diffstat (limited to 'phpBB/search.php')
-rw-r--r-- | phpBB/search.php | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/phpBB/search.php b/phpBB/search.php index 1d35dfb062..c6189051a3 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -73,7 +73,7 @@ switch ($search_id) login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']); } break; - + // The "new posts" search uses user_lastvisit which is user based, so it should require user to log in. case 'newposts': if ($user->data['user_id'] == ANONYMOUS) @@ -81,7 +81,7 @@ switch ($search_id) login_box('', $user->lang['LOGIN_EXPLAIN_NEWPOSTS']); } break; - + default: // There's nothing to do here for now ;) break; @@ -273,15 +273,12 @@ if ($keywords || $author || $author_id || $search_id || $submit) } // Select which method we'll use to obtain the post_id or topic_id information - $search_type = basename($config['search_type']); + $search_type = $config['search_type']; - if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) + if (!class_exists($search_type)) { trigger_error('NO_SUCH_SEARCH_MODULE'); } - - require("{$phpbb_root_path}includes/search/$search_type.$phpEx"); - // We do some additional checks in the module to ensure it can actually be utilised $error = false; $search = new $search_type($error); |