Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ CPPFLAGS_PHP = $(CPPFLAGS) $(INCLUDES_PHP)

PROGRAM = griddb_php_client.so

SOURCES = src/Resource.cpp \
src/TimeSeriesProperties.cpp \
src/AggregationResult.cpp \
SOURCES = src/TimeSeriesProperties.cpp \
src/ContainerInfo.cpp \
src/AggregationResult.cpp \
src/Container.cpp \
src/Store.cpp \
src/StoreFactory.cpp \
src/PartitionController.cpp \
src/Query.cpp \
src/Row.cpp \
src/QueryAnalysisEntry.cpp \
src/RowKeyPredicate.cpp \
src/RowSet.cpp \
src/TimestampUtils.cpp \

src/Field.cpp \
src/Util.cpp

all: $(PROGRAM)

Expand Down
55 changes: 18 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@ GridDB PHP Client

## Overview

GridDB PHP Client is developed using GridDB C Client and [SWIG](http://www.swig.org/) (Simplified Wrapper and Interface Generator).
GridDB PHP Client is developed using GridDB C Client and [SWIG](http://www.swig.org/) (Simplified Wrapper and Interface Generator).

(Additional information)
There is [PHP Client package on Packagist repository](https://packagist.org/packages/griddb/php-client) .

## Operating environment

Building of the library and execution of the sample programs have been checked in the following environment.

OS: CentOS 7.4(x64)
OS: CentOS 7.8(x64)
SWIG: 4.0.0
GCC: 4.8.5
PHP: 7
GridDB Server: 4.2 (CE)
GridDB C Client: 4.2 (CE)
PHP: 7.4.7
GridDB Server: 4.5 (CE)
GridDB C Client: 4.5 (CE)

## QuickStart
### Preparations
Expand All @@ -29,17 +27,17 @@ Install SWIG as below.
$ ./configure
$ make
$ sudo make install

Note: If CentOS, you might need to install pcre in advance.
$ sudo yum install pcre2-devel.x86_64

Install PHP7 and GridDB C Client.
Install PHP7.4.7 and GridDB C Client.

Set LIBRARY_PATH.
Set LIBRARY_PATH.

export LIBRARY_PATH=$LIBRARY_PATH:<C client library file directory path>

### Build and Run
### Build and Run

1. Execute the command on project directory.

Expand Down Expand Up @@ -69,22 +67,21 @@ GridDB Server need to be started in advance.

GridDB Server need to be started in advance.

In the case of Web Server: Apache/2.2.15, please use the following steps.
In the case of Web Server: Apache/2.4.6, please use the following steps.

1. Store griddb_php_client.php and sample/sample1_web.php in /var/www/html.

2. Store griddb_php_client.so in /usr/lib64/php/modules.

3. Add extension for griddb_php_client.so in /etc/php.ini.rpmsave or /etc/php/7.2/apache2/php.ini.
extension=griddb_php_client.so
3. Add extension for griddb_php_client.so in /etc/php.ini

4. Set LD_LIBRARY_PATH.

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:<C client library file directory path>

5. Restart httpd/apache.

6. In web browser, run : http://localhost:8000/sample1_web.php.
6. In web browser, run : http://localhost/sample1_web.php.

7. Click submit button after entering address, port, cluster, user and password.

Expand All @@ -102,37 +99,21 @@ In the case of Web Server: Apache/2.2.15, please use the following steps.
- timeseries-specific function like gsAggregateTimeSeries, gsQueryByTimeSeriesSampling in C client
- trigger, affinity

Please refer to the following files for more detailed information.
Please refer to the following files for more detailed information.
- [PHP Client API Reference](https://griddb.github.io/php_client/PHPAPIReference.htm)

About API:
- When an error occurs, an exception GSException is thrown.
- Based on C Client API. Please refer to C Client API Reference for the detailed information.
* [API Reference](https://griddb.github.io/griddb_nosql/manual/GridDB_API_Reference.html)
* [API Reference(Japanese)](https://griddb.github.io/griddb_nosql/manual/GridDB_API_Reference_ja.html)

Note:
1. The current API might be changed in the next version. e.g. ContainerInfo()
2. References to objects obtained using the get method described below must be referenced prior to executing the methods. When referencing after the execution of the get methods, please copy the basic data type such as string from the object and reference it to the copied data.
- get_row_xxx
- get_partition_xxx
- get_container_info

Please refer to the following note from C Client API Reference document for detailed information of the reason behind the implementation:

"In order to store the variable-length data such as string or array, it uses a temporary memory area.
This area is valid until this function or similar functions which use a temporary memory area.
The behavior is undefined when the area which has been invalidated is accessed."

## Community

* Issues
Use the GitHub issue function if you have any requests, questions, or bug reports.
* PullRequest
* Issues
Use the GitHub issue function if you have any requests, questions, or bug reports.
* PullRequest
Use the GitHub pull request function if you want to contribute code.
You'll need to agree GridDB Contributor License Agreement(CLA_rev1.1.pdf).
By using the GitHub pull request function, you shall be deemed to have agreed to GridDB Contributor License Agreement.

## License

GridDB PHP Client source license is Apache License, version 2.0.
151 changes: 69 additions & 82 deletions docs/PHPAPIReference.files/sheet001.htm
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
mso-displayed-thousand-separator:"\,";}
@page
{margin:.75in .7in .75in .7in;
mso-header-margin:.3in;
mso-footer-margin:.3in;}
mso-header-margin:.51in;
mso-footer-margin:.51in;}
ruby
{ruby-align:left;}
rt
Expand All @@ -26,8 +26,8 @@
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:"MS Pゴシック", monospace;
mso-font-charset:128;
font-family:Calibri, sans-serif;
mso-font-charset:0;
mso-char-type:katakana;
display:none;}
-->
Expand Down Expand Up @@ -56,100 +56,87 @@

<body link="#0563C1" vlink="#954F72">

<table border=0 cellpadding=0 cellspacing=0 width=1043 style='border-collapse:
collapse;table-layout:fixed;width:783pt'>
<col width=229 style='mso-width-source:userset;mso-width-alt:7328;width:172pt'>
<col width=489 style='mso-width-source:userset;mso-width-alt:15648;width:367pt'>
<col width=325 style='mso-width-source:userset;mso-width-alt:10400;width:244pt'>
<tr height=18 style='height:13.5pt'>
<td height=18 class=xl67 width=229 style='height:13.5pt;width:172pt'>class</td>
<td class=xl76 width=489 style='border-left:none;width:367pt'>description</td>
<td class=xl67 width=325 style='border-left:none;width:244pt'> </td>
<table border=0 cellpadding=0 cellspacing=0 width=849 style='border-collapse:
collapse;table-layout:fixed;width:637pt'>
<col width=200 style='width:150pt'>
<col width=649 style='mso-width-source:userset;mso-width-alt:23734;width:487pt'>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl96 width=200 style='height:15.0pt;width:150pt'>Class</td>
<td class=xl96 width=649 style='border-left:none;width:487pt'>Description</td>
</tr>
<tr height=18 style='height:13.5pt'>
<td height=18 class=xl66 style='height:13.5pt;border-top:none'>AggregationResult</td>
<td class=xl77 width=489 style='border-top:none;border-left:none;width:367pt'>Stores
the result of an aggregation operation</td>
<td class=xl66 style='border-top:none;border-left:none'> </td>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl69 style='height:15.0pt;border-top:none'>AggregationResult</td>
<td class=xl95 width=649 style='width:487pt'>Stores the result of an
aggregation operation<ruby><font class="font8"><rt class=font8></rt></font></ruby></td>
</tr>
<tr height=18 style='height:13.5pt'>
<td height=18 class=xl66 style='height:13.5pt;border-top:none'>Container</td>
<td class=xl77 width=489 style='border-top:none;border-left:none;width:367pt'>Provides
management functions for sets of row having same type</td>
<td class=xl66 style='border-top:none;border-left:none'>Inherits Resource
class</td>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl70 style='height:15.0pt;border-top:none'>Container</td>
<td class=xl95 width=649 style='border-top:none;width:487pt'>Provides
management functions for sets of row having same type<ruby><font class="font8"><rt
class=font8></rt></font></ruby></td>
</tr>
<tr height=18 style='height:13.5pt'>
<td height=18 class=xl66 style='height:13.5pt;border-top:none'>ContainerInfo</td>
<td class=xl77 width=489 style='border-top:none;border-left:none;width:367pt'>Represents
the information about a specific Container</td>
<td class=xl66 style='border-top:none;border-left:none'> </td>
<tr height=40 style='height:30.0pt'>
<td height=40 class=xl85 style='height:30.0pt;border-top:none'>QueryAnalysisEntry</td>
<td class=xl95 width=649 style='border-top:none;width:487pt'>Represents one
of information entries composing a query plan and the results of analyzing a
query operation.</td>
</tr>
<tr height=18 style='height:13.5pt'>
<td height=18 class=xl66 style='height:13.5pt;border-top:none'>GSException</td>
<td class=xl77 width=489 style='border-top:none;border-left:none;width:367pt'>Exception
for GridDB</td>
<td class=xl66 style='border-top:none;border-left:none'> </td>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl85 style='height:15.0pt;border-top:none'>GSException</td>
<td class=xl95 width=649 style='border-top:none;width:487pt'>Represents the
exception for GridDB<ruby><font class="font8"><rt class=font8></rt></font></ruby></td>
</tr>
<tr height=18 style='height:13.5pt'>
<td height=18 class=xl66 style='height:13.5pt;border-top:none'>PartitionController</td>
<td class=xl77 width=489 style='border-top:none;border-left:none;width:367pt'>Controller
for acquiring and processing the partition status</td>
<td class=xl66 style='border-top:none;border-left:none'> </td>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl85 style='height:15.0pt;border-top:none'>PartitionController</td>
<td class=xl95 width=649 style='border-top:none;width:487pt'>Controller for
acquiring and processing the partition status</td>
</tr>
<tr height=54 style='height:40.5pt'>
<td height=54 class=xl66 style='height:40.5pt;border-top:none'>Query</td>
<td class=xl77 width=489 style='border-top:none;border-left:none;width:367pt'>Provides
the functions of holding the information about a query related to a specific
<tr height=40 style='height:30.0pt'>
<td height=40 class=xl85 style='height:30.0pt;border-top:none'>Query</td>
<td class=xl95 width=649 style='border-top:none;width:487pt'>Provides the
functions of holding the information about a query related to a specific
Container, specifying the options for fetching and retrieving the result</td>
<td class=xl66 style='border-top:none;border-left:none'>Inherits Resource
class</td>
</tr>
<tr height=18 style='height:13.5pt'>
<td height=18 class=xl75 style='height:13.5pt;border-top:none'>Resource</td>
<td class=xl77 width=489 style='border-top:none;border-left:none;width:367pt'>Error
handling</td>
<td class=xl66 style='border-top:none;border-left:none'> </td>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl85 style='height:15.0pt;border-top:none'>RowKeyPredicate</td>
<td class=xl95 width=649 style='border-top:none;width:487pt'>Represents the
condition that a row key satisfies</td>
</tr>
<tr height=18 style='height:13.5pt'>
<td height=18 class=xl66 style='height:13.5pt;border-top:none'>Row</td>
<td class=xl77 width=489 style='border-top:none;border-left:none;width:367pt'>A
general-purpose Row for managing fields in any schema</td>
<td class=xl66 style='border-top:none;border-left:none'>Inherits Resource
class</td>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl70 style='height:15.0pt;border-top:none'>RowSet</td>
<td class=xl95 width=649 style='border-top:none;width:487pt'>Manages a set of
Rows obtained by a query</td>
</tr>
<tr height=18 style='height:13.5pt'>
<td height=18 class=xl66 style='height:13.5pt;border-top:none'>RowSet</td>
<td class=xl77 width=489 style='border-top:none;border-left:none;width:367pt'>Manages
a set of Rows obtained by a query</td>
<td class=xl66 style='border-top:none;border-left:none'>Inherits Resource
class</td>
</tr>
<tr height=36 style='height:27.0pt'>
<td height=36 class=xl66 style='height:27.0pt;border-top:none'>Store</td>
<td class=xl77 width=489 style='border-top:none;border-left:none;width:367pt'>Provides
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl70 style='height:15.0pt;border-top:none'>Store</td>
<td class=xl95 width=649 style='border-top:none;width:487pt'>Provides
functions to manipulate the entire data managed in one GridDB system</td>
<td class=xl66 style='border-top:none;border-left:none'>Inherits Resource
class</td>
</tr>
<tr height=18 style='height:13.5pt'>
<td height=18 class=xl66 style='height:13.5pt;border-top:none'>StoreFactory</td>
<td class=xl77 width=489 style='border-top:none;border-left:none;width:367pt'>Manages
a Store instance</td>
<td class=xl66 style='border-top:none;border-left:none'>Inherits Resource
class</td>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl70 style='height:15.0pt;border-top:none'>StoreFactory</td>
<td class=xl95 width=649 style='border-top:none;width:487pt'>Manages a Store
instance<ruby><font class="font8"><rt class=font8></rt></font></ruby></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl70 style='height:15.0pt;border-top:none'>ContainerInfo</td>
<td class=xl95 width=649 style='border-top:none;width:487pt'>Represents the
information about a Container<ruby><font class="font8"><rt class=font8></rt></font></ruby></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl70 style='height:15.0pt;border-top:none'>ExpirationInfo</td>
<td class=xl95 width=649 style='border-top:none;width:487pt'>Represents the
information about a expiration<ruby><font class="font8"><rt class=font8></rt></font></ruby></td>
</tr>
<tr height=18 style='height:13.5pt'>
<td height=18 class=xl66 style='height:13.5pt;border-top:none'>Timestamp</td>
<td class=xl77 width=489 style='border-top:none;border-left:none;width:367pt'>Provides
the utilities for manipulating time data</td>
<td class=xl66 style='border-top:none;border-left:none'> </td>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl70 style='height:15.0pt;border-top:none'>TimestampUtils</td>
<td class=xl95 width=649 style='border-top:none;width:487pt'>Provides the
utilities for manipulating time data<ruby><font class="font8"><rt
class=font8></rt></font></ruby></td>
</tr>
<![if supportMisalignedColumns]>
<tr height=0 style='display:none'>
<td width=229 style='width:172pt'></td>
<td width=489 style='width:367pt'></td>
<td width=325 style='width:244pt'></td>
<td width=200 style='width:150pt'></td>
<td width=649 style='width:487pt'></td>
</tr>
<![endif]>
</table>
Expand Down
Loading