1
0
This repository has been archived on 2021-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
gallery3-contrib/3.0/modules/event_watcher/helpers/event_watcher.php
2012-11-08 04:19:14 -05:00

42 lines
1.1 KiB
PHP

<?php defined('SYSPATH') or die('No direct script access.');
class event_watcher_Core {
static function watch_event($event,$args)
{
$msg=date('H:i:s',time()-4*3600)." $event: ";
$sep="";
foreach ($args as $arg)
{
if(is_object($arg))
{
$class = get_class($arg);
if( strcmp($class,'User_Model')==0 ||
strcmp($class,'Group_Model')==0 ||
strcmp($class,'Item_Model')==0 ||
strcmp($class,'Module_Model')==0 ||
strcmp($class,'Tag_Model')==0 ||
strcmp($class,'Task_Model')==0 ||
strcmp($class,'Theme_Model')==0 ||
strcmp($class,'Var_Model')==0 )
{
$msg = "$msg $sep $class(" . $arg->name . ")";
}
elseif( strcmp($class,'Comment_Model')==0 )
{
$text = substr($arg->text,0,25);
$msg = "$msg $sep $class( $text... )";
}
else
{
$msg = $msg . $sep . get_class($arg);
}
}
else
{
$msg = $msg . $sep . $arg;
}
$sep = ", ";
}
message::error($msg);
}
}