コード例 #1
0
 public function testResolver()
 {
     $_SERVER['REQUEST_METHOD'] = 'GET';
     $route = $this->routeResolver->process('/expressly/api/a2ea0a7e-eabd-4caf-a598-6b80887fc222/migrate');
     $this->assertInstanceOf('Expressly\\Entity\\Route', $route);
     $this->assertEquals($route->getName(), CampaignMigration::getName());
 }
コード例 #2
0
ファイル: controller.php プロジェクト: expressly/virtuemart
 /**
  * Default task
  */
 public function display($cachable = false, $urlparams = false)
 {
     // Get route
     $route = $this->app['route.resolver']->process($this->input->get('__xly', '', 'string'));
     if ($route instanceof \Expressly\Entity\Route) {
         switch ($route->getName()) {
             case Ping::getName():
                 $this->ping();
                 break;
             case UserData::getName():
                 $data = $route->getData();
                 $this->retrieveUserByEmail($data['email']);
                 break;
             case CampaignPopup::getName():
                 $data = $route->getData();
                 $this->migratestart($data['uuid']);
                 break;
             case CampaignMigration::getName():
                 $data = $route->getData();
                 $this->migratecomplete($data['uuid']);
                 break;
             case BatchCustomer::getName():
                 $this->batchCustomer();
                 break;
             case BatchInvoice::getName():
                 $this->batchInvoice();
                 break;
         }
     }
 }
コード例 #3
0
ファイル: Router.php プロジェクト: etwandro/magento2
 public function match(RequestInterface $request)
 {
     if ($request->getModuleName() == null && method_exists($request, 'getPathInfo')) {
         $route = $this->application['route.resolver']->process($request->getPathInfo());
         if ($route instanceof Route) {
             switch ($route->getName()) {
                 case Ping::getName():
                     return $this->dispatch($request, 'ping');
                     break;
                 case Registered::getName():
                     return $this->dispatch($request, 'registered');
                     break;
                 case UserData::getName():
                     $data = $route->getData();
                     return $this->dispatch($request, 'user', 'index', $data);
                     break;
                 case CampaignPopup::getName():
                     $data = $route->getData();
                     return $this->dispatch($request, 'migration', 'popup', $data);
                     break;
                 case CampaignMigration::getName():
                     $data = $route->getData();
                     return $this->dispatch($request, 'migration', 'migrate', $data);
                     break;
                 case BatchCustomer::getName():
                     return $this->dispatch($request, 'batch', 'customer');
                     break;
                 case BatchInvoice::getName():
                     return $this->dispatch($request, 'batch', 'invoice');
                     break;
             }
         }
         if (http_response_code() === 401) {
             return $this->dispatch($request, 'unauthorized');
         }
     }
     //        return $this->actionFactory->create(Forward::class, ['request' => $request]);
 }