diff --git notifications.info notifications.info index ba30bf4..20f38a3 100644 --- notifications.info +++ notifications.info @@ -4,7 +4,7 @@ description = The basic notifications framework package = "Notifications" version = VERSION core = 7.x -php = 5.3 +php = 5.2 dependencies[] = messaging dependencies[] = trigger dependencies[] = messaging_template diff --git notifications.module notifications.module index e6a99bd..565e29b 100644 --- notifications.module +++ notifications.module @@ -1415,4 +1415,34 @@ function notifications_cron_queue_info() { function notifications_cron_queue_event_worker($event) { $event->send_all(); $event->done(); +} + +if(!function_exists('get_called_class')) { + class class_tools { + static $i = 0; + static $fl = null; + + static function get_called() { + $bt = debug_backtrace(); + + if(self::$fl == $bt[2]['file'].$bt[2]['line']) { + self::$i++; + } else { + self::$i = 0; + self::$fl = $bt[2]['file'].$bt[2]['line']; + } + + $lines = file($bt[2]['file']); + + preg_match_all('/([a-zA-Z0-9\_]+)::'.$bt[2]['function'].'/', + $lines[$bt[2]['line']-1], + $matches); + + return $matches[1][self::$i]; + } + } + + function get_called_class() { + return class_tools::get_called(); + } } \ No newline at end of file diff --git notifications_scheduler/notifications_scheduler.info notifications_scheduler/notifications_scheduler.info index aa38605..459a2e4 100644 --- notifications_scheduler/notifications_scheduler.info +++ notifications_scheduler/notifications_scheduler.info @@ -5,7 +5,7 @@ package = "Notifications" version = VERSION core = 7.x dependencies[] = notifications -dependencies[] = job_scheduler_trigger +dependencies[] = job_scheduler files[] = notifications_scheduler.inc