Removing error_reporting everywhere

skala
Julio Montoya 12 years ago
parent add27693b9
commit 4e3788d569
  1. 62
      main/inc/global.inc.php
  2. 3
      main/inc/lib/fckeditor/editor/filemanager/connectors/php/io.php
  3. 9
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/config.base.php
  4. 6
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/config.tinymce.php
  5. 12
      main/inc/lib/main_api.lib.php
  6. 4
      main/inc/lib/template.lib.php
  7. 5
      main/inc/local.inc.php
  8. 3
      main/install/index.php
  9. 19
      src/ChamiloLMS/Controller/CourseHomeController.php
  10. 2
      tests/doctrine_console/cli-config.php
  11. 33
      tests/migrate/migrate.php
  12. 3
      tests/phpunit/autoload.php

@ -389,6 +389,7 @@ if (isset($_configuration['main_database'])) {
}
$app['is_admin'] = false;
//Creating a Chamilo service provider
use Silex\ServiceProviderInterface;
@ -461,6 +462,7 @@ $app['template.load_plugins'] = true;
//Default template style
$app['template_style'] = 'default';
//Default layout
$app['default_layout'] = $app['template_style'].'/layout/layout_1_col.tpl';
@ -803,58 +805,6 @@ if (is_array($language_files)) {
/* End loading languages */
//error_reporting(E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR);
error_reporting(-1);
if (api_get_setting('server_type') == 'test') {
error_reporting(-1);
} else {
/*
Server type is not test
- normal error reporting level
- full fake register globals block
*/
//error_reporting(E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR);
/*
// TODO: These obsolete variables $HTTP_* to be check whether they are actually used.
if (!isset($HTTP_GET_VARS)) {
$HTTP_GET_VARS = $_GET;
}
if (!isset($HTTP_POST_VARS)) {
$HTTP_POST_VARS = $_POST;
}
if (!isset($HTTP_POST_FILES)) {
$HTTP_POST_FILES = $_FILES;
}
if (!isset($HTTP_SESSION_VARS)) {
$HTTP_SESSION_VARS = $_SESSION;
}
if (!isset($HTTP_SERVER_VARS)) {
$HTTP_SERVER_VARS = $_SERVER;
}
// Register SESSION variables into $GLOBALS
if (sizeof($HTTP_SESSION_VARS)) {
if (!is_array($_SESSION)) {
$_SESSION = array();
}
foreach ($HTTP_SESSION_VARS as $key => $val) {
$_SESSION[$key] = $HTTP_SESSION_VARS[$key];
$GLOBALS[$key] = $HTTP_SESSION_VARS[$key];
}
}
// Register SERVER variables into $GLOBALS
if (sizeof($HTTP_SERVER_VARS)) {
$_SERVER = array();
foreach ($HTTP_SERVER_VARS as $key => $val) {
$_SERVER[$key] = $HTTP_SERVER_VARS[$key];
if (!isset($_SESSION[$key]) && $key != 'includePath' && $key != 'rootSys' && $key != 'lang_path' && $key != 'extAuthSource' && $key != 'thisAuthSource' && $key != 'main_configuration_file_path' && $key != 'phpDigIncCn' && $key != 'drs') {
$GLOBALS[$key] = $HTTP_SERVER_VARS[$key];
}
}
}*/
}
// Specification for usernames:
// 1. ASCII-letters, digits, "." (dot), "_" (underscore) are acceptable, 40 characters maximum length.
// 2. Empty username is formally valid, but it is reserved for the anonymous user.
@ -980,6 +930,10 @@ $app['learnpath.controller'] = $app->share(function () use ($app) {
return new ChamiloLMS\Controller\LearnpathController();
});
$app['course_home.controller'] = $app->share(function () use ($app) {
return new ChamiloLMS\Controller\CourseHomeController();
});
/*
class PostController
{
@ -1012,6 +966,10 @@ $app->get('/userportal', 'userportal.controller:indexAction');
//Logout page
$app->get('/logout', 'index.controller:logoutAction');
$app->match('/courses/{courseCode}/index.php', 'course_home.controller:indexAction', 'GET|POST');
$app->match('/courses/{courseCode}', 'course_home.controller:indexAction', 'GET|POST');
//LP controller
$app->match('/learnpath/subscribe_users/{lpId}', 'learnpath.controller:indexAction', 'GET|POST')->bind('subscribe_users');

@ -114,8 +114,6 @@ function CreateServerFolder($folderPath, $lastFolder = null)
}
if (!file_exists($folderPath)) {
// Turn off all error reporting.
error_reporting(0);
$php_errormsg = '';
// Enable error tracking to catch the error.
@ -167,7 +165,6 @@ function CreateServerFolder($folderPath, $lastFolder = null)
// Restore the configurations.
ini_restore('track_errors');
ini_restore('error_reporting');
return $sErrorMsg;
} else {

@ -11,9 +11,6 @@
* @since 31/December/2008
*/
//error_reporting(E_ALL);
//error_reporting(E_ALL ^ E_NOTICE);
//Access Control Setting
/**
* turn off => false
@ -45,7 +42,7 @@ if(empty($_course['path']) || Security::remove_XSS($_GET['editor'])=="stand_alon
define('CONFIG_OPTIONS_UPLOAD', true);
define('CONFIG_OPTIONS_EDITABLE', false); //disable image editor and text editor
} else {
if(api_is_allowed_to_edit()) {
//api_is_allowed_to_edit() from Chamilo
define('CONFIG_OPTIONS_DELETE', true);
@ -141,12 +138,12 @@ define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html'); //make you include all the
define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste
define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,jpeg,png,bmp,tif,psd,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,ogg,ogx,ogv,oga, aif,aiff,wav,mp3,swf,flv, mp4, aac, ppt,rtf,doc, pdf,xls,txt,flv,odt,ods,odp,odg,odc,odf,odb,odi,pps,docx,pptx,xlsx,accdb,xml,mid, midi, svg, svgz, mm');//Updated for Chamilo
//define viewable valid exts
$viewable='gif,bmp,txt,jpg,jpeg,png,tif,html,htm,mp3,wav,wmv,wma,rm,rmvb,mov,swf,flv,mp4,aac,avi,mpg,mpeg,asf,mid,midi';//updated by Chamilo
$viewable_array = explode(" ",$viewable);
if (api_browser_support('svg')){
if (api_browser_support('svg')){
$viewable_array[]=',svg';
}
if (api_browser_support('ogg')){

@ -7,12 +7,6 @@
*
*/
error_reporting(E_ALL);
//error_reporting(E_ALL ^ E_NOTICE);
//Access Control Setting
/**
* turn off => false

@ -5291,6 +5291,18 @@ function api_get_tools_lists($my_tool = null) {
return in_array($my_tool, $tools_list) ? $my_tool : '';
}
function api_get_tool_urls() {
return array(
TOOL_DOCUMENT => api_get_path(WEB_CODE_PATH).'document/document.php',
TOOL_QUIZ => api_get_path(WEB_CODE_PATH).'exercice/exercice.php',
TOOL_ANNOUNCEMENT => api_get_path(WEB_CODE_PATH).'announcements/announcements.php',
TOOL_CALENDAR_EVENT => api_get_path(WEB_CODE_PATH).'calendar/agenda.php',
TOOL_STUDENTPUBLICATION => api_get_path(WEB_CODE_PATH).'work/work.php',
TOOL_LEARNPATH => api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php'
);
}
/**
* Checks whether we already approved the last version term and condition
* @param int user id

@ -1261,7 +1261,9 @@ class Template
// Custom tabs
for ($i = 1; $i <= 3; $i++) {
if (api_get_setting('show_tabs', 'custom_tab_'.$i) == 'true') {
$navigation['custom_tab_'.$i] = $possible_tabs['custom_tab_'.$i];
if (isset($possible_tabs['custom_tab_'.$i])) {
$navigation['custom_tab_'.$i] = $possible_tabs['custom_tab_'.$i];
}
} else {
if (isset($possible_tabs['custom_tab_'.$i])) {
$menu_navigation['custom_tab_'.$i] = $possible_tabs['custom_tab_'.$i];

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
/**
*
* SCRIPT PURPOSE
* SCRIPT PURPOSE
*
* This script initializes and manages Chamilo session information. It
* keeps available session information up to date.
@ -40,7 +40,6 @@ if (isset($_SESSION['conditional_login']['uid']) && $_SESSION['conditional_login
event_login();
}
// parameters passed via GET
$logout = isset($_GET["logout"]) ? $_GET["logout"] : '';
$gidReq = isset($_GET["gidReq"]) ? Database::escape_string($_GET["gidReq"]) : null;
@ -132,6 +131,7 @@ if (!empty($_SESSION['_user']['user_id']) && !($login || $logout)) {
require_once api_get_path(SYS_PATH).'main/auth/cas/authcas.php';
$cas_login = cas_is_authenticated();
}
if ((isset($_POST['login']) AND isset($_POST['password']) ) OR ($cas_login)) {
// $login && $password are given to log in
@ -146,6 +146,7 @@ if (!empty($_SESSION['_user']['user_id']) && !($login || $logout)) {
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$sql = "SELECT user_id, username, password, auth_source, active, expiration_date, status FROM $user_table
WHERE username = '".Database::escape_string($login)."'";
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {

@ -90,9 +90,6 @@ api_set_internationalization_default_encoding($charset);
// Page encoding initialization.
header('Content-Type: text/html; charset='.api_get_system_encoding());
// Setting the error reporting levels.
error_reporting(E_ALL);
// Overriding the timelimit (for large campusses that have to be migrated).
@set_time_limit(0);

@ -11,11 +11,22 @@ use Symfony\Component\HttpFoundation\Response;
*/
class CourseHomeController
{
public function indexAction()
public $language_files = array('course_home','courses');
public function indexAction(Application $app, $courseCode)
{
/*$certificate = new Certificate($_GET['id']);
$list = api_get_tool_urls();
$content = null;
foreach ($list as $tool) {
$content .= \Display::url($tool, $tool.'?cidReq='.$courseCode);
}
$app['template']->assign('content', $content);
$response = $app['template']->render_layout('layout_2_col.tpl');
//Show certificate HTML
$certificate->show();*/
//return new Response($response, 200, array('Cache-Control' => 's-maxage=3600, public'));
return new Response($response, 200, array());
}
}

@ -1,8 +1,6 @@
<?php
require_once dirname(__FILE__).'/../../main/inc/global.inc.php';
error_reporting(-1);
$config = new \Doctrine\ORM\Configuration();
$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache);

@ -13,7 +13,6 @@ require_once 'config.php';
require_once api_get_path(LIBRARY_PATH).'attendance.lib.php';
require_once api_get_path(LIBRARY_PATH).'thematic.lib.php';
//error_reporting(-1);
$action_type = ((!empty($argv[1]) && $argv[1]=='migration')?'migration':'sync');
if (is_file(dirname(__FILE__) . '/migration.custom.class.php')) {
@ -33,19 +32,19 @@ $utc_datetime = api_get_utc_datetime();
$start = time();
echo "\n-- Starting at ".date('h:i:s')." local server time\n";
if (!empty($servers)) {
foreach ($servers as $server_info) {
foreach ($servers as $server_info) {
if ($server_info['active']) {
echo "\n---- Start loading server----- \n";
echo $server_info['name']."\n\n";
error_log('Treating server '.$server_info['name']);
//echo "---- ----------------------- \n";
$config_info = $server_info['connection'];
//echo "---- ----------------------- \n";
$config_info = $server_info['connection'];
$db_type = $config_info['type'];
if (empty($db_type)) {
die("This script requires a DB type to work. Please update orig_db_conn.inc.php\n");
}
}
$file = dirname(__FILE__) . '/migration.' . $db_type . '.class.php';
if (!is_file($file)) {
die("Could not find db type file " . $file . "\n");
@ -54,29 +53,29 @@ if (!empty($servers)) {
$class = 'Migration' . strtoupper($db_type);
$m = new $class($config_info['host'], $config_info['port'], $config_info['db_user'], $config_info['db_pass'], $config_info['db_name'], $boost);
$m->connect();
/**
* Prepare the arrays of matches that will allow for the migration
*/
$migrate = array();
$branch = $server_info['branch_id'];
include $server_info['filename'];
if ($action_type == 'migration') {
error_log('Starting Migration');
//Default migration from MSSQL to Chamilo MySQL
$m->migrate($matches);
} else {
} else {
//Getting transactions from MSSQL (via webservices)
if (!empty($matches['web_service_calls'])) {
if (!empty($matches['web_service_calls'])) {
error_log('Starting Synchronization');
$m->set_web_service_connection_info($matches);
//This functions truncates the transaction lists!
//$m->insert_test_transactions();
//$m->get_transactions_from_webservice();
//Load transactions saved before
@ -85,14 +84,14 @@ if (!empty($servers)) {
} else {
error_log('Make sure you define the web_service_calls array in your db_matches.php file');
}
//print_r($m->errors_stack);
}
//echo "OK so far\n";
echo "\n ---- End loading server----- \n";
} else {
error_log("db_matches not activated: {$server_info['name']} {$server_info['filename']}");
}
}
}
}
$end = time();

@ -1,3 +1,2 @@
<?php
require_once dirname(__FILE__).'/../../vendor/autoload.php';
error_reporting(-1);
require_once dirname(__FILE__).'/../../vendor/autoload.php';
Loading…
Cancel
Save