switched getenv to $_ENV

main
Lang, Simon 3 months ago
parent 519d671e1a
commit 856b76f3d7
  1. 2
      public/elotracker/RiotRequest.php
  2. 6
      public/util/dotenv.php
  3. 6
      public/util/mysql_connect.php

@ -32,7 +32,7 @@ class RiotRequest {
}
protected function getHeaderString(): string {
$api_key = getenv("RIOT_API_KEY");
$api_key = $_ENV["RIOT_API_KEY"];
$header = "X-Riot-Token: $api_key\r\n";
foreach ($this->headers as $key => $value) {
$header .= "$key: $value\r\n";

@ -1,5 +1,5 @@
<?php
foreach (parse_ini_file($_SERVER['DOCUMENT_ROOT']."/../.env") as $key => $value)
putenv("$key=$value");
foreach (parse_ini_file($_SERVER['DOCUMENT_ROOT']."/../.env") as $key => $value) {
$_ENV[$key] = $value;
}
unset($key, $value);

@ -13,9 +13,9 @@ class MySQLConnection {
public function __construct() {
$this->host = 'localhost';
$this->port = intval(getenv('MYSQL_PORT'));
$this->user = getenv('MYSQL_USER');
$this->pass = getenv('MYSQL_PASSWORD');
$this->port = intval($_ENV['MYSQL_PORT']);
$this->user = $_ENV['MYSQL_USER'];
$this->pass = $_ENV['MYSQL_PASSWORD'];
$this->createConn();
}

Loading…
Cancel
Save