From 1d52a164955658a36748ddda9229c8debd601cba Mon Sep 17 00:00:00 2001 From: Filip Komar Date: Tue, 14 Jan 2014 21:16:54 +0000 Subject: added error_reporting level to the report & company --- langs/diff.php | 7 ++++--- langs/lib.php | 11 +++++++++++ langs/missing.php | 4 ++-- langs/report.php | 5 +++-- 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 .= '

Please translate license fully into ' . $langs[$target_lang] . ' first

'; 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 @@