aboutsummaryrefslogtreecommitdiffstats
path: root/langs
diff options
context:
space:
mode:
authorFilip Komar <filip@mageia.org>2014-01-14 21:16:54 +0000
committerFilip Komar <filip@mageia.org>2014-01-14 21:16:54 +0000
commit1d52a164955658a36748ddda9229c8debd601cba (patch)
tree7a565a057eef428306a093ecafa0c7bfdb830d53 /langs
parent70440965824ce1b06577fb37e55b09386143124c (diff)
downloadwww-1d52a164955658a36748ddda9229c8debd601cba.tar
www-1d52a164955658a36748ddda9229c8debd601cba.tar.gz
www-1d52a164955658a36748ddda9229c8debd601cba.tar.bz2
www-1d52a164955658a36748ddda9229c8debd601cba.tar.xz
www-1d52a164955658a36748ddda9229c8debd601cba.zip
added error_reporting level to the report & company
Diffstat (limited to 'langs')
-rw-r--r--langs/diff.php7
-rw-r--r--langs/lib.php11
-rw-r--r--langs/missing.php4
-rw-r--r--langs/report.php5
4 files changed, 20 insertions, 7 deletions
diff --git a/langs/diff.php b/langs/diff.php
index f7e87839f..77cf330be 100644
--- a/langs/diff.php
+++ b/langs/diff.php
@@ -4,6 +4,8 @@
* against matching file in language 'l', if it exists.
*/
+include 'lib.php';
+
define('APP_ROOT', realpath(__DIR__ . '/..'));
$source_file = isset($_GET['s']) ? strip_tags(trim($_GET['s'])) : null;
@@ -19,8 +21,6 @@ if (!file_exists($source_file)) {
die('no source');
}
-include 'lib.php';
-
$target_file = _lang_file_switch($source_file, $target_lang);
if (!file_exists($target_file)) {
@@ -85,7 +85,8 @@ if($constitution) {
if($license) {
require_once('../en/about/license/license.php');
- $license_numbers = array_pop(read_license_from_vcs($target_lang));
+ $license_array = read_license_from_vcs($target_lang);
+ $license_numbers = array_pop($license_array);
$num_of_untranslated_strings = $license_numbers["untran"]; // number of all license sentences
$diff['untranslated_sentences_in_license'] = $license_numbers['untranslated_sentences']; // add untranslated license sentences
$s .= '<h2 style="color: red;">Please translate license fully into ' . $langs[$target_lang] . ' first</h2>';
diff --git a/langs/lib.php b/langs/lib.php
index 890b54823..f7422167f 100644
--- a/langs/lib.php
+++ b/langs/lib.php
@@ -2,6 +2,17 @@
/**
*/
+if (isset($_SERVER['APP_MODE']) && $_SERVER['APP_MODE'] !== 'prod') {
+ ini_set('error_reporting', E_ALL);
+ ini_set('show_errors', true);
+ ini_set('display_errors', true);
+} else {
+ ini_set('error_reporting', FALSE);
+ ini_set('show_errors', FALSE);
+ ini_set('display_errors', FALSE);
+ ini_set('log_errors', FALSE);
+}
+
include '../langs.inc.php';
/**
diff --git a/langs/missing.php b/langs/missing.php
index c8f5a4705..a2df2edcd 100644
--- a/langs/missing.php
+++ b/langs/missing.php
@@ -2,6 +2,8 @@
/**
*/
+include 'lib.php';
+
$s = isset($_GET['s']) ? strip_tags(trim($_GET['s'])) : null;
$l = isset($_GET['l']) ? strip_tags(trim($_GET['l'])) : null;
@@ -10,8 +12,6 @@ if (is_null($s)) {
die;
}
-include 'lib.php';
-
if($s =='en/about/constitution.en.lang') {
$constitution = true;
} else {
diff --git a/langs/report.php b/langs/report.php
index 7bb799008..5e16e1fad 100644
--- a/langs/report.php
+++ b/langs/report.php
@@ -37,9 +37,9 @@
<?php
/**
*/
+ include 'lib.php';
$one_language = isset($_GET['l']) ? strip_tags(trim($_GET['l'])) : null;
$one_resource = isset($_GET['r']) ? strip_tags(trim($_GET['r'])) : null;
- include 'lib.php';
define('APP_ROOT', realpath(__DIR__ . '/..'));
$restore_languages = FALSE;
@@ -141,7 +141,8 @@
}
if ($link == 'about/license') {
require_once('../en/about/license/license.php');
- $license_numbers = array_pop(read_license_from_vcs($l));
+ $license_array = read_license_from_vcs($l);
+ $license_numbers = array_pop($license_array);
$test['a'] += $license_numbers["all"]; // add aproximate number of untranslated sentences from license
$num_of_untranslated_strings += $license_numbers["untran"]; // add number of all license sentences
}