Fix wrong local path and some cleanup

This commit is contained in:
Frederic Guillot 2016-08-21 12:55:27 -04:00
parent 8fa6d65614
commit dfdb4d5c2b
No known key found for this signature in database
GPG Key ID: 92D77191BA7FBC99
3 changed files with 7 additions and 6 deletions

View File

@ -1,5 +1,4 @@
FROM ubuntu:14.04
MAINTAINER Frederic Guillot <fred@miniflux.net>
RUN apt-get update && \
apt-get install -y apache2 php5 php5-sqlite php5-curl && \

View File

@ -147,7 +147,7 @@ Router\get_action('add', function () {
)));
});
// Add a feed with the form or directly from the url, it can be used by a bookmarklet by example
// Add a feed with the form or directly from the url, it can be used by a bookmarklet for example
Router\action('subscribe', function () {
if (Request\is_post()) {
$values = Request\values();

View File

@ -2,7 +2,9 @@
namespace Translator;
const PATH = '../locales/';
use DirectoryIterator;
const PATH = '/../locales/';
function translate($identifier)
{
@ -15,7 +17,7 @@ function translate($identifier)
$arg = htmlspecialchars($arg, ENT_QUOTES, 'UTF-8', false);
}
return \call_user_func_array(
return call_user_func_array(
'sprintf',
$args
);
@ -115,11 +117,11 @@ function load($language)
{
setlocale(LC_TIME, $language.'.UTF-8');
$path = PATH.$language;
$path = __DIR__.PATH.$language;
$locales = array();
if (is_dir($path)) {
$dir = new \DirectoryIterator($path);
$dir = new DirectoryIterator($path);
foreach ($dir as $fileinfo) {
if (strpos($fileinfo->getFilename(), '.php') !== false) {