示例#1
0
 /**
  * Given /^I bootstrap Drupal$/
  *
  * @see menu_execute_active_handler()
  */
 public function stepIBootstrapDrupal()
 {
     $online = _menu_site_is_offline() ? MENU_SITE_OFFLINE : MENU_SITE_ONLINE;
     $this->assertEquals($online, MENU_SITE_ONLINE);
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function defineState(Request $request)
 {
     $this->initialize();
     // Check if site is offline.
     $this->status = _menu_site_is_offline() ? MENU_SITE_OFFLINE : MENU_SITE_ONLINE;
     // Allow other modules to change the site status but not the path because that
     // would not change the global variable. hook_url_inbound_alter() can be used
     // to change the path. Code later will not use the $read_only_path variable.
     $read_only_path = $_GET['q'];
     $path = null;
     drupal_alter('menu_site_status', $this->status, $read_only_path);
     $this->state = self::STATE_STATUS_DEFINED;
     $this->pageResultCallback = $this->status;
     // Only continue if the site status is not set.
     if (!$this->isOnline()) {
         return;
     }
     if (!($this->routerItem = menu_get_item($path))) {
         $this->state = self::STATE_INNER_CONTENT;
         $this->pageResultCallback = MENU_NOT_FOUND;
         $this->status = MENU_NOT_FOUND;
         return;
     }
     if (!$this->routerItem['access']) {
         $this->state = self::STATE_INNER_CONTENT;
         $this->status = MENU_ACCESS_DENIED;
         $this->pageResultCallback = MENU_ACCESS_DENIED;
         return;
     }
     $this->status = MENU_FOUND;
 }