summaryrefslogtreecommitdiff
path: root/classes/Profile.php
diff options
context:
space:
mode:
authormillette <millette@controlyourself.ca>2008-11-20 16:13:47 -0500
committermillette <millette@controlyourself.ca>2008-11-20 16:13:47 -0500
commit0bd6f7645159095be3a39e01888eab116b397883 (patch)
treec9cf3b71cf7d83b1601b3024c795e87844e6a4ea /classes/Profile.php
parent297744353449ad0cdcd9f7d971932386abe8f7d4 (diff)
sphinx search of people
darcs-hash:20081120211347-099f7-d5588788dcd9a16cf72ece59da3d2bf9b8171b85.gz
Diffstat (limited to 'classes/Profile.php')
-rw-r--r--classes/Profile.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/classes/Profile.php b/classes/Profile.php
index 794dc1de9..9de92ec4b 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -46,6 +46,21 @@ class Profile extends Memcached_DataObject
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
+ function getSearchEngine() {
+ require_once INSTALLDIR.'/classes/SearchEngines.php';
+ static $search_engine;
+ if (!isset($search_engine)) {
+ if (common_config('sphinx', 'enabled')) {
+ $search_engine = new SphinxSearch($this);
+ } elseif ('mysql' === common_config('db', 'type')) {
+ $search_engine = new MySQLSearch($this);
+ } else {
+ $search_engine = new PGSearch($this);
+ }
+ }
+ return $search_engine;
+ }
+
function getAvatar($width, $height=NULL) {
if (is_null($height)) {
$height = $width;