Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/02/2012, 21:28
Avatar de ahaugas
ahaugas
 
Fecha de Ingreso: agosto-2011
Ubicación: Madrid
Mensajes: 249
Antigüedad: 13 años, 6 meses
Puntos: 21
Pregunta problema con clases y funciones

Hola a todos, veran tengo una clase que supuestamente te genera los logs del usuario y los logs de los errores, esta hecho por mi.

pero no me funciona me funciona sin clase y sin funcion.

me gustaria saber que es lo que estoy haciendo mal y si me podriais ayudar.
Gracias.

Código PHP:
<?php
/*
    UserCake Version: 1.4
    http://usercake.com
    
    Developed by: Adam Davis
*/
class NotifyLogs {
    
    
//UserCake check host, port and url access
    
function takeURL(){
    
$url="http://".$_SERVER["HTTP_HOST"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
    return 
$url;
    }

    
//UserCake check debug mode and maintenance is true or false
    
function LogError() {
    if (
$debug_mode === true) {
        
$sendfinaldate base64_encode($finaldate);
        if((
strpos($_SERVER['REMOTE_ADDR'], $adminIP) === 0)) {    } 
        else { if(
is_file("maintenance.php")) { header("Location: maintenance.php?FinalDate=$sendfinaldate"); die(); } }
        
error_reporting(-1);
        
ini_set("display_errors","On");
        
ini_set("error_log",$logfiles_dir."error-$today.log");
        
$myFile $logfiles_dir."usercake-$today.log";
        
$fh fopen($myFile"a");
        
$configa "config"
        
$pageuser takeURL();
        
$ipuser $_SERVER["REMOTE_ADDR"];
        
$datelog date("D M j G:i:s T Y");
        
$stringData "userCake Notice: [ $ipuser ] --> [ Anonymous ] -->  [$datelog] -->  [ $pageuser ] \n";
            
fwrite($fh$stringData);
            
fclose($fh);
        }
    
//UserCake check debug mode and maintenance is true or false
    
if ($debug_mode === false) { 
        
error_reporting(0);
        
$myFile $logfiles_dir."usercake-$today.log";
        
$fh fopen($myFile"a");
        
$configa "config"
        
$pageuser takeURL();
        
$ipuser $_SERVER["REMOTE_ADDR"];
        
$datelog date("D M j G:i:s T Y");
        
$stringData "userCake Notice: [ $ipuser ] --> [ Anonymous ] -->  [$datelog] -->  [ $pageuser ] \n";
            
fwrite($fh$stringData);
            
fclose($fh); 
        }    
    }
}
?>
y al llamarlo

Código PHP:
    $createlog = new NotifyLogs();
    
$createlog->LogError();
    
NotifyLogs::LogError(); 
Porfavor una ayuda, gracias de antemano