Skip to content
Open
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
4 changes: 4 additions & 0 deletions .env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
HERALD_DSN:
description: Herald client settings. DSN url
type: url
example: "https://username:password@herald.dev/myAccount/myLibrary/myTransport"
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Herald PHP client
Send beautiful messages from your application.

## Installation
```
```sh
composer require herald-project/client-php
```

Expand Down Expand Up @@ -74,9 +74,16 @@ need to pass any options to the CLI application

### By .env

The Herald CLI application loads `.env` before running any commands, allowing you to create a `.env` file
The Herald CLI application loads `.env` before running any commands, allowing you to create a `.env` file
like this:

```sh
# run comand to create file
cp .env.dist .env # Create config file from template/.dist file
edit .env # Edit configuration, database settings etc
./vendor/bin/envoi validate # Run command validate based on meta file .env.yaml
```

```ini
HERALD_DSN=https://x:y@herald.dev/test/test/mandrill
```
Expand Down
7 changes: 5 additions & 2 deletions bin/herald-client
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?php

use Symfony\Component\Console\Application;
use Symfony\Component\Dotenv\Dotenv;
use Envoi\Envoi;

$loader = __DIR__.'/../vendor/autoload.php';

Expand All @@ -20,7 +20,10 @@ if (!file_exists($loader)) {

require $loader;

(new Dotenv())->load(__DIR__.'/../.env');
// .env validate it.
$envFilename = __DIR__.'/../.env';
$envMetaFile = __DIR__.'/../.env.yaml';
Envoi::init($envFilename, $envMetaFile);

$application = new Application('Herald client', '0.0.1');
$application->setCatchExceptions(true);
Expand Down
12 changes: 9 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,24 @@
"name": "Joost Faassen",
"email": "j.faassen@onatal.nl",
"role": "Developer"
},
{
"name": "Kaushik Prajapati",
"email": "prajapatikaushik@gmail.com",
"role": "Developer"
}
],
"support": {
"e-mail": "support@linkorb.com",
"issues": "https://github.com/linkorb/herald-client-php/issues"
},
"require": {
"guzzlehttp/guzzle": "^4.0|^5.0|^6.0"
"guzzlehttp/guzzle": "^4.0|^5.0|^6.0",
"linkorb/envoi": "^1.1"
},
"require-dev": {
"symfony/console": "^2.4|^3.0",
"symfony/dotenv": "^3.0"
"symfony/console": "^2.4|^4.0",
"symfony/dotenv": "^4.0|^3.0"
},
"autoload": {
"psr-4": {
Expand Down
Loading