Elasticsearch Kibana Shield Php


I am using Elasticsearch-php with kibana and shield. My Elasticsearch version 2.2.0, Php version 5.4.45, Kibana version 4.4.2 on localhost.

Firstly I have mysql data. Before installed Shield plugin I did mapping my data in mysql on sense editor. After I indexed my data with php codes. It was working true. However I installed Shield plugin(2.2) in kibana and elasticsearch. After I did index with php codes but my query didn't work true.

My query:

My error :

Warning: Invalid argument supplied for foreach() in /home/admin/web/server.com/public_html/filter.php on line 194

I add this codes in index.php and filter.php:

$hosts = [

$client = ClientBuilder::create()

But it has error again :

my error:
class ClientBuilder couldn't find...

What can I do?