<?php

/* 
 * Copyright (C) 2021 Echedey López Romero <elr@disroot.org>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

$DefaultConfig = [
    'base_url' => 'https://api.themoviedb.org/3',
    'api_key' => '0',
    'image_url' => 'https://image.tmdb.org/t/p/w185',
    'default_poster' => './images/poster.webp',
    'default_profile' => './images/profile.webp'
];

$Config = json_decode(file_get_contents('./data/config.json'), true);

$Data = null;
$Type = null;
$BaseURL = isset($Config['base_url']) ? $Config['base_url'] : $DefaultConfig['base_url'];
$APIKey = isset($Config['api_key']) ? $Config['api_key'] : $DefaultConfig['api_key'];
$ImageURL = isset($Config['image_url']) ? $Config['image_url'] : $DefaultConfig['image_url'];
$DefaultPoster = isset($Config['default_poster']) ? $Config['default_poster'] : $DefaultConfig['default_poster'];
$DefaultProfile = isset($Config['default_profile']) ? $Config['default_profile'] : $DefaultConfig['default_profile'];

$PagePrinter = null;
$Search = '';
$Page = null;


