diff --git a/root/Album.php b/root/Album.php index 3d13f7c..1409473 100644 --- a/root/Album.php +++ b/root/Album.php @@ -2,6 +2,8 @@ /* Copyright (C) 2021 Alexander Rosenberg * This file is AGPL v3. See LICENSE file for more information */ +require 'options.php'; + class Album { private const PATH_PREFIX = 'albums'; private const THUMB_PREFIX = 'thumbnails'; @@ -66,7 +68,8 @@ class Album { } function get_path() { - return $this::PATH_PREFIX . '/' . $this->name; + return AM_OPTIONS['root'] . '/' . $this::PATH_PREFIX . '/' + . $this->name; } function get_title() { diff --git a/root/library.php b/root/library.php index 8fb00f8..95dc412 100644 --- a/root/library.php +++ b/root/library.php @@ -2,7 +2,9 @@ /* Copyright (C) 2021 Alexander Rosenberg * This file is AGPL v3. See LICENSE file for more information */ -const CONFIG_PATH = 'config.json'; +require 'options.php'; + +const CONFIG_PATH = AM_OPTIONS['root'] . '/config.json'; function display_error_message($msg, $html_tags = '') { echo '
' . htmlspecialchars($msg, ENT_QUOTES | ENT_HTML5) . '
'; diff --git a/root/options.php b/root/options.php new file mode 100644 index 0000000..c35a848 --- /dev/null +++ b/root/options.php @@ -0,0 +1,8 @@ + "/path/to/root", +]; +?>