mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
* log errors instead showing them to users with system directories
* now it will print a notice, and aditionally log full path into system/logs/error.log * also, when it fails to load config.lua it will output error also to error.log * fix when $_SERVER['HTTP_ACCEPT_ENCODING'] is not set.
This commit is contained in:
@@ -47,7 +47,7 @@ class OTS_Group extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
*
|
||||
* @param DOMElement $group Group info.
|
||||
*/
|
||||
public function __construct($data)
|
||||
public function __construct($data = array())
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
|
@@ -51,6 +51,12 @@ class OTS_Groups_List implements IteratorAggregate, Countable
|
||||
global $config;
|
||||
$file = $config['data_path'] . 'XML/groups.xml';
|
||||
}
|
||||
|
||||
if(!@file_exists($file)) {
|
||||
error('Error: Cannot load groups.xml. More info in system/logs/error.log file.');
|
||||
log_append('error.log', '[OTS_Groups_List.php] Fatal error: Cannot load groups.xml (' . $file . '). It doesnt exist.');
|
||||
return;
|
||||
}
|
||||
|
||||
global $cache;
|
||||
|
||||
@@ -63,7 +69,9 @@ class OTS_Groups_List implements IteratorAggregate, Countable
|
||||
else
|
||||
{
|
||||
$groups = new DOMDocument();
|
||||
$groups->load($file);
|
||||
error('Error: Cannot load groups.xml. More info in system/logs/error.log file.');
|
||||
return;
|
||||
}
|
||||
|
||||
// loads groups
|
||||
foreach( $groups->getElementsByTagName('group') as $group)
|
||||
@@ -85,8 +93,10 @@ class OTS_Groups_List implements IteratorAggregate, Countable
|
||||
{
|
||||
// loads DOM document
|
||||
$groups = new DOMDocument();
|
||||
$groups->load($file);
|
||||
|
||||
error('Error: Cannot load groups.xml. More info in system/logs/error.log file.');
|
||||
return;
|
||||
}
|
||||
|
||||
// loads groups
|
||||
foreach($groups->getElementsByTagName('group') as $group)
|
||||
{
|
||||
|
@@ -644,7 +644,8 @@ class OTS_Player extends OTS_Row_DAO
|
||||
if($tmp)
|
||||
return $tmp;
|
||||
|
||||
echo 'error while loading group..';
|
||||
return new OTS_Group();
|
||||
// echo 'error while loading group..';
|
||||
/*
|
||||
$_id = $this->data['group_id'];
|
||||
$tmpGroup = new OTS_Group;
|
||||
|
Reference in New Issue
Block a user