Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/08/2010, 09:24
dezagus
 
Fecha de Ingreso: abril-2010
Ubicación: Ping: BSAS - Arg
Mensajes: 791
Antigüedad: 14 años
Puntos: 25
Revisar si la Funcion fue Declarada

Hola a Todos, estoy haciendo un registro de errores y queria saber si es posible averiguar si una Funcion fue declarada.

¿Que quiero decir?

Bueno, ej si tengo un php con una función faltante, que la agregue.

Acá dejo mi codigo para que lo entiendan mejor

Código PHP:
<?
function ErrorPaste ($Error) {
include(
'conec.php');
include(
'getip.php');
$IPError getRealIP();
date_default_timezone_set('GTM');
$Fecha date("c");
mysql_query("INSERT INTO ErrorLog
(Error,IP,Fecha) VALUES ('$Error', '$IPError', '$Fecha')"
);
}

ErrorPaste ('Estoesunaprueba3');
?>
El problema es cuando tengo ya el include en otra parte del php, como por ejemplo acá:

Código PHP:
<?
/// OTRA PARTE DEL CÓDIGO

include('conec.php');

/// OTRA PARTE DEL CÓDIGO

function ErrorPaste ($Error) {
include(
'conec.php');
include(
'getip.php');
$IPError getRealIP();
date_default_timezone_set('GTM');
$Fecha date("c");
mysql_query("INSERT INTO ErrorLog
(Error,IP,Fecha) VALUES ('$Error', '$IPError', '$Fecha')"
);
}

ErrorPaste ('Estoesunaprueba3');
?>
¿Se puede Detectar si fue declarada? (Probé con un if "funcion() == ''..... ) pero aparece error ya que si la función no está declarada no tiene nada con que comparar.

Saludos.