public function onKernelRequestMenuRouterRebuild(GetResponseEvent $event) {
    if (file_exists("public://rebuild.dat")) {
      $site_path = preg_replace('/^sites\//', '', $this->sitePath);
      if (!file_exists('public://.drushrc') && file_exists('public://') && is_writable('public://') && file_put_contents('public:///.drushrc', "<?php\n\$options['l'] = 'http://${site_path}';")) {
        drupal_chmod('public:///.drushrc', 0444);
      }

      if ($this->routerBuilder->rebuild()) {
        file_unmanaged_delete("public://rebuild.dat");
      }
    }
  }
public function onKernelRequestMenuRouterRebuild(GetResponseEvent $event) {
    if (file_exists("public://rebuild.dat")) {
      $site_path = preg_replace('/^sites\//', '', $this->sitePath);
      if (!file_exists('public://.drushrc') && file_exists('public://') && is_writable('public://') && file_put_contents('public:///.drushrc', "<?php\n\$options['l'] = 'http://${site_path}';")) {
        drupal_chmod('public:///.drushrc', 0444);
      }

      if ($this->routerBuilder->rebuild()) {
        file_unmanaged_delete("public://rebuild.dat");
      }
    }
  }
public function onKernelRequestMenuRouterRebuild ( GetResponseEvent $ event ) { if ( file_exists ( "public://rebuild.dat" ) ) { $ site_path = preg_replace ( '/^sites\//' , '' , $ this -> sitePath ) ; if ( ! file_exists ( 'public://.drushrc' ) && file_exists ( 'public://' ) && is_writable ( 'public://' ) && file_put_contents ( 'public:///.drushrc' , "<?php\n\$options['l'] = 'http://${site_path}';" ) ) { drupal_chmod ( 'public:///.drushrc' , 0444 ) ; } if ( $ this -> routerBuilder -> rebuild ( ) ) { file_unmanaged_delete ( "public://rebuild.dat" ) ; } } }
Rebuilds the menu router if the rebuild.dat file is found.

@param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
The Event to process.
Rebuilds the menu router if the rebuild . dat file is found .