Whoops \ Exception \ ErrorException (E_NOTICE)
Undefined index: XAU Whoops\Exception\ErrorException thrown with message "Undefined index: XAU" Stacktrace: #6 Whoops\Exception\ErrorException in /home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/lib/Currency/Converter.php:419 #5 Whoops\Run:handleError in /home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/lib/Currency/Converter.php:419 #4 Lexicon\Currency\Converter:addWizardingExchangeRates in /home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/lib/Currency/Converter.php:390 #3 Lexicon\Currency\Converter:getHistoricalExchangeRates in /home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/currency.php:30 #2 include in /home/hplex/alchemy.hp-lexicon.org/www/wp-includes/template-loader.php:106 #1 require_once in /home/hplex/alchemy.hp-lexicon.org/www/wp-blog-header.php:19 #0 require in /home/hplex/alchemy.hp-lexicon.org/www/index.php:17
Stack frames (7)
6
Whoops\Exception\ErrorException
/wp-content/themes/lexicon/lib/Currency/Converter.php419
5
Whoops\Run handleError
/wp-content/themes/lexicon/lib/Currency/Converter.php419
4
Lexicon\Currency\Converter addWizardingExchangeRates
/wp-content/themes/lexicon/lib/Currency/Converter.php390
3
Lexicon\Currency\Converter getHistoricalExchangeRates
/wp-content/themes/lexicon/currency.php30
2
include
/www/wp-includes/template-loader.php106
1
require_once
/www/wp-blog-header.php19
0
require
/www/index.php17
/home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/lib/Currency/Converter.php
 
        $baseRates = $service->getHistorical($date);
        $rates = $baseRates['rates'];
 
        $filename = $date->format("Y/m/d/") . "currencyRates-" . $date->format("Ymd").".json";
 
        $rates = $this->addWizardingExchangeRates($rates, $date);
        $this->cacheExchangeRates($filename, $rates, $date);
 
        return $rates;
    }
 
    private function addWizardingExchangeRates($rates, Carbon $date = null)
    {
        $rates['WZG'] = $rates['GBP'] / 5;
        $rates['WZS'] = 17 * $rates['WZG'];
        $rates['WZK'] = 29 * $rates['WZS'];
 
        $rates['WZD'] = 1.5;
        $rates['WZL'] = $rates['XAU'] * 100;
 
        $dobbyHoursToGalleon = $this->dobbyHoursToGalleon($date);
 
        $rates['WZE'] = $dobbyHoursToGalleon * $rates['WZG'];
 
        return $rates;
    }
 
    private function addWizardingCurrencies($currencies)
    {
        $topCurrencies = [
            'WZG' => 'Gold Galleon',
            'WZS' => 'Silver Sickle',
            'WZK' => 'Bronze Knut',
            'WZD' => 'Dragot',
            'WZL' => 'Leprechaun Gold Coin',
            'WZE' => 'Dobby Work Hour',
            'GBP' => 'British Pound Sterling',
            'USD' => 'United States Dollar'
        ];
Arguments
  1. "Undefined index: XAU"
    
/home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/lib/Currency/Converter.php
 
        $baseRates = $service->getHistorical($date);
        $rates = $baseRates['rates'];
 
        $filename = $date->format("Y/m/d/") . "currencyRates-" . $date->format("Ymd").".json";
 
        $rates = $this->addWizardingExchangeRates($rates, $date);
        $this->cacheExchangeRates($filename, $rates, $date);
 
        return $rates;
    }
 
    private function addWizardingExchangeRates($rates, Carbon $date = null)
    {
        $rates['WZG'] = $rates['GBP'] / 5;
        $rates['WZS'] = 17 * $rates['WZG'];
        $rates['WZK'] = 29 * $rates['WZS'];
 
        $rates['WZD'] = 1.5;
        $rates['WZL'] = $rates['XAU'] * 100;
 
        $dobbyHoursToGalleon = $this->dobbyHoursToGalleon($date);
 
        $rates['WZE'] = $dobbyHoursToGalleon * $rates['WZG'];
 
        return $rates;
    }
 
    private function addWizardingCurrencies($currencies)
    {
        $topCurrencies = [
            'WZG' => 'Gold Galleon',
            'WZS' => 'Silver Sickle',
            'WZK' => 'Bronze Knut',
            'WZD' => 'Dragot',
            'WZL' => 'Leprechaun Gold Coin',
            'WZE' => 'Dobby Work Hour',
            'GBP' => 'British Pound Sterling',
            'USD' => 'United States Dollar'
        ];
Arguments
  1. 8
    
  2. "Undefined index: XAU"
    
  3. "/home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/lib/Currency/Converter.php"
    
  4. 419
    
  5. array:2 [
      "rates" => array:16 [
        "CAD" => 1.1842
        "GBP" => 0.52082
        "JPY" => 127.347
        "AUD" => 1.3432
        "DKK" => 5.6906
        "FRF" => 5.003
        "DEM" => 1.48
        "ITL" => 1119.1
        "KRW" => 791
        "ESP" => 94.286
        "CHF" => 1.3186
        "USD" => 1
        "WZG" => 0.104164
        "WZS" => 1.770788
        "WZK" => 51.352852
        "WZD" => 1.5
      ]
      "date" => Carbon\Carbon @712540800 {#2652
        date: 1992-07-31 00:00:00.0 UTC (+00:00)
      }
    ]
    
/home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/lib/Currency/Converter.php
            $date = new Carbon();
        }
        $filename = $date->format("Y/m/d/") . "currencyRates-" . $date->format("Ymd").".json";
        $filesystem->put($filename, json_encode($rates));
    }
 
    public function getHistoricalExchangeRates(Carbon $date)
    {
        $filesystem = $this->filesystem();
 
        $filename = $date->format("Y/m/d/") . "currencyRates-" . $date->format("Ymd").".json";
 
 
        if (!$filesystem->has($filename)) {
            return $this->fetchHistoricalExchangeRates($date);
        }
 
        $rates = json_decode($filesystem->read($filename), true);
 
        return $this->addWizardingExchangeRates($rates, $date);
    }
 
    private function fetchHistoricalExchangeRates(Carbon $date)
    {
        $earliest = new Carbon('1999-01-01');
        if ($date->lt($earliest)) {
            return [];
        }
        $service = $this->exchangeRateService();
 
        $baseRates = $service->getHistorical($date);
        $rates = $baseRates['rates'];
 
        $filename = $date->format("Y/m/d/") . "currencyRates-" . $date->format("Ymd").".json";
 
        $rates = $this->addWizardingExchangeRates($rates, $date);
        $this->cacheExchangeRates($filename, $rates, $date);
 
        return $rates;
    }
Arguments
  1. array:16 [
      "CAD" => 1.1842
      "GBP" => 0.52082
      "JPY" => 127.347
      "AUD" => 1.3432
      "DKK" => 5.6906
      "FRF" => 5.003
      "DEM" => 1.48
      "ITL" => 1119.1
      "KRW" => 791
      "ESP" => 94.286
      "CHF" => 1.3186
      "USD" => 1
      "WZG" => 0.104164
      "WZS" => 1.770788
      "WZK" => 51.352852
      "WZD" => 1.5
    ]
    
  2. Carbon\Carbon @712540800 {#2652
      date: 1992-07-31 00:00:00.0 UTC (+00:00)
    }
    
/home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/currency.php
$currencies = $converter->getCurrencies();
 
$context['currencies'] = [];
foreach ($currencies as $abbreviation => $label) {
    $context['currencies'][$abbreviation] = [
        'abbreviation' => $abbreviation,
        'label'        => $label
    ];
}
 
$date = null;
$today = date("Y-m-d");
$context['selected_date'] = $today;
if (isset($_REQUEST['date']) && $_REQUEST['date'] && $_REQUEST['date'] != $today) {
    $date = new Carbon($_REQUEST['date']);
 
    if ($date->gte(new Carbon('1971-01-01')) && $date->lt(new Carbon())) {
        $context['selected_date'] = $date->format("Y-m-d");
        $context['past'] = true;
        $context['rates'] = $converter->getHistoricalExchangeRates($date);
    } else {
        $date = null;
    }
}
 
if (!isset($context['rates'])) {
    $context['rates'] = $converter->getCurrentExchangeRates();
}
 
 
$context['current_currency'] = $converter->currencyForCountry();
if (isset($_REQUEST['currency'])) {
    $context['current_currency'] = $_REQUEST['currency'];
}
 
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'muggle-to-wizard') {
    $context['action'] = 'muggle-to-wizard';
    $context['muggle'] = $_REQUEST['muggle'];
    $context['results'] = $results = $converter->muggleToWizard($_REQUEST['muggle'], $context['current_currency'], $date);
    $context['results_string'] = $converter->wizardCurrencyString($results);
Arguments
  1. Carbon\Carbon @712540800 {#2652
      date: 1992-07-31 00:00:00.0 UTC (+00:00)
    }
    
/home/hplex/alchemy.hp-lexicon.org/www/wp-includes/template-loader.php
            }
 
            break;
        }
    }
 
    if ( ! $template ) {
        $template = get_index_template();
    }
 
    /**
     * Filters the path of the current template before including it.
     *
     * @since 3.0.0
     *
     * @param string $template The path of the template to include.
     */
    $template = apply_filters( 'template_include', $template );
    if ( $template ) {
        include $template;
    } elseif ( current_user_can( 'switch_themes' ) ) {
        $theme = wp_get_theme();
        if ( $theme->errors() ) {
            wp_die( $theme->errors() );
        }
    }
    return;
}
 
Arguments
  1. "/home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/currency.php"
    
/home/hplex/alchemy.hp-lexicon.org/www/wp-blog-header.php
<?php
/**
 * Loads the WordPress environment and template.
 *
 * @package WordPress
 */
 
if ( ! isset( $wp_did_header ) ) {
 
    $wp_did_header = true;
 
    // Load the WordPress library.
    require_once __DIR__ . '/wp-load.php';
 
    // Set up the WordPress query.
    wp();
 
    // Load the theme template.
    require_once ABSPATH . WPINC . '/template-loader.php';
 
}
 
Arguments
  1. "/home/hplex/alchemy.hp-lexicon.org/www/wp-includes/template-loader.php"
    
/home/hplex/alchemy.hp-lexicon.org/www/index.php
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */
 
/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define( 'WP_USE_THEMES', true );
 
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
 
Arguments
  1. "/home/hplex/alchemy.hp-lexicon.org/www/wp-blog-header.php"
    

Environment & details:

Key Value
action
"wizard-to-muggle"
galleons
"1"
currency
"FRF"
date
"1992-07-31"
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE
"Apache/2.4.43 (Ubuntu)"
REQUEST_URI
"/currency/exchange/?action=wizard-to-muggle&galleons=1&currency=FRF&date=1992-07-31"
USER
"www-data"
HOME
"/var/www"
SCRIPT_NAME
"/index.php"
QUERY_STRING
"action=wizard-to-muggle&galleons=1&currency=FRF&date=1992-07-31"
REQUEST_METHOD
"GET"
SERVER_PROTOCOL
"HTTP/1.1"
GATEWAY_INTERFACE
"CGI/1.1"
REDIRECT_QUERY_STRING
"action=wizard-to-muggle&galleons=1&currency=FRF&date=1992-07-31"
REDIRECT_URL
"/currency/exchange/"
REMOTE_PORT
"16366"
SCRIPT_FILENAME
"/home/hplex/alchemy.hp-lexicon.org/www/index.php"
SERVER_ADMIN
"[no address given]"
CONTEXT_DOCUMENT_ROOT
"/home/hplex/alchemy.hp-lexicon.org/www"
CONTEXT_PREFIX
""
REQUEST_SCHEME
"https"
DOCUMENT_ROOT
"/home/hplex/alchemy.hp-lexicon.org/www"
REMOTE_ADDR
"3.238.147.211"
SERVER_PORT
"443"
SERVER_ADDR
"10.138.0.2"
SERVER_NAME
"alchemy.hp-lexicon.org"
SERVER_SIGNATURE
"<address>Apache/2.4.43 (Ubuntu) Server at alchemy.hp-lexicon.org Port 443</address>\n"
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
HTTP_CDN_LOOP
"cloudflare"
HTTP_CF_CONNECTING_IP
"3.238.147.211"
HTTP_CF_REQUEST_ID
"06b9d558d90000156f1fb29000000001"
HTTP_ACCEPT_LANGUAGE
"en-US,en;q=0.5"
HTTP_ACCEPT
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
HTTP_USER_AGENT
"CCBot/2.0 (https://commoncrawl.org/faq/)"
HTTP_CF_VISITOR
"{\"scheme\":\"https\"}"
HTTP_X_FORWARDED_PROTO
"https"
HTTP_CF_RAY
"5fa324d48e65156f-EWR"
HTTP_CF_IPCOUNTRY
"US"
HTTP_ACCEPT_ENCODING
"gzip"
HTTP_CONNECTION
"Keep-Alive"
HTTP_HOST
"alchemy.hp-lexicon.org"
proxy-nokeepalive
"1"
SSL_TLS_SNI
"alchemy.hp-lexicon.org"
HTTPS
"on"
proxyssl
"1"
REDIRECT_STATUS
"200"
REDIRECT_SSL_TLS_SNI
"alchemy.hp-lexicon.org"
REDIRECT_HTTPS
"on"
REDIRECT_proxyssl
"1"
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1606724370.8497
REQUEST_TIME
1606724370
HTTP_X_FORWARDED_FOR
"3.238.147.211"
empty
0. Whoops\Handler\PrettyPageHandler