I'm using vim with the Vdebug plugin and Xdebug to debug the WebDAV server of a nextcloud instance. Nextcloud uses SabreDAV, so the WebDAV server is a PHP script. The desktop file synchronization client (owncloud) which nextcloud uses keeps a local folder in sync with the nextcloud web storage.
I want to debug issues with quota calculation of the nextcloud server upon a WebDAV file upload (presumably PUT
) request. However, the owncloud client issues multiple WebDAV requests to the server if a local file changes, where the first request(s) is/are not of importance to me (presumably a PROPFIND
or similar). Only after this uninteresting request(s), an upload request is sent. However, if I set up vim to listen for an incoming connection by Xdebug (:VdebugStart
), the first uninteresting WebDAV request establishes the connection, but I would like to establish the connection for later incoming Xdebug connections. However, I am not fast enough to set vim into listen mode before the owncloud client calls the server again with the interesting WebDAV request.
There might be two ways of dealing with this:
- Make vim listen for a new Xdebug connection very fast after the first (uninteresting) one ends
- Make PHP not establish an Xdebug connection right from the start, but only when a certain code block, which corresponds to the interesting upload request by the client, is called. I could insert some PHP function
xdebug_connect_now_to_client()
function instead of Xdebug connecting to vim right from the start.
Do you know a possiblity to archieve one of those goals, or is there another solution?
Relevant php.ini
entries:
zend_extension=xdebug.so
xdebug.remote_enable=on
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
; have to set this, because owncloud does not set the
; XDEBUG_START_SESSION=true GET parameter
xdebug.remote_autostart=on
xdebug.idekey=netbeans-xdebug