2015-12-17, 08:23:35
Hello folks in this forum,
I am thinking to develope a site using ElasticSearch and PHP code is ready and working. I want to refactor the code
as a plugin of GetSimple. My question is:
Where to put the ElasticSearch PHP client libraries. I use xampp. Here is my stuff:
- Installation folder: c:\xampp\htdocs\getsimple
- cmd to: c:\xampp\htdocs\getsimple\plugins
- create a file: composer.json and put these lines:
{
"require": {
"elasticsearch/elasticsearch": "~2.0"
}
}
- curl -s http://getcomposer.org/installer | php
- php composer.phar install --no-dev
ElasticSearch PHP client libraries then are installed in: c:\xampp\htdocs\getsimple\plugins\vendor
In my regular PHP code, I do in this way:
require 'vendor/autoload.php'; // call the autoload
use "Elasticsearch/ClientBuilder"; // use the ClientBuilder class file
My question is: what are the correct ways to require/use the above 2 lines in GetSimple?
Thanks in advance for any advice and suggestions,
Best,
jwn
I am thinking to develope a site using ElasticSearch and PHP code is ready and working. I want to refactor the code
as a plugin of GetSimple. My question is:
Where to put the ElasticSearch PHP client libraries. I use xampp. Here is my stuff:
- Installation folder: c:\xampp\htdocs\getsimple
- cmd to: c:\xampp\htdocs\getsimple\plugins
- create a file: composer.json and put these lines:
{
"require": {
"elasticsearch/elasticsearch": "~2.0"
}
}
- curl -s http://getcomposer.org/installer | php
- php composer.phar install --no-dev
ElasticSearch PHP client libraries then are installed in: c:\xampp\htdocs\getsimple\plugins\vendor
In my regular PHP code, I do in this way:
require 'vendor/autoload.php'; // call the autoload
use "Elasticsearch/ClientBuilder"; // use the ClientBuilder class file
My question is: what are the correct ways to require/use the above 2 lines in GetSimple?
Thanks in advance for any advice and suggestions,
Best,
jwn