| Conditions | 3 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public static function set_search_engine($engine) |
||
| 32 | { |
||
| 33 | if (!$engine) { |
||
| 34 | $engine = 'ForumDatabaseSearch'; |
||
| 35 | } |
||
| 36 | |||
| 37 | $search = new $engine(); |
||
| 38 | |||
| 39 | if ($search instanceof ForumSearchProvider) { |
||
| 40 | self::$search_engine = $engine; |
||
| 41 | |||
| 42 | return $search->load(); |
||
| 43 | } else { |
||
| 44 | user_error("$engine must implement the ForumSearchProvider interface"); |
||
| 45 | } |
||
| 46 | } |
||
| 47 | |||
| 58 |