/* Enjoy!!! Dino Ciuffetti - dam2k@users.sourceforge.net
*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program (COPYING); if not, go to http://www.fsf.org/ or write
* to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*
*/
// TODO: IMPLEMENT THIS CLASS
/* ERRORS RELATIVES */
/**
* This is the cmsdAm error handling class.
*
* Stay tuned, it is not even written!!
* Class instance: $cms->errors
* @author dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
*/
class cmsdam_errors
{
/**
* You should not use this variable from your section
* @access private
*/
var $conf;
/**
* You should not use this variable from your section
* @access private
*/
var $logs;
/* PHP ERROR CAN BE:
E_ERROR E_WARNING E_PARSE E_NOTICE E_CORE_ERROR E_CORE_WARNING E_COMPILE_ERROR
E_COMPILE_WARNING E_USER_ERROR E_USER_WARNING E_USER_NOTICE E_ALL E_STRICT
or a combination of them. Please go to view PHP manual for details
*/
// Error reporting
// error_reporting (E_WARNING);
// report_error(__FILE__, __LINE__, "Something went wrong!");
/*
This method will create a fake function. If a function does not exist you can create
a fake function, but keep attention because you cannot redeclare previously declared functions!!
*/
function error_handler($function_name, $ret_state = true) { // This method will return a fake function
//echo "DEBUG: $function_name";
if ((isset($ret_state)) && ($ret_state == true)) {
$textual_ret = "true";
}
if ((isset($ret_state)) && ($ret_state === false)) {
$textual_ret = "false";
}
if ((isset($ret_state)) && ($ret_state === null)) {
$textual_ret = "null";
}
$this->logs->log_note(4, "NOTE: cmsdam_errors: appended an error handler: $function_name, ret: $textual_ret");
$evalcode = 'function '.$function_name.'() { return "'.$ret_state.'"; }';
eval($evalcode);
Global $function_name;
return true;
}
}
?>