summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorRomain d'Alverny <rdalverny@gmail.com>2022-01-11 17:57:46 +0100
committerRomain d'Alverny <rdalverny@gmail.com>2022-01-11 17:57:46 +0100
commit1b7fbc4614b577e14052fea50487ee5d0a301e93 (patch)
tree30ac8bfd172b4dd1f3a5da9611b452475056eac9 /index.php
parent138865bbde25bb6193930c98e30c33913d19e367 (diff)
downloadplanet-1b7fbc4614b577e14052fea50487ee5d0a301e93.tar
planet-1b7fbc4614b577e14052fea50487ee5d0a301e93.tar.gz
planet-1b7fbc4614b577e14052fea50487ee5d0a301e93.tar.bz2
planet-1b7fbc4614b577e14052fea50487ee5d0a301e93.tar.xz
planet-1b7fbc4614b577e14052fea50487ee5d0a301e93.zip
Factor more config into PlanetConfig
This moves into PlanetConfig: * people.opml, cache dir path definition, * installation check, * config upgrade when needed, * responsibility for providing config values instead of $conf global array).
Diffstat (limited to 'index.php')
-rwxr-xr-xindex.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/index.php b/index.php
index 627c8da..d98c709 100755
--- a/index.php
+++ b/index.php
@@ -3,14 +3,14 @@ include_once(__DIR__.'/app/app.php');
include_once(__DIR__.'/app/classes/Cache.php');
//Installed ?
-if (!isset($Planet)) {
+if (!$PlanetConfig::isInstalled()) {
echo '<p>' . _g('You might want to <a href="install.php">install moonmoon</a>.') . '</p>';
exit;
}
//Load from cache
$items = array();
-if (0 < $Planet->loadOpml(__DIR__.'/custom/people.opml')) {
+if (0 < $Planet->loadOpml($PlanetConfig->getOpmlFile())) {
$Planet->loadFeeds();
$items = $Planet->getItems();
}
@@ -21,7 +21,7 @@ $cache_key = (count($items)) ? $items[0]->get_id() : '';
$last_modified = (count($items)) ? $items[0]->get_date() : '';
$cache_duration = $PlanetConfig->getOutputTimeout()*60;
-Cache::setStore(__DIR__ . '/' . $conf['cachedir'] . '/');
+Cache::setStore($PlanetConfig->getCacheDir());
if (isset($_GET['type']) && $_GET['type'] == 'atom10') {
/* XXX: Redirect old ATOM feeds to new url to make sure our users don't
@@ -45,7 +45,7 @@ if (!OutputCache::Start($_GET['type'], $cache_key, $cache_duration)) {
OutputCache::End();
}
-if ($conf['debug'] === true) {
+if ($PlanetConfig->getDebug()) {
echo "<!-- \$Planet->errors:\n";
var_dump($Planet->errors);
echo "-->";