context = $context; } public function match($pathinfo) { $allow = array(); $pathinfo = rawurldecode($pathinfo); $context = $this->context; $request = $this->request; if (0 === strpos($pathinfo, '/cmcic')) { if (0 === strpos($pathinfo, '/cmcic/payfail')) { // cmcic.payfail if (preg_match('#^/cmcic/payfail/(?P\\d+)$#s', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) { $allow = array_merge($allow, array('GET', 'HEAD')); goto not_cmcicpayfail; } return $this->mergeDefaults(array_replace($matches, array('_route' => 'cmcic.payfail')), array ( '_controller' => 'CmCIC\\Controller\\CmcicPayResponse::payfail',)); } not_cmcicpayfail: // cmcic.payfail.with.message if (preg_match('#^/cmcic/payfail/(?P\\d+)/(?P[^/]++)$#s', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) { $allow = array_merge($allow, array('GET', 'HEAD')); goto not_cmcicpayfailwithmessage; } return $this->mergeDefaults(array_replace($matches, array('_route' => 'cmcic.payfail.with.message')), array ( '_controller' => 'CmCIC\\Controller\\CmcicPayResponse::payfail',)); } not_cmcicpayfailwithmessage: } // cmcic.receive if ($pathinfo === '/cmcic/validation') { if ($this->context->getMethod() != 'POST') { $allow[] = 'POST'; goto not_cmcicreceive; } return array ( '_controller' => 'CmCIC\\Controller\\CmcicPayResponse::receiveResponse', '_route' => 'cmcic.receive',); } not_cmcicreceive: } if (0 === strpos($pathinfo, '/admin/module/cmcic')) { // cmcic.saveconfig if ($pathinfo === '/admin/module/cmcic/saveconfig') { if ($this->context->getMethod() != 'POST') { $allow[] = 'POST'; goto not_cmcicsaveconfig; } return array ( '_controller' => 'CmCIC\\Controller\\CmcicSaveConfig::save', '_route' => 'cmcic.saveconfig',); } not_cmcicsaveconfig: // cmcic.download.log if ($pathinfo === '/admin/module/cmcic/log') { return array ( '_controller' => 'CmCIC\\Controller\\CmcicSaveConfig::downloadLog', '_route' => 'cmcic.download.log',); } } throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException(); } }