Skip to content

Commit 3a4b4f1

Browse files
author
kaushik.prajapati
committed
perf: envoi integrate #2531
1 parent f4ed139 commit 3a4b4f1

4 files changed

Lines changed: 21 additions & 16 deletions

File tree

.env.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,3 @@ USERBASE_CLIENT_URL:
33
type: url
44
example: https://username@password@userbase.example.com
55
required: true
6-
7-
USERBASE_CLIENT_USERNAME:
8-
description: usebase username. These are needed if USERBASE_DSN is a plain URL
9-
type: string
10-
required: false
11-
12-
USERBASE_CLIENT_PASSWORD:
13-
description: These are needed if USERBASE_DSN is a plain URL
14-
type: string
15-
required: false

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ The `examples/` directory contains a few example scripts that you can use during
3434

3535
First, copy the `.env.dist` file to `.env`. Edit the contents to match your Userbase server and credentials.
3636

37+
```bash
38+
cp .env.dist .env e
39+
edit .env # Edit configuration, database settings etc
40+
./vendor/bin/envoi validate # Run command validate based on meta file .env.yaml
41+
```
42+
3743
Then you can simply execute the examples like this:
3844

3945
php examples/checkcredentials.php alice sshhh

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
"name": "Joost Faassen",
1010
"email": "j.faassen@linkorb.com",
1111
"role": "Development"
12+
},
13+
{
14+
"name": "kaushik prajapati",
15+
"email": "prajapatikaushik@gmail.com",
16+
"role": "Developer"
1217
}
1318
],
1419
"require": {

examples/common.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,23 @@
22

33
require_once __DIR__.'/../vendor/autoload.php';
44

5-
use UserBase\Client\Client;
5+
use Envoi\Envoi;
66
use Symfony\Component\Dotenv\Dotenv;
7+
use UserBase\Client\Client;
8+
79

8-
$dotenv = new Dotenv();
9-
$dotenv->load(__DIR__.'/../.env');
10+
// .env validate
11+
$envFilename = __DIR__.'/../.env';
12+
$envMetaFile = __DIR__.'/../.env.yaml';
13+
Envoi::init($envFilename, $envMetaFile);
1014

1115
$url = getenv('USERBASE_CLIENT_URL');
12-
$username = getenv('USERBASE_CLIENT_USERNAME');
13-
$password = getenv('USERBASE_CLIENT_PASSWORD');
16+
//$username = getenv('USERBASE_CLIENT_USERNAME');
17+
//$password = getenv('USERBASE_CLIENT_PASSWORD');
1418

1519
if (!$url) {
1620
echo "Environment variables not yet properly configured\n";
1721
exit();
1822
}
1923

20-
$client = new Client($url, $username, $password);
24+
$client = new Client($url);

0 commit comments

Comments
 (0)