public function onBootstrap(MvcEvent $event) { $app = $event->getApplication(); $em = $app->getEventManager(); $sm = $app->getServiceManager(); \YcheukfDebug\Model\Debug::setEventManager($em); \YcheukfDebug\Model\Debug::setServiceManager($sm); if (PHP_SAPI === 'cli') { \YcheukfDebug\Model\Debug::dump($sm->get('console'), '[inline]---[request]---console start', array('datatag' => 'xmp'), 'w'); return; } // $aConfig = $this->getConfig(); $aConfig = $sm->get('config'); if (isset($aConfig['debugconfig']['ignore_request'])) { foreach ($aConfig['debugconfig']['ignore_request'] as $sRule) { if (is_string($_SERVER['REQUEST_URI']) && preg_match("/.*" . str_replace("/", "\\/", $sRule) . ".*/i", $_SERVER['REQUEST_URI'])) { return; } } } if (is_string($_SERVER['REQUEST_URI']) && preg_match("/.*" . str_replace("/", "\\/", $aConfig['router']['routes']['debug']['options']['route']) . ".*/i", $_SERVER['REQUEST_URI'])) { return true; } $this->setAttach($sm, $em); $em->trigger('YcheukfDebugSetProfiler', $this); if ($sm->get('request')->isXmlHttpRequest() == false) { \YcheukfDebug\Model\Debug::dump($_SERVER, '[inline]---[request http]---' . $sm->get('request')->getRequestUri(), array('datatag' => 'xmp'), 'w'); } else { \YcheukfDebug\Model\Debug::dump($_REQUEST, '[inline]---[request ajax]---' . $sm->get('request')->getRequestUri()); } }