From e89883610ab0b0a217500e5988fd5221ae438a47 Mon Sep 17 00:00:00 2001 From: Mikko Koppanen Date: Sat, 22 Aug 2009 14:55:22 +0000 Subject: [PATCH] importing tokyo_tyrant docs git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@287567 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/tokyo_tyrant/.cvsignore | 1 + reference/tokyo_tyrant/book.xml | 54 ++ reference/tokyo_tyrant/configure.xml | 104 +++ reference/tokyo_tyrant/constants.xml | 31 + .../tokyo_tyrant/entities.tokyotyrant.xml | 21 + .../entities.tokyotyrantquery.xml | 13 + .../entities.tokyotyranttable.xml | 11 + reference/tokyo_tyrant/examples.xml | 49 ++ reference/tokyo_tyrant/ini.xml | 157 +++++ reference/tokyo_tyrant/setup.xml | 52 ++ reference/tokyo_tyrant/tokyotyrant.xml | 649 ++++++++++++++++++ reference/tokyo_tyrant/tokyotyrant/add.xml | 125 ++++ .../tokyo_tyrant/tokyotyrant/connect.xml | 109 +++ .../tokyo_tyrant/tokyotyrant/connecturi.xml | 91 +++ .../tokyo_tyrant/tokyotyrant/construct.xml | 93 +++ reference/tokyo_tyrant/tokyotyrant/copy.xml | 92 +++ reference/tokyo_tyrant/tokyotyrant/ext.xml | 109 +++ .../tokyo_tyrant/tokyotyrant/fwmkeys.xml | 121 ++++ reference/tokyo_tyrant/tokyotyrant/get.xml | 110 +++ reference/tokyo_tyrant/tokyotyrant/num.xml | 89 +++ reference/tokyo_tyrant/tokyotyrant/out.xml | 97 +++ reference/tokyo_tyrant/tokyotyrant/put.xml | 119 ++++ reference/tokyo_tyrant/tokyotyrant/putcat.xml | 118 ++++ .../tokyo_tyrant/tokyotyrant/putkeep.xml | 125 ++++ reference/tokyo_tyrant/tokyotyrant/putnr.xml | 120 ++++ reference/tokyo_tyrant/tokyotyrant/putshl.xml | 126 ++++ .../tokyo_tyrant/tokyotyrant/restore.xml | 87 +++ .../tokyo_tyrant/tokyotyrant/setmaster.xml | 126 ++++ reference/tokyo_tyrant/tokyotyrant/size.xml | 91 +++ reference/tokyo_tyrant/tokyotyrant/stat.xml | 126 ++++ reference/tokyo_tyrant/tokyotyrant/sync.xml | 54 ++ reference/tokyo_tyrant/tokyotyrant/vanish.xml | 80 +++ .../tokyo_tyrant/tokyotyrantexception.xml | 112 +++ reference/tokyo_tyrant/tokyotyrantquery.xml | 75 ++ .../tokyo_tyrant/tokyotyrantquery/addcond.xml | 148 ++++ .../tokyotyrantquery/construct.xml | 94 +++ .../tokyo_tyrant/tokyotyrantquery/count.xml | 105 +++ .../tokyo_tyrant/tokyotyrantquery/current.xml | 106 +++ .../tokyo_tyrant/tokyotyrantquery/hint.xml | 100 +++ .../tokyo_tyrant/tokyotyrantquery/key.xml | 106 +++ .../tokyotyrantquery/metasearch.xml | 139 ++++ .../tokyo_tyrant/tokyotyrantquery/next.xml | 106 +++ .../tokyo_tyrant/tokyotyrantquery/out.xml | 98 +++ .../tokyo_tyrant/tokyotyrantquery/rewind.xml | 106 +++ .../tokyo_tyrant/tokyotyrantquery/search.xml | 120 ++++ .../tokyotyrantquery/setlimit.xml | 74 ++ .../tokyo_tyrant/tokyotyrantquery/valid.xml | 106 +++ reference/tokyo_tyrant/tokyotyranttable.xml | 79 +++ .../tokyo_tyrant/tokyotyranttable/add.xml | 95 +++ .../tokyo_tyrant/tokyotyranttable/genuid.xml | 88 +++ .../tokyo_tyrant/tokyotyranttable/get.xml | 109 +++ .../tokyotyranttable/getquery.xml | 108 +++ .../tokyo_tyrant/tokyotyranttable/out.xml | 97 +++ .../tokyo_tyrant/tokyotyranttable/put.xml | 131 ++++ .../tokyo_tyrant/tokyotyranttable/putcat.xml | 132 ++++ .../tokyo_tyrant/tokyotyranttable/putkeep.xml | 138 ++++ .../tokyo_tyrant/tokyotyranttable/putnr.xml | 87 +++ .../tokyo_tyrant/tokyotyranttable/putshl.xml | 98 +++ .../tokyotyranttable/setindex.xml | 74 ++ reference/tokyo_tyrant/versions.xml | 99 +++ 60 files changed, 6280 insertions(+) create mode 100644 reference/tokyo_tyrant/.cvsignore create mode 100644 reference/tokyo_tyrant/book.xml create mode 100644 reference/tokyo_tyrant/configure.xml create mode 100644 reference/tokyo_tyrant/constants.xml create mode 100644 reference/tokyo_tyrant/entities.tokyotyrant.xml create mode 100644 reference/tokyo_tyrant/entities.tokyotyrantquery.xml create mode 100644 reference/tokyo_tyrant/entities.tokyotyranttable.xml create mode 100644 reference/tokyo_tyrant/examples.xml create mode 100644 reference/tokyo_tyrant/ini.xml create mode 100644 reference/tokyo_tyrant/setup.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/add.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/connect.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/connecturi.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/construct.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/copy.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/ext.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/fwmkeys.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/get.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/num.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/out.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/put.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/putcat.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/putkeep.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/putnr.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/putshl.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/restore.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/setmaster.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/size.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/stat.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/sync.xml create mode 100644 reference/tokyo_tyrant/tokyotyrant/vanish.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantexception.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantquery.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantquery/addcond.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantquery/construct.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantquery/count.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantquery/current.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantquery/hint.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantquery/key.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantquery/metasearch.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantquery/next.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantquery/out.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantquery/rewind.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantquery/search.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantquery/setlimit.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantquery/valid.xml create mode 100644 reference/tokyo_tyrant/tokyotyranttable.xml create mode 100644 reference/tokyo_tyrant/tokyotyranttable/add.xml create mode 100644 reference/tokyo_tyrant/tokyotyranttable/genuid.xml create mode 100644 reference/tokyo_tyrant/tokyotyranttable/get.xml create mode 100644 reference/tokyo_tyrant/tokyotyranttable/getquery.xml create mode 100644 reference/tokyo_tyrant/tokyotyranttable/out.xml create mode 100644 reference/tokyo_tyrant/tokyotyranttable/put.xml create mode 100644 reference/tokyo_tyrant/tokyotyranttable/putcat.xml create mode 100644 reference/tokyo_tyrant/tokyotyranttable/putkeep.xml create mode 100644 reference/tokyo_tyrant/tokyotyranttable/putnr.xml create mode 100644 reference/tokyo_tyrant/tokyotyranttable/putshl.xml create mode 100644 reference/tokyo_tyrant/tokyotyranttable/setindex.xml create mode 100644 reference/tokyo_tyrant/versions.xml diff --git a/reference/tokyo_tyrant/.cvsignore b/reference/tokyo_tyrant/.cvsignore new file mode 100644 index 0000000000..c436382dcf --- /dev/null +++ b/reference/tokyo_tyrant/.cvsignore @@ -0,0 +1 @@ +entities.*.xml \ No newline at end of file diff --git a/reference/tokyo_tyrant/book.xml b/reference/tokyo_tyrant/book.xml new file mode 100644 index 0000000000..43d6171a5f --- /dev/null +++ b/reference/tokyo_tyrant/book.xml @@ -0,0 +1,54 @@ + + + + + tokyo_tyrant + tokyo_tyrant + + + &reftitle.intro; + + tokyo_tyrant extension provides a wrapper for Tokyo Tyrant client libraries. The extension + contains the normal key-value API and the table API. + + + + "Tokyo Tyrant is a package of network interface to the DBM called Tokyo Cabinet. Though the DBM has high performance, you might bother in case that multiple processes share the same database, or remote processes access the database. Thus, Tokyo Tyrant is provided for concurrent and remote connections to Tokyo Cabinet. It is composed of the server process managing a database and its access library for client applications." --Tokyo Tyrant documentation + + + + Tokyo Tyrant is written by Mikio Hirabayashi and is licensed under GNU Lesser General Public License. + + + + &reference.tokyo-tyrant.setup; + &reference.tokyo-tyrant.constants; + &reference.tokyo-tyrant.examples; + + &reference.tokyo-tyrant.tokyotyrant; + &reference.tokyo-tyrant.tokyotyranttable; + &reference.tokyo-tyrant.tokyotyrantquery; + + + + + diff --git a/reference/tokyo_tyrant/configure.xml b/reference/tokyo_tyrant/configure.xml new file mode 100644 index 0000000000..ddf4a3e03d --- /dev/null +++ b/reference/tokyo_tyrant/configure.xml @@ -0,0 +1,104 @@ + + + +
+ &reftitle.install; + + + &pecl.info; + &url.pecl.package;tokyo_tyrant + + +
+ Configure options + + --with-tokyo-tyrant[=DIR] DIR is the prefix to the Tokyo Tyrant installation + --with-tokyo-cabinet-dir[=DIR] DIR is the prefix to the Tokyo Cabinet installation + --disable-tokyo-tyrant-session Disable Tokyo Tyrant session handler support + +
+ +
+ Enabling the extension + + The extension can be enabled by adding extension=tokyo_tyrant.so to the INI-configuration + +
+ +
+ Running Tokyo Tyrant for the session handler + + ttserver -port 2000 -ext /path/to/expire.lua -extpc expire 30.0 '/tmp/sessions.tct#idx=ts:dec' + + + + expire.lua is included in the tokyo_tyrant extension source distribution + + +
+ +
+ Configuring session handler + + + tokyo_tyrant.session_salt="randomlongstring" + session.save_handler=tokyo_tyrant + session.save_path="tcp://hostname1:2000,tcp://hostname2:2000" + + + + + It is important to make sure that tokyo_tyrant.session_salt matches on all servers. + + +
+ +
+ How it works? + + The session handler creates a session id like the following: + 8b0e27a823fa4a6cf7246945b82c1d51-a5eadbbed1f2075952900628456bfd6830541629-0-5460 + + + + The parts from left to right: + + + + Session id - Generated session id + Checksum - Checksum of session salt, session id, node id and primary key + Node id - The id of the node where the session maps to + Primary key - The primary key of the row where the session is stored + + + + The checksum contains SHA1 sum of the node id, primary key, session id and the salt which is known only on the server side. This allows quick mapping of session id to node and primary key since there is no need to do an additional search. During session id regeneration only the parts 1 and 2 change but the mapping to the node and primary key stays constant. + + + In case some of the nodes fail tokyo_tyrant.allow_failover, tokyo_tyrant.fail_threshold and tokyo_tyrant.health_check_divisor INI-settings control the behavior during failover. If failover is allowed the session handler will map the session to a healthy node and creates a new empty session. + +
+ +
+ + + diff --git a/reference/tokyo_tyrant/constants.xml b/reference/tokyo_tyrant/constants.xml new file mode 100644 index 0000000000..acc101436e --- /dev/null +++ b/reference/tokyo_tyrant/constants.xml @@ -0,0 +1,31 @@ + + + + + &reftitle.constants; + + TokyoTyrant constant + + + + + diff --git a/reference/tokyo_tyrant/entities.tokyotyrant.xml b/reference/tokyo_tyrant/entities.tokyotyrant.xml new file mode 100644 index 0000000000..0a8efa9de9 --- /dev/null +++ b/reference/tokyo_tyrant/entities.tokyotyrant.xml @@ -0,0 +1,21 @@ +&reference.tokyo-tyrant.tokyotyrant.add; +&reference.tokyo-tyrant.tokyotyrant.connect; +&reference.tokyo-tyrant.tokyotyrant.connecturi; +&reference.tokyo-tyrant.tokyotyrant.construct; +&reference.tokyo-tyrant.tokyotyrant.copy; +&reference.tokyo-tyrant.tokyotyrant.ext; +&reference.tokyo-tyrant.tokyotyrant.fwmkeys; +&reference.tokyo-tyrant.tokyotyrant.get; +&reference.tokyo-tyrant.tokyotyrant.num; +&reference.tokyo-tyrant.tokyotyrant.out; +&reference.tokyo-tyrant.tokyotyrant.put; +&reference.tokyo-tyrant.tokyotyrant.putcat; +&reference.tokyo-tyrant.tokyotyrant.putkeep; +&reference.tokyo-tyrant.tokyotyrant.putnr; +&reference.tokyo-tyrant.tokyotyrant.putshl; +&reference.tokyo-tyrant.tokyotyrant.restore; +&reference.tokyo-tyrant.tokyotyrant.setmaster; +&reference.tokyo-tyrant.tokyotyrant.size; +&reference.tokyo-tyrant.tokyotyrant.stat; +&reference.tokyo-tyrant.tokyotyrant.sync; +&reference.tokyo-tyrant.tokyotyrant.vanish; diff --git a/reference/tokyo_tyrant/entities.tokyotyrantquery.xml b/reference/tokyo_tyrant/entities.tokyotyrantquery.xml new file mode 100644 index 0000000000..38e3b75dca --- /dev/null +++ b/reference/tokyo_tyrant/entities.tokyotyrantquery.xml @@ -0,0 +1,13 @@ +&reference.tokyo-tyrant.tokyotyrantquery.addcond; +&reference.tokyo-tyrant.tokyotyrantquery.construct; +&reference.tokyo-tyrant.tokyotyrantquery.count; +&reference.tokyo-tyrant.tokyotyrantquery.current; +&reference.tokyo-tyrant.tokyotyrantquery.hint; +&reference.tokyo-tyrant.tokyotyrantquery.key; +&reference.tokyo-tyrant.tokyotyrantquery.metasearch; +&reference.tokyo-tyrant.tokyotyrantquery.next; +&reference.tokyo-tyrant.tokyotyrantquery.out; +&reference.tokyo-tyrant.tokyotyrantquery.rewind; +&reference.tokyo-tyrant.tokyotyrantquery.search; +&reference.tokyo-tyrant.tokyotyrantquery.setlimit; +&reference.tokyo-tyrant.tokyotyrantquery.valid; diff --git a/reference/tokyo_tyrant/entities.tokyotyranttable.xml b/reference/tokyo_tyrant/entities.tokyotyranttable.xml new file mode 100644 index 0000000000..8f343b5f8e --- /dev/null +++ b/reference/tokyo_tyrant/entities.tokyotyranttable.xml @@ -0,0 +1,11 @@ +&reference.tokyo-tyrant.tokyotyranttable.add; +&reference.tokyo-tyrant.tokyotyranttable.genuid; +&reference.tokyo-tyrant.tokyotyranttable.get; +&reference.tokyo-tyrant.tokyotyranttable.getquery; +&reference.tokyo-tyrant.tokyotyranttable.out; +&reference.tokyo-tyrant.tokyotyranttable.put; +&reference.tokyo-tyrant.tokyotyranttable.putcat; +&reference.tokyo-tyrant.tokyotyranttable.putkeep; +&reference.tokyo-tyrant.tokyotyranttable.putnr; +&reference.tokyo-tyrant.tokyotyranttable.putshl; +&reference.tokyo-tyrant.tokyotyranttable.setindex; diff --git a/reference/tokyo_tyrant/examples.xml b/reference/tokyo_tyrant/examples.xml new file mode 100644 index 0000000000..9ebb337d34 --- /dev/null +++ b/reference/tokyo_tyrant/examples.xml @@ -0,0 +1,49 @@ + + + + + &reftitle.examples; + + Basic usage + + + Putting and getting a key-value pair + +put("key", "value"); +echo $tt->get("key"); +?> +]]> + + &example.outputs; + + + + + + + + diff --git a/reference/tokyo_tyrant/ini.xml b/reference/tokyo_tyrant/ini.xml new file mode 100644 index 0000000000..760e56a046 --- /dev/null +++ b/reference/tokyo_tyrant/ini.xml @@ -0,0 +1,157 @@ + + + +
+ &reftitle.runtime; + &extension.runtime; + + + tokyo_tyrant &ConfigureOptions; + + + + &Name; + &Default; + &Changeable; + &Changelog; + + + + + tokyo_tyrant.default_timeout + 2.0 + PHP_INI_ALL + + + + tokyo_tyrant.session_salt + &null; + PHP_INI_ALL + + + + tokyo_tyrant.key_prefix + &null; + PHP_INI_ALL + + + + tokyo_tyrant.allow_failover + 1 + PHP_INI_ALL + + + + tokyo_tyrant.fail_threshold + 5 + PHP_INI_ALL + + + + tokyo_tyrant.health_check_divisor + 1000 + PHP_INI_ALL + + + + tokyo_tyrant.php_expiration + 0 + PHP_INI_ALL + + + + +
+
+ + &ini.descriptions.title; + + + + + + tokyo_tyrant.default_timeout + integer + + + + Default timeout when connecting to databases + + + + + + tokyo_tyrant.session_salt + string + + + + The secret that is used to salt session id + + + + + + tokyo_tyrant.key_prefix + string + + + + Prefix all keys with this string. The prefix is transparent + to the developer but helps making sure that keys won't collide if multiple + applications are using the same database. + + + + + + tokyo_tyrant.allow_failover + integer + + + + Whether to allow session failover in case a server dies. + + + + + + tokyo_tyrant.fail_threshold + integer + + + + How many read/write or connection failures is allowed + before server is marked as failed. + + + + + + tokyo_tyrant.health_check_divisor + integer + + + + Defines the divisor for the health check probability. If there are failed + servers and the probability matches, the servers are health checked and + in case the server seems healthy, it will be added back to the pool. + + + + + + tokyo_tyrant.php_expiration + integer + + + + Whether to use built in session expiration mechanism or delegate + expire.lua like script. + + + + + + +
diff --git a/reference/tokyo_tyrant/setup.xml b/reference/tokyo_tyrant/setup.xml new file mode 100644 index 0000000000..f494cab4d1 --- /dev/null +++ b/reference/tokyo_tyrant/setup.xml @@ -0,0 +1,52 @@ + + + + + &reftitle.setup; + +
+ &reftitle.required; + + + Before using this extension Tokyo Cabinet and Tokyo Tyrant must be installed. + +
+ + + &reference.tokyo-tyrant.configure; + + + + + &reference.tokyo-tyrant.ini; + + + +
+ &reftitle.resources; + &no.resource; +
+ +
+ + + diff --git a/reference/tokyo_tyrant/tokyotyrant.xml b/reference/tokyo_tyrant/tokyotyrant.xml new file mode 100644 index 0000000000..8ac65cc1e6 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant.xml @@ -0,0 +1,649 @@ + + + + + + The TokyoTyrant class + TokyoTyrant + + + + +
+ &reftitle.intro; + + The main Tokyo Tyrant class + +
+ + +
+ &reftitle.classsynopsis; + + + + TokyoTyrant + + + + + TokyoTyrant + + + + Constants + + const + integer + TokyoTyrant::RDBDEF_PORT + 1978 + + + const + integer + TokyoTyrant::RDBQC_STREQ + 0 + + + const + integer + TokyoTyrant::RDBQC_STRINC + 1 + + + const + integer + TokyoTyrant::RDBQC_STRBW + 2 + + + const + integer + TokyoTyrant::RDBQC_STREW + 3 + + + const + integer + TokyoTyrant::RDBQC_STRAND + 4 + + + const + integer + TokyoTyrant::RDBQC_STROR + 5 + + + const + integer + TokyoTyrant::RDBQC_STROREQ + 6 + + + const + integer + TokyoTyrant::RDBQC_STRRX + 7 + + + const + integer + TokyoTyrant::RDBQC_NUMEQ + 8 + + + const + integer + TokyoTyrant::RDBQC_NUMGT + 9 + + + const + integer + TokyoTyrant::RDBQC_NUMGE + 10 + + + const + integer + TokyoTyrant::RDBQC_NUMLT + 11 + + + const + integer + TokyoTyrant::RDBQC_NUMLE + 12 + + + const + integer + TokyoTyrant::RDBQC_NUMBT + 13 + + + const + integer + TokyoTyrant::RDBQC_NUMOREQ + 14 + + + const + integer + TokyoTyrant::RDBQC_NEGATE + 16777216 + + + const + integer + TokyoTyrant::RDBQC_NOIDX + 33554432 + + + const + integer + TokyoTyrant::RDBQO_STRASC + 0 + + + const + integer + TokyoTyrant::RDBQO_STRDESC + 1 + + + const + integer + TokyoTyrant::RDBQO_NUMASC + 2 + + + const + integer + TokyoTyrant::RDBQO_NUMDESC + 3 + + + const + integer + TokyoTyrant::RDBIT_LEXICAL + 0 + + + const + integer + TokyoTyrant::RDBIT_DECIMAL + 1 + + + const + integer + TokyoTyrant::RDBIT_OPT + 9998 + + + const + integer + TokyoTyrant::RDBIT_VOID + 9999 + + + const + integer + TokyoTyrant::RDBIT_KEEP + 16777216 + + + + const + integer + TokyoTyrant::RDBQCFTS_PH + 15 + + + + const + integer + TokyoTyrant::RDBQCFTS_AND + 16 + + + + const + integer + TokyoTyrant::RDBQCFTS_OR + 17 + + + + const + integer + TokyoTyrant::RDBQCFTS_EX + 18 + + + + const + integer + TokyoTyrant::RDBXO_LCKREC + 1 + + + + const + integer + TokyoTyrant::RDBXOLCK_GLB + 2 + + + + const + integer + TokyoTyrant::RDBREC_INT + 1 + + + + const + integer + TokyoTyrant::RDBREC_DBL + 2 + + + + const + integer + TokyoTyrant::RDBMS_UNION + 0 + + + + const + integer + TokyoTyrant::RDBMS_ISECT + 1 + + + + const + integer + TokyoTyrant::RDBMS_DIFF + 2 + + + Methods + + + + +
+ + +
+ &reftitle.constants; +
+ TokyoTyrant Constants + + + + TokyoTyrant::RDBDEF_PORT + + The default port of the Tokyo Tyrant database + + + + + TokyoTyrant::RDBQC_STREQ + + string is equal to + + + + + TokyoTyrant::RDBQC_STRINC + + string is included in + + + + + TokyoTyrant::RDBQC_STRBW + + string begins with + + + + + TokyoTyrant::RDBQC_STREW + + string ends with + + + + + TokyoTyrant::RDBQC_STRAND + + string includes all tokens in + + + + + TokyoTyrant::RDBQC_STROR + + string includes at least one token in + + + + + TokyoTyrant::RDBQC_STROREQ + + string is equal to at least one token in + + + + + TokyoTyrant::RDBQC_STRRX + + string matches regular expressions of + + + + + TokyoTyrant::RDBQC_NUMEQ + + number is equal to + + + + + TokyoTyrant::RDBQC_NUMGT + + number is greater than + + + + + TokyoTyrant::RDBQC_NUMGE + + number is greater than or equal to + + + + + TokyoTyrant::RDBQC_NUMLT + + number is less than + + + + + TokyoTyrant::RDBQC_NUMLE + + number is less than or equal to + + + + + TokyoTyrant::RDBQC_NUMBT + + number is between two tokens of + + + + + TokyoTyrant::RDBQC_NUMOREQ + + number is equal to at least one token in + + + + + TokyoTyrant::RDBQC_NEGATE + + negation flag + + + + + TokyoTyrant::RDBQC_NOIDX + + no index flag + + + + + TokyoTyrant::RDBQO_STRASC + + string ascending + + + + + TokyoTyrant::RDBQO_STRDESC + + string descending + + + + + TokyoTyrant::RDBQO_NUMASC + + number ascending + + + + + TokyoTyrant::RDBQO_NUMDESC + + number descending + + + + + TokyoTyrant::RDBIT_LEXICAL + + lexical string + + + + + TokyoTyrant::RDBIT_DECIMAL + + decimal string + + + + + TokyoTyrant::RDBIT_OPT + + optimize + + + + + TokyoTyrant::RDBIT_VOID + + void + + + + + TokyoTyrant::RDBIT_KEEP + + keep existing index + + + + + TokyoTyrant::RDBQCFTS_PH + + full-text search with the phrase of (Tokyo Tyrant >= 1.1.29) + + + + + TokyoTyrant::RDBQCFTS_AND + + full-text search with all tokens in (Tokyo Tyrant >= 1.1.29) + + + + + TokyoTyrant::RDBQCFTS_OR + + full-text search with at least one token in (Tokyo Tyrant >= 1.1.29) + + + + + TokyoTyrant::RDBQCFTS_EX + + full-text search with the compound expression of (Tokyo Tyrant >= 1.1.29) + + + + + TokyoTyrant::RDBQCFTS_AND + + Metasearch union between records (Tokyo Tyrant >= 1.1.33) + + + + + TokyoTyrant::RDBQCFTS_OR + + Metasearch intersection between records (Tokyo Tyrant >= 1.1.33) + + + + + TokyoTyrant::RDBQCFTS_EX + + Metasearch difference between records (Tokyo Tyrant >= 1.1.33) + + + + + TokyoTyrant::RDBXOLCK_REC + + record locking + + + + + TokyoTyrant::RDBXOLCK_GLB + + global locking + + + + + TokyoTyrant::RDBREC_INT + + record type int + + + + + TokyoTyrant::RDBREC_DBL + + record type float (double) + + + + + TokyoTyrant::TTE_SUCCESS + + success + + + + + TokyoTyrant::TTE_INVALID + + invalid operation + + + + + TokyoTyrant::TTE_NOHOST + + host not found + + + + + TokyoTyrant::TTE_REFUSED + + connection refused + + + + + TokyoTyrant::TTE_SEND + + send error + + + + + TokyoTyrant::TTE_RECV + + recv error + + + + + TokyoTyrant::TTE_KEEP + + record exist + + + + + TokyoTyrant::TTE_NOREC + + no record found + + + + + TokyoTyrant::TTE_MISC + + miscellaneous error + + + + +
+
+ + + +
+ + &reference.tokyo-tyrant.entities.tokyotyrant; + +
+ + diff --git a/reference/tokyo_tyrant/tokyotyrant/add.xml b/reference/tokyo_tyrant/tokyotyrant/add.xml new file mode 100644 index 0000000000..ab7a935298 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/add.xml @@ -0,0 +1,125 @@ + + + + + + TokyoTyrant::add + Adds to a numeric key + + + + &reftitle.description; + + public intTokyoTyrant::add + stringkey + mixedincrement + stringtype + + + Adds to a int or double value. This increments the value by the given amount + and returns the new value. If the key does not exist a new key is created with + initial value of the increment parameter. + + + + + &reftitle.parameters; + + + + key + + + The string key + + + + + increment + + + The amount to increment + + + + + type + + + TokyoTyrant::RDB_RECINT or TokyoTyrant::RDB_RECDBL constant. + If this parameter is omitted the type is guessed from the increment + parameters type. + + + + + + + + + &reftitle.returnvalues; + + Returns the new value on success + + + + + &reftitle.examples; + + + <methodname>TokyoTyrant::add</methodname> example + +add("test", 3); + +/* String value is converted to double */ +echo $tt->add("test", "3.5", TokyoTyrant::RDB_RECDBL); +?> +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + + TokyoTyrant::put + TokyoTyrant::putcat + TokyoTyrant::putkeep + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/connect.xml b/reference/tokyo_tyrant/tokyotyrant/connect.xml new file mode 100644 index 0000000000..8f568acbe7 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/connect.xml @@ -0,0 +1,109 @@ + + + + + + TokyoTyrant::connect + Connect to a database + + + + &reftitle.description; + + public TokyoTyrantTokyoTyrant::connect + stringhost + intport + boolpersistent + + + Connects to a remote database + + + + + &reftitle.parameters; + + + + host + + + The hostname + + + + + port + + + The port. Default: 1978 + + + + + persistent + + + Whether to create a persistent connection. Default: &true; + + + + + + + + + &reftitle.returnvalues; + + This method returns the current object and throws TokyoTyrantException on failure. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrant::connect</methodname> example + +connect("localhost", TokyoTyrant::RDBDEF_PORT)->put("test", "value"); +?> +]]> + + + + + + + &reftitle.seealso; + + + TokyoTyrant::connectUri + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/connecturi.xml b/reference/tokyo_tyrant/tokyotyrant/connecturi.xml new file mode 100644 index 0000000000..b424118b40 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/connecturi.xml @@ -0,0 +1,91 @@ + + + + + + TokyoTyrant::connectUri + Connects to a database + + + + &reftitle.description; + + public TokyoTyrantTokyoTyrant::connectUri + stringuri + + + Connects to a database using an uri + + + + + &reftitle.parameters; + + + + uri + + + An URI to the database. For example tcp://localhost:1979/ + + + + + + + + + &reftitle.returnvalues; + + This method returns the current object and throws TokyoTyrantException on failure. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrant::connectUri</methodname> example + +connectUri("tcp://localhost:1978/")->put("test", "hi"); +?> +]]> + + + + + + + &reftitle.seealso; + + + Classname::Method + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/construct.xml b/reference/tokyo_tyrant/tokyotyrant/construct.xml new file mode 100644 index 0000000000..e7e321fda4 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/construct.xml @@ -0,0 +1,93 @@ + + + + + + TokyoTyrant::__construct + Construct a new TokyoTyrant object + + + + &reftitle.description; + + TokyoTyrant::__construct + stringhost + stringport + stringpersistent + + + Constructs a new TokyoTyrant object and optionally connects to the database + + + + + &reftitle.parameters; + + + + host + + + The hostname. Default: &null; + + + + + port + + + The hostname. Default: 1978 + + + + + persistent + + + Whether to create a persistent connection. Default: &true; + + + + + + + + + &reftitle.returnvalues; + + Throws TokyoTyrantException if connection to database fails + + + + + &reftitle.seealso; + + + TokyoTyrant::connect + TokyoTyrant::connectUri + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/copy.xml b/reference/tokyo_tyrant/tokyotyrant/copy.xml new file mode 100644 index 0000000000..d694b5e021 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/copy.xml @@ -0,0 +1,92 @@ + + + + + + TokyoTyrant::copy + Copies the database + + + + &reftitle.description; + + public TokyoTyrantTokyoTyrant::copy + stringpath + + + Makes a copy of the current database + + + + + &reftitle.parameters; + + + + path + + + Path to where to copy the database. The user running the remote + database must have a write access to the directory. + + + + + + + + + &reftitle.returnvalues; + + This method returns the current object and throws TokyoTyrantException on failure. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrant::copy</methodname> example + +copy("/tmp/foobar.tct"); +?> +]]> + + + + + + + &reftitle.seealso; + + + TokyoTyrant::restore + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/ext.xml b/reference/tokyo_tyrant/tokyotyrant/ext.xml new file mode 100644 index 0000000000..98d93e4eec --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/ext.xml @@ -0,0 +1,109 @@ + + + + + + TokyoTyrant::ext + Execute a remote script + + + + &reftitle.description; + + public stringTokyoTyrant::ext + stringname + intoptions + stringkey + stringvalue + + + Executes a remote script extension. + + + + + &reftitle.parameters; + + + + name + + + Name of the function to execute + + + + + options + + + Either TokyoTyrant::RDBXO_LCKREC for record locking and + TokyoTyrant::RDBXO_LCKGLB for global locking. + + + + + key + + + The key to pass to the function + + + + + value + + + The value to pass to the function + + + + + + + + + &reftitle.returnvalues; + + Returns the result of the script function + + + + + &reftitle.examples; + + + <methodname>TokyoTyrant::ext</methodname> example + +ext("somefunc", TokyoTyrant::RDBXO_LCKREC, "some_key", "some_value"); +?> +]]> + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/fwmkeys.xml b/reference/tokyo_tyrant/tokyotyrant/fwmkeys.xml new file mode 100644 index 0000000000..986300e539 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/fwmkeys.xml @@ -0,0 +1,121 @@ + + + + + + TokyoTyrant::fwmKeys + Returns the forward matching keys + + + + &reftitle.description; + + public arrayTokyoTyrant::fwmKeys + stringprefix + intmax_recs + + + Returns the forward matching keys from the database + + + + + &reftitle.parameters; + + + + prefix + + + Prefix of the keys + + + + + max_recs + + + Maximum records to return + + + + + + + + + &reftitle.returnvalues; + + Returns an array of matching keys. The values are not returned + + + + + &reftitle.examples; + + + <methodname>TokyoTyrant::fwmKeys</methodname> example + +put("key_" . $i, "value_" . $i); +} + +/* Create 20 non-macthing keys */ +for ($i = 0; $i < 20; $i++) { + $tt->put("something_" . $i, "data_" . $i); +} + +/* Get five matching keys */ +var_dump($tt->fwmKeys("key_", 5)); +?> +]]> + + &example.outputs.similar; + + + string(5) "key_5" + [1]=> + string(6) "key_14" + [2]=> + string(5) "key_6" + [3]=> + string(6) "key_15" + [4]=> + string(5) "key_7" +} +]]> + + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/get.xml b/reference/tokyo_tyrant/tokyotyrant/get.xml new file mode 100644 index 0000000000..da92ac9710 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/get.xml @@ -0,0 +1,110 @@ + + + + + + TokyoTyrant::get + The get purpose + + + + &reftitle.description; + + public mixedTokyoTyrant::get + mixedkeys + + + This method is used to return a value or multiple values. This method accepts a string + or an array as a value. + + + + + &reftitle.parameters; + + + + keys + + + A string key or an array of string keys + + + + + + + + + &reftitle.returnvalues; + + Returns a string or an array based on the given parameters. Throws a TokyoTyrantException + on error. If string is passed null is returned if the key is not found. In case an array + is given as an parameter only existing keys will be returned. It is not an error to pass + a key that does not exist. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrant::get</methodname> example + +put("key1", "value1"); +$tt->put("key2", "value2"); +var_dump($tt->get(array("key1", "key2"))); +var_dump($tt->get("key1")); +?> +]]> + + &example.outputs; + + + string(6) "value1" + ["key2"]=> + string(6) "value2" +} +string(6) "value1" +]]> + + + + + + + &reftitle.seealso; + + + TokyoTyrant::put + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/num.xml b/reference/tokyo_tyrant/tokyotyrant/num.xml new file mode 100644 index 0000000000..ae79ebbbdc --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/num.xml @@ -0,0 +1,89 @@ + + + + + + TokyoTyrant::num + Number of records in the database + + + + &reftitle.description; + + public intTokyoTyrant::num + + + + Returns the number of records in the database + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns number of records in the database + + + + + &reftitle.examples; + + + <methodname>TokyoTyrant::num</methodname> example + +num(); +?> +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + + TokyoTyrant::stat + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/out.xml b/reference/tokyo_tyrant/tokyotyrant/out.xml new file mode 100644 index 0000000000..d04661b058 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/out.xml @@ -0,0 +1,97 @@ + + + + + + TokyoTyrant::out + Removes records + + + + &reftitle.description; + + public TokyoTyrantTokyoTyrant::out + mixedkeys + + + Removes a record or multiple records. This method accepts a string for a single key + or an array of keys for multiple records. + + + + + &reftitle.parameters; + + + + keys + + + A string key or an array of string keys + + + + + + + + + &reftitle.returnvalues; + + This method returns the current object and throws TokyoTyrantException on failure. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrant::out</methodname> example + +put("test1", "value1"); +$tt->put("test2", "value2"); + +$tt->out(array("test1", "test2")); +?> +]]> + + + + + + + &reftitle.seealso; + + + TokyoTyrant::put + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/put.xml b/reference/tokyo_tyrant/tokyotyrant/put.xml new file mode 100644 index 0000000000..670fc1fb40 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/put.xml @@ -0,0 +1,119 @@ + + + + + + TokyoTyrant::put + Puts values + + + + &reftitle.description; + + public TokyoTyrantTokyoTyrant::put + mixedkeys + stringvalue + + + Puts a key-value pair into the database or multiple key-value pairs. If keys is + string then the second parameter value defines the value. + The second parameter is mandatory if keys is a string. If the key exists the value + will be replaced with new value. + + + + + &reftitle.parameters; + + + + keys + + + A string key or an array of key-value pairs + + + + + value + + + The value in case a string key is used + + + + + + + + + &reftitle.returnvalues; + + This method returns a reference to the current object and throws TokyoTyrantException on failure. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrant::put</methodname> example + +put("key", "value"); + +/* Put key-value pairs, new value overwrites the old */ +$tt->put(array("key1" => "value1", "key" => "value2")); + +/* Get back one key */ +echo $tt->get("key"); +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + TokyoTyrant::putKeep + TokyoTyrant::putCat + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/putcat.xml b/reference/tokyo_tyrant/tokyotyrant/putcat.xml new file mode 100644 index 0000000000..7844a85fe4 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/putcat.xml @@ -0,0 +1,118 @@ + + + + + + TokyoTyrant::putCat + Concatenates to a record + + + + &reftitle.description; + + public TokyoTyrantTokyoTyrant::putCat + mixedkeys + stringvalue + + + Appends a value into existing key or multiple values if keys is an array. + The second parameter is mandatory if keys is a string. If the record does + not exist a new record is created. + + + + + &reftitle.parameters; + + + + keys + + + A string key or an array of key-value pairs + + + + + value + + + The value in case a string key is used + + + + + + + + + &reftitle.returnvalues; + + This method returns a reference to the current object and throws TokyoTyrantException on failure. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrant::putCat</methodname> example + +put("key", "value"); + +/* Concatenate single key-value pair */ +$tt->putCat("key", " has more data"); + +/* Echo the key */ +echo $tt->get("key"); +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + TokyoTyrant::put + TokyoTyrant::putKeep + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/putkeep.xml b/reference/tokyo_tyrant/tokyotyrant/putkeep.xml new file mode 100644 index 0000000000..5ed7f8bf3d --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/putkeep.xml @@ -0,0 +1,125 @@ + + + + + + TokyoTyrant::putKeep + Puts a record + + + + &reftitle.description; + + public TokyoTyrantTokyoTyrant::putKeep + mixedkeys + stringvalue + + + Puts a key-value pair into the database or multiple key-value pairs. If keys is + string then the second parameter value defines the value. + The second parameter is mandatory if keys is a string. If the key already + exists this method throws an exception indicating that the records exists. + + + + + &reftitle.parameters; + + + + keys + + + A string key or an array of key-value pairs + + + + + value + + + The string value + + + + + + + + + &reftitle.returnvalues; + + This method returns a reference to the current object and throws TokyoTyrantException on failure. + + + + + &reftitle.examples; + + + <methodname>tokyotyrant::putKeep</methodname> example + +put("key", "value"); + +try { + $tt->putKeep("key", "new value"); +} catch (TokyoTyrantException $e) { + if ($e->getCode() === TokyoTyrant::TTE_KEEP) { + echo "Existing record! Not modified\n"; + } else { + echo "Error: " , $e->getMessage() , "\n"; + } +} +echo $tt->get("key"); +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + TokyoTyrant::put + TokyoTyrant::putCat + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/putnr.xml b/reference/tokyo_tyrant/tokyotyrant/putnr.xml new file mode 100644 index 0000000000..386dde98e3 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/putnr.xml @@ -0,0 +1,120 @@ + + + + + + TokyoTyrant::putNr + Puts value + + + + &reftitle.description; + + public TokyoTyrantTokyoTyrant::putNr + mixedkeys + stringvalue + + + Puts a key-value pair into the database or multiple key-value pairs. If keys is + string then the second parameter value defines the value. + The second parameter is mandatory if keys is a string. This method does not wait + for the response from the server. + + + + + &reftitle.parameters; + + + + keys + + + A string key or an array of key-value pairs + + + + + value + + + The value in case a string key is used + + + + + + + + + &reftitle.returnvalues; + + This method returns a reference to the current object and throws TokyoTyrantException on failure. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrant::putNr</methodname> example + +putNr("key", "value"); + +/* Put key-value pairs */ +$tt->putNr(array("key1" => "value1", "key2" => "value2")); + +/* Get back one key */ +echo $tt->get("key1"); +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + TokyoTyrant::putNr + TokyoTyrant::putKeep + TokyoTyrant::putCat + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/putshl.xml b/reference/tokyo_tyrant/tokyotyrant/putshl.xml new file mode 100644 index 0000000000..c789efc509 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/putshl.xml @@ -0,0 +1,126 @@ + + + + + + TokyoTyrant::putShl + Concatenates to a record + + + + &reftitle.description; + + public voidTokyoTyrant::putShl + stringkey + stringvalue + intwidth + + + Concatenate to a record and shift to left. + + + + + &reftitle.parameters; + + + + key + + + A string key + + + + + value + + + The value to concatenate + + + + + width + + + The width of the record + + + + + + + + + &reftitle.returnvalues; + + This method returns a reference to the current object and throws TokyoTyrantException on failure. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrant::putShl</methodname> example + +put("key", "just a long piece of data"); + +/* Concatenate and shift to left */ +$tt->putShl("key", " and string", 15); + +/* Echo the key */ +echo $tt->get("key"); +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + TokyoTyrant::put + TokyoTyrant::putKeep + TokyoTyrant::putCat + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/restore.xml b/reference/tokyo_tyrant/tokyotyrant/restore.xml new file mode 100644 index 0000000000..720d9a0168 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/restore.xml @@ -0,0 +1,87 @@ + + + + + + TokyoTyrant::restore + Restore the database + + + + &reftitle.description; + + public voidTokyoTyrant::restore + stringlog_dir + inttimestamp + boolcheck_consistency + + + Restore the database from the update log. + + + + This method is not supported on 32bit platforms. + + + + + + &reftitle.parameters; + + + + log_dir + + + Directory where the log is + + + + + timestamp + + + Beginning timestamp with microseconds + + + + + check_consistency + + + Whether to check consistency: Default: &true; + + + + + + + + + &reftitle.returnvalues; + + This method returns the current object and throws TokyoTyrantException on failure. + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/setmaster.xml b/reference/tokyo_tyrant/tokyotyrant/setmaster.xml new file mode 100644 index 0000000000..64356d4ee2 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/setmaster.xml @@ -0,0 +1,126 @@ + + + + + + TokyoTyrant::setMaster + Set the replication master + + + + &reftitle.description; + + public voidTokyoTyrant::setMaster + stringhost + intport + inttimestamp + boolcheck_consistency + + + Sets the replication master of the database + + + + This method is not supported on 32bit platforms. + + + + + + &reftitle.parameters; + + + + host + + + Hostname of the replication master. If &null; the replication is disabled. + + + + + port + + + Port of the replication master + + + + + timestamp + + + Beginning timestamp with microseconds + + + + + check_consistency + + + Whether to check consistency: Default: &true; + + + + + + + + + &reftitle.returnvalues; + + This method returns the current object and throws TokyoTyrantException on failure. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrant::setMaster</methodname> example + +setMaster(NULL, 0, 0); +?> +]]> + + + + + + + &reftitle.seealso; + + + Classname::Method + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/size.xml b/reference/tokyo_tyrant/tokyotyrant/size.xml new file mode 100644 index 0000000000..3fc0306861 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/size.xml @@ -0,0 +1,91 @@ + + + + + + TokyoTyrant::size + Returns the size of the value + + + + &reftitle.description; + + public intTokyoTyrant::size + stringkey + + + Returns the size of a value by key + + + + + &reftitle.parameters; + + + + key + + + The key of which size to fetch + + + + + + + + + &reftitle.returnvalues; + + Returns the size of the key or throw TokyoTyrantException on error + + + + + &reftitle.examples; + + + <methodname>TokyoTyrant::size</methodname> example + +put("test_key", "12345"); + +echo $tt->size("test_key"); +?> +]]> + + &example.outputs; + + + + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/stat.xml b/reference/tokyo_tyrant/tokyotyrant/stat.xml new file mode 100644 index 0000000000..443b468b68 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/stat.xml @@ -0,0 +1,126 @@ + + + + + + TokyoTyrant::stat + Get statistics + + + + &reftitle.description; + + public arrayTokyoTyrant::stat + + + + Returns statistics of the remote database + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns an array of key value pairs describing the statistics + + + + + &reftitle.examples; + + + <methodname>TokyoTyrant::stat</methodname> example + +stat()); +?> +]]> + + &example.outputs.similar; + + + string(6) "1.1.28" + ["libver"]=> + string(3) "311" + ["protver"]=> + string(4) "0.91" + ["os"]=> + string(5) "Linux" + ["time"]=> + string(17) "1247358357.665630" + ["pid"]=> + string(5) "14348" + ["sid"]=> + string(8) "59025947" + ["type"]=> + string(9) "on-memory" + ["path"]=> + string(1) "*" + ["rnum"]=> + string(1) "4" + ["size"]=> + string(6) "262856" + ["bigend"]=> + string(1) "0" + ["fd"]=> + string(1) "5" + ["loadavg"]=> + string(8) "0.000000" + ["memsize"]=> + string(8) "77328384" + ["memrss"]=> + string(7) "1183744" + ["ru_real"]=> + string(13) "162776.042152" + ["ru_user"]=> + string(8) "0.476029" + ["ru_sys"]=> + string(8) "8.652540" +} +]]> + + + + + + + &reftitle.seealso; + + + Classname::Method + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/sync.xml b/reference/tokyo_tyrant/tokyotyrant/sync.xml new file mode 100644 index 0000000000..85f6d128a0 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/sync.xml @@ -0,0 +1,54 @@ + + + + + + TokyoTyrant::sync + Synchronize the database + + + + &reftitle.description; + + public voidtokyotyrant::sync + + + + Synchronizes the database on to the physical device + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + This method returns the current object and throws TokyoTyrantException on failure. + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrant/vanish.xml b/reference/tokyo_tyrant/tokyotyrant/vanish.xml new file mode 100644 index 0000000000..e91b9c8e92 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/vanish.xml @@ -0,0 +1,80 @@ + + + + + + TokyoTyrant::vanish + Empties the database + + + + &reftitle.description; + + public voidTokyoTyrant::vanish + + + + Empties a remote database + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + This method returns the current object and throws TokyoTyrantException on failure. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrant::vanish</methodname> example + +vanish(); +?> +]]> + + + + + + + &reftitle.seealso; + + + TokyoTyrant::out + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantexception.xml b/reference/tokyo_tyrant/tokyotyrantexception.xml new file mode 100644 index 0000000000..70fd80bc98 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantexception.xml @@ -0,0 +1,112 @@ + + + + + + The TokyoTyrantException class + TokyoTyrantException + + + + +
+ &reftitle.intro; + + TokyoTyrantException + +
+ + +
+ &reftitle.classsynopsis; + + + + tokyotyrantexception + + + + + tokyotyrantexception + + + + extends + Exception + + + + Properties + + + Methods + + + Inherited methods + + + + + +
+ + + +
+ &reftitle.properties; + + + message + + The exception message + + + + code + + The exception code. This can be compared to TokyoTyrant::TTE_* constants + + + + file + + Filename where the exception happened + + + + line + + Line where the exception happened + + + +
+ + + +
+ + &reference.tokyo-tyrant.entities.tokyotyrantexception; + +
+ + diff --git a/reference/tokyo_tyrant/tokyotyrantquery.xml b/reference/tokyo_tyrant/tokyotyrantquery.xml new file mode 100644 index 0000000000..00bf5c6300 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantquery.xml @@ -0,0 +1,75 @@ + + + + + + The TokyoTyrantQuery class + TokyoTyrantQuery + + + + +
+ &reftitle.intro; + + This class is used to query the table databases + +
+ + +
+ &reftitle.classsynopsis; + + + + TokyoTyrantQuery + + + + + TokyoTyrantQuery + + + + Iterator + + + + Traversable + + + + + Methods + + + + +
+ +
+ + &reference.tokyo-tyrant.entities.tokyotyrantquery; + +
+ + diff --git a/reference/tokyo_tyrant/tokyotyrantquery/addcond.xml b/reference/tokyo_tyrant/tokyotyrantquery/addcond.xml new file mode 100644 index 0000000000..3bd38f02b6 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantquery/addcond.xml @@ -0,0 +1,148 @@ + + + + + + TokyoTyrantQuery::addCond + Adds a condition to the query + + + + &reftitle.description; + + public voidTokyoTyrantQuery::addCond + stringname + intop + stringexpr + + + Adds a condition to the query. Condition can be something like: get all keys which value + matches expr. + + + + + &reftitle.parameters; + + + + name + + + Name of the column in the condition + + + + + op + + + The operator. One of the TokyoTyrant::RDBQC_* constants + + + + + expr + + + The expression + + + + + + + + + &reftitle.returnvalues; + + This method returns the current object and throws TokyoTyrantException on failure. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrantQuery::addCond</methodname> example + +put(null, array("column1" => "some data", "column2" => "something here")); +$tt->put(null, array("column1" => "more data", "column2" => "best data this far")); +$tt->put(null, array("column1" => "again data", "column3" => "not here")); +$tt->put(null, array("column45" => "random data", "column2" => "something along the lines")); +$tt->put(null, array("column21" => "test data", "column2" => "generating..")); +$tt->put(null, array("column1" => "foobar data", "column2" => "value here")); + +/* Get a new query object */ +$query = $tt->getQuery(); + +/* Add a search condition */ +$query->addCond("column2", TokyoTyrant::RDBQC_STROR, "something"); + +/* Dump the search results */ +var_dump($query->search()); +?> +]]> + + &example.outputs; + + + array(2) { + ["column1"]=> + string(9) "some data" + ["column2"]=> + string(14) "something here" + } + [4]=> + array(2) { + ["column45"]=> + string(11) "random data" + ["column2"]=> + string(25) "something along the lines" + } +} +]]> + + + + + + + &reftitle.seealso; + + + Classname::Method + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantquery/construct.xml b/reference/tokyo_tyrant/tokyotyrantquery/construct.xml new file mode 100644 index 0000000000..579d4b174c --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantquery/construct.xml @@ -0,0 +1,94 @@ + + + + + + TokyoTyrantQuery::__construct + Construct a new query + + + + &reftitle.description; + + TokyoTyrantQuery::__construct + TokyoTyrantTabletable + + + Construct a new query object + + + + + &reftitle.parameters; + + + + table + + + TokyoTyrantTable object with active database connection + + + + + + + + + &reftitle.returnvalues; + + Returns a new TokyoTyrantQuery object and throws TokyoTyrantException on error + + + + + &reftitle.examples; + + + <methodname>TokyoTyrantQuery::__construct</methodname> example + + +]]> + + + + + + + &reftitle.seealso; + + + TokyoTyrantTable::getQuery + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantquery/count.xml b/reference/tokyo_tyrant/tokyotyrantquery/count.xml new file mode 100644 index 0000000000..c57743bd69 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantquery/count.xml @@ -0,0 +1,105 @@ + + + + + + TokyoTyrantQuery::count + Counts records + + + + &reftitle.description; + + public intTokyoTyrantQuery::count + + + + Returns a count of how many records a query returns. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns a count of matching rows and throws TokyoTyrantException on error + + + + + &reftitle.examples; + + + <methodname>TokyoTyrantQuery::count</methodname> example + +put(null, array("column1" => "some data", "column2" => "something here")); +$tt->put(null, array("column1" => "more data", "column2" => "best data this far")); +$tt->put(null, array("column1" => "again data", "column3" => "not here")); +$tt->put(null, array("column45" => "random data", "column2" => "something along the lines")); +$tt->put(null, array("column21" => "test data", "column2" => "generating..")); +$tt->put(null, array("column1" => "foobar data", "column2" => "value here")); + +/* Get a new query object */ +$query = $tt->getQuery(); + +/* Add a search condition */ +$query->addCond("column2", TokyoTyrant::RDBQC_STROR, "something"); + +/* Count the results */ +var_dump($query->count()); +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + TokyoTyrantQuery::out + TokyoTyrantQuery::search + TokyoTyrantQuery::metaSearch + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantquery/current.xml b/reference/tokyo_tyrant/tokyotyrantquery/current.xml new file mode 100644 index 0000000000..0ed2a13d0b --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantquery/current.xml @@ -0,0 +1,106 @@ + + + + + + TokyoTyrantQuery::current + Returns the current element + + + + &reftitle.description; + + public arrayTokyoTyrantQuery::current + + + + Returns the current element. Part of Iterator interface + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the current row + + + + + &reftitle.examples; + + + TokyoTyrantQuery iterator example + +put(null, array("column1" => "some data", "column2" => "something here")); +$tt->put(null, array("column1" => "more data", "column2" => "best data this far")); +$tt->put(null, array("column1" => "again data", "column3" => "foobar here")); +$tt->put(null, array("column45" => "random data", "column2" => "something along the lines")); +$tt->put(null, array("column21" => "test data", "column2" => "generating..")); +$tt->put(null, array("column1" => "foobar data", "column2" => "value here")); + +/* Get a new query object */ +$query = $tt->getQuery(); + +/* Add a search condition */ +$query->addCond("column2", TokyoTyrant::RDBQC_STROR, "something"); + +/* Iterate the results */ +foreach ($query as $key => $value) { + echo "pk: $key, columns: ", count($value) ,"\n"; +} +?> +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + + TokyoTyrantQuery::addCond + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantquery/hint.xml b/reference/tokyo_tyrant/tokyotyrantquery/hint.xml new file mode 100644 index 0000000000..de2969e03a --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantquery/hint.xml @@ -0,0 +1,100 @@ + + + + + + TokyoTyrantQuery::hint + Get the hint string of the query + + + + &reftitle.description; + + public stringTokyoTyrantQuery::hint + + + + Get the hint string of the query. The hint string contains information about an executed query and + it could be compared to for example MySQL EXPLAIN statement. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + This method always returns a string + + + + + &reftitle.examples; + + + TokyoTyrantQuery::hint example + +vanish(); + +for ($i = 0; $i < 11; $i++) { + $tt->put(null, array('a_col' => 'a' . $i, 'b_col' => 'b' . $i)); +} + +$query = $tt->getQuery(); +$query->addCond('a_col', TokyoTyrant::RDBQC_STRBW, 'a'); + +$query->search(); +var_dump($query->hint()); +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + + TokyoTyrantQuery::addCond + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantquery/key.xml b/reference/tokyo_tyrant/tokyotyrantquery/key.xml new file mode 100644 index 0000000000..5ed01526f1 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantquery/key.xml @@ -0,0 +1,106 @@ + + + + + + TokyoTyrantQuery::key + The key purpose + + + + &reftitle.description; + + public intTokyoTyrantQuery::key + + + + Returns the current key. Part of the Iterator interface + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the current key and throws TokyoTyrantException on error + + + + + &reftitle.examples; + + + TokyoTyrantQuery iterator example + +put(null, array("column1" => "some data", "column2" => "something here")); +$tt->put(null, array("column1" => "more data", "column2" => "best data this far")); +$tt->put(null, array("column1" => "again data", "column3" => "foobar here")); +$tt->put(null, array("column45" => "random data", "column2" => "something along the lines")); +$tt->put(null, array("column21" => "test data", "column2" => "generating..")); +$tt->put(null, array("column1" => "foobar data", "column2" => "value here")); + +/* Get a new query object */ +$query = $tt->getQuery(); + +/* Add a search condition */ +$query->addCond("column2", TokyoTyrant::RDBQC_STROR, "something"); + +/* Iterate the results */ +foreach ($query as $key => $value) { + echo "pk: $key, columns: ", count($value) ,"\n"; +} +?> +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + + TokyoTyrantQuery::addCond + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantquery/metasearch.xml b/reference/tokyo_tyrant/tokyotyrantquery/metasearch.xml new file mode 100644 index 0000000000..eb823e5468 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantquery/metasearch.xml @@ -0,0 +1,139 @@ + + + + + + TokyoTyrantQuery::metaSearch + Retrieve records with multiple queries + + + + &reftitle.description; + + public arrayTokyoTyrantQuery::metaSearch + + + + Executes multiple queries on a database and returns matching records. The current object + is always the left most object in the search. + + + + + &reftitle.parameters; + + + + queries + + + Array of TokyoTyrantQuery objects + + + + + type + + + One of the TokyoTyrant::RDBMS_* constants + + + + + + + + + &reftitle.returnvalues; + + Returns the matching rows and throws TokyoTyrantException on error + + + + + &reftitle.examples; + + + <methodname>TokyoTyrantQuery::metaSearch</methodname> example + +put('cherry', array('color' => 'red')); +$tt->put('strawberry', array('color' => 'red')); +$tt->put('apple', array('color' => 'green')); +$tt->put('lemon', array('color' => 'yellow')); + +/* First query */ +$query = $tt->getQuery(); +$query->addCond('color', TokyoTyrant::RDBQC_STREQ, 'red')->setOrder('color', TokyoTyrant::RDBQO_STRASC); + +/* Second query */ +$query1 = $tt->getQuery(); +$query1->addCond('color', TokyoTyrant::RDBQC_STREQ, 'yellow'); + +/* Get union between the queries */ +var_dump($query->metaSearch(array($query1), TokyoTyrant::RDBMS_UNION)); +?> +]]> + + &example.outputs; + + + array(1) { + ["color"]=> + string(3) "red" + } + ["strawberry"]=> + array(1) { + ["color"]=> + string(3) "red" + } + ["lemon"]=> + array(1) { + ["color"]=> + string(6) "yellow" + } +} +]]> + + + + + + + &reftitle.seealso; + + + TokyoTyrantQuery::search + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantquery/next.xml b/reference/tokyo_tyrant/tokyotyrantquery/next.xml new file mode 100644 index 0000000000..ebaba18a2a --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantquery/next.xml @@ -0,0 +1,106 @@ + + + + + + TokyoTyrantQuery::next + The next purpose + + + + &reftitle.description; + + public arrayTokyoTyrantQuery::next + + + + Returns the next result in the resultset. Part of the Iterator interface. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the next row and throws TokyoTyrantException on error. + + + + + &reftitle.examples; + + + TokyoTyrantQuery iterator example + +put(null, array("column1" => "some data", "column2" => "something here")); +$tt->put(null, array("column1" => "more data", "column2" => "best data this far")); +$tt->put(null, array("column1" => "again data", "column3" => "foobar here")); +$tt->put(null, array("column45" => "random data", "column2" => "something along the lines")); +$tt->put(null, array("column21" => "test data", "column2" => "generating..")); +$tt->put(null, array("column1" => "foobar data", "column2" => "value here")); + +/* Get a new query object */ +$query = $tt->getQuery(); + +/* Add a search condition */ +$query->addCond("column2", TokyoTyrant::RDBQC_STROR, "something"); + +/* Iterate the results */ +foreach ($query as $key => $value) { + echo "pk: $key, columns: ", count($value) ,"\n"; +} +?> +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + + TokyoTyrantQuery::addCond + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantquery/out.xml b/reference/tokyo_tyrant/tokyotyrantquery/out.xml new file mode 100644 index 0000000000..cfe245dcf7 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantquery/out.xml @@ -0,0 +1,98 @@ + + + + + + TokyoTyrantQuery::out + Removes records based on query + + + + &reftitle.description; + + public TokyoTyrantQueryTokyoTyrantQuery::out + + + + Removes all records that match the query. Works exactly like search but removes the records instead + of returning them. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + This method returns the current object and throws TokyoTyrantException on failure. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrantQuery::out</methodname> example + +put(null, array("column1" => "some data", "column2" => "something here")); +$tt->put(null, array("column1" => "more data", "column2" => "best data this far")); +$tt->put(null, array("column1" => "again data", "column3" => "foobar here")); +$tt->put(null, array("column45" => "random data", "column2" => "something along the lines")); +$tt->put(null, array("column21" => "test data", "column2" => "generating..")); +$tt->put(null, array("column1" => "foobar data", "column2" => "value here")); + +/* Get a new query object */ +$query = $tt->getQuery(); + +/* Add a search condition */ +$query->addCond("column2", TokyoTyrant::RDBQC_STROR, "something"); + +/* Remove matching records */ +$query->out(); +?> +]]> + + + + + + + &reftitle.seealso; + + + TokyoTyrantQuery::addCond + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantquery/rewind.xml b/reference/tokyo_tyrant/tokyotyrantquery/rewind.xml new file mode 100644 index 0000000000..4c1957b055 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantquery/rewind.xml @@ -0,0 +1,106 @@ + + + + + + TokyoTyrantQuery::rewind + The rewind purpose + + + + &reftitle.description; + + public booleanTokyoTyrantQuery::rewind + + + + Rewind the resultset and executes the query if it has not been executed. Part of the Iterator interface. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns &true; + + + + + &reftitle.examples; + + + TokyoTyrantQuery iterator example + +put(null, array("column1" => "some data", "column2" => "something here")); +$tt->put(null, array("column1" => "more data", "column2" => "best data this far")); +$tt->put(null, array("column1" => "again data", "column3" => "foobar here")); +$tt->put(null, array("column45" => "random data", "column2" => "something along the lines")); +$tt->put(null, array("column21" => "test data", "column2" => "generating..")); +$tt->put(null, array("column1" => "foobar data", "column2" => "value here")); + +/* Get a new query object */ +$query = $tt->getQuery(); + +/* Add a search condition */ +$query->addCond("column2", TokyoTyrant::RDBQC_STROR, "something"); + +/* Iterate the results */ +foreach ($query as $key => $value) { + echo "pk: $key, columns: ", count($value) ,"\n"; +} +?> +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + + TokyoTyrantQuery::addCond + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantquery/search.xml b/reference/tokyo_tyrant/tokyotyrantquery/search.xml new file mode 100644 index 0000000000..ea9dd9d1f3 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantquery/search.xml @@ -0,0 +1,120 @@ + + + + + + TokyoTyrantQuery::search + Searches records + + + + &reftitle.description; + + public arrayTokyoTyrantQuery::search + + + + Executes a search on the table database. Returns an array of arrays containing the matching records. + In the returned array the first level is the primary key of the data and the second level is the row data. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the matching rows and throws TokyoTyrantException on error + + + + + &reftitle.examples; + + + <methodname>TokyoTyrantQuery::search</methodname> example + +put(null, array("column1" => "some data", "column2" => "something here")); +$tt->put(null, array("column1" => "more data", "column2" => "best data this far")); +$tt->put(null, array("column1" => "again data", "column3" => "not here")); +$tt->put(null, array("column45" => "random data", "column2" => "something along the lines")); +$tt->put(null, array("column21" => "test data", "column2" => "generating..")); +$tt->put(null, array("column1" => "foobar data", "column2" => "value here")); + +/* Get a new query object */ +$query = $tt->getQuery(); + +/* Add a search condition */ +$query->addCond("column2", TokyoTyrant::RDBQC_STROR, "something"); + +/* Dump the search results */ +var_dump($query->search()); +?> +]]> + + &example.outputs; + + + array(2) { + ["column1"]=> + string(9) "some data" + ["column2"]=> + string(14) "something here" + } + [4]=> + array(2) { + ["column45"]=> + string(11) "random data" + ["column2"]=> + string(25) "something along the lines" + } +} +]]> + + + + + + + &reftitle.seealso; + + + TokyoTyrantQuery::out + TokyoTyrantQuery::metaSearch + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantquery/setlimit.xml b/reference/tokyo_tyrant/tokyotyrantquery/setlimit.xml new file mode 100644 index 0000000000..655fe55fb3 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantquery/setlimit.xml @@ -0,0 +1,74 @@ + + + + + + TokyoTyrantQuery::setLimit + Limit results + + + + &reftitle.description; + + public voidTokyoTyrantQuery::setLimit + intmax + intskip + + + Set the maximum amount of records to return on a query. + + + + + &reftitle.parameters; + + + + max + + + Maximum amount of records. Default: -1 + + + + + skip + + + How many records to skip from the start. Default: -1 + + + + + + + + + &reftitle.returnvalues; + + This method returns the current object and throws TokyoTyrantException on failure. + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantquery/valid.xml b/reference/tokyo_tyrant/tokyotyrantquery/valid.xml new file mode 100644 index 0000000000..5e9fb650dc --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantquery/valid.xml @@ -0,0 +1,106 @@ + + + + + + TokyoTyrantQuery::valid + Checks the validity of current item + + + + &reftitle.description; + + public voidTokyoTyrantQuery::valid + + + + Checks if the current item is valid. Part of the Iterator interface + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns &true; if the current item is valid and &false; if not. + + + + + &reftitle.examples; + + + TokyoTyrantQuery iterator example + +put(null, array("column1" => "some data", "column2" => "something here")); +$tt->put(null, array("column1" => "more data", "column2" => "best data this far")); +$tt->put(null, array("column1" => "again data", "column3" => "foobar here")); +$tt->put(null, array("column45" => "random data", "column2" => "something along the lines")); +$tt->put(null, array("column21" => "test data", "column2" => "generating..")); +$tt->put(null, array("column1" => "foobar data", "column2" => "value here")); + +/* Get a new query object */ +$query = $tt->getQuery(); + +/* Add a search condition */ +$query->addCond("column2", TokyoTyrant::RDBQC_STROR, "something"); + +/* Iterate the results */ +foreach ($query as $key => $value) { + echo "pk: $key, columns: ", count($value) ,"\n"; +} +?> +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + + TokyoTyrantQuery::addCond + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyranttable.xml b/reference/tokyo_tyrant/tokyotyranttable.xml new file mode 100644 index 0000000000..529247859b --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyranttable.xml @@ -0,0 +1,79 @@ + + + + + + The TokyoTyrantTable class + TokyoTyrantTable + + + + +
+ &reftitle.intro; + + Provides an API to the table databases. A table database can be create using the following + command: ttserver -port 1979 /tmp/tt_table.tct. In Tokyo Tyrant the table + API is a schemaless database which can store arbitrary amount of key-value pairs under a single + primary key. + +
+ + +
+ &reftitle.classsynopsis; + + + + TokyoTyrantTable + + + + + TokyoTyrantTable + + + + extends + TokyoTyrant + + + + + Methods + + + Inherited methods + + + + + +
+ +
+ + &reference.tokyo-tyrant.entities.tokyotyranttable; + +
+ + diff --git a/reference/tokyo_tyrant/tokyotyranttable/add.xml b/reference/tokyo_tyrant/tokyotyranttable/add.xml new file mode 100644 index 0000000000..a294edef69 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyranttable/add.xml @@ -0,0 +1,95 @@ + + + + + + TokyoTyrantTable::add + Adds a record + + + + &reftitle.description; + + public intTokyoTyrantTable::add + stringkey + mixedincrement + stringtype + + + This method is not supported with table databases. + + + + + &reftitle.parameters; + + + + key + + + The string key + + + + + increment + + + The amount to increment + + + + + type + + + TokyoTyrant::RDB_RECINT or TokyoTyrant::RDB_RECDBL constant. + If this parameter is omitted the type is guessed from the increment + parameters type. + + + + + + + + + &reftitle.returnvalues; + + This method throws an TokyoTyrantException if used through this class. + + + + + + &reftitle.seealso; + + + TokyoTyrant::add + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyranttable/genuid.xml b/reference/tokyo_tyrant/tokyotyranttable/genuid.xml new file mode 100644 index 0000000000..67dab07eba --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyranttable/genuid.xml @@ -0,0 +1,88 @@ + + + + + + TokyoTyrantTable::genUid + Generate unique id + + + + &reftitle.description; + + public intTokyoTyrantTable::genUid + + + + Generates an unique id inside the table database. In table databases rows are referenced + using a numeric primary key. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns an unique id or throws TokyoTyrantException on error + + + + + &reftitle.examples; + + + <methodname>TokyoTyrantTable::genUid</methodname> example + +genUid(); +?> +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + + TokyoTyrantTable::put + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyranttable/get.xml b/reference/tokyo_tyrant/tokyotyranttable/get.xml new file mode 100644 index 0000000000..b8459fe25f --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyranttable/get.xml @@ -0,0 +1,109 @@ + + + + + + TokyoTyrantTable::get + Get a row + + + + &reftitle.description; + + public voidTokyoTyrantTable::get + mixedkeys + + + Gets a row from table database. keys is a single integer for + the primary key of the row or an array of integers for multiple rows. + + + + + &reftitle.parameters; + + + + keys + + + Single integer or an array of integers for multiple keys + + + + + + + + + &reftitle.returnvalues; + + Returns the row as an array or an array of arrays for multiple keys + + + + + &reftitle.examples; + + + <methodname>TokyoTyrantTable::get</methodname> example + +put(null, array("column1" => "some data", "column2" => "more data")); + +/* Get the row back */ +var_dump($tt->get($index)); +?> +]]> + + &example.outputs; + + + string(9) "some data" + ["column2"]=> + string(9) "more data" +} +]]> + + + + + + + &reftitle.seealso; + + + TokyoTyrantTable::put + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyranttable/getquery.xml b/reference/tokyo_tyrant/tokyotyranttable/getquery.xml new file mode 100644 index 0000000000..00e883f8b1 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyranttable/getquery.xml @@ -0,0 +1,108 @@ + + + + + + TokyoTyrantTable::getQuery + Get a query object + + + + &reftitle.description; + + public TokyoTyrantQueryTokyoTyrantTable::getQuery + + + + Get a query object to execute searches on the database + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns TokyoTyrantQuery on success and throws TokyoTyrantException on error + + + + + &reftitle.examples; + + + <methodname>TokyoTyrantTable::getQuery</methodname> example + +put(null, array("column1" => "some data", "column2" => "more data")); +$table->put(null, array("something" => "value", "data" => "good data")); + +/* Get query object */ +$query = $table->getQuery(); + +/* Add condition to query */ +$query->addCond('data', TokyoTyrant::RDBQC_STREQ, 'good data'); + +/* Get matching rows */ +var_dump($query->search()); +?> +]]> + + &example.outputs.similar; + + + array(2) { + ["something"]=> + string(5) "value" + ["data"]=> + string(9) "good data" + } +} +]]> + + + + + + + &reftitle.seealso; + + + TokyoTyrantQuery::search + TokyoTyrantQuery::out + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyranttable/out.xml b/reference/tokyo_tyrant/tokyotyranttable/out.xml new file mode 100644 index 0000000000..20ee2fde41 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyranttable/out.xml @@ -0,0 +1,97 @@ + + + + + + TokyoTyrantTable::out + Remove records + + + + &reftitle.description; + + public voidTokyoTyrantTable::out + mixedkeys + + + Removes records from a table database. + + + + + &reftitle.parameters; + + + + keys + + + A single integer key or an array of integers + + + + + + + + + &reftitle.returnvalues; + + This method returns the current object and throws TokyoTyrantException on failure. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrantTable::out</methodname> example + +put(null, array("column1" => "some data", "column2" => "more data")); + +/* Delete the row */ +$tt->out($index); +?> +]]> + + + + + + + &reftitle.seealso; + + + TokyoTyrantTable::put + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyranttable/put.xml b/reference/tokyo_tyrant/tokyotyranttable/put.xml new file mode 100644 index 0000000000..71d6850407 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyranttable/put.xml @@ -0,0 +1,131 @@ + + + + + + TokyoTyrantTable::put + Store a row + + + + &reftitle.description; + + public intTokyoTyrantTable::put + intkey + arraycolumns + + + Puts a new row into the database. This method parameters are key which is + the primary key of the row, passing &null; will generate a new unique id. value + is an array containing the row contents which is usually key value pairs. + + + + + &reftitle.parameters; + + + + key + + + The primary key of the row + + + + + columns + + + The row contents + + + + + + + + + &reftitle.returnvalues; + + Returns the primary key on success and throws TokyoTyrantException on error + + + + + &reftitle.examples; + + + <methodname>TokyoTyrantTable::put</methodname> example + +put(null, array("column1" => "some data", "column2" => "more data")); + +/* Get the row back */ +var_dump($tt->get($index)); + +/* Modify an existing row */ +$tt->put($index, array("column1" => "other data", "column2" => "better data")); + +/* Get the row back */ +var_dump($tt->get($index)); +?> +]]> + + &example.outputs; + + + string(9) "some data" + ["column2"]=> + string(9) "more data" +} +array(2) { + ["column1"]=> + string(10) "other data" + ["column2"]=> + string(11) "better data" +} +]]> + + + + + + + &reftitle.seealso; + + + TokyoTyrantTable::get + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyranttable/putcat.xml b/reference/tokyo_tyrant/tokyotyranttable/putcat.xml new file mode 100644 index 0000000000..eaacedfbac --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyranttable/putcat.xml @@ -0,0 +1,132 @@ + + + + + + TokyoTyrantTable::putCat + Concatenates to a row + + + + &reftitle.description; + + public voidTokyoTyrantTable::putCat + intkey + arraycolumns + + + This method can be used to add new columns to existing records. Existing keys will be left unmodified + but any new columns will be appended to the row. Passing null as key will generate a new row. + + + + + &reftitle.parameters; + + + + key + + + The primary key of the row or &null; + + + + + columns + + + Array of row contents + + + + + + + + + &reftitle.returnvalues; + + Returns the primary key and throws TokyoTyrantException on error. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrantTable::putCat</methodname> example + +put(null, array("column1" => "some data", "column2" => "more data")); + +/* Get the row back */ +var_dump($tt->get($index)); + +/* Modify an existing row */ +$tt->putcat($index, array("column1" => "something new", "new_column" => "other data")); + +/* Get the row back */ +var_dump($tt->get($index)); +?> +]]> + + &example.outputs; + + + string(9) "some data" + ["column2"]=> + string(9) "more data" +} +array(3) { + ["column1"]=> + string(9) "some data" + ["column2"]=> + string(9) "more data" + ["new_column"]=> + string(10) "other data" +} +]]> + + + + + + + &reftitle.seealso; + + + TokyoTyrantTable::put + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyranttable/putkeep.xml b/reference/tokyo_tyrant/tokyotyranttable/putkeep.xml new file mode 100644 index 0000000000..0b56ee463a --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyranttable/putkeep.xml @@ -0,0 +1,138 @@ + + + + + + TokyoTyrantTable::putKeep + Put a new record + + + + &reftitle.description; + + public voidTokyoTyrantTable::putKeep + intkey + arraycolumns + + + Puts a new record into the database. If the key already exists this method throws an exception + indicating that the records exists. + + + + + &reftitle.parameters; + + + + key + + + The primary key of the row or &null; + + + + + columns + + + Array of the row contents + + + + + + + + + &reftitle.returnvalues; + + Returns the primary key and throws TokyoTyrantException on error. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrantTable::putKeep</methodname> example + +put(null, array("column1" => "some data", "column2" => "more data")); + +/* Get the row back */ +var_dump($tt->get($index)); + +try { + $tt->putKeep($index, array("column1" => "something new", "new_column" => "other data")); +} catch (TokyoTyrantException $e) { + if ($e->getCode() === TokyoTyrant::TTE_KEEP) { + echo "Existing record! Not modified\n"; + } else { + echo "Error: " , $e->getMessage() , "\n"; + } +} + +/* Get the row back */ +var_dump($tt->get($index)); +?> +]]> + + &example.outputs.similar; + + + string(9) "some data" + ["column2"]=> + string(9) "more data" +} +Existing record! Not modified +array(2) { + ["column1"]=> + string(9) "some data" + ["column2"]=> + string(9) "more data" +} +]]> + + + + + + + &reftitle.seealso; + + + TokyoTyrantTable::put + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyranttable/putnr.xml b/reference/tokyo_tyrant/tokyotyranttable/putnr.xml new file mode 100644 index 0000000000..bb5614be06 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyranttable/putnr.xml @@ -0,0 +1,87 @@ + + + + + + TokyoTyrantTable::putNr + Puts value + + + + &reftitle.description; + + public voidTokyoTyrantTable::putNr + mixedkeys + stringvalue + + + This method is not supported on table databases. Calling this method through TokyoTyrantTable + is considered an error and an TokyoTyrantException will be thrown. + + + + + &reftitle.parameters; + + + + keys + + + A string key or an array of key-value pairs + + + + + value + + + The value in case a string key is used + + + + + + + + + &reftitle.returnvalues; + + This method is not supported on table databases. Calling this method through TokyoTyrantTable + is considered an error and an TokyoTyrantException will be thrown. + + + + + &reftitle.seealso; + + + TokyoTyrant::putNr + TokyoTyrant::putKeep + TokyoTyrant::putCat + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyranttable/putshl.xml b/reference/tokyo_tyrant/tokyotyranttable/putshl.xml new file mode 100644 index 0000000000..83ef57916b --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyranttable/putshl.xml @@ -0,0 +1,98 @@ + + + + + + TokyoTyrantTable::putShl + Concatenates to a record + + + + &reftitle.description; + + public voidTokyoTyrantTable::putShl + stringkey + stringvalue + intwidth + + + This method is not supported on table databases. Calling this method through TokyoTyrantTable + is considered an error and an TokyoTyrantException will be thrown. + + + + + &reftitle.parameters; + + + + key + + + A string key + + + + + value + + + The value to concatenate + + + + + width + + + The width of the record + + + + + + + + + &reftitle.returnvalues; + + This method is not supported on table databases. + + + + + &reftitle.seealso; + + + TokyoTyrant::put + TokyoTyrant::putKeep + TokyoTyrant::putCat + TokyoTyrantTable::put + TokyoTyrantTable::putKeep + TokyoTyrantTable::putCat + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyranttable/setindex.xml b/reference/tokyo_tyrant/tokyotyranttable/setindex.xml new file mode 100644 index 0000000000..a2d56b2472 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyranttable/setindex.xml @@ -0,0 +1,74 @@ + + + + + + TokyoTyrantTable::setIndex + Sets index + + + + &reftitle.description; + + public voidTokyoTyrantTable::setIndex + stringcolumn + inttype + + + Sets an index on a specified column. The index type is one of the TokyoTyrant::RDBIT_* constants + + + + + &reftitle.parameters; + + + + column + + + The name of the column + + + + + type + + + The index type + + + + + + + + + &reftitle.returnvalues; + + This method returns the current object and throws TokyoTyrantException on failure. + + + + + + diff --git a/reference/tokyo_tyrant/versions.xml b/reference/tokyo_tyrant/versions.xml new file mode 100644 index 0000000000..179ea925ac --- /dev/null +++ b/reference/tokyo_tyrant/versions.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +