Skip to content

Add examples from repository #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* added examples
* updated saveToken function in Iam.php

## 1.5.4
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
],
"require": {
"php": ">=7.0",
"php": ">=7.3",
"ext-bcmath": "*",
"ext-curl": "*",
"ext-grpc": "*",
Expand All @@ -31,7 +31,8 @@
},
"autoload-dev": {
"psr-4": {
"YdbPlatform\\Ydb\\Test\\": "tests"
"YdbPlatform\\Ydb\\Test\\": "tests",
"App\\": "examples/"
}
}
}
29 changes: 29 additions & 0 deletions examples/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Common YDB settings
DB_ENDPOINT=ydb.serverless.yandexcloud.net:2135
DB_DATABASE=

YDB_ANONYMOUS=false
YDB_INSECURE=false

# Auto discovery
DB_DISCOVERY=false

# Metadata URL authentication
USE_METADATA=false

# OAuth token authentication
DB_OAUTH_TOKEN=

# Private key authentication
SA_PRIVATE_KEY_FILE=
SA_ACCESS_KEY_ID=
SA_ID=

# Service account JSON file authentication
SA_SERVICE_FILE=

# Root CA file (dedicated server only)
YDB_SSL_ROOT_CERTIFICATES_FILE=

# Logging settings
USE_LOGGER=false
8 changes: 8 additions & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/vendor
.env
composer.lock
/*.key
/*.pem
/sa_name.json
/ydb_data
/ydb_certs
35 changes: 35 additions & 0 deletions examples/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Notice to external contributors


## General info

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:
1) https://yandex.ru/legal/cla/?lang=en (in English) and
2) https://yandex.ru/legal/cla/?lang=ru (in Russian).

By adopting the CLA, you state the following:

* You obviously wish and are willingly licensing your contributions to us for our open source projects under the terms of the CLA,
* You has read the terms and conditions of the CLA and agree with them in full,
* You are legally able to provide and license your contributions as stated,
* We may use your contributions for our open source projects and for any other our project too,
* We rely on your assurances concerning the rights of third parties in relation to your contributes.

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.

## Provide contributions

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:

```
I hereby agree to the terms of the CLA available at: [link].
```

Replace the bracketed text as follows:
* [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).

It is enough to provide us such notification at once.

## Other questions

If you have any questions, please mail us at [email protected].
9 changes: 9 additions & 0 deletions examples/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM thecodingmachine/php:8.0-v4-cli

ENV PHP_EXTENSION_GRPC=1
ENV PHP_EXTENSION_BCMATH=1

WORKDIR /usr/src/app

CMD [ "php", "console", "select1" ]

13 changes: 13 additions & 0 deletions examples/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2021 YANDEX LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Loading