public static function getInstance() { if (!self::$_instance) { self::$_instance = new self(); } return self::$_instance; }
public static function getInstance() { try { if (defined('BENCHMARK_TIMER') && BENCHMARK_TIMER == 'on') { self::startTimer(); } if (!self::$_instance) { self::$_instance = new self(); self::$_modelAndFlow = ModelAndFlow::getInstance(); } if (!self::$_session) { self::$_session = Session::getInstance(); } } catch (Exception $ex) { if (self::$_logger) { self::$_logger->error('Can not get a instance of the dispatcher', $ex); } // also throw it to the container throw new Exception($ex->getMessage()); } return self::$_instance; }