1<?php 2 3namespace Sabre\DAV; 4 5use 6 Sabre\HTTP\RequestInterface, 7 Sabre\HTTP\ResponseInterface; 8 9class TestPlugin extends ServerPlugin { 10 11 public $beforeMethod; 12 13 function getFeatures() { 14 15 return ['drinking']; 16 17 } 18 19 function getHTTPMethods($uri) { 20 21 return ['BEER','WINE']; 22 23 } 24 25 function initialize(Server $server) { 26 27 $server->on('beforeMethod', [$this,'beforeMethod']); 28 29 } 30 31 function beforeMethod(RequestInterface $request, ResponseInterface $response) { 32 33 $this->beforeMethod = $request->getMethod(); 34 return true; 35 36 } 37 38} 39