├── README.md ├── ajax.php ├── bootstrap.min.css ├── bootstrap.php ├── css ├── bootstrap-theme.css ├── bootstrap-theme.css.map ├── bootstrap-theme.min.css ├── bootstrap.css ├── bootstrap.css.map └── bootstrap.min.css ├── fonts ├── glyphicons-halflings-regular.eot ├── glyphicons-halflings-regular.svg ├── glyphicons-halflings-regular.ttf ├── glyphicons-halflings-regular.woff └── glyphicons-halflings-regular.woff2 ├── index.html ├── js ├── administry.js ├── ajax.js ├── analytics.js ├── bootstrap.css ├── bootstrap.js ├── bootstrap.min.css ├── bootstrap.min.js ├── isdc-theme.css ├── jquery-1.10.2.min.js ├── logo.png └── system.js ├── vendor ├── autoload.php ├── composer │ ├── ClassLoader.php │ ├── autoload_classmap.php │ ├── autoload_namespaces.php │ ├── autoload_psr4.php │ ├── autoload_real.php │ └── installed.json └── elasticsearch │ └── elasticsearch │ ├── .gitignore │ ├── .gitmodules │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── benchmarks │ └── Elasticsearch │ │ └── Benchmarks │ │ └── IndexingEvent.php │ ├── composer.json │ ├── docs │ ├── configuration.asciidoc │ ├── connection-pool.asciidoc │ ├── connections.asciidoc │ ├── index-operations.asciidoc │ ├── index.asciidoc │ ├── indexing-operations.asciidoc │ ├── installation.asciidoc │ ├── namespaces.asciidoc │ ├── overview.asciidoc │ ├── php-version-requirement.asciidoc │ ├── php_json_objects.asciidoc │ ├── quickstart.asciidoc │ ├── search-operations.asciidoc │ ├── security.asciidoc │ └── serializers.asciidoc │ ├── run_travis_test.sh │ ├── src │ └── Elasticsearch │ │ ├── Client.php │ │ ├── Common │ │ ├── AbstractFactory.php │ │ ├── DICBuilder.php │ │ ├── EmptyLogger.php │ │ └── Exceptions │ │ │ ├── AlreadyExpiredException.php │ │ │ ├── Authentication401Exception.php │ │ │ ├── BadMethodCallException.php │ │ │ ├── BadRequest400Exception.php │ │ │ ├── ClientErrorResponseException.php │ │ │ ├── Conflict409Exception.php │ │ │ ├── Curl │ │ │ ├── CouldNotConnectToHost.php │ │ │ ├── CouldNotResolveHostException.php │ │ │ └── OperationTimeoutException.php │ │ │ ├── ElasticsearchException.php │ │ │ ├── Forbidden403Exception.php │ │ │ ├── InvalidArgumentException.php │ │ │ ├── MaxRetriesException.php │ │ │ ├── Missing404Exception.php │ │ │ ├── NoDocumentsToGetException.php │ │ │ ├── NoNodesAvailableException.php │ │ │ ├── NoShardAvailableException.php │ │ │ ├── RoutingMissingException.php │ │ │ ├── RuntimeException.php │ │ │ ├── ScriptLangNotSupportedException.php │ │ │ ├── Serializer │ │ │ ├── JsonDeserializationError.php │ │ │ ├── JsonErrorException.php │ │ │ └── JsonSerializationError.php │ │ │ ├── ServerErrorResponseException.php │ │ │ ├── TransportException.php │ │ │ └── UnexpectedValueException.php │ │ ├── ConnectionPool │ │ ├── AbstractConnectionPool.php │ │ ├── Selectors │ │ │ ├── RandomSelector.php │ │ │ ├── RoundRobinSelector.php │ │ │ ├── SelectorInterface.php │ │ │ └── StickyRoundRobinSelector.php │ │ ├── SniffingConnectionPool.php │ │ ├── StaticConnectionPool.php │ │ └── StaticNoPingConnectionPool.php │ │ ├── Connections │ │ ├── AbstractConnection.php │ │ ├── ConnectionFactory.php │ │ ├── ConnectionInterface.php │ │ ├── CurlMultiConnection.php │ │ └── GuzzleConnection.php │ │ ├── Endpoints │ │ ├── AbstractEndpoint.php │ │ ├── Bulk.php │ │ ├── BulkEndpointInterface.php │ │ ├── Cat │ │ │ ├── Aliases.php │ │ │ ├── Allocation.php │ │ │ ├── Count.php │ │ │ ├── Fielddata.php │ │ │ ├── Health.php │ │ │ ├── Help.php │ │ │ ├── Indices.php │ │ │ ├── Master.php │ │ │ ├── Nodes.php │ │ │ ├── PendingTasks.php │ │ │ ├── Plugins.php │ │ │ ├── Recovery.php │ │ │ ├── Segments.php │ │ │ ├── Shards.php │ │ │ └── ThreadPool.php │ │ ├── ClearScroll.php │ │ ├── Cluster │ │ │ ├── Health.php │ │ │ ├── Nodes │ │ │ │ ├── AbstractNodesEndpoint.php │ │ │ │ ├── HotThreads.php │ │ │ │ ├── Info.php │ │ │ │ ├── Shutdown.php │ │ │ │ └── Stats.php │ │ │ ├── PendingTasks.php │ │ │ ├── Reroute.php │ │ │ ├── Settings │ │ │ │ ├── Get.php │ │ │ │ └── Put.php │ │ │ ├── State.php │ │ │ └── Stats.php │ │ ├── Count.php │ │ ├── CountPercolate.php │ │ ├── Delete.php │ │ ├── DeleteByQuery.php │ │ ├── Exists.php │ │ ├── Explain.php │ │ ├── Get.php │ │ ├── Index.php │ │ ├── Indices │ │ │ ├── Alias │ │ │ │ ├── AbstractAliasEndpoint.php │ │ │ │ ├── Delete.php │ │ │ │ ├── Exists.php │ │ │ │ ├── Get.php │ │ │ │ └── Put.php │ │ │ ├── Aliases │ │ │ │ ├── Get.php │ │ │ │ └── Update.php │ │ │ ├── Analyze.php │ │ │ ├── Cache │ │ │ │ └── Clear.php │ │ │ ├── ClearCache.php │ │ │ ├── Close.php │ │ │ ├── Create.php │ │ │ ├── Delete.php │ │ │ ├── Exists.php │ │ │ ├── Exists │ │ │ │ └── Types.php │ │ │ ├── Field │ │ │ │ └── Get.php │ │ │ ├── Flush.php │ │ │ ├── Gateway │ │ │ │ └── Snapshot.php │ │ │ ├── Get.php │ │ │ ├── Mapping │ │ │ │ ├── Delete.php │ │ │ │ ├── Get.php │ │ │ │ ├── GetField.php │ │ │ │ └── Put.php │ │ │ ├── Open.php │ │ │ ├── Optimize.php │ │ │ ├── Recovery.php │ │ │ ├── Refresh.php │ │ │ ├── Segments.php │ │ │ ├── Settings │ │ │ │ ├── Get.php │ │ │ │ └── Put.php │ │ │ ├── Snapshotindex.php │ │ │ ├── Stats.php │ │ │ ├── Status.php │ │ │ ├── Template │ │ │ │ ├── AbstractTemplateEndpoint.php │ │ │ │ ├── Delete.php │ │ │ │ ├── Exists.php │ │ │ │ ├── Get.php │ │ │ │ └── Put.php │ │ │ ├── Type │ │ │ │ └── Exists.php │ │ │ ├── Validate │ │ │ │ └── Query.php │ │ │ ├── ValidateQuery.php │ │ │ └── Warmer │ │ │ │ ├── AbstractWarmerEndpoint.php │ │ │ │ ├── Delete.php │ │ │ │ ├── Get.php │ │ │ │ └── Put.php │ │ ├── Info.php │ │ ├── MPercolate.php │ │ ├── MTermVectors.php │ │ ├── Mget.php │ │ ├── Mlt.php │ │ ├── Msearch.php │ │ ├── Percolate.php │ │ ├── Ping.php │ │ ├── Script │ │ │ ├── Delete.php │ │ │ ├── Get.php │ │ │ └── Put.php │ │ ├── Scroll.php │ │ ├── Search.php │ │ ├── SearchShards.php │ │ ├── SearchTemplate.php │ │ ├── Snapshot │ │ │ ├── Create.php │ │ │ ├── Delete.php │ │ │ ├── Get.php │ │ │ ├── Repository │ │ │ │ ├── Create.php │ │ │ │ ├── Delete.php │ │ │ │ ├── Get.php │ │ │ │ └── Verify.php │ │ │ ├── Restore.php │ │ │ └── Status.php │ │ ├── Source │ │ │ └── Get.php │ │ ├── Suggest.php │ │ ├── Template │ │ │ ├── Delete.php │ │ │ ├── Get.php │ │ │ └── Put.php │ │ ├── TermVector.php │ │ └── Update.php │ │ ├── Namespaces │ │ ├── AbstractNamespace.php │ │ ├── CatNamespace.php │ │ ├── ClusterNamespace.php │ │ ├── IndicesNamespace.php │ │ ├── NodesNamespace.php │ │ └── SnapshotNamespace.php │ │ ├── Serializers │ │ ├── AbstractJsonSerializer.php │ │ ├── ArrayToJSONSerializer.php │ │ ├── EverythingToJSONSerializer.php │ │ ├── SerializerInterface.php │ │ └── SmartSerializer.php │ │ └── Transport.php │ ├── tests │ ├── Elasticsearch │ │ └── Tests │ │ │ ├── ClientTest.php │ │ │ ├── ConnectionPool │ │ │ ├── Selectors │ │ │ │ ├── RoundRobinSelectorTest.php │ │ │ │ └── StickyRoundRobinSelectorTest.php │ │ │ ├── SniffingConnectionPoolIntegrationTest.php │ │ │ ├── SniffingConnectionPoolTest.php │ │ │ └── StaticConnectionPoolTest.php │ │ │ ├── Connections │ │ │ ├── AbstractConnectionTest.php │ │ │ ├── ConnectionFactoryTest.php │ │ │ ├── CurlMultiConnectionTest.php │ │ │ ├── GuzzleConnectionIntegrationTest.php │ │ │ └── GuzzleConnectionTest.php │ │ │ ├── Endpoints │ │ │ ├── AbstractEndpointTest.php │ │ │ ├── BulkTest.php │ │ │ ├── Cluster │ │ │ │ ├── HealthTest.php │ │ │ │ ├── Nodes │ │ │ │ │ ├── HotThreadsTest.php │ │ │ │ │ ├── InfoTest.php │ │ │ │ │ └── ShutdownTest.php │ │ │ │ ├── RerouteTest.php │ │ │ │ ├── Settings │ │ │ │ │ ├── GetTest.php │ │ │ │ │ └── PutTest.php │ │ │ │ └── StateTest.php │ │ │ ├── CountTest.php │ │ │ ├── DeleteTest.php │ │ │ ├── ExplainTest.php │ │ │ ├── GetTest.php │ │ │ ├── IndexTest.php │ │ │ ├── Indices │ │ │ │ ├── Alias │ │ │ │ │ ├── AliasesTest.php │ │ │ │ │ ├── DeleteTest.php │ │ │ │ │ ├── GetTest.php │ │ │ │ │ └── PutTest.php │ │ │ │ ├── AnalyzeTest.php │ │ │ │ ├── Cache │ │ │ │ │ └── ClearTest.php │ │ │ │ ├── CloseTest.php │ │ │ │ ├── CreateTest.php │ │ │ │ ├── DeleteTest.php │ │ │ │ ├── Exists │ │ │ │ │ ├── IndicesTest.php │ │ │ │ │ └── TypesTest.php │ │ │ │ ├── FlushTest.php │ │ │ │ ├── Gateway │ │ │ │ │ └── SnapshotTest.php │ │ │ │ ├── Mapping │ │ │ │ │ ├── DeleteTest.php │ │ │ │ │ ├── GetFieldTest.php │ │ │ │ │ ├── GetTest.php │ │ │ │ │ └── PutTest.php │ │ │ │ ├── OpenTest.php │ │ │ │ ├── OptimizeTest.php │ │ │ │ ├── RefreshTest.php │ │ │ │ ├── SegmentsTest.php │ │ │ │ ├── Settings │ │ │ │ │ ├── GetTest.php │ │ │ │ │ └── PutTest.php │ │ │ │ ├── StatusTest.php │ │ │ │ ├── Template │ │ │ │ │ ├── DeleteTest.php │ │ │ │ │ ├── GetTest.php │ │ │ │ │ └── PutTest.php │ │ │ │ ├── Validate │ │ │ │ │ └── QueryTest.php │ │ │ │ └── Warmer │ │ │ │ │ ├── DeleteTest.php │ │ │ │ │ ├── GetTest.php │ │ │ │ │ └── PutTest.php │ │ │ ├── InfoTest.php │ │ │ ├── MgetTest.php │ │ │ ├── MltTest.php │ │ │ ├── MsearchTest.php │ │ │ ├── PercolateTest.php │ │ │ ├── ScrollTest.php │ │ │ ├── SearchTest.php │ │ │ ├── SuggestTest.php │ │ │ └── UpdateTest.php │ │ │ ├── Serializers │ │ │ ├── ArrayToJSONSerializerTest.php │ │ │ ├── EverythingToJSONSerializerTest.php │ │ │ └── SmartSerializerTest.php │ │ │ ├── TransportTest.php │ │ │ └── YamlRunnerTest.php │ └── bootstrap.php │ └── util │ ├── RestSpecRunner.php │ ├── SpecParser.php │ └── templates │ └── endpoint.twig └── web.png /README.md: -------------------------------------------------------------------------------- 1 | # sgk 2 | 仿findmima的社工库代码,基于elasticsearch和PHP构建 3 | 4 | 整个架构用到的东西是
5 | 6 | 1.filebeat
7 | 2.logstash
8 | 3.ealsticsearch
9 | 5.php
10 | 6.nginx
11 | 12 | 13 | #优点 14 | 15 | 1.基于elasticsearch,在数据的处理上要优于sphinx
16 | 2.数据清洗,格式化和备份都比solr和sphinx要简单
17 | 3.速度快啊
18 | 19 | #缺点 20 | 21 | 1.前台查询语句还不够好
22 | 2.界面直接用的findmima的,有些样式还不够完美
23 | 3.希望UI/前端大牛能bugfix
24 | 25 | #后续 26 | 27 | 1.可以开源清洗规则给大家
28 | 29 | #界面 30 | 31 | ![image](https://raw.githubusercontent.com/sechacking/sgk/master/web.png) 32 | -------------------------------------------------------------------------------- /ajax.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bootstrap.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sechacking/sgk/35186c26a88e21b0992636381f1a18e1528d9ff4/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sechacking/sgk/35186c26a88e21b0992636381f1a18e1528d9ff4/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sechacking/sgk/35186c26a88e21b0992636381f1a18e1528d9ff4/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sechacking/sgk/35186c26a88e21b0992636381f1a18e1528d9ff4/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /js/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sechacking/sgk/35186c26a88e21b0992636381f1a18e1528d9ff4/js/logo.png -------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/pimple/pimple/src'), 10 | 'Guzzle\\Tests' => array($vendorDir . '/guzzle/guzzle/tests'), 11 | 'Guzzle' => array($vendorDir . '/guzzle/guzzle/src'), 12 | ); 13 | -------------------------------------------------------------------------------- /vendor/composer/autoload_psr4.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/symfony/event-dispatcher'), 10 | 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), 11 | 'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'), 12 | 'Elasticsearch\\' => array($vendorDir . '/elasticsearch/elasticsearch/src/Elasticsearch'), 13 | ); 14 | -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | $path) { 28 | $loader->set($namespace, $path); 29 | } 30 | 31 | $map = require __DIR__ . '/autoload_psr4.php'; 32 | foreach ($map as $namespace => $path) { 33 | $loader->setPsr4($namespace, $path); 34 | } 35 | 36 | $classMap = require __DIR__ . '/autoload_classmap.php'; 37 | if ($classMap) { 38 | $loader->addClassMap($classMap); 39 | } 40 | 41 | $loader->register(true); 42 | 43 | return $loader; 44 | } 45 | } 46 | 47 | function composerRequire79f8209a405f5cfaad7c235e52967e79($file) 48 | { 49 | require $file; 50 | } 51 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/.gitignore: -------------------------------------------------------------------------------- 1 | #composer related 2 | composer.lock 3 | vendor/ 4 | composer.phar 5 | 6 | #editor related 7 | .idea 8 | 9 | # OS generated files 10 | .DS_Store 11 | .DS_Store? 12 | ._* 13 | .Spotlight-V100 14 | .Trashes 15 | Icon? 16 | ehthumbs.db 17 | Thumbs.db 18 | 19 | #generator related 20 | generator/* -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "util/elasticsearch"] 2 | path = util/elasticsearch 3 | url = https://github.com/elasticsearch/elasticsearch.git 4 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | php: 3 | - "5.5" 4 | - "5.4" 5 | - "5.3" 6 | env: 7 | - ES_VERSION=0.90.0 ES_TEST_HOST=http://localhost:9200 8 | - ES_VERSION=0.90.1 ES_TEST_HOST=http://localhost:9200 9 | - ES_VERSION=0.90.2 ES_TEST_HOST=http://localhost:9200 10 | - ES_VERSION=0.90.3 ES_TEST_HOST=http://localhost:9200 11 | - ES_VERSION=0.90.4 ES_TEST_HOST=http://localhost:9200 12 | - ES_VERSION=0.90.5 ES_TEST_HOST=http://localhost:9200 13 | 14 | before_script: 15 | - composer install --dev 16 | - mkdir -p build/logs 17 | 18 | script: ./run_travis_test.sh 19 | 20 | after_script: 21 | - php vendor/bin/coveralls -v -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/NOTICE: -------------------------------------------------------------------------------- 1 | Apache v2.0 Notice: 2 | Copyright 2013-2014 Elasticsearch 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | 17 | LGPL v2.1 Notice: 18 | Copyright (C) 2013-2014 Elasticsearch 19 | 20 | This library is free software; you can redistribute it and/or 21 | modify it under the terms of the GNU Lesser General Public 22 | License as published by the Free Software Foundation; either 23 | version 2.1 of the License, or (at your option) any later version. 24 | 25 | This library is distributed in the hope that it will be useful, 26 | but WITHOUT ANY WARRANTY; without even the implied warranty of 27 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 28 | Lesser General Public License for more details. 29 | 30 | You should have received a copy of the GNU Lesser General Public 31 | License along with this library; if not, write to the Free Software 32 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "elasticsearch/elasticsearch", 3 | "description": "PHP Client for Elasticsearch", 4 | "keywords": ["search","client", "elasticsearch"], 5 | "type": "library", 6 | "license": "Apache 2", 7 | "authors": [ 8 | { 9 | "name": "Zachary Tong" 10 | } 11 | ], 12 | "require": { 13 | "php": ">=5.3.9", 14 | "monolog/monolog": "~1.11", 15 | "pimple/pimple": "~3.0", 16 | "guzzle/guzzle": "~3.0", 17 | "psr/log": "~1.0", 18 | "ext-curl": "*" 19 | }, 20 | "require-dev": { 21 | "phpunit/phpunit": "3.7.*", 22 | "mockery/mockery": "0.9.4", 23 | "athletic/athletic": "~0.1", 24 | "symfony/yaml": "2.4.3 as 2.4.2", 25 | "satooshi/php-coveralls": "dev-master", 26 | "mikey179/vfsStream": "~1.2", 27 | "twig/twig": "1.*", 28 | "cpliakas/git-wrapper": "~1.0" 29 | }, 30 | "autoload": { 31 | "psr-4": { 32 | "Elasticsearch\\": "src/Elasticsearch/" 33 | } 34 | }, 35 | "autoload-dev": { 36 | "psr-4": { 37 | "Elasticsearch\\Tests\\": "tests/Elasticsearch/Tests/", 38 | "Elasticsearch\\Benchmarks\\": "benchmarks/Elasticsearch/Benchmarks/" 39 | } 40 | }, 41 | "repositories": [ 42 | { 43 | "type": "vcs", 44 | "url": "https://github.com/polyfractal/Yaml" 45 | } 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/docs/index.asciidoc: -------------------------------------------------------------------------------- 1 | 2 | = Elasticsearch-PHP 3 | 4 | include::overview.asciidoc[] 5 | 6 | include::quickstart.asciidoc[] 7 | 8 | include::installation.asciidoc[] 9 | 10 | include::configuration.asciidoc[] 11 | 12 | include::php_json_objects.asciidoc[] 13 | 14 | include::index-operations.asciidoc[] 15 | 16 | include::indexing-operations.asciidoc[] 17 | 18 | include::search-operations.asciidoc[] 19 | 20 | include::namespaces.asciidoc[] 21 | 22 | include::connection-pool.asciidoc[] 23 | 24 | include::connections.asciidoc[] 25 | 26 | include::serializers.asciidoc[] 27 | 28 | include::php-version-requirement.asciidoc[] 29 | 30 | include::security.asciidoc[] -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/docs/overview.asciidoc: -------------------------------------------------------------------------------- 1 | == Overview 2 | 3 | This is the official PHP client for Elasticsearch. It is designed to be a very low-level client that does not stray from the REST API. 4 | 5 | All methods closely match the REST API, and furthermore, match the method structure of other language clients (ruby, python, etc). We hope that this consistency makes it easy to get started with a client, and to seamlessly switch from one language to the next with minimal effort. 6 | 7 | The client is designed to be "unopinionated". There are a few universal niceties added to the client (cluster state sniffing, round-robin requests, etc) but largely it is very barebones. This was intentional. We want a common base that more sophisticated libraries can build on top of. 8 | 9 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/run_travis_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ -z $ES_VERSION ]; then 4 | echo "No ES_VERSION specified"; 5 | exit 1; 6 | fi; 7 | 8 | ES_DIR="elasticsearch-$ES_VERSION" 9 | 10 | killall java 2>/dev/null 11 | 12 | if [ ! -d $ES_DIR ]; then 13 | echo "Downloading Elasticsearch v${ES_VERSION}" 14 | ES_URL="https://download.elasticsearch.org/elasticsearch/elasticsearch/${ES_DIR}.zip" 15 | curl -O $ES_URL 16 | unzip "${ES_DIR}.zip" 17 | fi; 18 | 19 | echo "Starting Elasticsearch v${ES_VERSION}" 20 | ./${ES_DIR}/bin/elasticsearch \ 21 | -Des.network.host=localhost \ 22 | -Des.discovery.zen.ping.multicast.enabled=false \ 23 | -Des.discovery.zen.ping_timeout=1 24 | 25 | sleep 3 26 | 27 | phpunit --bootstrap tests/bootstrap.php --no-configuration --coverage-clover build/logs/clover.xml --exclude-group ignore tests -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/AbstractFactory.php: -------------------------------------------------------------------------------- 1 | container = $container; 24 | } 25 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/EmptyLogger.php: -------------------------------------------------------------------------------- 1 | 16 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 17 | * @link http://elasticsearch.org 18 | */ 19 | class AlreadyExpiredException extends \Exception implements ElasticsearchException 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/Authentication401Exception.php: -------------------------------------------------------------------------------- 1 | 11 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 12 | * @link http://elasticsearch.org 13 | */ 14 | class Authentication401Exception extends \Exception implements ElasticsearchException 15 | { 16 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/BadMethodCallException.php: -------------------------------------------------------------------------------- 1 | 10 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 11 | * @link http://elasticsearch.org 12 | */ 13 | namespace Elasticsearch\Common\Exceptions; 14 | 15 | /** 16 | * BadMethodCallException 17 | * Denote problems with a method call (e.g. incorrect number of arguments) 18 | */ 19 | class BadMethodCallException extends \BadMethodCallException implements ElasticsearchException 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/BadRequest400Exception.php: -------------------------------------------------------------------------------- 1 | 11 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 12 | * @link http://elasticsearch.org 13 | */ 14 | class BadRequest400Exception extends \Exception implements ElasticsearchException 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/ClientErrorResponseException.php: -------------------------------------------------------------------------------- 1 | 10 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 11 | * @link http://elasticsearch.org 12 | */ 13 | namespace Elasticsearch\Common\Exceptions; 14 | 15 | /** 16 | * Class ClientErrorResponseException 17 | * @package Elasticsearch\Common\Exceptions 18 | */ 19 | class ClientErrorResponseException extends TransportException implements ElasticsearchException 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/Conflict409Exception.php: -------------------------------------------------------------------------------- 1 | 11 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 12 | * @link http://elasticsearch.org 13 | */ 14 | class Conflict409Exception extends \Exception implements ElasticsearchException 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/Curl/CouldNotConnectToHost.php: -------------------------------------------------------------------------------- 1 | 10 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 11 | * @link http://elasticsearch.org 12 | */ 13 | 14 | namespace Elasticsearch\Common\Exceptions; 15 | 16 | /** 17 | * Generic Exception interface 18 | * 19 | * @category Elasticsearch 20 | * @package Elasticsearch\Common\Exceptions 21 | * @author Zachary Tong 22 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 23 | * @link http://elasticsearch.org 24 | */ 25 | interface ElasticsearchException 26 | { 27 | } 28 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/Forbidden403Exception.php: -------------------------------------------------------------------------------- 1 | 16 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 17 | * @link http://elasticsearch.org 18 | */ 19 | class Forbidden403Exception extends \Exception implements ElasticsearchException 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/InvalidArgumentException.php: -------------------------------------------------------------------------------- 1 | 10 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 11 | * @link http://elasticsearch.org 12 | */ 13 | namespace Elasticsearch\Common\Exceptions; 14 | 15 | /** 16 | * InvalidArgumentException 17 | * Denote invalid or incorrect argument values 18 | */ 19 | class InvalidArgumentException extends \InvalidArgumentException implements ElasticsearchException 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/MaxRetriesException.php: -------------------------------------------------------------------------------- 1 | 10 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 11 | * @link http://elasticsearch.org 12 | */ 13 | namespace Elasticsearch\Common\Exceptions; 14 | 15 | /** 16 | * BadMethodCallException 17 | * Denote problems with a method call (e.g. incorrect number of arguments) 18 | */ 19 | class MaxRetriesException extends \Exception implements ElasticsearchException 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/Missing404Exception.php: -------------------------------------------------------------------------------- 1 | 10 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 11 | * @link http://elasticsearch.org 12 | */ 13 | 14 | namespace Elasticsearch\Common\Exceptions; 15 | 16 | /** 17 | * Generic Exception interface 18 | * 19 | * @category Elasticsearch 20 | * @package Elasticsearch\Common\Exceptions 21 | * @author Zachary Tong 22 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 23 | * @link http://elasticsearch.org 24 | */ 25 | class Missing404Exception extends \Exception implements ElasticsearchException 26 | { 27 | } 28 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/NoDocumentsToGetException.php: -------------------------------------------------------------------------------- 1 | 17 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 18 | * @link http://elasticsearch.org 19 | */ 20 | class NoDocumentsToGetException extends ServerErrorResponseException implements ElasticsearchException 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/NoNodesAvailableException.php: -------------------------------------------------------------------------------- 1 | 9 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 10 | * @link http://elasticsearch.org 11 | */ 12 | namespace Elasticsearch\Common\Exceptions; 13 | 14 | /** 15 | * NoNodesAvailableException 16 | */ 17 | class NoNodesAvailableException extends \Exception implements ElasticsearchException 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/NoShardAvailableException.php: -------------------------------------------------------------------------------- 1 | 16 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 17 | * @link http://elasticsearch.org 18 | */ 19 | class NoShardAvailableException extends ServerErrorResponseException implements ElasticsearchException 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/RoutingMissingException.php: -------------------------------------------------------------------------------- 1 | 17 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 18 | * @link http://elasticsearch.org 19 | */ 20 | class RoutingMissingException extends ServerErrorResponseException implements ElasticsearchException 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/RuntimeException.php: -------------------------------------------------------------------------------- 1 | 12 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 13 | * @link http://elasticsearch.org 14 | */ 15 | namespace Elasticsearch\Common\Exceptions; 16 | 17 | /** 18 | * RuntimeException 19 | */ 20 | class RuntimeException extends \RuntimeException implements ElasticsearchException 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/ScriptLangNotSupportedException.php: -------------------------------------------------------------------------------- 1 | 17 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 18 | * @link http://elasticsearch.org 19 | */ 20 | class ScriptLangNotSupportedException extends BadRequest400Exception implements ElasticsearchException 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/Serializer/JsonDeserializationError.php: -------------------------------------------------------------------------------- 1 | 9 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 10 | * @link http://elasticsearch.org 11 | */ 12 | final class JsonDeserializationError extends JsonErrorException 13 | { 14 | // noop 15 | } 16 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/Serializer/JsonErrorException.php: -------------------------------------------------------------------------------- 1 | 11 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 12 | * @link http://elasticsearch.org 13 | */ 14 | class JsonErrorException extends \Exception implements ElasticsearchException 15 | { 16 | private $input; 17 | 18 | private $result; 19 | 20 | private static $messages = array( 21 | JSON_ERROR_DEPTH => 'The maximum stack depth has been exceeded', 22 | JSON_ERROR_STATE_MISMATCH => 'Invalid or malformed JSON', 23 | JSON_ERROR_CTRL_CHAR => 'Control character error, possibly incorrectly encoded', 24 | JSON_ERROR_SYNTAX => 'Syntax error', 25 | JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded', 26 | 27 | // JSON_ERROR_* constant values that are available on PHP >= 5.5.0 28 | 6 => 'One or more recursive references in the value to be encoded', 29 | 7 => 'One or more NAN or INF values in the value to be encoded', 30 | 8 => 'A value of a type that cannot be encoded was given', 31 | 32 | ); 33 | 34 | public function __construct($code, $input, $result, $previous = null) 35 | { 36 | if (isset(self::$messages[$code]) !== true) { 37 | throw new \InvalidArgumentException(sprintf('%d is not a valid JSON error code.', $code)); 38 | } 39 | 40 | parent::__construct(self::$messages[$code], $code, $previous); 41 | $this->input = $input; 42 | $this->result = $result; 43 | } 44 | 45 | /** 46 | * @return mixed 47 | */ 48 | public function getInput() 49 | { 50 | return $this->input; 51 | } 52 | 53 | /** 54 | * @return mixed 55 | */ 56 | public function getResult() 57 | { 58 | return $this->result; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/Serializer/JsonSerializationError.php: -------------------------------------------------------------------------------- 1 | 10 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 11 | * @link http://elasticsearch.org 12 | */ 13 | final class JsonSerializationError extends JsonErrorException 14 | { 15 | // noop 16 | } 17 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/ServerErrorResponseException.php: -------------------------------------------------------------------------------- 1 | 10 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 11 | * @link http://elasticsearch.org 12 | */ 13 | namespace Elasticsearch\Common\Exceptions; 14 | 15 | /** 16 | * ServerErrorResponseException 17 | */ 18 | class ServerErrorResponseException extends TransportException implements ElasticsearchException 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/TransportException.php: -------------------------------------------------------------------------------- 1 | 10 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 11 | * @link http://elasticsearch.org 12 | */ 13 | namespace Elasticsearch\Common\Exceptions; 14 | 15 | /** 16 | * BadMethodCallException 17 | * Denote problems with a method call (e.g. incorrect number of arguments) 18 | */ 19 | class TransportException extends \Exception implements ElasticsearchException 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Common/Exceptions/UnexpectedValueException.php: -------------------------------------------------------------------------------- 1 | 10 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 11 | * @link http://elasticsearch.org 12 | */ 13 | namespace Elasticsearch\Common\Exceptions; 14 | 15 | /** 16 | * UnexpectedValueException 17 | * Denote a value that is outside the normally accepted values 18 | */ 19 | class UnexpectedValueException extends \UnexpectedValueException implements ElasticsearchException 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/Selectors/RandomSelector.php: -------------------------------------------------------------------------------- 1 | 18 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 19 | * @link http://elasticsearch.org 20 | */ 21 | class RandomSelector implements SelectorInterface 22 | { 23 | 24 | 25 | /** 26 | * Select a random connection from the provided array 27 | * 28 | * @param array $connections Array of Connection objects 29 | * 30 | * @return ConnectionInterface 31 | */ 32 | public function select($connections) 33 | { 34 | return $connections[array_rand($connections)]; 35 | 36 | } 37 | 38 | 39 | }//end class -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/Selectors/RoundRobinSelector.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | class RoundRobinSelector implements SelectorInterface 23 | { 24 | 25 | /** 26 | * @var int 27 | */ 28 | private $current = 0; 29 | 30 | 31 | /** 32 | * Select the next connectioion in the sequence 33 | * 34 | * @param array $connections Array of connections to choose from 35 | * 36 | * @return ConnectionInterface 37 | */ 38 | public function select($connections) 39 | { 40 | $this->current += 1; 41 | 42 | return $connections[$this->current % count($connections)]; 43 | 44 | } 45 | 46 | 47 | }//end class -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/Selectors/SelectorInterface.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | class StickyRoundRobinSelector implements SelectorInterface 23 | { 24 | 25 | /** 26 | * @var int 27 | */ 28 | private $current = 0; 29 | 30 | /** @var int */ 31 | private $currentCounter = 0; 32 | 33 | /** 34 | * Use current connection unless it is dead, otherwise round-robin 35 | * 36 | * @param array $connections Array of connections to choose from 37 | * 38 | * @return ConnectionInterface 39 | */ 40 | public function select($connections) 41 | { 42 | /** @var ConnectionInterface[] $connections */ 43 | if ($connections[$this->current]->isAlive()) { 44 | return $connections[$this->current]; 45 | } 46 | 47 | $this->currentCounter += 1; 48 | $this->current = $this->currentCounter % count($connections); 49 | 50 | return $connections[$this->current]; 51 | 52 | } 53 | 54 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/ConnectionFactory.php: -------------------------------------------------------------------------------- 1 | container['connection']( 22 | $hostDetails, 23 | $this->container['connectionParamsShared'], 24 | $this->container['logObject'], 25 | $this->container['traceObject'] 26 | ); 27 | } 28 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/ConnectionInterface.php: -------------------------------------------------------------------------------- 1 | 18 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 19 | * @link http://elasticsearch.org 20 | */ 21 | interface ConnectionInterface 22 | { 23 | public function __construct($hostDetails, $connectionParams, LoggerInterface $log, LoggerInterface $trace); 24 | 25 | public function getTransportSchema(); 26 | 27 | public function isAlive(); 28 | 29 | public function markAlive(); 30 | 31 | public function markDead(); 32 | 33 | public function getLastRequestInfo(); 34 | 35 | public function performRequest($method, $uri, $params = null, $body = null); 36 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Bulk.php: -------------------------------------------------------------------------------- 1 | serializer = $serializer; 29 | parent::__construct($transport); 30 | } 31 | 32 | 33 | /** 34 | * @param string|array $body 35 | * 36 | * @return $this 37 | */ 38 | public function setBody($body) 39 | { 40 | if (isset($body) !== true) { 41 | return $this; 42 | } 43 | 44 | if (is_array($body) === true) { 45 | $bulkBody = ""; 46 | foreach ($body as $item) { 47 | $bulkBody .= $this->serializer->serialize($item)."\n"; 48 | } 49 | $body = $bulkBody; 50 | } 51 | 52 | $this->body = $body; 53 | return $this; 54 | } 55 | 56 | /** 57 | * @return string 58 | */ 59 | protected function getURI() 60 | { 61 | return $this->getOptionalURI('_bulk'); 62 | 63 | } 64 | 65 | /** 66 | * @return string[] 67 | */ 68 | protected function getParamWhitelist() 69 | { 70 | return array( 71 | 'consistency', 72 | 'refresh', 73 | 'replication', 74 | 'type', 75 | ); 76 | } 77 | 78 | /** 79 | * @return string 80 | */ 81 | protected function getMethod() 82 | { 83 | return 'POST'; 84 | } 85 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/BulkEndpointInterface.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Aliases extends AbstractEndpoint 24 | { 25 | // A comma-separated list of alias names to return 26 | private $name; 27 | 28 | 29 | /** 30 | * @param $name 31 | * 32 | * @return $this 33 | */ 34 | public function setName($name) 35 | { 36 | if (isset($name) !== true) { 37 | return $this; 38 | } 39 | 40 | $this->name = $name; 41 | return $this; 42 | } 43 | 44 | 45 | /** 46 | * @return string 47 | */ 48 | protected function getURI() 49 | { 50 | $name = $this->name; 51 | $uri = "/_cat/aliases"; 52 | 53 | if (isset($name) === true) { 54 | $uri = "/_cat/aliases/$name"; 55 | } 56 | 57 | return $uri; 58 | } 59 | 60 | 61 | /** 62 | * @return string[] 63 | */ 64 | protected function getParamWhitelist() 65 | { 66 | return array( 67 | 'local', 68 | 'master_timeout', 69 | 'h', 70 | 'help', 71 | 'v', 72 | ); 73 | } 74 | 75 | 76 | /** 77 | * @return string 78 | */ 79 | protected function getMethod() 80 | { 81 | return 'GET'; 82 | } 83 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cat/Allocation.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Allocation extends AbstractEndpoint 24 | { 25 | // A comma-separated list of node IDs or names to limit the returned information 26 | private $node_id; 27 | 28 | 29 | /** 30 | * @param $node_id 31 | * 32 | * @return $this 33 | */ 34 | public function setNodeId($node_id) 35 | { 36 | if (isset($node_id) !== true) { 37 | return $this; 38 | } 39 | 40 | $this->node_id = $node_id; 41 | return $this; 42 | } 43 | 44 | 45 | /** 46 | * @return string 47 | */ 48 | protected function getURI() 49 | { 50 | $node_id = $this->node_id; 51 | $uri = "/_cat/allocation"; 52 | 53 | if (isset($node_id) === true) { 54 | $uri = "/_cat/allocation/$node_id"; 55 | } 56 | 57 | return $uri; 58 | } 59 | 60 | 61 | /** 62 | * @return string[] 63 | */ 64 | protected function getParamWhitelist() 65 | { 66 | return array( 67 | 'bytes', 68 | 'local', 69 | 'master_timeout', 70 | 'h', 71 | 'help', 72 | 'v', 73 | ); 74 | } 75 | 76 | 77 | /** 78 | * @return string 79 | */ 80 | protected function getMethod() 81 | { 82 | return 'GET'; 83 | } 84 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cat/Count.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Count extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $index = $this->index; 31 | $uri = "/_cat/count"; 32 | 33 | if (isset($index) === true) { 34 | $uri = "/_cat/count/$index"; 35 | } 36 | 37 | return $uri; 38 | } 39 | 40 | 41 | /** 42 | * @return string[] 43 | */ 44 | protected function getParamWhitelist() 45 | { 46 | return array( 47 | 'local', 48 | 'master_timeout', 49 | 'h', 50 | 'help', 51 | 'v', 52 | ); 53 | } 54 | 55 | 56 | /** 57 | * @return string 58 | */ 59 | protected function getMethod() 60 | { 61 | return 'GET'; 62 | } 63 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cat/Fielddata.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Fielddata extends AbstractEndpoint 24 | { 25 | private $fields; 26 | 27 | 28 | /** 29 | * @param $fields 30 | * 31 | * @return $this 32 | */ 33 | public function setFields($fields) 34 | { 35 | if (isset($fields) !== true) { 36 | return $this; 37 | } 38 | 39 | $this->fields = $fields; 40 | return $this; 41 | } 42 | 43 | 44 | /** 45 | * @return string 46 | */ 47 | protected function getURI() 48 | { 49 | $fields = $this->fields; 50 | $uri = "/_cat/fielddata"; 51 | 52 | if (isset($fields) === true) { 53 | $uri = "/_cat/fielddata/$fields"; 54 | } 55 | 56 | return $uri; 57 | } 58 | 59 | 60 | /** 61 | * @return string[] 62 | */ 63 | protected function getParamWhitelist() 64 | { 65 | return array( 66 | 'local', 67 | 'master_timeout', 68 | 'h', 69 | 'help', 70 | 'v', 71 | ); 72 | } 73 | 74 | 75 | /** 76 | * @return string 77 | */ 78 | protected function getMethod() 79 | { 80 | return 'GET'; 81 | } 82 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cat/Health.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Health extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $uri = "/_cat/health"; 31 | 32 | 33 | return $uri; 34 | } 35 | 36 | 37 | /** 38 | * @return string[] 39 | */ 40 | protected function getParamWhitelist() 41 | { 42 | return array( 43 | 'local', 44 | 'master_timeout', 45 | 'h', 46 | 'help', 47 | 'ts', 48 | 'v', 49 | ); 50 | } 51 | 52 | 53 | /** 54 | * @return string 55 | */ 56 | protected function getMethod() 57 | { 58 | return 'GET'; 59 | } 60 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cat/Help.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Help extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $uri = "/_cat"; 31 | 32 | 33 | return $uri; 34 | } 35 | 36 | 37 | /** 38 | * @return string[] 39 | */ 40 | protected function getParamWhitelist() 41 | { 42 | return array( 43 | 'help', 44 | ); 45 | } 46 | 47 | 48 | /** 49 | * @return string 50 | */ 51 | protected function getMethod() 52 | { 53 | return 'GET'; 54 | } 55 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cat/Indices.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Indices extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $index = $this->index; 31 | $uri = "/_cat/indices"; 32 | 33 | if (isset($index) === true) { 34 | $uri = "/_cat/indices/$index"; 35 | } 36 | 37 | return $uri; 38 | } 39 | 40 | 41 | /** 42 | * @return string[] 43 | */ 44 | protected function getParamWhitelist() 45 | { 46 | return array( 47 | 'bytes', 48 | 'local', 49 | 'master_timeout', 50 | 'h', 51 | 'help', 52 | 'pri', 53 | 'v', 54 | ); 55 | } 56 | 57 | 58 | /** 59 | * @return string 60 | */ 61 | protected function getMethod() 62 | { 63 | return 'GET'; 64 | } 65 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cat/Master.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Master extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $uri = "/_cat/master"; 31 | 32 | 33 | return $uri; 34 | } 35 | 36 | 37 | /** 38 | * @return string[] 39 | */ 40 | protected function getParamWhitelist() 41 | { 42 | return array( 43 | 'local', 44 | 'master_timeout', 45 | 'h', 46 | 'help', 47 | 'v', 48 | ); 49 | } 50 | 51 | 52 | /** 53 | * @return string 54 | */ 55 | protected function getMethod() 56 | { 57 | return 'GET'; 58 | } 59 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cat/Nodes.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Nodes extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $uri = "/_cat/nodes"; 31 | 32 | 33 | return $uri; 34 | } 35 | 36 | 37 | /** 38 | * @return string[] 39 | */ 40 | protected function getParamWhitelist() 41 | { 42 | return array( 43 | 'local', 44 | 'master_timeout', 45 | 'h', 46 | 'help', 47 | 'v', 48 | ); 49 | } 50 | 51 | 52 | /** 53 | * @return string 54 | */ 55 | protected function getMethod() 56 | { 57 | return 'GET'; 58 | } 59 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cat/PendingTasks.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class PendingTasks extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $uri = "/_cat/pending_tasks"; 31 | 32 | 33 | return $uri; 34 | } 35 | 36 | 37 | /** 38 | * @return string[] 39 | */ 40 | protected function getParamWhitelist() 41 | { 42 | return array( 43 | 'local', 44 | 'master_timeout', 45 | 'h', 46 | 'help', 47 | 'v', 48 | ); 49 | } 50 | 51 | 52 | /** 53 | * @return string 54 | */ 55 | protected function getMethod() 56 | { 57 | return 'GET'; 58 | } 59 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cat/Plugins.php: -------------------------------------------------------------------------------- 1 | 14 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 15 | * @link http://elasticsearch.org 16 | */ 17 | 18 | class Plugins extends AbstractEndpoint 19 | { 20 | /** 21 | * @return string 22 | */ 23 | protected function getURI() 24 | { 25 | $uri = "/_cat/plugins"; 26 | 27 | 28 | return $uri; 29 | } 30 | 31 | 32 | /** 33 | * @return string[] 34 | */ 35 | protected function getParamWhitelist() 36 | { 37 | return array( 38 | 'local', 39 | 'master_timeout', 40 | 'h', 41 | 'help', 42 | 'v', 43 | ); 44 | } 45 | 46 | 47 | /** 48 | * @return string 49 | */ 50 | protected function getMethod() 51 | { 52 | return 'GET'; 53 | } 54 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cat/Recovery.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Recovery extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $index = $this->index; 31 | $uri = "/_cat/recovery"; 32 | 33 | if (isset($index) === true) { 34 | $uri = "/_cat/recovery/$index"; 35 | } 36 | 37 | return $uri; 38 | } 39 | 40 | 41 | /** 42 | * @return string[] 43 | */ 44 | protected function getParamWhitelist() 45 | { 46 | return array( 47 | 'bytes', 48 | 'local', 49 | 'master_timeout', 50 | 'h', 51 | 'help', 52 | 'v', 53 | ); 54 | } 55 | 56 | 57 | /** 58 | * @return string 59 | */ 60 | protected function getMethod() 61 | { 62 | return 'GET'; 63 | } 64 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cat/Segments.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Segments extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $index = $this->index; 31 | $uri = "/_cat/segments"; 32 | 33 | if (isset($index) === true) { 34 | $uri = "/_cat/segments/$index"; 35 | } 36 | 37 | return $uri; 38 | } 39 | 40 | 41 | /** 42 | * @return string[] 43 | */ 44 | protected function getParamWhitelist() 45 | { 46 | return array( 47 | 'h', 48 | 'help', 49 | 'v', 50 | ); 51 | } 52 | 53 | 54 | /** 55 | * @return string 56 | */ 57 | protected function getMethod() 58 | { 59 | return 'GET'; 60 | } 61 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cat/Shards.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Shards extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $index = $this->index; 31 | $uri = "/_cat/shards"; 32 | 33 | if (isset($index) === true) { 34 | $uri = "/_cat/shards/$index"; 35 | } 36 | 37 | return $uri; 38 | } 39 | 40 | 41 | /** 42 | * @return string[] 43 | */ 44 | protected function getParamWhitelist() 45 | { 46 | return array( 47 | 'local', 48 | 'master_timeout', 49 | 'h', 50 | 'help', 51 | 'v', 52 | ); 53 | } 54 | 55 | 56 | /** 57 | * @return string 58 | */ 59 | protected function getMethod() 60 | { 61 | return 'GET'; 62 | } 63 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cat/ThreadPool.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class ThreadPool extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $uri = "/_cat/thread_pool"; 31 | 32 | return $uri; 33 | } 34 | 35 | 36 | /** 37 | * @return string[] 38 | */ 39 | protected function getParamWhitelist() 40 | { 41 | return array( 42 | 'local', 43 | 'master_timeout', 44 | 'h', 45 | 'help', 46 | 'v', 47 | 'full_id', 48 | ); 49 | } 50 | 51 | 52 | /** 53 | * @return string 54 | */ 55 | protected function getMethod() 56 | { 57 | return 'GET'; 58 | } 59 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/ClearScroll.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Clearscroll extends AbstractEndpoint 24 | { 25 | // A comma-separated list of scroll IDs to clear 26 | private $scroll_id; 27 | 28 | 29 | /** 30 | * @param $scroll_id 31 | * 32 | * @return $this 33 | */ 34 | public function setScroll_Id($scroll_id) 35 | { 36 | if (isset($scroll_id) !== true) { 37 | return $this; 38 | } 39 | 40 | $this->scroll_id = $scroll_id; 41 | return $this; 42 | } 43 | 44 | 45 | /** 46 | * @throws \Elasticsearch\Common\Exceptions\RuntimeException 47 | * @return string 48 | */ 49 | protected function getURI() 50 | { 51 | if (isset($this->scroll_id) !== true) { 52 | throw new Exceptions\RuntimeException( 53 | 'scroll_id is required for Clearscroll' 54 | ); 55 | } 56 | $scroll_id = $this->scroll_id; 57 | $uri = "/_search/scroll/$scroll_id"; 58 | 59 | if (isset($scroll_id) === true) { 60 | $uri = "/_search/scroll/$scroll_id"; 61 | } 62 | 63 | return $uri; 64 | } 65 | 66 | 67 | /** 68 | * @return string[] 69 | */ 70 | protected function getParamWhitelist() 71 | { 72 | return array( 73 | ); 74 | } 75 | 76 | 77 | /** 78 | * @return string 79 | */ 80 | protected function getMethod() 81 | { 82 | return 'DELETE'; 83 | } 84 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cluster/Health.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Health extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $index = $this->index; 31 | $uri = "/_cluster/health"; 32 | 33 | if (isset($index) === true) { 34 | $uri = "/_cluster/health/$index"; 35 | } 36 | 37 | return $uri; 38 | } 39 | 40 | 41 | /** 42 | * @return string[] 43 | */ 44 | protected function getParamWhitelist() 45 | { 46 | return array( 47 | 'level', 48 | 'local', 49 | 'master_timeout', 50 | 'timeout', 51 | 'wait_for_active_shards', 52 | 'wait_for_nodes', 53 | 'wait_for_relocating_shards', 54 | 'wait_for_status', 55 | ); 56 | } 57 | 58 | 59 | /** 60 | * @return string 61 | */ 62 | protected function getMethod() 63 | { 64 | return 'GET'; 65 | } 66 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cluster/Nodes/AbstractNodesEndpoint.php: -------------------------------------------------------------------------------- 1 | nodeID = $nodeID; 42 | return $this; 43 | } 44 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cluster/Nodes/HotThreads.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class HotThreads extends AbstractNodesEndpoint 24 | { 25 | 26 | /** 27 | * @return string 28 | */ 29 | protected function getURI() 30 | { 31 | $node_id = $this->nodeID; 32 | $uri = "/_cluster/nodes/hotthreads"; 33 | 34 | if (isset($node_id) === true) { 35 | $uri = "/_cluster/nodes/$node_id/hotthreads"; 36 | } 37 | 38 | return $uri; 39 | } 40 | 41 | 42 | /** 43 | * @return string[] 44 | */ 45 | protected function getParamWhitelist() 46 | { 47 | return array( 48 | 'interval', 49 | 'snapshots', 50 | 'threads', 51 | 'type', 52 | ); 53 | } 54 | 55 | 56 | /** 57 | * @return string 58 | */ 59 | protected function getMethod() 60 | { 61 | return 'GET'; 62 | } 63 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cluster/Nodes/Shutdown.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Shutdown extends AbstractNodesEndpoint 24 | { 25 | 26 | /** 27 | * @return string 28 | */ 29 | protected function getURI() 30 | { 31 | $node_id = $this->nodeID; 32 | $uri = "/_shutdown"; 33 | 34 | if (isset($node_id) === true) { 35 | $uri = "/_cluster/nodes/$node_id/_shutdown"; 36 | } 37 | 38 | return $uri; 39 | } 40 | 41 | 42 | /** 43 | * @return string[] 44 | */ 45 | protected function getParamWhitelist() 46 | { 47 | return array( 48 | 'delay', 49 | 'exit', 50 | ); 51 | } 52 | 53 | 54 | /** 55 | * @return string 56 | */ 57 | protected function getMethod() 58 | { 59 | return 'POST'; 60 | } 61 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cluster/PendingTasks.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class PendingTasks extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $uri = "/_cluster/pending_tasks"; 31 | 32 | return $uri; 33 | } 34 | 35 | 36 | /** 37 | * @return string[] 38 | */ 39 | protected function getParamWhitelist() 40 | { 41 | return array( 42 | 'local', 43 | 'master_timeout', 44 | ); 45 | } 46 | 47 | 48 | /** 49 | * @return string 50 | */ 51 | protected function getMethod() 52 | { 53 | return 'GET'; 54 | } 55 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cluster/Reroute.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Reroute extends AbstractEndpoint 24 | { 25 | /** 26 | * @param array $body 27 | * 28 | * @throws \Elasticsearch\Common\Exceptions\InvalidArgumentException 29 | * @return $this 30 | */ 31 | public function setBody($body) 32 | { 33 | if (isset($body) !== true) { 34 | return $this; 35 | } 36 | 37 | 38 | $this->body = $body; 39 | return $this; 40 | } 41 | 42 | 43 | 44 | /** 45 | * @return string 46 | */ 47 | protected function getURI() 48 | { 49 | $uri = "/_cluster/reroute"; 50 | 51 | 52 | return $uri; 53 | } 54 | 55 | 56 | /** 57 | * @return string[] 58 | */ 59 | protected function getParamWhitelist() 60 | { 61 | return array( 62 | 'dry_run', 63 | 'filter_metadata', 64 | 'master_timeout', 65 | 'timeout', 66 | 'explain', 67 | 'metric' 68 | ); 69 | } 70 | 71 | 72 | /** 73 | * @return string 74 | */ 75 | protected function getMethod() 76 | { 77 | return 'POST'; 78 | } 79 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cluster/Settings/Get.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Get extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $uri = "/_cluster/settings"; 31 | 32 | 33 | return $uri; 34 | } 35 | 36 | 37 | /** 38 | * @return string[] 39 | */ 40 | protected function getParamWhitelist() 41 | { 42 | return array( 43 | 'flat_settings', 44 | 'master_timeout', 45 | 'timeout', 46 | ); 47 | } 48 | 49 | 50 | /** 51 | * @return string 52 | */ 53 | protected function getMethod() 54 | { 55 | return 'GET'; 56 | } 57 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cluster/Settings/Put.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Put extends AbstractEndpoint 24 | { 25 | /** 26 | * @param array $body 27 | * 28 | * @throws \Elasticsearch\Common\Exceptions\InvalidArgumentException 29 | * @return $this 30 | */ 31 | public function setBody($body) 32 | { 33 | if (isset($body) !== true) { 34 | return $this; 35 | } 36 | 37 | 38 | $this->body = $body; 39 | return $this; 40 | } 41 | 42 | 43 | 44 | /** 45 | * @return string 46 | */ 47 | protected function getURI() 48 | { 49 | $uri = "/_cluster/settings"; 50 | 51 | 52 | return $uri; 53 | } 54 | 55 | 56 | /** 57 | * @return string[] 58 | */ 59 | protected function getParamWhitelist() 60 | { 61 | return array( 62 | 'flat_settings', 63 | ); 64 | } 65 | 66 | 67 | /** 68 | * @return string 69 | */ 70 | protected function getMethod() 71 | { 72 | return 'PUT'; 73 | } 74 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cluster/Stats.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Stats extends AbstractEndpoint 24 | { 25 | // A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes 26 | private $nodeID; 27 | 28 | 29 | /** 30 | * @param $node_id 31 | * 32 | * @return $this 33 | */ 34 | public function setNodeID($node_id) 35 | { 36 | if (isset($node_id) !== true) { 37 | return $this; 38 | } 39 | 40 | $this->nodeID = $node_id; 41 | return $this; 42 | } 43 | 44 | 45 | /** 46 | * @return string 47 | */ 48 | protected function getURI() 49 | { 50 | $node_id = $this->nodeID; 51 | $uri = "/_cluster/stats"; 52 | 53 | if (isset($node_id) === true) { 54 | $uri = "/_cluster/stats/nodes/$node_id"; 55 | } 56 | 57 | return $uri; 58 | } 59 | 60 | 61 | /** 62 | * @return string[] 63 | */ 64 | protected function getParamWhitelist() 65 | { 66 | return array( 67 | 'flat_settings', 68 | 'human', 69 | ); 70 | } 71 | 72 | 73 | /** 74 | * @return string 75 | */ 76 | protected function getMethod() 77 | { 78 | return 'GET'; 79 | } 80 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Alias/AbstractAliasEndpoint.php: -------------------------------------------------------------------------------- 1 | name = urlencode($name); 39 | return $this; 40 | } 41 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Alias/Exists.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Exists extends AbstractEndpoint 24 | { 25 | // A comma-separated list of alias names to return 26 | private $name; 27 | 28 | 29 | /** 30 | * @param $name 31 | * 32 | * @return $this 33 | */ 34 | public function setName($name) 35 | { 36 | if (isset($name) !== true) { 37 | return $this; 38 | } 39 | 40 | $this->name = $name; 41 | return $this; 42 | } 43 | 44 | 45 | /** 46 | * @return string 47 | */ 48 | protected function getURI() 49 | { 50 | $index = $this->index; 51 | $name = $this->name; 52 | $uri = "/_alias/$name"; 53 | 54 | if (isset($index) === true && isset($name) === true) { 55 | $uri = "/$index/_alias/$name"; 56 | } elseif (isset($index) === true) { 57 | $uri = "/$index/_alias"; 58 | } elseif (isset($name) === true) { 59 | $uri = "/_alias/$name"; 60 | } 61 | 62 | return $uri; 63 | } 64 | 65 | 66 | /** 67 | * @return string[] 68 | */ 69 | protected function getParamWhitelist() 70 | { 71 | return array( 72 | 'ignore_unavailable', 73 | 'allow_no_indices', 74 | 'expand_wildcards', 75 | 'local', 76 | ); 77 | } 78 | 79 | 80 | /** 81 | * @return string 82 | */ 83 | protected function getMethod() 84 | { 85 | return 'HEAD'; 86 | } 87 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Alias/Get.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Get extends AbstractEndpoint 24 | { 25 | // A comma-separated list of alias names to return 26 | private $name; 27 | 28 | 29 | /** 30 | * @param $name 31 | * 32 | * @return $this 33 | */ 34 | public function setName($name) 35 | { 36 | if (isset($name) !== true) { 37 | return $this; 38 | } 39 | 40 | $this->name = $name; 41 | return $this; 42 | } 43 | 44 | 45 | /** 46 | * @return string 47 | */ 48 | protected function getURI() 49 | { 50 | $index = $this->index; 51 | $name = $this->name; 52 | $uri = "/_alias"; 53 | 54 | if (isset($index) === true && isset($name) === true) { 55 | $uri = "/$index/_alias/$name"; 56 | } else if (isset($index) === true) { 57 | $uri = "/$index/_alias"; 58 | } else if (isset($name) === true) { 59 | $uri = "/_alias/$name"; 60 | } 61 | 62 | return $uri; 63 | } 64 | 65 | 66 | /** 67 | * @return string[] 68 | */ 69 | protected function getParamWhitelist() 70 | { 71 | return array( 72 | 'ignore_unavailable', 73 | 'allow_no_indices', 74 | 'expand_wildcards', 75 | 'local', 76 | ); 77 | } 78 | 79 | 80 | /** 81 | * @return string 82 | */ 83 | protected function getMethod() 84 | { 85 | return 'GET'; 86 | } 87 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Aliases/Get.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Get extends AbstractEndpoint 24 | { 25 | // A comma-separated list of alias names to filter 26 | private $name; 27 | 28 | 29 | /** 30 | * @param $name 31 | * 32 | * @return $this 33 | */ 34 | public function setName($name) 35 | { 36 | if (isset($name) !== true) { 37 | return $this; 38 | } 39 | 40 | $this->name = $name; 41 | return $this; 42 | } 43 | 44 | 45 | /** 46 | * @return string 47 | */ 48 | protected function getURI() 49 | { 50 | $index = $this->index; 51 | $name = $this->name; 52 | $uri = "/_aliases"; 53 | 54 | if (isset($index) === true && isset($name) === true) { 55 | $uri = "/$index/_aliases/$name"; 56 | } elseif (isset($name) === true) { 57 | $uri = "/_aliases/$name"; 58 | } elseif (isset($index) === true) { 59 | $uri = "/$index/_aliases"; 60 | } 61 | 62 | return $uri; 63 | } 64 | 65 | 66 | /** 67 | * @return string[] 68 | */ 69 | protected function getParamWhitelist() 70 | { 71 | return array( 72 | 'timeout', 73 | 'local', 74 | ); 75 | } 76 | 77 | 78 | /** 79 | * @return string 80 | */ 81 | protected function getMethod() 82 | { 83 | return 'GET'; 84 | } 85 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Aliases/Update.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Update extends AbstractEndpoint 24 | { 25 | /** 26 | * @param array $body 27 | * 28 | * @throws \Elasticsearch\Common\Exceptions\InvalidArgumentException 29 | * @return $this 30 | */ 31 | public function setBody($body) 32 | { 33 | if (isset($body) !== true) { 34 | return $this; 35 | } 36 | 37 | 38 | $this->body = $body; 39 | return $this; 40 | } 41 | 42 | 43 | 44 | /** 45 | * @return string 46 | */ 47 | protected function getURI() 48 | { 49 | $uri = "/_aliases"; 50 | 51 | 52 | return $uri; 53 | } 54 | 55 | 56 | /** 57 | * @return string[] 58 | */ 59 | protected function getParamWhitelist() 60 | { 61 | return array( 62 | 'timeout', 63 | 'master_timeout', 64 | ); 65 | } 66 | 67 | 68 | /** 69 | * @return array 70 | * @throws \Elasticsearch\Common\Exceptions\RuntimeException 71 | */ 72 | protected function getBody() 73 | { 74 | if (isset($this->body) !== true) { 75 | throw new Exceptions\RuntimeException('Body is required for Update Aliases'); 76 | } 77 | return $this->body; 78 | } 79 | 80 | 81 | /** 82 | * @return string 83 | */ 84 | protected function getMethod() 85 | { 86 | return 'POST'; 87 | } 88 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Analyze.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Analyze extends AbstractEndpoint 24 | { 25 | /** 26 | * @param array $body 27 | * 28 | * @throws \Elasticsearch\Common\Exceptions\InvalidArgumentException 29 | * @return $this 30 | */ 31 | public function setBody($body) 32 | { 33 | if (isset($body) !== true) { 34 | return $this; 35 | } 36 | 37 | 38 | $this->body = $body; 39 | return $this; 40 | } 41 | 42 | 43 | 44 | /** 45 | * @return string 46 | */ 47 | protected function getURI() 48 | { 49 | $index = $this->index; 50 | $uri = "/_analyze"; 51 | 52 | if (isset($index) === true) { 53 | $uri = "/$index/_analyze"; 54 | } 55 | 56 | return $uri; 57 | } 58 | 59 | 60 | /** 61 | * @return string[] 62 | */ 63 | protected function getParamWhitelist() 64 | { 65 | return array( 66 | 'analyzer', 67 | 'field', 68 | 'filters', 69 | 'index', 70 | 'prefer_local', 71 | 'text', 72 | 'tokenizer', 73 | 'format', 74 | ); 75 | } 76 | 77 | 78 | /** 79 | * @return string 80 | */ 81 | protected function getMethod() 82 | { 83 | return 'GET'; 84 | } 85 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Cache/Clear.php: -------------------------------------------------------------------------------- 1 | index; 26 | $uri = "/_cache/clear"; 27 | 28 | if (isset($index) === true) { 29 | $uri = "/$index/_cache/clear"; 30 | } 31 | return $uri; 32 | } 33 | 34 | /** 35 | * @return string[] 36 | */ 37 | protected function getParamWhitelist() 38 | { 39 | return array( 40 | 'field_data', 41 | 'fielddata', 42 | 'fields', 43 | 'filter', 44 | 'filter_cache', 45 | 'filter_keys', 46 | 'id', 47 | 'id_cache', 48 | 'index', 49 | 'recycler', 50 | 'ignore_unavailable', 51 | 'allow_no_indices', 52 | 'expand_wildcards' 53 | ); 54 | } 55 | 56 | /** 57 | * @return string 58 | */ 59 | protected function getMethod() 60 | { 61 | return 'POST'; 62 | } 63 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/ClearCache.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class ClearCache extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $index = $this->index; 31 | $uri = "/_cache/clear"; 32 | 33 | if (isset($index) === true) { 34 | $uri = "/$index/_cache/clear"; 35 | } 36 | 37 | return $uri; 38 | } 39 | 40 | 41 | /** 42 | * @return string[] 43 | */ 44 | protected function getParamWhitelist() 45 | { 46 | return array( 47 | 'field_data', 48 | 'fielddata', 49 | 'fields', 50 | 'filter', 51 | 'filter_cache', 52 | 'filter_keys', 53 | 'id', 54 | 'id_cache', 55 | 'ignore_unavailable', 56 | 'allow_no_indices', 57 | 'expand_wildcards', 58 | 'index', 59 | 'recycler', 60 | ); 61 | } 62 | 63 | 64 | /** 65 | * @return string 66 | */ 67 | protected function getMethod() 68 | { 69 | return 'GET'; 70 | } 71 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Close.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Close extends AbstractEndpoint 24 | { 25 | /** 26 | * @throws \Elasticsearch\Common\Exceptions\RuntimeException 27 | * @return string 28 | */ 29 | protected function getURI() 30 | { 31 | if (isset($this->index) !== true) { 32 | throw new Exceptions\RuntimeException( 33 | 'index is required for Close' 34 | ); 35 | } 36 | $index = $this->index; 37 | $uri = "/$index/_close"; 38 | 39 | if (isset($index) === true) { 40 | $uri = "/$index/_close"; 41 | } 42 | 43 | return $uri; 44 | } 45 | 46 | 47 | /** 48 | * @return string[] 49 | */ 50 | protected function getParamWhitelist() 51 | { 52 | return array( 53 | 'timeout', 54 | 'master_timeout', 55 | 'ignore_unavailable', 56 | 'allow_no_indices', 57 | 'expand_wildcards', 58 | ); 59 | } 60 | 61 | 62 | /** 63 | * @return string 64 | */ 65 | protected function getMethod() 66 | { 67 | return 'POST'; 68 | } 69 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Delete.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Delete extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $index = $this->index; 31 | $uri = "/$index"; 32 | 33 | if (isset($index) === true) { 34 | $uri = "/$index"; 35 | } 36 | 37 | return $uri; 38 | } 39 | 40 | 41 | /** 42 | * @return string[] 43 | */ 44 | protected function getParamWhitelist() 45 | { 46 | return array( 47 | 'timeout', 48 | 'master_timeout', 49 | ); 50 | } 51 | 52 | 53 | /** 54 | * @return string 55 | */ 56 | protected function getMethod() 57 | { 58 | return 'DELETE'; 59 | } 60 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Exists.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Exists extends AbstractEndpoint 24 | { 25 | /** 26 | * @throws \Elasticsearch\Common\Exceptions\RuntimeException 27 | * @return string 28 | */ 29 | protected function getURI() 30 | { 31 | if (isset($this->index) !== true) { 32 | throw new Exceptions\RuntimeException( 33 | 'index is required for Exists' 34 | ); 35 | } 36 | $index = $this->index; 37 | $uri = "/$index"; 38 | 39 | if (isset($index) === true) { 40 | $uri = "/$index"; 41 | } 42 | 43 | return $uri; 44 | } 45 | 46 | 47 | /** 48 | * @return string[] 49 | */ 50 | protected function getParamWhitelist() 51 | { 52 | return array( 53 | 'ignore_unavailable', 54 | 'allow_no_indices', 55 | 'expand_wildcards', 56 | 'local', 57 | ); 58 | } 59 | 60 | 61 | /** 62 | * @return string 63 | */ 64 | protected function getMethod() 65 | { 66 | return 'HEAD'; 67 | } 68 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Exists/Types.php: -------------------------------------------------------------------------------- 1 | index) !== true) { 28 | throw new Exceptions\RuntimeException( 29 | 'index is required for Types Exists' 30 | ); 31 | } 32 | 33 | if (isset($this->type) !== true) { 34 | throw new Exceptions\RuntimeException( 35 | 'type is required for Types Exists' 36 | ); 37 | } 38 | 39 | $index = $this->index; 40 | $type = $this->type; 41 | $uri = "/$index/$type"; 42 | 43 | return $uri; 44 | } 45 | 46 | /** 47 | * @return string[] 48 | */ 49 | protected function getParamWhitelist() 50 | { 51 | return array( 52 | 'ignore_unavailable', 53 | 'allow_no_indices', 54 | 'expand_wildcards' 55 | ); 56 | } 57 | 58 | /** 59 | * @return string 60 | */ 61 | protected function getMethod() 62 | { 63 | return 'HEAD'; 64 | } 65 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Flush.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Flush extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $index = $this->index; 31 | $uri = "/_flush"; 32 | 33 | if (isset($index) === true) { 34 | $uri = "/$index/_flush"; 35 | } 36 | 37 | return $uri; 38 | } 39 | 40 | 41 | /** 42 | * @return string[] 43 | */ 44 | protected function getParamWhitelist() 45 | { 46 | return array( 47 | 'force', 48 | 'full', 49 | 'ignore_unavailable', 50 | 'allow_no_indices', 51 | 'expand_wildcards', 52 | ); 53 | } 54 | 55 | 56 | /** 57 | * @return string 58 | */ 59 | protected function getMethod() 60 | { 61 | return 'GET'; 62 | } 63 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Gateway/Snapshot.php: -------------------------------------------------------------------------------- 1 | index; 26 | $uri = "/_gateway/snapshot"; 27 | 28 | 29 | if (isset($index) === true) { 30 | $uri = "/$index/_gateway/snapshot"; 31 | } 32 | 33 | return $uri; 34 | } 35 | 36 | /** 37 | * @return string[] 38 | */ 39 | protected function getParamWhitelist() 40 | { 41 | return array( 42 | 'ignore_unavailable', 43 | 'allow_no_indices', 44 | 'expand_wildcards' 45 | ); 46 | } 47 | 48 | /** 49 | * @return string 50 | */ 51 | protected function getMethod() 52 | { 53 | return 'POST'; 54 | } 55 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Get.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Get extends AbstractEndpoint 24 | { 25 | 26 | private $feature; 27 | 28 | /** 29 | * @throws \Elasticsearch\Common\Exceptions\RuntimeException 30 | * @return string 31 | */ 32 | protected function getURI() 33 | { 34 | if (isset($this->index) !== true) { 35 | throw new Exceptions\RuntimeException( 36 | 'index is required for Get' 37 | ); 38 | } 39 | $index = $this->index; 40 | $feature = $this->feature; 41 | $uri = "/$index"; 42 | 43 | if (isset($feature) === true) { 44 | $uri = "/$index/$feature"; 45 | } 46 | 47 | return $uri; 48 | } 49 | 50 | public function setFeature($feature) 51 | { 52 | if (isset($feature) !== true) { 53 | return $this; 54 | } 55 | 56 | if (is_array($feature) === true) { 57 | $feature = implode(",", $feature); 58 | } 59 | 60 | $this->feature = $feature; 61 | return $this; 62 | } 63 | 64 | 65 | /** 66 | * @return string[] 67 | */ 68 | protected function getParamWhitelist() 69 | { 70 | return array( 71 | 'local', 72 | 'ignore_unavailable', 73 | 'allow_no_indices', 74 | 'expand_wildcards', 75 | ); 76 | } 77 | 78 | 79 | /** 80 | * @return string 81 | */ 82 | protected function getMethod() 83 | { 84 | return 'GET'; 85 | } 86 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Mapping/Delete.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Delete extends AbstractEndpoint 24 | { 25 | /** 26 | * @throws \Elasticsearch\Common\Exceptions\RuntimeException 27 | * @return string 28 | */ 29 | protected function getURI() 30 | { 31 | if (isset($this->index) !== true) { 32 | throw new Exceptions\RuntimeException( 33 | 'index is required for Delete' 34 | ); 35 | } 36 | if (isset($this->type) !== true) { 37 | throw new Exceptions\RuntimeException( 38 | 'type is required for Delete' 39 | ); 40 | } 41 | $index = $this->index; 42 | $type = $this->type; 43 | $uri = "/$index/$type/_mapping"; 44 | 45 | if (isset($index) === true && isset($type) === true) { 46 | $uri = "/$index/$type/_mapping"; 47 | } 48 | 49 | return $uri; 50 | } 51 | 52 | 53 | /** 54 | * @return string[] 55 | */ 56 | protected function getParamWhitelist() 57 | { 58 | return array( 59 | 'master_timeout', 60 | ); 61 | } 62 | 63 | 64 | /** 65 | * @return string 66 | */ 67 | protected function getMethod() 68 | { 69 | return 'DELETE'; 70 | } 71 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Mapping/Get.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Get extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $index = $this->index; 31 | $type = $this->type; 32 | $uri = "/_mapping"; 33 | 34 | if (isset($index) === true && isset($type) === true) { 35 | $uri = "/$index/_mapping/$type"; 36 | } elseif (isset($type) === true) { 37 | $uri = "/_mapping/$type"; 38 | } elseif (isset($index) === true) { 39 | $uri = "/$index/_mapping"; 40 | } 41 | 42 | return $uri; 43 | } 44 | 45 | 46 | /** 47 | * @return string[] 48 | */ 49 | protected function getParamWhitelist() 50 | { 51 | return array( 52 | 'ignore_unavailable', 53 | 'allow_no_indices', 54 | 'expand_wildcards', 55 | 'wildcard_expansion', 56 | 'local', 57 | ); 58 | } 59 | 60 | 61 | /** 62 | * @return string 63 | */ 64 | protected function getMethod() 65 | { 66 | return 'GET'; 67 | } 68 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Mapping/GetField.php: -------------------------------------------------------------------------------- 1 | 21 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 22 | * @link http://elasticsearch.org 23 | */ 24 | 25 | class GetField extends AbstractEndpoint 26 | { 27 | /** @var string */ 28 | private $field; 29 | 30 | 31 | /** 32 | * @param string|array $field 33 | * 34 | * @return $this 35 | */ 36 | public function setField($field) { 37 | if (isset($field) !== true) { 38 | return $this; 39 | } 40 | 41 | if (is_array($field) === true) { 42 | $field = implode(",", $field); 43 | } 44 | 45 | $this->field = $field; 46 | return $this; 47 | } 48 | 49 | 50 | /** 51 | * @throws \Elasticsearch\Common\Exceptions\RuntimeException 52 | * @return string 53 | */ 54 | protected function getURI() 55 | { 56 | if (isset($this->field) !== true) { 57 | throw new Exceptions\RuntimeException( 58 | 'field is required for Get Field Mapping' 59 | ); 60 | } 61 | $uri = $this->getOptionalURI('_mapping/field'); 62 | 63 | return $uri.'/'.$this->field; 64 | } 65 | 66 | /** 67 | * @return string[] 68 | */ 69 | protected function getParamWhitelist() 70 | { 71 | return array( 72 | 'include_defaults' 73 | ); 74 | } 75 | 76 | /** 77 | * @return string 78 | */ 79 | protected function getMethod() 80 | { 81 | return 'GET'; 82 | } 83 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Open.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Open extends AbstractEndpoint 24 | { 25 | /** 26 | * @throws \Elasticsearch\Common\Exceptions\RuntimeException 27 | * @return string 28 | */ 29 | protected function getURI() 30 | { 31 | if (isset($this->index) !== true) { 32 | throw new Exceptions\RuntimeException( 33 | 'index is required for Open' 34 | ); 35 | } 36 | $index = $this->index; 37 | $uri = "/$index/_open"; 38 | 39 | if (isset($index) === true) { 40 | $uri = "/$index/_open"; 41 | } 42 | 43 | return $uri; 44 | } 45 | 46 | 47 | /** 48 | * @return string[] 49 | */ 50 | protected function getParamWhitelist() 51 | { 52 | return array( 53 | 'timeout', 54 | 'master_timeout', 55 | 'ignore_unavailable', 56 | 'allow_no_indices', 57 | 'expand_wildcards', 58 | ); 59 | } 60 | 61 | 62 | /** 63 | * @return string 64 | */ 65 | protected function getMethod() 66 | { 67 | return 'POST'; 68 | } 69 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Optimize.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Optimize extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $index = $this->index; 31 | $uri = "/_optimize"; 32 | 33 | if (isset($index) === true) { 34 | $uri = "/$index/_optimize"; 35 | } 36 | 37 | return $uri; 38 | } 39 | 40 | 41 | /** 42 | * @return string[] 43 | */ 44 | protected function getParamWhitelist() 45 | { 46 | return array( 47 | 'flush', 48 | 'ignore_unavailable', 49 | 'allow_no_indices', 50 | 'expand_wildcards', 51 | 'max_num_segments', 52 | 'only_expunge_deletes', 53 | 'operation_threading', 54 | 'wait_for_merge', 55 | ); 56 | } 57 | 58 | 59 | /** 60 | * @return string 61 | */ 62 | protected function getMethod() 63 | { 64 | return 'POST'; 65 | } 66 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Recovery.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Recovery extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $index = $this->index; 31 | $uri = "/_recovery"; 32 | 33 | if (isset($index) === true) { 34 | $uri = "/$index/_recovery"; 35 | } 36 | 37 | return $uri; 38 | } 39 | 40 | 41 | /** 42 | * @return string[] 43 | */ 44 | protected function getParamWhitelist() 45 | { 46 | return array( 47 | 'detailed', 48 | 'active_only', 49 | 'human' 50 | ); 51 | } 52 | 53 | 54 | /** 55 | * @return string 56 | */ 57 | protected function getMethod() 58 | { 59 | return 'GET'; 60 | } 61 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Refresh.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Refresh extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $index = $this->index; 31 | $uri = "/_refresh"; 32 | 33 | if (isset($index) === true) { 34 | $uri = "/$index/_refresh"; 35 | } 36 | 37 | return $uri; 38 | } 39 | 40 | 41 | /** 42 | * @return string[] 43 | */ 44 | protected function getParamWhitelist() 45 | { 46 | return array( 47 | 'ignore_unavailable', 48 | 'allow_no_indices', 49 | 'expand_wildcards', 50 | 'force', 51 | 'operation_threading', 52 | ); 53 | } 54 | 55 | 56 | /** 57 | * @return string 58 | */ 59 | protected function getMethod() 60 | { 61 | return 'GET'; 62 | } 63 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Segments.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Segments extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $index = $this->index; 31 | $uri = "/_segments"; 32 | 33 | if (isset($index) === true) { 34 | $uri = "/$index/_segments"; 35 | } 36 | 37 | return $uri; 38 | } 39 | 40 | 41 | /** 42 | * @return string[] 43 | */ 44 | protected function getParamWhitelist() 45 | { 46 | return array( 47 | 'ignore_unavailable', 48 | 'allow_no_indices', 49 | 'expand_wildcards', 50 | 'human', 51 | 'operation_threading', 52 | ); 53 | } 54 | 55 | 56 | /** 57 | * @return string 58 | */ 59 | protected function getMethod() 60 | { 61 | return 'GET'; 62 | } 63 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Settings/Get.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Get extends AbstractEndpoint 24 | { 25 | // The name of the settings that should be included 26 | private $name; 27 | 28 | 29 | /** 30 | * @param $name 31 | * 32 | * @return $this 33 | */ 34 | public function setName($name) 35 | { 36 | if (isset($name) !== true) { 37 | return $this; 38 | } 39 | 40 | $this->name = $name; 41 | return $this; 42 | } 43 | 44 | 45 | /** 46 | * @return string 47 | */ 48 | protected function getURI() 49 | { 50 | $index = $this->index; 51 | $name = $this->name; 52 | $uri = "/_settings"; 53 | 54 | if (isset($index) === true && isset($name) === true) { 55 | $uri = "/$index/_settings/$name"; 56 | } elseif (isset($name) === true) { 57 | $uri = "/_settings/$name"; 58 | } elseif (isset($index) === true) { 59 | $uri = "/$index/_settings"; 60 | } 61 | 62 | return $uri; 63 | } 64 | 65 | 66 | /** 67 | * @return string[] 68 | */ 69 | protected function getParamWhitelist() 70 | { 71 | return array( 72 | 'ignore_unavailable', 73 | 'allow_no_indices', 74 | 'expand_wildcards', 75 | 'flat_settings', 76 | 'local', 77 | ); 78 | } 79 | 80 | 81 | /** 82 | * @return string 83 | */ 84 | protected function getMethod() 85 | { 86 | return 'GET'; 87 | } 88 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Snapshotindex.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Snapshotindex extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $index = $this->index; 31 | $uri = "/_gateway/snapshot"; 32 | 33 | if (isset($index) === true) { 34 | $uri = "/$index/_gateway/snapshot"; 35 | } 36 | 37 | return $uri; 38 | } 39 | 40 | 41 | /** 42 | * @return string[] 43 | */ 44 | protected function getParamWhitelist() 45 | { 46 | return array( 47 | 'ignore_unavailable', 48 | 'allow_no_indices', 49 | 'expand_wildcards', 50 | ); 51 | } 52 | 53 | 54 | /** 55 | * @return string 56 | */ 57 | protected function getMethod() 58 | { 59 | return 'POST'; 60 | } 61 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Status.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Status extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $index = $this->index; 31 | $uri = "/_status"; 32 | 33 | if (isset($index) === true) { 34 | $uri = "/$index/_status"; 35 | } 36 | 37 | return $uri; 38 | } 39 | 40 | 41 | /** 42 | * @return string[] 43 | */ 44 | protected function getParamWhitelist() 45 | { 46 | return array( 47 | 'ignore_unavailable', 48 | 'allow_no_indices', 49 | 'expand_wildcards', 50 | 'human', 51 | 'operation_threading', 52 | 'recovery', 53 | 'snapshot', 54 | ); 55 | } 56 | 57 | 58 | /** 59 | * @return string 60 | */ 61 | protected function getMethod() 62 | { 63 | return 'GET'; 64 | } 65 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Template/AbstractTemplateEndpoint.php: -------------------------------------------------------------------------------- 1 | name = $name; 27 | return $this; 28 | } 29 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Template/Delete.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Delete extends AbstractEndpoint 24 | { 25 | // The name of the template 26 | private $name; 27 | 28 | 29 | /** 30 | * @param $name 31 | * 32 | * @return $this 33 | */ 34 | public function setName($name) 35 | { 36 | if (isset($name) !== true) { 37 | return $this; 38 | } 39 | 40 | $this->name = $name; 41 | return $this; 42 | } 43 | 44 | 45 | /** 46 | * @throws \Elasticsearch\Common\Exceptions\RuntimeException 47 | * @return string 48 | */ 49 | protected function getURI() 50 | { 51 | if (isset($this->name) !== true) { 52 | throw new Exceptions\RuntimeException( 53 | 'name is required for Delete' 54 | ); 55 | } 56 | $name = $this->name; 57 | $uri = "/_template/$name"; 58 | 59 | if (isset($name) === true) { 60 | $uri = "/_template/$name"; 61 | } 62 | 63 | return $uri; 64 | } 65 | 66 | 67 | /** 68 | * @return string[] 69 | */ 70 | protected function getParamWhitelist() 71 | { 72 | return array( 73 | 'timeout', 74 | 'master_timeout', 75 | ); 76 | } 77 | 78 | 79 | /** 80 | * @return string 81 | */ 82 | protected function getMethod() 83 | { 84 | return 'DELETE'; 85 | } 86 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Template/Exists.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Exists extends AbstractEndpoint 24 | { 25 | // The name of the template 26 | private $name; 27 | 28 | 29 | /** 30 | * @param $name 31 | * 32 | * @return $this 33 | */ 34 | public function setName($name) 35 | { 36 | if (isset($name) !== true) { 37 | return $this; 38 | } 39 | 40 | $this->name = $name; 41 | return $this; 42 | } 43 | 44 | 45 | /** 46 | * @throws \Elasticsearch\Common\Exceptions\RuntimeException 47 | * @return string 48 | */ 49 | protected function getURI() 50 | { 51 | if (isset($this->name) !== true) { 52 | throw new Exceptions\RuntimeException( 53 | 'name is required for Exists' 54 | ); 55 | } 56 | $name = $this->name; 57 | $uri = "/_template/$name"; 58 | 59 | if (isset($name) === true) { 60 | $uri = "/_template/$name"; 61 | } 62 | 63 | return $uri; 64 | } 65 | 66 | 67 | /** 68 | * @return string[] 69 | */ 70 | protected function getParamWhitelist() 71 | { 72 | return array( 73 | 'local', 74 | 'master_timeout' 75 | ); 76 | } 77 | 78 | 79 | /** 80 | * @return string 81 | */ 82 | protected function getMethod() 83 | { 84 | return 'HEAD'; 85 | } 86 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Template/Get.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Get extends AbstractEndpoint 24 | { 25 | // The name of the template 26 | private $name; 27 | 28 | 29 | /** 30 | * @param $name 31 | * 32 | * @return $this 33 | */ 34 | public function setName($name) 35 | { 36 | if (isset($name) !== true) { 37 | return $this; 38 | } 39 | 40 | $this->name = $name; 41 | return $this; 42 | } 43 | 44 | 45 | /** 46 | * @throws \Elasticsearch\Common\Exceptions\RuntimeException 47 | * @return string 48 | */ 49 | protected function getURI() 50 | { 51 | $name = $this->name; 52 | $uri = "/_template"; 53 | 54 | if (isset($name) === true) { 55 | $uri = "/_template/$name"; 56 | } 57 | 58 | return $uri; 59 | } 60 | 61 | 62 | /** 63 | * @return string[] 64 | */ 65 | protected function getParamWhitelist() 66 | { 67 | return array( 68 | 'flat_settings', 69 | 'local', 70 | 'master_timeout' 71 | ); 72 | } 73 | 74 | 75 | /** 76 | * @return string 77 | */ 78 | protected function getMethod() 79 | { 80 | return 'GET'; 81 | } 82 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Type/Exists.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Exists extends AbstractEndpoint 24 | { 25 | /** 26 | * @throws \Elasticsearch\Common\Exceptions\RuntimeException 27 | * @return string 28 | */ 29 | protected function getURI() 30 | { 31 | if (isset($this->index) !== true) { 32 | throw new Exceptions\RuntimeException( 33 | 'index is required for Exists' 34 | ); 35 | } 36 | if (isset($this->type) !== true) { 37 | throw new Exceptions\RuntimeException( 38 | 'type is required for Exists' 39 | ); 40 | } 41 | $index = $this->index; 42 | $type = $this->type; 43 | $uri = "/$index/$type"; 44 | 45 | if (isset($index) === true && isset($type) === true) { 46 | $uri = "/$index/$type"; 47 | } 48 | 49 | return $uri; 50 | } 51 | 52 | 53 | /** 54 | * @return string[] 55 | */ 56 | protected function getParamWhitelist() 57 | { 58 | return array( 59 | 'ignore_unavailable', 60 | 'allow_no_indices', 61 | 'expand_wildcards', 62 | 'local', 63 | ); 64 | } 65 | 66 | 67 | /** 68 | * @return string 69 | */ 70 | protected function getMethod() 71 | { 72 | return 'HEAD'; 73 | } 74 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Validate/Query.php: -------------------------------------------------------------------------------- 1 | body = $body; 34 | return $this; 35 | } 36 | 37 | /** 38 | * @return string 39 | */ 40 | protected function getURI() 41 | { 42 | return $this->getOptionalURI('_validate/query'); 43 | } 44 | 45 | /** 46 | * @return string[] 47 | */ 48 | protected function getParamWhitelist() 49 | { 50 | return array( 51 | 'explain', 52 | 'ignore_indices', 53 | 'operation_threading', 54 | 'source', 55 | 'q' 56 | ); 57 | } 58 | 59 | /** 60 | * @return string 61 | */ 62 | protected function getMethod() 63 | { 64 | return 'GET'; 65 | } 66 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/ValidateQuery.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class ValidateQuery extends AbstractEndpoint 24 | { 25 | /** 26 | * @param array $body 27 | * 28 | * @throws \Elasticsearch\Common\Exceptions\InvalidArgumentException 29 | * @return $this 30 | */ 31 | public function setBody($body) 32 | { 33 | if (isset($body) !== true) { 34 | return $this; 35 | } 36 | 37 | 38 | $this->body = $body; 39 | return $this; 40 | } 41 | 42 | 43 | 44 | /** 45 | * @return string 46 | */ 47 | protected function getURI() 48 | { 49 | $index = $this->index; 50 | $type = $this->type; 51 | $uri = "/_validate/query"; 52 | 53 | if (isset($index) === true && isset($type) === true) { 54 | $uri = "/$index/$type/_validate/query"; 55 | } elseif (isset($index) === true) { 56 | $uri = "/$index/_validate/query"; 57 | } 58 | 59 | return $uri; 60 | } 61 | 62 | 63 | /** 64 | * @return string[] 65 | */ 66 | protected function getParamWhitelist() 67 | { 68 | return array( 69 | 'explain', 70 | 'ignore_unavailable', 71 | 'allow_no_indices', 72 | 'expand_wildcards', 73 | 'operation_threading', 74 | 'source', 75 | 'q', 76 | ); 77 | } 78 | 79 | 80 | /** 81 | * @return string 82 | */ 83 | protected function getMethod() 84 | { 85 | return 'GET'; 86 | } 87 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Warmer/AbstractWarmerEndpoint.php: -------------------------------------------------------------------------------- 1 | name = $name; 28 | return $this; 29 | } 30 | 31 | 32 | /** 33 | * @return string 34 | * @throws \Elasticsearch\Common\Exceptions\RuntimeException 35 | */ 36 | protected function getWarmerURI() 37 | { 38 | if (isset($this->index) !== true) { 39 | throw new RuntimeException( 40 | 'index is required for Delete' 41 | ); 42 | } 43 | 44 | $uri = $this->getOptionalURI('_warmer'); 45 | 46 | $name = $this->name; 47 | if (isset($name) === true) { 48 | $uri .= "/$name"; 49 | } 50 | 51 | return $uri; 52 | } 53 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Info.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Info extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $uri = "/"; 31 | 32 | 33 | return $uri; 34 | } 35 | 36 | 37 | /** 38 | * @return string[] 39 | */ 40 | protected function getParamWhitelist() 41 | { 42 | return array( 43 | ); 44 | } 45 | 46 | 47 | /** 48 | * @return string 49 | */ 50 | protected function getMethod() 51 | { 52 | return 'GET'; 53 | } 54 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/MPercolate.php: -------------------------------------------------------------------------------- 1 | serializer = $serializer; 29 | parent::__construct($transport); 30 | } 31 | 32 | 33 | /** 34 | * @param string|array $body 35 | * 36 | * @return $this 37 | */ 38 | public function setBody($body) 39 | { 40 | if (isset($body) !== true) { 41 | return $this; 42 | } 43 | 44 | if (is_array($body) === true) { 45 | $bulkBody = ""; 46 | foreach ($body as $item) { 47 | $bulkBody .= $this->serializer->serialize($item)."\n"; 48 | } 49 | $body = $bulkBody; 50 | } 51 | 52 | $this->body = $body; 53 | return $this; 54 | } 55 | 56 | /** 57 | * @return string 58 | */ 59 | protected function getURI() 60 | { 61 | return $this->getOptionalURI('_mpercolate'); 62 | 63 | } 64 | 65 | /** 66 | * @return string[] 67 | */ 68 | protected function getParamWhitelist() 69 | { 70 | return array( 71 | 'ignore_unavailable', 72 | 'allow_no_indices', 73 | 'expand_wildcards', 74 | ); 75 | } 76 | 77 | /** 78 | * @return string 79 | */ 80 | protected function getMethod() 81 | { 82 | return 'POST'; 83 | } 84 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/MTermVectors.php: -------------------------------------------------------------------------------- 1 | body = $body; 33 | return $this; 34 | } 35 | 36 | /** 37 | * @return string 38 | */ 39 | protected function getURI() 40 | { 41 | return $this->getOptionalURI('_mtermvectors'); 42 | 43 | } 44 | 45 | /** 46 | * @return string[] 47 | */ 48 | protected function getParamWhitelist() 49 | { 50 | return array( 51 | 'ids', 52 | 'term_statistics', 53 | 'field_statistics', 54 | 'fields', 55 | 'offsets', 56 | 'positions', 57 | 'payloads', 58 | 'preference', 59 | 'routing', 60 | 'parent', 61 | 'realtime' 62 | ); 63 | } 64 | 65 | /** 66 | * @return string 67 | */ 68 | protected function getMethod() 69 | { 70 | return 'POST'; 71 | } 72 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Ping.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Ping extends AbstractEndpoint 24 | { 25 | /** 26 | * @return string 27 | */ 28 | protected function getURI() 29 | { 30 | $uri = "/"; 31 | 32 | 33 | return $uri; 34 | } 35 | 36 | 37 | /** 38 | * @return string[] 39 | */ 40 | protected function getParamWhitelist() 41 | { 42 | return array( 43 | ); 44 | } 45 | 46 | 47 | /** 48 | * @return string 49 | */ 50 | protected function getMethod() 51 | { 52 | return 'HEAD'; 53 | } 54 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Script/Delete.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Delete extends AbstractEndpoint 24 | { 25 | /** @var String */ 26 | private $lang; 27 | 28 | 29 | /** 30 | * @param $lang 31 | * 32 | * @return $this 33 | */ 34 | public function setLang($lang) 35 | { 36 | if (isset($lang) !== true) { 37 | return $this; 38 | } 39 | 40 | $this->lang = $lang; 41 | return $this; 42 | } 43 | 44 | 45 | /** 46 | * @throws \Elasticsearch\Common\Exceptions\RuntimeException 47 | * @return string 48 | */ 49 | protected function getURI() 50 | { 51 | if (isset($this->lang) !== true) { 52 | throw new Exceptions\RuntimeException( 53 | 'lang is required for Put' 54 | ); 55 | } 56 | if (isset($this->id) !== true) { 57 | throw new Exceptions\RuntimeException( 58 | 'id is required for put' 59 | ); 60 | } 61 | $id = $this->id; 62 | $lang = $this->lang; 63 | $uri = "/_scripts/$lang/$id"; 64 | 65 | return $uri; 66 | } 67 | 68 | 69 | /** 70 | * @return string[] 71 | */ 72 | protected function getParamWhitelist() 73 | { 74 | return array( 75 | 'version', 76 | 'version_type' 77 | ); 78 | } 79 | 80 | 81 | /** 82 | * @return string 83 | */ 84 | protected function getMethod() 85 | { 86 | return 'DELETE'; 87 | } 88 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Script/Get.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Get extends AbstractEndpoint 24 | { 25 | /** @var String */ 26 | private $lang; 27 | 28 | 29 | /** 30 | * @param $lang 31 | * 32 | * @return $this 33 | */ 34 | public function setLang($lang) 35 | { 36 | if (isset($lang) !== true) { 37 | return $this; 38 | } 39 | 40 | $this->lang = $lang; 41 | return $this; 42 | } 43 | 44 | 45 | /** 46 | * @throws \Elasticsearch\Common\Exceptions\RuntimeException 47 | * @return string 48 | */ 49 | protected function getURI() 50 | { 51 | if (isset($this->lang) !== true) { 52 | throw new Exceptions\RuntimeException( 53 | 'lang is required for Put' 54 | ); 55 | } 56 | if (isset($this->id) !== true) { 57 | throw new Exceptions\RuntimeException( 58 | 'id is required for put' 59 | ); 60 | } 61 | $id = $this->id; 62 | $lang = $this->lang; 63 | $uri = "/_scripts/$lang/$id"; 64 | 65 | return $uri; 66 | } 67 | 68 | 69 | /** 70 | * @return string[] 71 | */ 72 | protected function getParamWhitelist() 73 | { 74 | return array( 75 | 'version_type', 76 | 'version' 77 | ); 78 | } 79 | 80 | 81 | /** 82 | * @return string 83 | */ 84 | protected function getMethod() 85 | { 86 | return 'GET'; 87 | } 88 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/SearchShards.php: -------------------------------------------------------------------------------- 1 | 20 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 21 | * @link http://elasticsearch.org 22 | */ 23 | 24 | class SearchShards extends AbstractEndpoint 25 | { 26 | 27 | 28 | /** 29 | * @return string 30 | */ 31 | protected function getURI() 32 | { 33 | $index = $this->index; 34 | $type = $this->type; 35 | $uri = "/_search_shards"; 36 | 37 | if (isset($index) === true && isset($type) === true) { 38 | $uri = "/$index/$type/_search_shards"; 39 | } elseif (isset($index) === true) { 40 | $uri = "/$index/_search_shards"; 41 | } elseif (isset($type) === true) { 42 | $uri = "/_all/$type/_search_shards"; 43 | } 44 | 45 | return $uri; 46 | } 47 | 48 | 49 | /** 50 | * @return string[] 51 | */ 52 | protected function getParamWhitelist() 53 | { 54 | return array( 55 | 'preference', 56 | 'routing', 57 | 'local', 58 | 'ignore_unavailable', 59 | 'allow_no_indices', 60 | 'expand_wildcards' 61 | ); 62 | } 63 | 64 | 65 | /** 66 | * @return string 67 | */ 68 | protected function getMethod() 69 | { 70 | return 'GET'; 71 | } 72 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/SearchTemplate.php: -------------------------------------------------------------------------------- 1 | 20 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 21 | * @link http://elasticsearch.org 22 | */ 23 | 24 | class SearchTemplate extends AbstractEndpoint 25 | { 26 | /** 27 | * @param array $body 28 | * 29 | * @throws \Elasticsearch\Common\Exceptions\InvalidArgumentException 30 | * @return $this 31 | */ 32 | public function setBody($body) 33 | { 34 | if (isset($body) !== true) { 35 | return $this; 36 | } 37 | 38 | $this->body = $body; 39 | return $this; 40 | } 41 | 42 | 43 | 44 | /** 45 | * @return string 46 | */ 47 | protected function getURI() 48 | { 49 | $index = $this->index; 50 | $type = $this->type; 51 | $uri = "/_search/template"; 52 | 53 | if (isset($index) === true && isset($type) === true) { 54 | $uri = "/$index/$type/_search/template"; 55 | } elseif (isset($index) === true) { 56 | $uri = "/$index/_search/template"; 57 | } elseif (isset($type) === true) { 58 | $uri = "/_all/$type/_search/template"; 59 | } 60 | 61 | return $uri; 62 | } 63 | 64 | 65 | /** 66 | * @return string[] 67 | */ 68 | protected function getParamWhitelist() 69 | { 70 | return array(); 71 | } 72 | 73 | 74 | /** 75 | * @return string 76 | */ 77 | protected function getMethod() 78 | { 79 | return 'GET'; 80 | } 81 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Snapshot/Repository/Get.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Get extends AbstractEndpoint 24 | { 25 | // A comma-separated list of repository names 26 | private $repository; 27 | 28 | 29 | /** 30 | * @param $repository 31 | * 32 | * @return $this 33 | */ 34 | public function setRepository($repository) 35 | { 36 | if (isset($repository) !== true) { 37 | return $this; 38 | } 39 | 40 | $this->repository = $repository; 41 | return $this; 42 | } 43 | 44 | 45 | /** 46 | * @return string 47 | */ 48 | protected function getURI() 49 | { 50 | $repository = $this->repository; 51 | $uri = "/_snapshot"; 52 | 53 | if (isset($repository) === true) { 54 | $uri = "/_snapshot/$repository"; 55 | } 56 | 57 | return $uri; 58 | } 59 | 60 | 61 | /** 62 | * @return string[] 63 | */ 64 | protected function getParamWhitelist() 65 | { 66 | return array( 67 | 'master_timeout', 68 | 'local', 69 | ); 70 | } 71 | 72 | 73 | /** 74 | * @return string 75 | */ 76 | protected function getMethod() 77 | { 78 | return 'GET'; 79 | } 80 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Snapshot/Repository/Verify.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Verify extends AbstractEndpoint 24 | { 25 | // A comma-separated list of repository names 26 | private $repository; 27 | 28 | 29 | /** 30 | * @param $repository 31 | * 32 | * @return $this 33 | */ 34 | public function setRepository($repository) 35 | { 36 | if (isset($repository) !== true) { 37 | return $this; 38 | } 39 | 40 | $this->repository = $repository; 41 | return $this; 42 | } 43 | 44 | 45 | /** 46 | * @return string 47 | */ 48 | protected function getURI() 49 | { 50 | $repository = $this->repository; 51 | if (isset($this->repository) !== true) { 52 | throw new Exceptions\RuntimeException( 53 | 'repository is required for Verify' 54 | ); 55 | } 56 | 57 | $uri = "/_snapshot/$repository/_verify"; 58 | 59 | return $uri; 60 | } 61 | 62 | 63 | /** 64 | * @return string[] 65 | */ 66 | protected function getParamWhitelist() 67 | { 68 | return array( 69 | 'master_timeout', 70 | 'local', 71 | ); 72 | } 73 | 74 | 75 | /** 76 | * @return string 77 | */ 78 | protected function getMethod() 79 | { 80 | return 'POST'; 81 | } 82 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Template/Delete.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Delete extends AbstractEndpoint 24 | { 25 | 26 | /** 27 | * @throws \Elasticsearch\Common\Exceptions\RuntimeException 28 | * @return string 29 | */ 30 | protected function getURI() 31 | { 32 | if (isset($this->id) !== true) { 33 | throw new Exceptions\RuntimeException( 34 | 'id is required for Delete' 35 | ); 36 | } 37 | $templateId = $this->id; 38 | $uri = "/_search/template/$templateId"; 39 | 40 | return $uri; 41 | } 42 | 43 | 44 | /** 45 | * @return string[] 46 | */ 47 | protected function getParamWhitelist() 48 | { 49 | return array(); 50 | } 51 | 52 | 53 | /** 54 | * @return string 55 | */ 56 | protected function getMethod() 57 | { 58 | return 'DELETE'; 59 | } 60 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Template/Get.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Get extends AbstractEndpoint 24 | { 25 | 26 | /** 27 | * @throws \Elasticsearch\Common\Exceptions\RuntimeException 28 | * @return string 29 | */ 30 | protected function getURI() 31 | { 32 | if (isset($this->id) !== true) { 33 | throw new Exceptions\RuntimeException( 34 | 'id is required for Get' 35 | ); 36 | } 37 | $templateId = $this->id; 38 | $uri = "/_search/template/$templateId"; 39 | 40 | return $uri; 41 | } 42 | 43 | 44 | /** 45 | * @return string[] 46 | */ 47 | protected function getParamWhitelist() 48 | { 49 | return array(); 50 | } 51 | 52 | 53 | /** 54 | * @return string 55 | */ 56 | protected function getMethod() 57 | { 58 | return 'GET'; 59 | } 60 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Template/Put.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | 23 | class Put extends AbstractEndpoint 24 | { 25 | 26 | /** 27 | * @param array $body 28 | * 29 | * @return $this 30 | */ 31 | public function setBody($body) 32 | { 33 | if (isset($body) !== true) { 34 | return $this; 35 | } 36 | 37 | $this->body = $body; 38 | return $this; 39 | } 40 | 41 | 42 | /** 43 | * @throws \Elasticsearch\Common\Exceptions\RuntimeException 44 | * @return string 45 | */ 46 | protected function getURI() 47 | { 48 | if (isset($this->id) !== true) { 49 | throw new Exceptions\RuntimeException( 50 | 'id is required for Put' 51 | ); 52 | } 53 | 54 | $templateId = $this->id; 55 | $uri = "/_search/template/$templateId"; 56 | 57 | return $uri; 58 | } 59 | 60 | 61 | /** 62 | * @return string[] 63 | */ 64 | protected function getParamWhitelist() 65 | { 66 | return array(); 67 | } 68 | 69 | 70 | /** 71 | * @return string 72 | */ 73 | protected function getMethod() 74 | { 75 | return 'PUT'; 76 | } 77 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Namespaces/AbstractNamespace.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | abstract class AbstractNamespace 23 | { 24 | /** @var \Elasticsearch\Transport */ 25 | protected $transport; 26 | 27 | /** @var callback */ 28 | protected $dicEndpoints; 29 | 30 | 31 | /** 32 | * Abstract constructor 33 | * 34 | * @param Transport $transport Transport object 35 | * @param $dicEndpoints 36 | */ 37 | public function __construct($transport, $dicEndpoints) 38 | { 39 | $this->transport = $transport; 40 | $this->dicEndpoints = $dicEndpoints; 41 | } 42 | 43 | 44 | /** 45 | * @param array $params 46 | * @param string $arg 47 | * 48 | * @return null|mixed 49 | */ 50 | public function extractArgument(&$params, $arg) 51 | { 52 | if (is_object($params) === true) { 53 | $params = (array)$params; 54 | } 55 | 56 | if (isset($params[$arg]) === true) { 57 | $val = $params[$arg]; 58 | unset($params[$arg]); 59 | return $val; 60 | } else { 61 | return null; 62 | } 63 | } 64 | 65 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Serializers/AbstractJsonSerializer.php: -------------------------------------------------------------------------------- 1 | 12 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 13 | * @link http://elasticsearch.org 14 | */ 15 | abstract class AbstractJsonSerializer implements SerializerInterface 16 | { 17 | /** 18 | * Encode a php object or array to a JSON string 19 | * 20 | * @param object|array $value 21 | * @throws JsonSerializationError if something goes wrong during encoding 22 | * @return string 23 | */ 24 | protected static function jsonEncode($value) 25 | { 26 | $result = json_encode($value); 27 | 28 | if (static::hasJsonError()) { 29 | throw new JsonSerializationError(json_last_error(), $value, $result); 30 | } 31 | 32 | return '[]' === $result ? '{}' : $result; 33 | } 34 | 35 | /** 36 | * Decode a JSON string to a PHP array. 37 | * 38 | * @param string $json 39 | * @throws JsonDeserializationError if something goes wrong during decoding 40 | * @return array 41 | */ 42 | protected static function jsonDecode($json) 43 | { 44 | $result = json_decode($json, true); 45 | 46 | if (static::hasJsonError()) { 47 | throw new JsonDeserializationError(json_last_error(), $json, $result); 48 | } 49 | 50 | return $result; 51 | } 52 | 53 | /** 54 | * Check to see if the last `json_{encode,decode}` call produced an error. 55 | * 56 | * @return boolean 57 | */ 58 | protected static function hasJsonError() 59 | { 60 | return json_last_error() !== JSON_ERROR_NONE; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Serializers/ArrayToJSONSerializer.php: -------------------------------------------------------------------------------- 1 | 16 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 17 | * @link http://elasticsearch.org 18 | */ 19 | class ArrayToJSONSerializer extends AbstractJsonSerializer 20 | { 21 | /** 22 | * Serialize assoc array into JSON string 23 | * 24 | * @param string|array $data Assoc array to encode into JSON 25 | * 26 | * @return string 27 | */ 28 | public function serialize($data) 29 | { 30 | if (is_string($data) === true) { 31 | return $data; 32 | } 33 | 34 | return $this->jsonEncode($data); 35 | } 36 | 37 | 38 | /** 39 | * Deserialize JSON into an assoc array 40 | * 41 | * @param string $data JSON encoded string 42 | * @param array $headers Response Headers 43 | * 44 | * @return array 45 | */ 46 | public function deserialize($data, $headers) 47 | { 48 | return $this->jsonDecode($data); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Serializers/EverythingToJSONSerializer.php: -------------------------------------------------------------------------------- 1 | 15 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 16 | * @link http://elasticsearch.org 17 | */ 18 | class EverythingToJSONSerializer extends AbstractJsonSerializer 19 | { 20 | /** 21 | * Serialize assoc array into JSON string 22 | * 23 | * @param string|array $data Assoc array to encode into JSON 24 | * 25 | * @return string 26 | */ 27 | public function serialize($data) 28 | { 29 | return $this->jsonEncode($data); 30 | } 31 | 32 | /** 33 | * Deserialize JSON into an assoc array 34 | * 35 | * @param string $data JSON encoded string 36 | * @param array $headers Response headers 37 | * 38 | * @return array 39 | */ 40 | public function deserialize($data, $headers) 41 | { 42 | return $this->jsonDecode($data); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Serializers/SerializerInterface.php: -------------------------------------------------------------------------------- 1 | 18 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 19 | * @link http://elasticsearch.org 20 | */ 21 | class SmartSerializer extends ArrayToJSONSerializer 22 | { 23 | /** 24 | * Deserialize by introspecting content_type. Tries to deserialize JSON, 25 | * otherwise returns string 26 | * 27 | * @param string $data JSON encoded string 28 | * @param array $headers Response Headers 29 | * 30 | * @throws JsonErrorException 31 | * @return array 32 | */ 33 | public function deserialize($data, $headers) 34 | { 35 | if (isset($headers['content_type']) && strpos($headers['content_type'], 'json') === false) { 36 | return $data; 37 | } 38 | 39 | return $this->jsonDecode($data); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/ConnectionPool/SniffingConnectionPoolIntegrationTest.php: -------------------------------------------------------------------------------- 1 | 12 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 13 | * @link http://elasticsearch.org 14 | */ 15 | class SniffingConnectionPoolIntegrationTest extends \PHPUnit_Framework_TestCase 16 | { 17 | public function testSniff() { 18 | $params['connectionPoolClass'] = '\Elasticsearch\ConnectionPool\SniffingConnectionPool'; 19 | $params['connectionPoolParams']['sniffingInterval'] = -10; 20 | $params['hosts'] = array ($_SERVER['ES_TEST_HOST']); 21 | 22 | $client = new \Elasticsearch\Client($params); 23 | 24 | $client->ping(); 25 | 26 | } 27 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Connections/ConnectionFactoryTest.php: -------------------------------------------------------------------------------- 1 | 15 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 16 | * @link http://elasticsearch.org 17 | */ 18 | class ConnectionFactoryTest extends \PHPUnit_Framework_TestCase 19 | { 20 | public function tearDown() { 21 | m::close(); 22 | } 23 | 24 | public function testCreate() 25 | { 26 | $mockConnection = m::mock('\Elasticsearch\Connections\AbstractConnection'); 27 | $mockFunction = function($hostDetails, $params, $log, $trace) use ($mockConnection) { 28 | return $mockConnection; 29 | }; 30 | 31 | // Eww... 32 | $mockPimple = m::mock('\Pimple\Container') 33 | ->shouldReceive('offsetGet')->with('connection')->andReturn($mockFunction)->getMock() 34 | ->shouldReceive('offsetGet')->with('connectionParamsShared')->andReturn(array())->getMock() 35 | ->shouldReceive('offsetGet')->with('logObject')->andReturn(array())->getMock() 36 | ->shouldReceive('offsetGet')->with('traceObject')->andReturn(array())->getMock(); 37 | 38 | $hostDetails = array( 39 | 'host' => 'localhost', 40 | 'port' => 9200 41 | ); 42 | 43 | $factory = new ConnectionFactory($mockPimple); 44 | $connection = $factory->create($hostDetails); 45 | 46 | $this->assertEquals($mockConnection, $connection); 47 | } 48 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Connections/GuzzleConnectionIntegrationTest.php: -------------------------------------------------------------------------------- 1 | 23 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 24 | * @link http://elasticsearch.org 25 | */ 26 | class GuzzleConnectionIntegrationTest extends \PHPUnit_Framework_TestCase 27 | { 28 | public function tearDown() 29 | { 30 | m::close(); 31 | } 32 | 33 | 34 | /** 35 | * @expectedException Elasticsearch\Common\Exceptions\Curl\CouldNotResolveHostException 36 | */ 37 | public function test5xxErrorBadHost() 38 | { 39 | $hostDetails = array('host' => 'localhost5', 'port' => 9200); 40 | 41 | $connectionParams['guzzleClient'] = new Client(); 42 | 43 | $log = m::mock('\Monolog\Logger')->shouldReceive('error')->once()->getMock(); 44 | 45 | $connection = new GuzzleConnection($hostDetails, $connectionParams, $log, $log); 46 | $ret = $connection->performRequest('GET', '/'); 47 | 48 | } 49 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Connections/GuzzleConnectionTest.php: -------------------------------------------------------------------------------- 1 | 21 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 22 | * @link http://elasticsearch.org 23 | */ 24 | class GuzzleConnectionTest extends \PHPUnit_Framework_TestCase 25 | { 26 | public function tearDown() 27 | { 28 | m::close(); 29 | } 30 | 31 | /** 32 | * @expectedException \Elasticsearch\Common\Exceptions\InvalidArgumentException 33 | */ 34 | public function testNoGuzzleClient() 35 | { 36 | $hostDetails = array('host' => 'localhost', 'port' => 9200); 37 | $connectionParams = null; 38 | 39 | $log = m::mock('\Monolog\Logger')->shouldReceive('critical')->once()->getMock(); 40 | 41 | $connection = new GuzzleConnection($hostDetails, $connectionParams, $log, $log); 42 | 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/Cluster/HealthTest.php: -------------------------------------------------------------------------------- 1 | 17 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 18 | * @link http://elasticsearch.org 19 | */ 20 | class HealthTest extends \PHPUnit_Framework_TestCase 21 | { 22 | 23 | public function tearDown() { 24 | m::close(); 25 | } 26 | 27 | public function testGetURIWithNoIndex() 28 | { 29 | 30 | $uri = '/_cluster/health'; 31 | 32 | $mockTransport = m::mock('\Elasticsearch\Transport') 33 | ->shouldReceive('performRequest')->once() 34 | ->with( 35 | 'GET', 36 | $uri, 37 | array(), 38 | null 39 | ) 40 | ->getMock(); 41 | 42 | $action = new Health($mockTransport); 43 | $action->performRequest(); 44 | 45 | } 46 | 47 | public function testGetURIWithIndex() 48 | { 49 | $uri = '/_cluster/health/testIndex'; 50 | 51 | $mockTransport = m::mock('\Elasticsearch\Transport') 52 | ->shouldReceive('performRequest')->once() 53 | ->with( 54 | 'GET', 55 | $uri, 56 | array(), 57 | null 58 | ) 59 | ->getMock(); 60 | 61 | $action = new Health($mockTransport); 62 | $action->setIndex('testIndex') 63 | ->performRequest(); 64 | 65 | } 66 | 67 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/Cluster/RerouteTest.php: -------------------------------------------------------------------------------- 1 | 18 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 19 | * @link http://elasticsearch.org 20 | */ 21 | class RerouteTest extends \PHPUnit_Framework_TestCase 22 | { 23 | public function tearDown() { 24 | m::close(); 25 | } 26 | 27 | 28 | public function testSetBody() 29 | { 30 | $query['docs'] = '1'; 31 | 32 | $mockTransport = m::mock('\Elasticsearch\Transport') 33 | ->shouldReceive('performRequest')->once() 34 | ->with( 35 | m::any(), 36 | m::any(), 37 | array(), 38 | $query 39 | ) 40 | ->getMock(); 41 | 42 | $action = new Reroute($mockTransport); 43 | $action->setBody($query) 44 | ->performRequest(); 45 | 46 | } 47 | 48 | public function testValidReroute() 49 | { 50 | $mockTransport = m::mock('\Elasticsearch\Transport') 51 | ->shouldReceive('performRequest')->once() 52 | ->with( 53 | 'POST', 54 | '/_cluster/reroute', 55 | array(), 56 | null 57 | ) 58 | ->getMock(); 59 | 60 | $action = new Reroute($mockTransport); 61 | $action->performRequest(); 62 | 63 | } 64 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/Cluster/Settings/GetTest.php: -------------------------------------------------------------------------------- 1 | 18 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 19 | * @link http://elasticsearch.org 20 | */ 21 | class GetTest extends \PHPUnit_Framework_TestCase 22 | { 23 | public function tearDown() { 24 | m::close(); 25 | } 26 | 27 | public function testValidGet() 28 | { 29 | $mockTransport = m::mock('\Elasticsearch\Transport') 30 | ->shouldReceive('performRequest')->once() 31 | ->with( 32 | 'GET', 33 | '/_cluster/settings', 34 | array(), 35 | null 36 | ) 37 | ->getMock(); 38 | 39 | $action = new Get($mockTransport); 40 | $action->performRequest(); 41 | 42 | } 43 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/Cluster/StateTest.php: -------------------------------------------------------------------------------- 1 | 18 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 19 | * @link http://elasticsearch.org 20 | */ 21 | class StateTest extends \PHPUnit_Framework_TestCase 22 | { 23 | public function tearDown() { 24 | m::close(); 25 | } 26 | 27 | 28 | public function testValidState() 29 | { 30 | $mockTransport = m::mock('\Elasticsearch\Transport') 31 | ->shouldReceive('performRequest')->once() 32 | ->with( 33 | 'GET', 34 | '/_cluster/state', 35 | array(), 36 | null 37 | ) 38 | ->getMock(); 39 | 40 | $action = new State($mockTransport); 41 | $action->performRequest(); 42 | 43 | } 44 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/Indices/Cache/ClearTest.php: -------------------------------------------------------------------------------- 1 | 18 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 19 | * @link http://elasticsearch.org 20 | */ 21 | 22 | class ClearTest extends \PHPUnit_Framework_TestCase 23 | { 24 | public function tearDown() { 25 | m::close(); 26 | } 27 | 28 | public function testValidSegmentsWithNoIndex() 29 | { 30 | $mockTransport = m::mock('\Elasticsearch\Transport') 31 | ->shouldReceive('performRequest')->once() 32 | ->with( 33 | 'POST', 34 | '/_cache/clear', 35 | array(), 36 | null 37 | ) 38 | ->getMock(); 39 | 40 | $action = new Clear($mockTransport); 41 | $action->performRequest(); 42 | 43 | } 44 | 45 | public function testValidSegmentsWithIndex() 46 | { 47 | 48 | $mockTransport = m::mock('\Elasticsearch\Transport') 49 | ->shouldReceive('performRequest')->once() 50 | ->with( 51 | 'POST', 52 | '/testIndex/_cache/clear', 53 | array(), 54 | null 55 | ) 56 | ->getMock(); 57 | 58 | $action = new Clear($mockTransport); 59 | $action->setIndex('testIndex') 60 | ->performRequest(); 61 | 62 | } 63 | 64 | 65 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/Indices/CloseTest.php: -------------------------------------------------------------------------------- 1 | 18 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 19 | * @link http://elasticsearch.org 20 | */ 21 | class CloseTest extends \PHPUnit_Framework_TestCase 22 | { 23 | public function tearDown() { 24 | m::close(); 25 | } 26 | 27 | /** 28 | * @expectedException RuntimeException 29 | */ 30 | public function testNoIndex() 31 | { 32 | 33 | $mockTransport = m::mock('\Elasticsearch\Transport'); 34 | 35 | $action = new Close($mockTransport); 36 | $action->performRequest(); 37 | 38 | } 39 | 40 | public function testValidClose() 41 | { 42 | 43 | $mockTransport = m::mock('\Elasticsearch\Transport') 44 | ->shouldReceive('performRequest')->once() 45 | ->with( 46 | 'POST', 47 | '/testIndex/_close', 48 | array(), 49 | null 50 | ) 51 | ->getMock(); 52 | 53 | 54 | 55 | $action = new Close($mockTransport); 56 | $action->setIndex('testIndex') 57 | 58 | ->performRequest(); 59 | 60 | } 61 | 62 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/Indices/DeleteTest.php: -------------------------------------------------------------------------------- 1 | 17 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 18 | * @link http://elasticsearch.org 19 | */ 20 | class DeleteTest extends \PHPUnit_Framework_TestCase 21 | { 22 | public function tearDown() { 23 | m::close(); 24 | } 25 | 26 | public function testValidDeleteWithNoIndex() 27 | { 28 | 29 | $mockTransport = m::mock('\Elasticsearch\Transport') 30 | ->shouldReceive('performRequest')->once() 31 | ->with( 32 | 'DELETE', 33 | '/', 34 | array(), 35 | null 36 | ) 37 | ->getMock(); 38 | 39 | $action = new Delete($mockTransport); 40 | $action->performRequest(); 41 | 42 | } 43 | 44 | public function testValidDeleteWithIndex() 45 | { 46 | 47 | $mockTransport = m::mock('\Elasticsearch\Transport') 48 | ->shouldReceive('performRequest')->once() 49 | ->with( 50 | 'DELETE', 51 | '/testIndex', 52 | array(), 53 | null 54 | ) 55 | ->getMock(); 56 | 57 | $action = new Delete($mockTransport); 58 | $action->setIndex('testIndex') 59 | ->performRequest(); 60 | 61 | } 62 | 63 | 64 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/Indices/Exists/IndicesTest.php: -------------------------------------------------------------------------------- 1 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 20 | * @link http://elasticsearch.org 21 | */ 22 | class IndicesTest extends \PHPUnit_Framework_TestCase 23 | { 24 | public function tearDown() { 25 | m::close(); 26 | } 27 | 28 | /** 29 | * @expectedException RuntimeException 30 | */ 31 | public function testNoIndex() 32 | { 33 | $mockTransport = m::mock('\Elasticsearch\Transport'); 34 | 35 | $index = new Exists($mockTransport); 36 | $index->performRequest(); 37 | 38 | } 39 | 40 | public function testValidIndicesExists() 41 | { 42 | $mockTransport = m::mock('\Elasticsearch\Transport') 43 | ->shouldReceive('performRequest')->once() 44 | ->with( 45 | 'HEAD', 46 | '/testIndex', 47 | array(), 48 | null 49 | ) 50 | ->getMock(); 51 | 52 | $action = new Exists($mockTransport); 53 | $action->setIndex('testIndex')->performRequest(); 54 | 55 | } 56 | 57 | 58 | 59 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/Indices/FlushTest.php: -------------------------------------------------------------------------------- 1 | 17 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 18 | * @link http://elasticsearch.org 19 | */ 20 | class FlushTest extends \PHPUnit_Framework_TestCase 21 | { 22 | public function tearDown() { 23 | m::close(); 24 | } 25 | 26 | public function testValidFlushWithNoIndex() 27 | { 28 | $mockTransport = m::mock('\Elasticsearch\Transport') 29 | ->shouldReceive('performRequest')->once() 30 | ->with( 31 | 'GET', 32 | '/_flush', 33 | array(), 34 | null 35 | ) 36 | ->getMock(); 37 | 38 | $action = new Flush($mockTransport); 39 | $action->performRequest(); 40 | 41 | } 42 | 43 | public function testValidFlushWithIndex() 44 | { 45 | 46 | $mockTransport = m::mock('\Elasticsearch\Transport') 47 | ->shouldReceive('performRequest')->once() 48 | ->with( 49 | 'GET', 50 | '/testIndex/_flush', 51 | array(), 52 | null 53 | ) 54 | ->getMock(); 55 | 56 | $action = new Flush($mockTransport); 57 | $action->setIndex('testIndex') 58 | ->performRequest(); 59 | 60 | } 61 | 62 | 63 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/Indices/Gateway/SnapshotTest.php: -------------------------------------------------------------------------------- 1 | 17 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 18 | * @link http://elasticsearch.org 19 | */ 20 | 21 | class SnapshotTest extends \PHPUnit_Framework_TestCase 22 | { 23 | public function tearDown() { 24 | m::close(); 25 | } 26 | 27 | public function testValidSnapshotWithNoIndex() 28 | { 29 | $mockTransport = m::mock('\Elasticsearch\Transport') 30 | ->shouldReceive('performRequest')->once() 31 | ->with( 32 | 'POST', 33 | '/_gateway/snapshot', 34 | array(), 35 | null 36 | ) 37 | ->getMock(); 38 | 39 | $action = new Snapshot($mockTransport); 40 | $action->performRequest(); 41 | 42 | } 43 | 44 | public function testValidSnapshotWithIndex() 45 | { 46 | 47 | $mockTransport = m::mock('\Elasticsearch\Transport') 48 | ->shouldReceive('performRequest')->once() 49 | ->with( 50 | 'POST', 51 | '/testIndex/_gateway/snapshot', 52 | array(), 53 | null 54 | ) 55 | ->getMock(); 56 | 57 | $action = new Snapshot($mockTransport); 58 | $action->setIndex('testIndex') 59 | ->performRequest(); 60 | 61 | } 62 | 63 | 64 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/Indices/OpenTest.php: -------------------------------------------------------------------------------- 1 | 18 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 19 | * @link http://elasticsearch.org 20 | */ 21 | class OpenTest extends \PHPUnit_Framework_TestCase 22 | { 23 | public function tearDown() { 24 | m::close(); 25 | } 26 | 27 | /** 28 | * @expectedException RuntimeException 29 | */ 30 | public function testNoIndex() 31 | { 32 | 33 | $mockTransport = m::mock('\Elasticsearch\Transport'); 34 | 35 | $action = new Open($mockTransport); 36 | $action->performRequest(); 37 | 38 | } 39 | 40 | public function testValidOpen() 41 | { 42 | 43 | $mockTransport = m::mock('\Elasticsearch\Transport') 44 | ->shouldReceive('performRequest')->once() 45 | ->with( 46 | 'POST', 47 | '/testIndex/_open', 48 | array(), 49 | null 50 | ) 51 | ->getMock(); 52 | 53 | 54 | 55 | $action = new Open($mockTransport); 56 | $action->setIndex('testIndex') 57 | 58 | ->performRequest(); 59 | 60 | } 61 | 62 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/Indices/OptimizeTest.php: -------------------------------------------------------------------------------- 1 | 17 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 18 | * @link http://elasticsearch.org 19 | */ 20 | class OptimizeTest extends \PHPUnit_Framework_TestCase 21 | { 22 | public function tearDown() { 23 | m::close(); 24 | } 25 | 26 | public function testValidOptimizeWithNoIndex() 27 | { 28 | $mockTransport = m::mock('\Elasticsearch\Transport') 29 | ->shouldReceive('performRequest')->once() 30 | ->with( 31 | 'POST', 32 | '/_optimize', 33 | array(), 34 | null 35 | ) 36 | ->getMock(); 37 | 38 | $action = new Optimize($mockTransport); 39 | $action->performRequest(); 40 | 41 | } 42 | 43 | public function testValidOptimizeWithIndex() 44 | { 45 | 46 | $mockTransport = m::mock('\Elasticsearch\Transport') 47 | ->shouldReceive('performRequest')->once() 48 | ->with( 49 | 'POST', 50 | '/testIndex/_optimize', 51 | array(), 52 | null 53 | ) 54 | ->getMock(); 55 | 56 | $action = new Optimize($mockTransport); 57 | $action->setIndex('testIndex') 58 | ->performRequest(); 59 | 60 | } 61 | 62 | 63 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/Indices/RefreshTest.php: -------------------------------------------------------------------------------- 1 | 17 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 18 | * @link http://elasticsearch.org 19 | */ 20 | class RefreshTest extends \PHPUnit_Framework_TestCase 21 | { 22 | public function tearDown() { 23 | m::close(); 24 | } 25 | 26 | public function testValidRefreshWithNoIndex() 27 | { 28 | $mockTransport = m::mock('\Elasticsearch\Transport') 29 | ->shouldReceive('performRequest')->once() 30 | ->with( 31 | 'GET', 32 | '/_refresh', 33 | array(), 34 | null 35 | ) 36 | ->getMock(); 37 | 38 | $action = new Refresh($mockTransport); 39 | $action->performRequest(); 40 | 41 | } 42 | 43 | public function testValidRefreshWithIndex() 44 | { 45 | 46 | $mockTransport = m::mock('\Elasticsearch\Transport') 47 | ->shouldReceive('performRequest')->once() 48 | ->with( 49 | 'GET', 50 | '/testIndex/_refresh', 51 | array(), 52 | null 53 | ) 54 | ->getMock(); 55 | 56 | $action = new Refresh($mockTransport); 57 | $action->setIndex('testIndex') 58 | ->performRequest(); 59 | 60 | } 61 | 62 | 63 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/Indices/SegmentsTest.php: -------------------------------------------------------------------------------- 1 | 17 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 18 | * @link http://elasticsearch.org 19 | */ 20 | class SegmentsTest extends \PHPUnit_Framework_TestCase 21 | { 22 | public function tearDown() { 23 | m::close(); 24 | } 25 | 26 | public function testValidSegmentsWithNoIndex() 27 | { 28 | $mockTransport = m::mock('\Elasticsearch\Transport') 29 | ->shouldReceive('performRequest')->once() 30 | ->with( 31 | 'GET', 32 | '/_segments', 33 | array(), 34 | null 35 | ) 36 | ->getMock(); 37 | 38 | $action = new Segments($mockTransport); 39 | $action->performRequest(); 40 | 41 | } 42 | 43 | public function testValidSegmentsWithIndex() 44 | { 45 | 46 | $mockTransport = m::mock('\Elasticsearch\Transport') 47 | ->shouldReceive('performRequest')->once() 48 | ->with( 49 | 'GET', 50 | '/testIndex/_segments', 51 | array(), 52 | null 53 | ) 54 | ->getMock(); 55 | 56 | $action = new Segments($mockTransport); 57 | $action->setIndex('testIndex') 58 | ->performRequest(); 59 | 60 | } 61 | 62 | 63 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/Indices/Settings/GetTest.php: -------------------------------------------------------------------------------- 1 | 18 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 19 | * @link http://elasticsearch.org 20 | */ 21 | class GetTest extends \PHPUnit_Framework_TestCase 22 | { 23 | public function tearDown() { 24 | m::close(); 25 | } 26 | 27 | public function testValidSegmentsWithNoIndex() 28 | { 29 | $mockTransport = m::mock('\Elasticsearch\Transport') 30 | ->shouldReceive('performRequest')->once() 31 | ->with( 32 | 'GET', 33 | '/_settings', 34 | array(), 35 | null 36 | ) 37 | ->getMock(); 38 | 39 | $action = new Get($mockTransport); 40 | $action->performRequest(); 41 | 42 | } 43 | 44 | public function testValidSegmentsWithIndex() 45 | { 46 | 47 | $mockTransport = m::mock('\Elasticsearch\Transport') 48 | ->shouldReceive('performRequest')->once() 49 | ->with( 50 | 'GET', 51 | '/testIndex/_settings', 52 | array(), 53 | null 54 | ) 55 | ->getMock(); 56 | 57 | $action = new Get($mockTransport); 58 | $action->setIndex('testIndex') 59 | ->performRequest(); 60 | 61 | } 62 | 63 | 64 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/Indices/StatusTest.php: -------------------------------------------------------------------------------- 1 | 17 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 18 | * @link http://elasticsearch.org 19 | */ 20 | class StatusTest extends \PHPUnit_Framework_TestCase 21 | { 22 | public function tearDown() { 23 | m::close(); 24 | } 25 | 26 | public function testValidStatusWithNoIndex() 27 | { 28 | $mockTransport = m::mock('\Elasticsearch\Transport') 29 | ->shouldReceive('performRequest')->once() 30 | ->with( 31 | 'GET', 32 | '/_status', 33 | array(), 34 | null 35 | ) 36 | ->getMock(); 37 | 38 | $action = new Status($mockTransport); 39 | $action->performRequest(); 40 | 41 | } 42 | 43 | public function testValidStatusWithIndex() 44 | { 45 | 46 | $mockTransport = m::mock('\Elasticsearch\Transport') 47 | ->shouldReceive('performRequest')->once() 48 | ->with( 49 | 'GET', 50 | '/testIndex/_status', 51 | array(), 52 | null 53 | ) 54 | ->getMock(); 55 | 56 | $action = new Status($mockTransport); 57 | $action->setIndex('testIndex') 58 | ->performRequest(); 59 | 60 | } 61 | 62 | 63 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/Indices/Template/DeleteTest.php: -------------------------------------------------------------------------------- 1 | 18 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 19 | * @link http://elasticsearch.org 20 | */ 21 | class DeleteTest extends \PHPUnit_Framework_TestCase 22 | { 23 | public function tearDown() { 24 | m::close(); 25 | } 26 | 27 | /** 28 | * @expectedException RuntimeException 29 | */ 30 | public function testNoName() 31 | { 32 | 33 | $mockTransport = m::mock('\Elasticsearch\Transport'); 34 | 35 | $action = new Delete($mockTransport); 36 | $action->performRequest(); 37 | 38 | } 39 | 40 | public function testValidDelete() 41 | { 42 | 43 | $mockTransport = m::mock('\Elasticsearch\Transport') 44 | ->shouldReceive('performRequest')->once() 45 | ->with( 46 | 'DELETE', 47 | '/_template/testName', 48 | array(), 49 | null 50 | ) 51 | ->getMock(); 52 | 53 | $action = new Delete($mockTransport); 54 | $action->setIndex('testIndex')->setName('testName') 55 | ->performRequest(); 56 | 57 | } 58 | 59 | 60 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/Indices/Template/GetTest.php: -------------------------------------------------------------------------------- 1 | 18 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 19 | * @link http://elasticsearch.org 20 | */ 21 | class GetTest extends \PHPUnit_Framework_TestCase 22 | { 23 | public function tearDown() { 24 | m::close(); 25 | } 26 | 27 | 28 | public function testValidGetNoName() 29 | { 30 | 31 | $mockTransport = m::mock('\Elasticsearch\Transport') 32 | ->shouldReceive('performRequest')->once() 33 | ->with( 34 | 'GET', 35 | '/_template/', 36 | array(), 37 | null 38 | ) 39 | ->getMock(); 40 | 41 | $action = new Get($mockTransport); 42 | $action->setIndex('testIndex') 43 | ->performRequest(); 44 | 45 | } 46 | 47 | public function testValidGet() 48 | { 49 | 50 | $mockTransport = m::mock('\Elasticsearch\Transport') 51 | ->shouldReceive('performRequest')->once() 52 | ->with( 53 | 'GET', 54 | '/_template/testName', 55 | array(), 56 | null 57 | ) 58 | ->getMock(); 59 | 60 | $action = new Get($mockTransport); 61 | $action->setIndex('testIndex')->setName('testName') 62 | ->performRequest(); 63 | 64 | } 65 | 66 | 67 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Endpoints/InfoTest.php: -------------------------------------------------------------------------------- 1 | 17 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 18 | * @link http://elasticsearch.org 19 | */ 20 | class InfoTest extends \PHPUnit_Framework_TestCase 21 | { 22 | public function tearDown() { 23 | m::close(); 24 | } 25 | 26 | 27 | public function testValidInfo() 28 | { 29 | $mockTransport = m::mock('\Elasticsearch\Transport') 30 | ->shouldReceive('performRequest')->once() 31 | ->with( 32 | 'GET', 33 | '/', 34 | array(), 35 | null 36 | ) 37 | ->getMock(); 38 | 39 | $action = new Info($mockTransport); 40 | $action->performRequest(); 41 | 42 | } 43 | } -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Serializers/ArrayToJSONSerializerTest.php: -------------------------------------------------------------------------------- 1 | 'field'); 23 | 24 | $ret = $serializer->serialize($body); 25 | 26 | $body = json_encode($body); 27 | $this->assertEquals($body, $ret); 28 | } 29 | 30 | public function testSerializeString() 31 | { 32 | $serializer = new ArrayToJSONSerializer(); 33 | $body = 'abc'; 34 | 35 | $ret = $serializer->serialize($body); 36 | 37 | $this->assertEquals($body, $ret); 38 | } 39 | 40 | public function testDeserializeJSON() 41 | { 42 | $serializer = new ArrayToJSONSerializer(); 43 | $body = '{"field":"value"}'; 44 | 45 | $ret = $serializer->deserialize($body, array()); 46 | 47 | $body = json_decode($body, true); 48 | $this->assertEquals($body, $ret); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests/Serializers/SmartSerializerTest.php: -------------------------------------------------------------------------------- 1 | content'; 24 | 25 | $result = $this->serializer->deserialize($body, array('content_type' => 'application/xml')); 26 | 27 | $this->assertEquals($body, $result); 28 | } 29 | 30 | public function testDeserializeWithJsonContentTypeReturnsDecodedJson() 31 | { 32 | $result = $this->serializer->deserialize('{"one": "two"}', array('content_type' => 'application/json')); 33 | 34 | $this->assertInternalType('array', $result); 35 | $this->assertArrayHasKeY('one', $result); 36 | } 37 | 38 | public function testDeserializeWithoutContentTypeReturnsDecodedJson() 39 | { 40 | $result = $this->serializer->deserialize('{"one": "two"}', array()); 41 | 42 | $this->assertInternalType('array', $result); 43 | $this->assertArrayHasKeY('one', $result); 44 | } 45 | 46 | protected function setUp() 47 | { 48 | $this->serializer = new SmartSerializer(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/elasticsearch/elasticsearch/tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | workingCopy(dirname(__DIR__) . '/util/elasticsearch'); 29 | 30 | 31 | 32 | echo "Update elasticsearch submodule\n"; 33 | $git->fetchAll(array('verbose' => true)); 34 | 35 | 36 | $hash = $_SERVER['TEST_BUILD_REF']; 37 | echo "Checkout yaml tests (hash: $hash)\n"; 38 | $git->checkout($hash, array('force' => true, 'quiet' => true)); 39 | -------------------------------------------------------------------------------- /web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sechacking/sgk/35186c26a88e21b0992636381f1a18e1528d9ff4/web.png --------------------------------------------------------------------------------