2017 © Pedro Peláez
 

library test-groonga_server

Groonga server runner for tests

image

dooaki/test-groonga_server

Groonga server runner for tests

  • Friday, September 19, 2014
  • by do-aki
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

dooaki\Test\GroongaServer

Build Status Coverage Status, (*1)

Groonga server runner for tests, (*2)

Requirements

SYNOPSIS

<?php

use dooaki\Test\GroongaServer;

$server = new GroongaServer(array('protocol' => 'http'));
$server->run();
$fp = stream_socket_client("tcp://localhost:{$server->getPort()}");

fwrite("GET /d/status HTTP/1.0\r\n\r\n");
while (!feof($fp)) {
    echo fgets($fp, 1024);
}

fclose($fp);

Installation

you can install the script with Composer., (*3)

in your composer.json file:, (*4)

{
    "require": {
        "dooaki/test-groonga_server": "dev-master"
    }
}
composer.phar install

起動オプション

コンストラクタで groonga サーバの起動オプションを変更できます, (*5)

例:, (*6)

new GroongaServer(array(
    'protocol' => 'gqtp',
    'encoding' => 'euc',
));

  • db, (*7)

    既存のデータベースファイルを指定することができます。 指定した場合、このファイルが存在するディレクトリが 作業ディレクトリ となります, (*8)

  • tempdir, (*9)

    db を指定しなかった場合に作られる 作業ディレクトリ の格納先を指定します。 デフォルトは sys_get_temp_dir() が使われます, (*10)

  • __protocol__ (--protocol), (*11)

    プロトコル を指定 http もしくは gqtp (default: http), (*12)

  • __port__ (--port), (*13)

    サーバのポートを指定。指定しない場合は、空きポートを探索して自動設定されます, (*14)

  • __pid-path__ (--pid-path), (*15)

    サーバのプロセスID を格納するファイルを指定。起動前に削除されます。 絶対パスを指定した場合はそのファイルが、そうでない場合は 作業ディレクトリからの相対パスとなります (default: 'pid'), (*16)

  • __log-path__ (--log-path), (*17)

    ログファイルの保存先を指定。 絶対パスを指定した場合はそのファイルが、そうでない場合は 作業ディレクトリからの相対パスとなります (default: 'log'), (*18)

  • __query-log-path__ (--query-log-path), (*19)

    クエリログを記録する場合、クエリログファイルの保存先を指定。 絶対パスを指定した場合はそのファイルが、そうでない場合は 作業ディレクトリからの相対パスとなります (default: 指定なし), (*20)

以下のオプションについては、指定した場合、それぞれの起動オプションの値としてそのまま渡されます。 各オプションの説明は groonga コマンドの説明 を参照してください, (*21)

  • __encoding__ (--encoding)
  • __log-level__ (--log-level)
  • __bind-address__ (--bind-address)
  • __server-id__ (--server-id)
  • __document-root__ (--document-root)
  • __max-threads__ (--max-thread)
  • __config-path__ (--config-path)
  • __cache-limit__ (--cache-limit)
  • __default-match-escalation-threshold__ (--default-match-escalation-threshold)

Methods

class dooaki\Test\GroongaServer

run()

Groonga Server を起動します。 コンストラクタで db を指定せずに実行すると、一時的な作業ディレクトリを作りその中に DB ファイルを作成します。 一時的な作業ディレクトリはオブジェクトが破棄されるときに自動的に削除されます。, (*22)

getPid()

サーバのプロセスID を返します, (*23)

getWorkDir()

作業ディレクトリ を返します, (*24)

getPort()

サーバのポート番号を返します, (*25)

getDb()

サーバが開いている DB ファイルを返します, (*26)

getLogFile()

ログファイルのパスを返します, (*27)

getQueryLogFile()

クエリログファイルのパスを返します, (*28)

Author

do_aki <do.hiroaki at gmail.com>, (*29)

License

MIT License, (*30)

The Versions

19/09 2014

dev-master

9999999-dev

Groonga server runner for tests

  Sources   Download

MIT

The Requires

 

The Development Requires

by do_aki

test groonga