Skip to content

Commit 8388342

Browse files
Merge pull request #5 from griddb/php8
PHP8
2 parents fdb10c9 + bd6764a commit 8388342

39 files changed

+364
-172
lines changed

README.md

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,56 @@ GridDB PHP Client
44

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

7-
The new PHP Client (0.8) brings improved usability.
8-
Main difference to the old PHP Client (0.5) is as below:
9-
- Put and get row data without C-based methods defined for each data-type
107

118
## Operating environment
129

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

15-
OS: CentOS 7.8(x64)
16-
SWIG: 4.0.0
12+
OS: CentOS 7.9(x64)
13+
SWIG: 4.1.0 (commit: d22b7dfaea1f7abd4f3d0baecc1a1eddff827561)
1714
GCC: 4.8.5
18-
PHP: 7.4.7
19-
GridDB Server: 4.5 (CE)
20-
GridDB C Client: 4.5 (CE)
15+
PHP: 8.0/8.1
16+
GridDB Server: 4.6 (CE)
17+
GridDB C Client: 4.6 (CE)
18+
19+
OS: CentOS 8.5(x64)
20+
SWIG: 4.1.0 (commit: d22b7dfaea1f7abd4f3d0baecc1a1eddff827561)
21+
GCC: 8.3.1
22+
PHP: 8.0/8.1
23+
GridDB Server: 4.6 (CE)
24+
GridDB C Client: 4.6 (CE)
25+
26+
OS: Ubuntu 18.04(x64)
27+
SWIG: 4.1.0 (commit: d22b7dfaea1f7abd4f3d0baecc1a1eddff827561)
28+
GCC: 7.5.0
29+
PHP: 8.0/8.1
30+
GridDB Server: 4.6 (CE)
31+
GridDB C Client: 4.6 (CE)
32+
33+
OS: Ubuntu 20.04(x64)
34+
SWIG: 4.1.0 (commit: d22b7dfaea1f7abd4f3d0baecc1a1eddff827561)
35+
GCC: 10.3.0
36+
PHP: 8.0/8.1
37+
GridDB Server: 4.6 (CE)
38+
GridDB C Client: 4.6 (CE)
2139

2240
## QuickStart
2341
### Preparations
2442

2543
Install SWIG as below.
2644

27-
$ wget https://prdownloads.sourceforge.net/swig/swig-4.0.0.tar.gz
28-
$ tar xvfz swig-4.0.0.tar.gz
29-
$ cd swig-4.0.0
45+
$ git clone https://github.com/swig/swig.git
46+
$ cd swig
47+
$ git checkout d22b7dfaea1f7abd4f3d0baecc1a1eddff827561
48+
$ ./autogen.sh
3049
$ ./configure
3150
$ make
3251
$ sudo make install
3352

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

37-
Install PHP7.4.7 and GridDB C Client.
56+
Install PHP 8 and GridDB C Client.
3857

3958
Set LIBRARY_PATH.
4059

@@ -46,8 +65,6 @@ Set LIBRARY_PATH.
4665

4766
$ make
4867

49-
2. Include 'griddb_php_client.php' in PHP.
50-
5168
### How to run sample (with Command Line)
5269

5370
GridDB Server need to be started in advance.
@@ -72,7 +89,7 @@ GridDB Server need to be started in advance.
7289

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

75-
1. Store griddb_php_client.php and sample/sample1_web.php in /var/www/html.
92+
1. Store sample/sample1_web.php in /var/www/html.
7693

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

sample/BlobData.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
2-
include('griddb_php_client.php');
2+
if (file_exists('griddb_php_client.php')) {
3+
// File php wrapper is generated with SWIG 4.0.2 and below
4+
include_one('griddb_php_client.php');
5+
}
36

47
$factory = StoreFactory::getInstance();
58

sample/Connect.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
2-
include('griddb_php_client.php');
2+
if (file_exists('griddb_php_client.php')) {
3+
// File php wrapper is generated with SWIG 4.0.2 and below
4+
include_once('griddb_php_client.php');
5+
}
36

47
$factory = StoreFactory::getInstance();
58

@@ -38,4 +41,4 @@
3841
echo($e->getErrorMessage($i)."\n");
3942
}
4043
}
41-
?>
44+
?>

sample/ContainerInformation.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
2-
include('griddb_php_client.php');
2+
if (file_exists('griddb_php_client.php')) {
3+
// File php wrapper is generated with SWIG 4.0.2 and below
4+
include_once('griddb_php_client.php');
5+
}
36

47
$factory = StoreFactory::getInstance();
58

sample/ContainerNames.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
2-
include('griddb_php_client.php');
2+
if (file_exists('griddb_php_client.php')) {
3+
// File php wrapper is generated with SWIG 4.0.2 and below
4+
include_once('griddb_php_client.php');
5+
}
36

47
$factory = StoreFactory::getInstance();
58

sample/CreateCollection.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
2-
include('griddb_php_client.php');
2+
if (file_exists('griddb_php_client.php')) {
3+
// File php wrapper is generated with SWIG 4.0.2 and below
4+
include_once('griddb_php_client.php');
5+
}
36

47
$factory = StoreFactory::getInstance();
58

sample/CreateIndex.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
2-
include('griddb_php_client.php');
2+
if (file_exists('griddb_php_client.php')) {
3+
// File php wrapper is generated with SWIG 4.0.2 and below
4+
include_once('griddb_php_client.php');
5+
}
36

47
$factory = StoreFactory::getInstance();
58

@@ -31,7 +34,7 @@
3134
}
3235

3336
// Create an index
34-
$col->createIndex("count", IndexType::HASH, "hash_index");
37+
$col->createIndex("count", IndexType::HASH);
3538
echo("Create Index\n");
3639
echo("success!\n");
3740
} catch (GSException $e) {

sample/CreateTimeSeries.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
2-
include('griddb_php_client.php');
2+
if (file_exists('griddb_php_client.php')) {
3+
// File php wrapper is generated with SWIG 4.0.2 and below
4+
include_once('griddb_php_client.php');
5+
}
36

47
$factory = StoreFactory::getInstance();
58

sample/GetRow.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
2-
include('griddb_php_client.php');
2+
if (file_exists('griddb_php_client.php')) {
3+
// File php wrapper is generated with SWIG 4.0.2 and below
4+
include_once('griddb_php_client.php');
5+
}
36

47
$factory = StoreFactory::getInstance();
58

sample/PutRow.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
2-
include('griddb_php_client.php');
2+
if (file_exists('griddb_php_client.php')) {
3+
// File php wrapper is generated with SWIG 4.0.2 and below
4+
include_once('griddb_php_client.php');
5+
}
36

47
$factory = StoreFactory::getInstance();
58

0 commit comments

Comments
 (0)