39 lines
993 B
PHP
39 lines
993 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
require_once __DIR__ . '/../vendor/autoload.php';
|
||
|
|
|
||
|
|
use Jessa0\Littleshlink\LittlelinkLink;
|
||
|
|
use Jessa0\Littleshlink\LittlelinkPage;
|
||
|
|
use Jessa0\Littleshlink\LittleshlinkPage;
|
||
|
|
|
||
|
|
if (file_exists(__DIR__ . '/../config/config.php')) {
|
||
|
|
require_once __DIR__ . '/../config/config.php';
|
||
|
|
}
|
||
|
|
|
||
|
|
if (!defined('TITLE')) {
|
||
|
|
define('TITLE', 'My Links');
|
||
|
|
}
|
||
|
|
if (!defined('ICON')) {
|
||
|
|
define('ICON', 'images/littlelink.png');
|
||
|
|
}
|
||
|
|
if (!defined('AVATAR')) {
|
||
|
|
define('AVATAR', 'images/littlelink.svg');
|
||
|
|
}
|
||
|
|
if (!defined('STYLESHEET')) {
|
||
|
|
define('STYLESHEET', 'css/skeleton-auto.css');
|
||
|
|
}
|
||
|
|
if (!defined('SHLINK_TAG')) {
|
||
|
|
define('SHLINK_TAG', 'index');
|
||
|
|
}
|
||
|
|
|
||
|
|
$littlelink_site = new LittlelinkPage(TITLE, ICON, AVATAR, STYLESHEET);
|
||
|
|
|
||
|
|
if (defined('SHLINK_BASE_URL') && defined('SHLINK_API_KEY')) {
|
||
|
|
$littleshlink_site = new LittleshlinkPage(SHLINK_BASE_URL, SHLINK_API_KEY, SHLINK_TAG);
|
||
|
|
$littleshlink_site->render($littlelink_site);
|
||
|
|
} else {
|
||
|
|
$littlelink_site->render([]);
|
||
|
|
}
|