Skip to content

Commit bd35b9c

Browse files
committed
Added examples
1 parent 5359d7c commit bd35b9c

23 files changed

+1865
-1
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010
],
1111
"require": {
12-
"php": ">=7.0",
12+
"php": ">=7.3",
1313
"ext-bcmath": "*",
1414
"ext-curl": "*",
1515
"ext-grpc": "*",
@@ -23,6 +23,7 @@
2323
"phpunit/phpunit": ">= 6.0, <10.0"
2424
},
2525
"autoload": {
26+
"exclude-from-classmap": ["/examples/"],
2627
"psr-4": {
2728
"Ydb\\": "protos/Ydb/",
2829
"GPBMetadata\\": "protos/GPBMetadata/",

examples/.env.example

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Common YDB settings
2+
DB_ENDPOINT=ydb.serverless.yandexcloud.net:2135
3+
DB_DATABASE=
4+
5+
YDB_ANONYMOUS=false
6+
YDB_INSECURE=false
7+
8+
# Auto discovery
9+
DB_DISCOVERY=false
10+
11+
# Metadata URL authentication
12+
USE_METADATA=false
13+
14+
# OAuth token authentication
15+
DB_OAUTH_TOKEN=
16+
17+
# Private key authentication
18+
SA_PRIVATE_KEY_FILE=
19+
SA_ACCESS_KEY_ID=
20+
SA_ID=
21+
22+
# Service account JSON file authentication
23+
SA_SERVICE_FILE=
24+
25+
# Root CA file (dedicated server only)
26+
YDB_SSL_ROOT_CERTIFICATES_FILE=
27+
28+
# Logging settings
29+
USE_LOGGER=false

examples/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/vendor
2+
.env
3+
composer.lock
4+
/*.key
5+
/*.pem
6+
/sa_name.json
7+
/ydb_data
8+
/ydb_certs

examples/CONTRIBUTING.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Notice to external contributors
2+
3+
4+
## General info
5+
6+
Hello! In order for us (YANDEX LLC) to accept patches and other contributions from you, you will have to adopt our Yandex Contributor License Agreement (the “**CLA**”). The current version of the CLA you may find here:
7+
1) https://yandex.ru/legal/cla/?lang=en (in English) and
8+
2) https://yandex.ru/legal/cla/?lang=ru (in Russian).
9+
10+
By adopting the CLA, you state the following:
11+
12+
* You obviously wish and are willingly licensing your contributions to us for our open source projects under the terms of the CLA,
13+
* You has read the terms and conditions of the CLA and agree with them in full,
14+
* You are legally able to provide and license your contributions as stated,
15+
* We may use your contributions for our open source projects and for any other our project too,
16+
* We rely on your assurances concerning the rights of third parties in relation to your contributes.
17+
18+
If you agree with these principles, please read and adopt our CLA. By providing us your contributions, you hereby declare that you has already read and adopt our CLA, and we may freely merge your contributions with our corresponding open source project and use it in further in accordance with terms and conditions of the CLA.
19+
20+
## Provide contributions
21+
22+
If you have already adopted terms and conditions of the CLA, you are able to provide your contributes. When you submit your pull request, please add the following information into it:
23+
24+
```
25+
I hereby agree to the terms of the CLA available at: [link].
26+
```
27+
28+
Replace the bracketed text as follows:
29+
* [link] is the link at the current version of the CLA (you may add here a link https://yandex.ru/legal/cla/?lang=en (in English) or a link https://yandex.ru/legal/cla/?lang=ru (in Russian).
30+
31+
It is enough to provide us such notification at once.
32+
33+
## Other questions
34+
35+
If you have any questions, please mail us at opensource@yandex-team.ru.

examples/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM thecodingmachine/php:8.0-v4-cli
2+
3+
ENV PHP_EXTENSION_GRPC=1
4+
ENV PHP_EXTENSION_BCMATH=1
5+
6+
WORKDIR /usr/src/app
7+
8+
CMD [ "php", "console", "select1" ]
9+

examples/LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2021 YANDEX LLC
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

0 commit comments

Comments
 (0)