aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-17 01:35:06 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-17 01:35:06 +0100
commitb8c4afadf4bff7ac282ac5933eedccb1c666d873 (patch)
treeaef58395f1aecf027532fdc579b73084edfb8aa8
parenta532a023633ac692bd573d4ec29b7871e8e4c19f (diff)
Nouveau fichier constants.php
En particulier pour stocker le numéro de version de FreshRSS utilisé entre autres par https://github.com/marienfressinaud/FreshRSS/issues/174 et centraliser les constantes de chemins Implémente https://github.com/marienfressinaud/FreshRSS/issues/271
-rwxr-xr-xactualize_script.php8
-rw-r--r--app/models/Feed.php2
-rw-r--r--app/views/index/about.phtml2
-rw-r--r--constants.php10
-rwxr-xr-xpublic/index.php7
5 files changed, 14 insertions, 15 deletions
diff --git a/actualize_script.php b/actualize_script.php
index 45b2938cb..65f9360a0 100755
--- a/actualize_script.php
+++ b/actualize_script.php
@@ -1,11 +1,5 @@
<?php
-
-// Constantes de chemins
-define ('PUBLIC_PATH', realpath (dirname (__FILE__) . '/public'));
-define ('LIB_PATH', realpath (PUBLIC_PATH . '/../lib'));
-define ('APP_PATH', realpath (PUBLIC_PATH . '/../app'));
-define ('LOG_PATH', realpath (PUBLIC_PATH . '/../log'));
-define ('CACHE_PATH', realpath (PUBLIC_PATH . '/../cache'));
+require('constants.php');
$_GET['c'] = 'feed';
$_GET['a'] = 'actualize';
diff --git a/app/models/Feed.php b/app/models/Feed.php
index d76d4cd0e..2618d023f 100644
--- a/app/models/Feed.php
+++ b/app/models/Feed.php
@@ -194,7 +194,7 @@ class Feed extends Model {
);
} else {
$feed = new SimplePie ();
- $feed->set_useragent(Translate::t ('freshrss') . '/' . '0.7' . ' (' . PHP_OS . '; http://marienfressinaud.github.io/FreshRSS/) ' . SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION);
+ $feed->set_useragent(Translate::t ('freshrss') . '/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ') ' . SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION);
$url = str_replace ('&amp;', '&', $this->url);
if ($this->httpAuth != '') {
$url = preg_replace ('#((.+)://)(.+)#', '${1}' . $this->httpAuth . '@${3}', $url);
diff --git a/app/views/index/about.phtml b/app/views/index/about.phtml
index ca1254053..fa799154b 100644
--- a/app/views/index/about.phtml
+++ b/app/views/index/about.phtml
@@ -5,7 +5,7 @@
<dl class="infos">
<dt><?php echo Translate::t ('project_website'); ?></dt>
- <dd><a href="http://marienfressinaud.github.io/FreshRSS/">http://marienfressinaud.github.io/FreshRSS/</a></dd>
+ <dd><a href="<?php echo FRESHRSS_WEBSITE; ?>"><?php echo FRESHRSS_WEBSITE; ?></a></dd>
<dt><?php echo Translate::t ('lead_developer'); ?></dt>
<dd><a href="mailto:contact@marienfressinaud.fr">Marien Fressinaud</a> - <a href="http://marienfressinaud.fr"><?php echo Translate::t ('website'); ?></a></dd>
diff --git a/constants.php b/constants.php
new file mode 100644
index 000000000..260f01986
--- /dev/null
+++ b/constants.php
@@ -0,0 +1,10 @@
+<?php
+define('FRESHRSS_VERSION', '0.7-dev');
+define('FRESHRSS_WEBSITE', 'http://marienfressinaud.github.io/FreshRSS/');
+
+// Constantes de chemins
+define ('PUBLIC_PATH', realpath (dirname (__FILE__) . '/public'));
+define ('LIB_PATH', realpath (dirname (__FILE__) . '/lib'));
+define ('APP_PATH', realpath (dirname (__FILE__) . '/app'));
+define ('LOG_PATH', realpath (dirname (__FILE__) . '/log'));
+define ('CACHE_PATH', realpath (dirname (__FILE__) . '/cache'));
diff --git a/public/index.php b/public/index.php
index 1a1651707..bda585592 100755
--- a/public/index.php
+++ b/public/index.php
@@ -18,12 +18,7 @@
#
# ***** END LICENSE BLOCK *****
-// Constantes de chemins
-define ('PUBLIC_PATH', realpath (dirname (__FILE__)));
-define ('LIB_PATH', realpath (PUBLIC_PATH . '/../lib'));
-define ('APP_PATH', realpath (PUBLIC_PATH . '/../app'));
-define ('LOG_PATH', realpath (PUBLIC_PATH . '/../log'));
-define ('CACHE_PATH', realpath (PUBLIC_PATH . '/../cache'));
+require('../constants.php');
if (file_exists (PUBLIC_PATH . '/install.php')) {
include ('install.php');