コード例 #1
0
ファイル: Plugin.php プロジェクト: Kevin-ZK/vaneDisk
 /**
  * 'beforeMethod' event handles. This event handles intercepts GET requests ending
  * with ?mount
  *
  * @param RequestInterface $request
  * @param ResponseInterface $response
  * @return bool
  */
 function httpGet(RequestInterface $request, ResponseInterface $response)
 {
     $queryParams = $request->getQueryParameters();
     if (!array_key_exists('mount', $queryParams)) {
         return;
     }
     $currentUri = $request->getAbsoluteUrl();
     // Stripping off everything after the ?
     list($currentUri) = explode('?', $currentUri);
     $this->davMount($response, $currentUri);
     // Returning false to break the event chain
     return false;
 }