Как получить имя вызывающего класса (в PHP)
define('anActionType', 1); $actionTypes = array(anActionType => 'anActionType'); class core { public $callbacks = array(); public $plugins = array(); public function __construct() { $this->plugins[] = new admin(); $this->plugins[] = new client(); } } abstract class plugin { public function registerCallback($callbackMethod, $onAction) { if (!isset($this->callbacks[$onAction])) $this->callbacks[$onAction] = array(); global $actionTypes; echo "Calling $callbackMethod in $callbacksClass because we […]