PHP code example of mougrim / php-xdebug-proxy

1. Go to this page and download the library: Download mougrim/php-xdebug-proxy library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mougrim / php-xdebug-proxy example snippets


    
    return [
        'xdebugServer' => [
            // xdebug proxy server host:port
            'listen' => '127.0.0.1:9002',
        ],
        'ideServer' => [
            // if proxy can't find ide, then it uses default ide,
            // pass empty string if you want to disable default ide
            // defaultIde is useful when there is only one user for proxy
            'defaultIde' => '127.0.0.1:9000',
            // predefined ide list in format 'idekey' => 'host:port',
            // pass empty array if you don't need predefined ide list
            // predefinedIdeList is useful when proxy's users aren't changed often,
            // so they don't need to register in proxy each proxy restart
            'predefinedIdeList' => [
                'idekey' => '127.0.0.1:9000',
            ],
        ],
        'ideRegistrationServer' => [
            // host:port for register ide in proxy
            // pass empty string if you want to disable ide registration
            'listen' => '127.0.0.1:9001',
        ],
    ];
    

...
    'softMocks' => [
        // if empty string, then vendor/badoo/soft-mocks/src/init_with_composer.php is used
        'initScript' => '/your/custom/init-script.php',
    ],
...
bash
composer.phar create-project mougrim/php-xdebug-proxy
text
Using config path /path/to/php-xdebug-proxy/config
[2019-02-14 10:46:24] xdebug-proxy.NOTICE: Use default ide: 127.0.0.1:9000 array ( ) array ( )
[2019-02-14 10:46:24] xdebug-proxy.NOTICE: Use predefined ides array (   'predefinedIdeList' =>    array (     'idekey' => '127.0.0.1:9000',   ), ) array ( )
[2019-02-14 10:46:24] xdebug-proxy.NOTICE: [Proxy][IdeRegistration] Listening for new connections on '127.0.0.1:9001'... array ( ) array ( )
[2019-02-14 10:46:24] xdebug-proxy.NOTICE: [Proxy][Xdebug] Listening for new connections on '127.0.0.1:9002'... array ( ) array ( )
bash
bin/xdebug-proxy --configs=/path/to/php-xdebug-proxy/softMocksConfig