summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain d'Alverny <rdalverny@gmail.com>2022-01-14 19:07:19 +0100
committerRomain d'Alverny <rdalverny@gmail.com>2022-01-14 19:07:19 +0100
commit79961b6bae9256cb7686a94a46e1b8eb3f2721c6 (patch)
tree0cc21287ffabe2d694afa525b130e86310ddcf86
parentef25d22544d4df97eae819217d841a7a3147c41d (diff)
downloadplanet-79961b6bae9256cb7686a94a46e1b8eb3f2721c6.tar
planet-79961b6bae9256cb7686a94a46e1b8eb3f2721c6.tar.gz
planet-79961b6bae9256cb7686a94a46e1b8eb3f2721c6.tar.bz2
planet-79961b6bae9256cb7686a94a46e1b8eb3f2721c6.tar.xz
planet-79961b6bae9256cb7686a94a46e1b8eb3f2721c6.zip
Cleanup
-rw-r--r--README.md7
-rwxr-xr-xadmin/index.php8
-rw-r--r--app/classes/Planet.php8
-rw-r--r--app/classes/PlanetConfig.php27
4 files changed, 7 insertions, 43 deletions
diff --git a/README.md b/README.md
index 032d421..48550a8 100644
--- a/README.md
+++ b/README.md
@@ -54,12 +54,9 @@ url: http://planet.example.net # your planet base URL
name: My Planet # your planet front page name
locale: en # front page locale
items: 10 # how many items to show
-refresh: 240 # feeds cache timeout (in seconds)
-cache: 10 # front page cache timeout (in seconds)
+refresh: 3600 # feeds cache timeout (in seconds)
+cache: 1800 # front page cache timeout (in seconds)
cachedir: ./cache # where is cache stored
-postmaxlength: 0 # deprecated
-shuffle: 0 # deprecated
-nohtml: 0 # deprecated
categories: # only list posts that have one
# of these (tag or category)
debug: false # debug mode (dangerous in production!)
diff --git a/admin/index.php b/admin/index.php
index b16ed04..153c2ad 100755
--- a/admin/index.php
+++ b/admin/index.php
@@ -3,13 +3,7 @@
require_once __DIR__ . '/../app/app.php';
require_once __DIR__ . '/inc/auth.inc.php';
-//Load configuration
-$config_file = __DIR__ . '/../custom/config.yml';
-
-if (is_file($config_file)) {
- $conf = Spyc::YAMLLoad($config_file);
- $PlanetConfig = new PlanetConfig($conf);
-} else {
+if (!$PlanetConfig::isInstalled()) {
die('<p>' . _g('You might want to <a href="../install.php">install moonmoon</a>.') . '</p>');
}
diff --git a/app/classes/Planet.php b/app/classes/Planet.php
index d3e6149..402d2d0 100644
--- a/app/classes/Planet.php
+++ b/app/classes/Planet.php
@@ -159,7 +159,7 @@ class Planet
public function download($max_load = 0.1)
{
$max_load_feeds = ceil(count($this->people) * $max_load);
- $opml = OpmlManager::load(__DIR__.'/../../custom/people.opml');
+ $opml = OpmlManager::load($this->config->getOpmlFile());
foreach ($this->people as $feed) {
//Avoid mass loading with variable cache duration
@@ -173,7 +173,7 @@ class Planet
// Bypass remote's SSL/TLS certificate if the user explicitly
// asked for it in the configuration.
- if ($this->config->checkcerts === false) {
+ if (!$this->config->checkCertificates()) {
$feed->set_curl_options([
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false
@@ -188,7 +188,7 @@ class Planet
$items = $feed->get_items();
$this->items = array_merge($this->items, $items);
} else {
- $this->errors[] = new PlanetError(1, 'No items or down : ' . $feed->getFeed());
+ $this->errors[] = new PlanetError(1, 'No items or down: ' . $feed->getFeed());
$isDown = '1';
}
@@ -199,7 +199,7 @@ class Planet
}
}
- OpmlManager::save($opml, __DIR__.'/../../custom/people.opml');
+ OpmlManager::save($opml, $this->config->getOpmlFile());
}
public function sort()
diff --git a/app/classes/PlanetConfig.php b/app/classes/PlanetConfig.php
index 179e25b..a13179b 100644
--- a/app/classes/PlanetConfig.php
+++ b/app/classes/PlanetConfig.php
@@ -128,38 +128,11 @@ class PlanetConfig
return $this->conf['cache'];
}
- /**
- * @deprecated
- * @return mixed
- */
- public function getShuffle()
- {
- return $this->conf['shuffle'];
- }
-
public function getMaxDisplay()
{
return $this->conf['items'];
}
- /**
- * @deprecated
- * @return mixed
- */
- public function getNoHTML()
- {
- return $this->conf['nohtml'];
- }
-
- /**
- * @deprecated
- * @return mixed
- */
- public function getPostMaxLength()
- {
- return $this->conf['postmaxlength'];
- }
-
public function getCategories()
{
return $this->conf['categories'];