partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 247c59a5ad80b9d86c6a3c272a47ba642937bc44
parent f546c4cb9b14714bdbe552e8a381d93de5504187
Author: Felicitus <felicitus@felicitus.org>
Date:   Sun, 18 Mar 2012 08:53:01 +0100

Automagically fill in values for partkeepr.files.path, partkeepr.images.path and partkeepr.images.cache. Fixes #157

Diffstat:
Msrc/backend/de/RaumZeitLabor/PartKeepr/PartKeepr.php | 22++++++++++++++++++++++
1 file changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/backend/de/RaumZeitLabor/PartKeepr/PartKeepr.php b/src/backend/de/RaumZeitLabor/PartKeepr/PartKeepr.php @@ -101,6 +101,28 @@ class PartKeepr { include(dirname(dirname(dirname(dirname(dirname(__DIR__)))))."/config.php"); } + // Check if the files path is set. If not, fall back to <partkeepr-root>/data/ + if (PartKeeprConfiguration::getOption("partkeepr.files.path", null) === null) { + + PartKeeprConfiguration::setOption("partkeepr.files.path", + PartKeepr::getRootDirectory() . "/data/"); + } + + // Check if the image path is set. If not, fall back to <configured-files-directory>/images/ + if (PartKeeprConfiguration::getOption("partkeepr.images.path", null) === null) { + + PartKeeprConfiguration::setOption("partkeepr.images.path", + PartKeeprConfiguration::getOption("partkeepr.files.path") . "images/"); + } + + // Check if the image cache path is set. If not, fall back to <configured-images-directory>/images/ + if (PartKeeprConfiguration::getOption("partkeepr.images.cache", null) === null) { + + PartKeeprConfiguration::setOption("partkeepr.images.cache", + PartKeeprConfiguration::getOption("partkeepr.images.path") . "cache/"); + + } + } /**