system_authorized_init example

if ($response instanceof Response) {
          $form_state->setResponse($response);
        }
      }
      // Otherwise, go through the regular workflow to prompt for FTP/SSH       // credentials and invoke update_authorize_run_update() indirectly with       // whatever FileTransfer object authorize.php creates for us.       else {
        // The page title must be passed here to ensure it is initially used         // when authorize.php loads for the first time with the FTP/SSH         // credentials form.         system_authorized_init('update_authorize_run_update', __DIR__ . '/../../update.authorize.inc', [$updates]$this->t('Update manager'));
        $form_state->setRedirectUrl(system_authorized_get_url());
      }
    }
  }

}
$form_state->setResponse($response);
      }
    }

    // Otherwise, go through the regular workflow to prompt for FTP/SSH     // credentials and invoke update_authorize_run_install() indirectly with     // whatever FileTransfer object authorize.php creates for us.     else {
      // The page title must be passed here to ensure it is initially used when       // authorize.php loads for the first time with the FTP/SSH credentials       // form.       system_authorized_init('update_authorize_run_install', __DIR__ . '/../../update.authorize.inc', $arguments$this->t('Update manager'));
      $form_state->setRedirectUrl(system_authorized_get_url());
    }
  }

}
$elements['#cache']['tags'][] = 'pre_render';
    return $elements;
  }

  /** * Initialize authorize.php during testing. * * @see system_authorized_init() */
  public function authorizeInit($page_title) {
    $authorize_url = Url::fromUri('base:core/authorize.php', ['absolute' => TRUE])->toString();
    system_authorized_init('system_test_authorize_run', __DIR__ . '/../../system_test.module', []$page_title);
    return new RedirectResponse($authorize_url);
  }

  /** * Sets a header. */
  public function setHeader(Request $request) {
    $query = $request->query->all();
    $response = new CacheableResponse();
    $response->headers->set($query['name']$query['value']);
    $response->getCacheableMetadata()->addCacheContexts(['url.query_args:name', 'url.query_args:value']);
    
Home | Imprint | This part of the site doesn't use cookies.