Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
m_log Class Reference

Classe de gestion des erreurs apparaissant lors d'appels API. More...

Public Member Functions

 m_log ()
 list_logs_directory ($dir)
 hook_menu ()
 list_logs_directory_all ($dirs)
 get_logs_directory ()
 download_link ($file)

Private Member Functions

 compare_logname ($a, $b)

Detailed Description

Classe de gestion des erreurs apparaissant lors d'appels API.

Definition at line 29 of file m_log.php.

Member Function Documentation

compare_logname (   $a,
  $b 
)
private

Definition at line 52 of file m_log.php.

{
return strcmp($a['name'],$b['name']);
}
download_link (   $file)

Definition at line 91 of file m_log.php.

References $err, $mem, and get_logs_directory().

{
global $err,$mem;
$err->log("log","download_link");
header("Content-Disposition: attachment; filename=".$file);
header("Content-Type: application/force-download");
header("Content-Transfer-Encoding: binary");
$f=$this->get_logs_directory();
$ff=$f['dir']."/".basename($file);
set_time_limit(0);
readfile($ff);
}
get_logs_directory ( )

Definition at line 79 of file m_log.php.

References $c, $cuid, $err, $mem, and ALTERNC_LOGS.

Referenced by download_link().

{
global $cuid,$mem,$err;
$err->log("log","get_logs_directory");
// Return an array to allow multiple directory in the future
if(defined('ALTERNC_LOGS_ARCHIVE')){
$c=array("dir"=>ALTERNC_LOGS_ARCHIVE."/".$cuid."-".$mem->user["login"]);
}else{
$c=array("dir"=>ALTERNC_LOGS."/".$cuid."-".$mem->user["login"]);
}
return $c;
}
hook_menu ( )

Definition at line 57 of file m_log.php.

{
$obj = array(
'title' => _("Logs"),
'ico' => 'images/logs.png',
'link' => 'logs_list.php',
'pos' => 130,
) ;
return $obj;
}
list_logs_directory (   $dir)

Definition at line 34 of file m_log.php.

References $c, $cuid, and $err.

Referenced by list_logs_directory_all().

{
global $cuid,$err;
$err->log("log","list_logs_directory");
$c=array();
foreach( glob("${dir}/*log*") as $absfile) {
$c[]=array("name"=>basename($absfile),
"creation_date"=>date("F d Y H:i:s.", filectime($absfile)),
"filesize"=>filesize($absfile),
"downlink"=>"logs_download.php?file=".urlencode(basename($absfile)),
);
}
usort($c,"m_log::compare_logname");
return $c;
}//list_logs
list_logs_directory_all (   $dirs)

Definition at line 68 of file m_log.php.

References $c, $err, $val, and list_logs_directory().

{
global $err;
$err->log("log","get_logs_directory_all");
$c=array();
foreach($dirs as $dir=>$val){
$c[$dir]=$this->list_logs_directory($val);
}
return $c;
}
m_log ( )

Definition at line 31 of file m_log.php.

{
}

The documentation for this class was generated from the following file: