Skip to content

Commit

Permalink
YODA-T-64 Refactor index.php to use dotenv for environment variable m…
Browse files Browse the repository at this point in the history
…anagement
  • Loading branch information
DaggieBlanqx committed Nov 25, 2024
1 parent 85b242b commit c794547
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions example/index.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<?php
require 'vendor/autoload.php';
require __DIR__.'/vendor/autoload.php';

use Dotenv\Dotenv;
use AfricasTalking\SDK\AfricasTalking;

$username = "sandbox";
$apiKey = getenv("API_KEY");
$dotenv = Dotenv::createImmutable(__DIR__);
$dotenv->load();

$username = $_ENV['USERNAME'];
$apiKey = $_ENV['API_KEY'];

$AT = new AfricasTalking($username, $apiKey);

Expand Down

0 comments on commit c794547

Please sign in to comment.