Example #1
0
 public static function execute($search)
 {
     $modules = ServerInfo::getAll();
     $result = array('entries' => array());
     foreach ($modules['entries'] as $module) {
         if (stripos($module['key'], $search) !== false || stripos($module['title'], $search) !== false || stripos($module['value'], $search) !== false) {
             $result['entries'][] = $module;
         }
     }
     $result['total'] = count($result['entries']);
     return $result;
 }
Example #2
0
 public static function execute()
 {
     if (!isset($_GET['search'])) {
         $_GET['search'] = '';
     }
     if (!empty($_GET['search'])) {
         $result = ServerInfo::find($_GET['search']);
     } else {
         $result = ServerInfo::getAll();
     }
     $result['rpcStatus'] = RPC::STATUS_SUCCESS;
     echo json_encode($result);
 }