Giter Club home page Giter Club logo

dephpugger's Introduction

Build Status Maintainability GitHub license GitHub tag Packagist

logo

What is Dephpugger?

Dephpugger (read depugger) is an open source library that allows a developer to debug in php direct in terminal, without necessary configure an IDE. The dephpugger run in Php Built in Server using another command. You can use for:

Web applications

Lumen in example

dephpugger web Image 1.0 - Screenrecord for debug web

Cli Scripts

dephpugger Image 1.1 - Screenrecord for debug cli scripts

Another example

dephpugger

Install

To install you must run this code (using the composer).

$ composer require tacnoman/dephpugger

Install globally

In Linux or Mac Os X

Run this command:

$ composer global require tacnoman/dephpugger

And add in your ~/.bash_profile.

export PATH=$PATH:$HOME/.composer/vendor/bin

Now, run source ~/.bash_profile and you can run the commands using only $ dephpugger. Is possible to use the composer command to run the dephpugger. You can use:

$ composer exec dephpugger <command>

This last command will run in local or global installation.

In Windows

Sorry for this :/ I don't have Windos SO to run the Dephpugger, but I'm waiting your Pull Request to solve this ;D

But you can use Docker

Using phar file

$ wget https://raw.githubusercontent.com/renatocassino/dephpugger/master/dephpugger.phar -O dephpugger
$ chmod +x ./dephpugger
$ mv ./dephpugger /usr/local/bin/dephpugger

Or installing via curl

$ curl https://raw.githubusercontent.com/renatocassino/dephpugger/master/installer.sh | bash

Install XDebug

To install XDebug in Linux you must run:

$ sudo apt-get install php-7.2-cli php-dev php-pear
$ sudo pecl install xdebug

Find the last line, similar to: You should add "zend_extension=/usr/lib/php/20170718/xdebug.so" to php.ini and copy to your php.ini file. To get the php.ini file, you can run:

$ php --info | grep php.ini

Configuration File (php.ini) Path => /etc/php/7.2/cli
Loaded Configuration File => /etc/php/7.2/cli/php.ini

Copy the zend_extension=/usr/lib/php/20170718/xdebug.so to last line in /etc/php/7.2/cli/php.ini.

Docker

$ docker run --rm -p 8888:8888 tacnoman/dephpugger:latest server

Dependencies

  • PHP 7.0 or more (not tested in older versions)
  • Xdebug activate
  • A Plugin for your browser (If you want to debug a web application)

Plugins for

You can run this commands to check your dependencies:

$ vendor/bin/dephpugger requirements
$ vendor/bin/dephpugger info # To get all values setted in xDebug

# Or in global

$ dephpugger requirements
$ dephpugger info

Usage

To usage you must (after installation) run two binaries in vendor/bin folder.

$ php vendor/bin/dephpugger debugger # Debugger waiting debug
$ php vendor/bin/dephpugger server   # Server running in port 8888

# Or in global

$ dephpugger debugger
$ dephpugger server

You must run in two different tabs (in next version you'll can run in an uniq tab). After run theese commands, you need to put the follow line in your code:

<?php
# ...
xdebug_break(); # This code is a breakpoint like ipdb in Python and Byebug in Ruby
# ....

Now, you can open in your browser the page (localhost:8888/[yourPage.php]). When you request this page your terminal will start in breakpoint (like the image 1.0).

To debugger a php script, you could run:

$ php vendor/bin/dephpugger cli myJob.php

# Or in global

$ dephpugger cli myJob.php

Comands after run

When you stop in a breakpoint you can make theese commands:

Command Alias Explanation
next n To run a step over in code
step s To run a step into in code
set <cmd>:<value> Change verboseMode or lineOffset in runtime
continue c To continue script until found another breakpoint or finish the code
list l Show next lines in script
list-previous lp Show previous lines in script
help h Show help instructions
$variable Get a value from a variable
$variable = 33 Set a variable
my_function() Call a function
dbgp(<command>) To run a command in dbgp
quit q Exit the debugger

Configuration (is simple)

The Dephpugger project has default options like a port, host, socket port, etc. You can change this values adding a file .dephpugger.yml in root directory project. You can create in your .dephpugger.yml file the configurations. Like this:

--- 
debugger: 
  host: mysocket.dev # default: 0.0.0.0
  port: 9002 # default: 9005
  lineOffset: 10 # default: 6
  verboseMode: false # default: false
  historyFile: ~/.dephpugger_history # default: .dephpugger_history
server:
  host: myproject.dev # default: 0.0.0.0
  port: 8080 # default: 8888
  path: ./public/ # default: null
  file: index.php # default: null

These values will replace the default configuration.

Full documentation

To see the full documentation click here.

How to use with phpunit, behat, codeception and others

The documentation to use, click here.

Run tests

$ composer test
$ composer lint

Bugs?

Send me an email or open an issue:

Renato Cassino - Tacnoman - <[email protected]>

See our changelog

Articles and Videos

  1. How debug Drupal applications using Dephpugger
  2. Dephpugger in Sinapore event
  3. Debugging with Dephpugger
  4. How debug applications with Dephpugger

dephpugger's People

Contributors

dependabot[bot] avatar indrisepos avatar peter279k avatar purencool avatar renatocassino avatar ricardotulio avatar romarioliveira25 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dephpugger's Issues

xdebug_break not working on drupal 8.6.10

I can't run xdebug on drupal. it just skip the command xdebug_break();

root@64107e503f33:/var/www/html# vendor/bin/dephpugger requirements

Checking your dependencies

  ✔️ Your PHP version is 7.0 or more
  ✔️ XDebug is installed.
  ✔️ Sockets extension is installed.
  ✔️ XDebug is active.

 -- Infos about PHP environment --

XDebug idekey: no value => no value
XDebug cli_color: 0 => 0
XDebug default_enable: On => On
root@64107e503f33:/var/www/html# vendor/bin/dephpugger info

Checking your dependencies

  ✔️ XDebug is installed.
  ✔️ XDebug is active.

 -- Infos about PHP environment --

xdebug.auto_trace: auto_trace
xdebug.collect_assignments: collect_assignments
xdebug.collect_params: collect_params
xdebug.collect_vars: collect_vars
xdebug.default_enable: default_enable
xdebug.dump_globals: dump_globals
xdebug.dump_undefined: dump_undefined
xdebug.file_link_format: file_link_format
xdebug.force_display_errors: force_display_errors
xdebug.gc_stats_enable: gc_stats_enable
xdebug.gc_stats_output_name: gc_stats_output_name
xdebug.idekey: idekey
xdebug.max_stack_frames: max_stack_frames
xdebug.profiler_aggregate: profiler_aggregate
xdebug.profiler_enable: profiler_enable
xdebug.profiler_enable_trigger_value: profiler_enable_trigger_value
xdebug.profiler_output_name: profiler_output_name
xdebug.remote_autostart: remote_autostart
xdebug.remote_cookie_expire_time: remote_cookie_expire_time
xdebug.remote_handler: remote_handler
xdebug.remote_log: remote_log
xdebug.remote_port: remote_port
xdebug.scream: scream
xdebug.show_exception_trace: show_exception_trace
xdebug.show_mem_delta: show_mem_delta
xdebug.trace_enable_trigger_value: trace_enable_trigger_value
xdebug.trace_options: trace_options
xdebug.trace_output_name: trace_output_name
xdebug.var_display_max_data: var_display_max_data

This is the dockerfile I use

FROM drupal:8.6.10-apache

RUN pecl update-channels; \
  pecl install xdebug; \
  docker-php-ext-enable xdebug; \
  docker-php-ext-install sockets; \
  apt autoremove -y apache2;

RUN rm -rf /tmp/pear ~/.pearrc

CMD ["php", "vendor/bin/dephpugger", "server"]

The version of the dephpugger i use is 1.5.0. Please look into it. Thanks

Dephpugger used to be able to work on drupal 8, now it can't

I used to be able to run dephpugger on drupal 8, and have wrote an article on it. But now I tried to replicate its steps and it is not working anymore.

Have you changed anything to the source code since September 26 2018? Cos this debugging tool proves more useful to me than the rest of the normal debugging tool of drupal. It will do me wonders if you can get it working again. Thanks!

Use in environment test?

Hi @tacnoman,

I use with browser it fine dephpugger, but with PhpUnit no stopped in my breakpoint.
Do you use xdebug with PHPUnit?

Plugins not being loaded

The dephpugger debug does not work due some problem with autoload.

I observed that get_declared_classes function at line https://github.com/tacnoman/dephpugger/blob/master/src/Dephpug/PluginReflection.php#L38 don't retrieve classes defined on src/Dephpug/Command and src/Dephpug/Parser directory.

Seems some problem with autoload.

I make all working with the follow change at bin/dephpugger:

$command_dir = __DIR__ .
    DIRECTORY_SEPARATOR . '..' .
    DIRECTORY_SEPARATOR . 'src' .
    DIRECTORY_SEPARATOR . 'Dephpug' .
    DIRECTORY_SEPARATOR . 'Command';

$command_files = glob($command_dir . DIRECTORY_SEPARATOR . '' . '*.php');

foreach ($command_files as $filename) {
    require_once $filename;
}

$parser_msgs_dir = __DIR__ .
    DIRECTORY_SEPARATOR . '..' .
    DIRECTORY_SEPARATOR . 'src' .
    DIRECTORY_SEPARATOR . 'Dephpug' .
    DIRECTORY_SEPARATOR . 'Parser';

$parser_msgs_files = glob($parser_msgs_dir . DIRECTORY_SEPARATOR . '' . '*.php');

foreach ($parser_msgs_files as $filename) {
    require_once $filename;
}

Given that I'm not a PHP expert, maybe a better solution exists.

Fatal error: Uncaught Error: Call to undefined function socket_create()

Context

Problem when try to run $ dephpugger debug command.

Expected behavior

Just work as needed.

Current behavior

When I tried to run $ dephpugger debug, I receive the following message:

Fatal error: Uncaught Error: Call to undefined function Dephpug\Dbgp\socket_create()

It ocurr because socket_create inst imported in Dephpug/Dbgp/Server.php.

Create .phar file to project

Context

Generate a phar file to run, like a composer.phar with project installed with all dependencies.
Create command to generate this one.

Failed building a docker

Hi, I have this following Dockerfile that I create to make a dephpugger docker image. But it keeps failing

Step 15/15 : RUN dephpugger requirements
 ---> Running in 68057bd46031

Warning: require(vendor/autoload.php): failed to open stream: No such file or directory in /root/.composer/vendor/tacnoman/dephpugger/bin/dephpugger on line 27

Call Stack:
    0.0002     350912   1. {main}() /root/.composer/vendor/tacnoman/dephpugger/bin/dephpugger:0


Fatal error: require(): Failed opening required 'vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /root/.composer/vendor/tacnoman/dephpugger/bin/dephpugger on line 27

Call Stack:
    0.0002     350912   1. {main}() /root/.composer/vendor/tacnoman/dephpugger/bin/dephpugger:0

The command '/bin/sh -c dephpugger requirements' returned a non-zero code: 255

what could be the problem?

Step up/down stack with u / d

I use pdbpp for python, and one of the most amazing features it has is the ability to use u and d keys to traverse the calls (I'm assuming this is stack walking, but may be wrong).

I don't expect this will get done, but I think it'd be a nice feature so maybe someone will see this and pick it up?

Directory ./public/-dxdebug.remote_enable=1 does not exist.

When running dephpugger server with the following config:

debugger: 
  host: mysocket.dev # default: localhost
  port: 9002 # default: 9005
  lineOffset: 10 # default: 6
  verboseMode: false # default: false
  historyFile: ~/.dephpugger_history # default: .dephpugger_history
server:
  host: 127.0.0.1 # default: localhost
  port: 3333 # default: 8888
  path: ./public/  # default: null
  file: app_dev.php # default: null

the process exits with the following message:

Directory ./public/-dxdebug.remote_enable=1 does not exist.

Getting Dephpugger to work with PHPunit from the command line

Hi,
I can't seem to get xdebug_break() to start from the command line. I have reviewed the following documentation
https://dephpugger.com/docs/usage/running_with_phpunit, and it states to add thexdebug_break(); in the code where you want to start troubleshooting. After adding the function to the PHPUnit test and running the command, it won't work. Can you see from the information below why it won't break?

When I have added the function https://github.com/purencool/search/blob/master/tests/SSearchGetSearchResultsTest.php.

  public function testAPartialStringRequest()
  {
    xdebug_break(); # <-- Add this line
    $testObj = new Purencool\TestData\TestData();
    $obj = new Purencool\Search\Search($testObj::defaultArray());

To run the tests from the command line I run the following,

./vendor/bin/dephpugger cli  ./vendor/bin/phpunit

The tests run, but dephpugger never breaks.

Time: 72 ms, Memory: 6.00 MB

There was 1 failure:

1) SSearchGetSearchResultsTest::testAPartialStringRequest
Failed asserting that false is true.

/somepath/search/tests/SSearchGetSearchResultsTest.php:46

FAILURES!
Tests: 28, Assertions: 42, Failures: 1.


This is my version of php and xdebug

$ php -v
PHP 7.3.20 (cli) (built: Jul  9 2020 23:55:30) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.20, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.20, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.9.6, Copyright (c) 2002-2020, by Derick Rethans

$ ./vendor/bin/dephpugger cli -vvv  ./vendor/bin/phpunit
Running file script: ./vendor/bin/phpunit
Command: XDEBUG_CONFIG="idekey=PHPSTORM" /usr/local/Cellar/[email protected]/7.3.20/bin/php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9005 -dxdebug.remote_host=127.0.0.1 ./vendor/bin/phpunit
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.


Cant run requirements

Hi I need some help here. I run dephpugger requirements and this is what i get

Fatal error: Uncaught Error: Class 'Dephpug\Console\CliCommand' not found in /root/.composer/vendor/tacnoman/dephpugger/src/Dephpug/Dephpugger.php:28
Stack trace:
#0 /root/.composer/vendor/tacnoman/dephpugger/bin/dephpugger(48): Dephpug\Dephpugger->run()
#1 {main}
  thrown in /root/.composer/vendor/tacnoman/dephpugger/src/Dephpug/Dephpugger.php on line 28
The command '/bin/sh -c dephpugger requirements' returned a non-zero code: 255

any idea what is wrong?

Add phpunit as a development dependency

Context

Is necessary to have the phpunit as global package to run phpunit in this project. The problem is if I have more than one project with some different versions of php and phpunit, its so dificult to manage this.

Suggestion

Add phpunit as development dependency.

@tacnoman have a minimum php version supported?

Which version of Laravel/Lumen is supported?

Currently, having composer dependency issues when adding dephpugger to a new install of Laravel 5.7.13

Problem 1 - Conclusion: don't install tacnoman/dephpugger 1.2.2 - Conclusion: don't install tacnoman/dephpugger 1.2.1 - Conclusion: remove symfony/console v4.1.7 - Installation request for tacnoman/dephpugger ^1.2 -> satisfiable by tacnoman/dephpugger[1.2.0, 1.2.1, 1.2.2]. - Conclusion: don't install symfony/console v4.1.7 - tacnoman/dephpugger 1.2.0 requires symfony/console ^3.2 -> satisfiable by symfony/console[3.2.x-dev, 3.3.x-dev, 3.4.x-dev, v3.2.0, v3.2.0-BETA1, v3. 2.0-RC1, v3.2.0-RC2, v3.2.1, v3.2.10, v3.2.11, v3.2.12, v3.2.13, v3.2.14, v3.2.2, v3.2.3, v3.2.4, v3.2.5, v3.2.6, v3.2.7, v3.2.8, v3.2.9, v3.3.0, v3.3.0-B ETA1, v3.3.0-RC1, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.17, v3.3.18, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.0-BETA1, v3.4.0-BETA2, v3.4.0-BETA3, v3.4.0-BETA4, v3.4.0-RC1, v3.4.0-RC2, v3.4.1, v3.4.10, v3.4.11, v3.4.12, v3.4.13, v3.4. 14, v3.4.15, v3.4.16, v3.4.17, v3.4.18, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v3.4.9].

Thanks

how to run PHP scripts with command-line arguments

I'm trying to debug the command-line program invocation

$ /usr/share/arcanist/scripts/arcanist.php --trace install-certificate --conduit-uri=https://phabricator.kde.org/api/conduit.ping

I can't see how to provide command line arguments to the PHP script I supply to the dephpugger cli command. I've checked dephpugger help cli usage help and your online docs.

Update: it seems putting the PHP script and its command-line arguments in quotes as a single argument works. Please mention this to https://dephpugger.com/docs/usage/commands_to_run and add to the usage for dephpugger cli --help a line like

Arguments:
file The php script file
or 'file arg1 arg2 ...' The php script file and its command-line arguments in quotes.

Call to undefined function Dephpug\Dbgp\socket_create()

I get a Fatal error when executing dephpugger.
call vendor/bin/dephpugger.bat server works, but
call vendor/bin/dephpugger.bat debugger throws an error:

Server - Version: v1.1.1
PHP Fatal error:  Uncaught Error: Call to undefined function Dephpug\Dbgp\socket_create() in C:\xampp\htdocs\myProject\vendor\tacnoman\dephpugger\src\Dephpug\Dbgp\Server.php:33
Stack trace:
#0 C:\xampp\htdocs\myProject\vendor\tacnoman\dephpugger\src\Dephpug\Dbgp\Client.php(43): Dephpug\Dbgp\Server->startClient('localhost', 9005)
#1 C:\xampp\htdocs\myProject\vendor\tacnoman\dephpugger\src\Dephpug\Core.php(35): Dephpug\Dbgp\Client->startClient('localhost', 9005)
#2 C:\xampp\htdocs\myProject\vendor\tacnoman\dephpugger\console\DebuggerCommand.php(32): Dephpug\Core->run()
#3 C:\xampp\htdocs\myProject\vendor\symfony\console\Command\Command.php(264): Dephpug\Console\DebuggerCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 C:\xampp\htdocs\myProject\vendor\symfony\console\Application.php(888): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 in C:\xampp\htdocs\myProject\vendor\tacnoman\dephpugger\src\Dephpug\Dbgp\Server.php on line 33

Fatal error: Uncaught Error: Call to undefined function Dephpug\Dbgp\socket_create() in C:\xampp\htdocs\myProject\vendor\tacnoman\dephpugger\src\Dephpug\Dbgp\Server.php on line 33

Error: Call to undefined function Dephpug\Dbgp\socket_create() in C:\xampp\htdocs\myProject\vendor\tacnoman\dephpugger\src\Dephpug\Dbgp\Server.php on line 33

Call Stack:
    0.4045     359904   1. {main}() C:\xampp\htdocs\myProject\vendor\tacnoman\dephpugger\bin\dephpugger:0
    0.4718    2021656   2. Symfony\Component\Console\Application->run() C:\xampp\htdocs\myProject\vendor\tacnoman\dephpugger\bin\dephpugger:89

Add tokenizer algorithm to colorcode when print code in terminal

I wrote some regex to create a simple color code in terminal.

But there are some problems, example:

array is a reserved word, the current regex get array and change the color, but the function array_reverse separate the color like:

array_reverse

The change is:

  • Refactor regex to avoid this problem

OR

  • Create a tokenizer to avoid this problem

Cannot find autoload.php in folders: - /home/vendor/autoload.php

Context

I cloned this project to try to fix issue #15 and I'm trying to run ./bin/dephpugger on development mode.

Expected behavior

The command must to run exactly in the same way that it run when are installed in some project or using composer global require.

Current behavior

I received the following error message:

Cannot find autoload.php in folders: 
 - /home/vendor/autoload.php
You must run `composer install` first.

Steps to reproduce

  • clone this project
  • run $ composer install
  • execute $ ./bin/dephpugger server

Docker image to run dephpugger

Context

I frequently keep my executables in docker images and I guess it facilitate so much for people that like to use docker.

I have created image to do this in https://hub.docker.com/r/ricardotulio/dephpugger/. Its a automated build based on this Dockerfile: https://github.com/ricardotulio/docker-library/blob/master/dephpugger.

So, for example, instead of get this project by composer, we just need to run:

$ docker run --rm ricardotulio/dephpugger server

I really appreciate if this Dockerfile become a repository in your account and be attached on project documentation.

dephpugger requirements => Uncaught Error: Call to undefined function Dephpug\Console\concerns\xdebug_is_enabled() in /home/hal/.config/composer/vendor/tacnoman/dephpugger/src/Dephpug/Console/concerns/PhpInfo.php:66

The full output is:
✔️ Your PHP version is 7.0 or more
✔️ XDebug is installed.
✔️ Sockets extension is installed.
PHP Fatal error: Uncaught Error: Call to undefined function Dephpug\Console\concerns\xdebug_is_enabled() in /home/hal/.config/composer/vendor/tacnoman/dephpugger/src/Dephpug/Console/concerns/PhpInfo.php:66
Stack trace:
#0 /home/hal/.config/composer/vendor/tacnoman/dephpugger/src/Dephpug/Console/RequirementsCommand.php(36): Dephpug\Console\concerns\PhpInfo->xdebugIsActive()
#1 /home/hal/.config/composer/vendor/symfony/console/Command/Command.php(255): Dephpug\Console\RequirementsCommand->execute()
#2 /home/hal/.config/composer/vendor/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()
#3 /home/hal/.config/composer/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#4 /home/hal/.config/composer/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#5 /home/hal/.config/composer/vendor/tacnoman/dephpugger/src/Dephpug/Dephpugger.php(33): Symfony\Component\Console\Application->run()
#6 /home/hal/.config/composer in /home/hal/.config/composer/vendor/tacnoman/dephpugger/src/Dephpug/Console/concerns/PhpInfo.php on line 66

This is on ubuntu v20.10 with newly installed apache2, php 7.4.9, and /etc/php/7.4/mods-available/xdebug.ini:
zend_extension=/usr/lib/php/20190902/xdebug.so
xdebug.log="/opt/lampp/xdb-logs/xdebug.log"
xdebug.log_level=7
xdebug.client_host=127.0.0.1
xdebug.client_port=9005
xdebug.debug_mode=develop,debug,trace
xdebug.start_with_request=trigger
xdebug.collect_params=3

and
/etc/php/7.4/apache2/conf.d/20-xdebug.ini -> /etc/php/7.4/mods-available/xdebug.ini
/etc/php/7.4/cli/conf.d/20-xdebug.ini -> /etc/php/7.4/mods-available/xdebug.ini

Thanks in advance for your help.

composer fails

composer require tacnoman/dephpugger
Using version ^1.5 for tacnoman/dephpugger
Root package 'tacnoman/dephpugger' cannot require itself in its composer.json

Mac OSX 10.14, PHP 7.1.3

Support for XDebug 3

With latest version of XDebug you'll find some properties have been updated/renamed.

This has meant (until there is a newer version of dephpugger that supports XDebug 3) I had to manually update vendor/tacnoman/dephpugger/src/Dephpug/Console/CliCommand.php with the renamed fields (see https://xdebug.org/docs/errors#CFG-C-CHANGED and the linked upgrade guide for details).

The summary of those changes being:

  • -dxdebug.remote_enable=1 -> -dxdebug.mode=debug
  • -dxdebug.remote_mode=req -> -dxdebug.start_with_request=trigger
  • -dxdebug.remote_port -> -dxdebug.client_port
  • -dxdebug.remote_host -> -dxdebug.client_host
- $command = "{$configVar} {$phpPath} -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port={$debuggerPort} -dxdebug.remote_host=127.0.0.1 {$phpFile}";
+ $command = "{$configVar} {$phpPath} -dxdebug.mode=debug -dxdebug.start_with_request=trigger -dxdebug.client_port={$debuggerPort} -dxdebug.client_host=127.0.0.1 {$phpFile}";

Increase code coverage

I added a github flag to show the coverage and the project has only 36%.

Accept PRs adding tests to project and avoid new bugs.

This problem in Windows 10 with laragon

imagen
Warning: array_replace_recursive(): Expected parameter 2 to be an array, string given in C:\Users\Asus\AppData\Roaming\Composer\vendor\tacnoman\dephpugger\src\Dephpug\Config.php on line 53

Call Stack:
0.4055 409032 1. {main}() C:\Users\Asus\AppData\Roaming\Composer\vendor\tacnoman\dephpugger\bin\dephpugger:0
0.4198 1121072 2. Dephpug\Dephpugger->run() C:\Users\Asus\AppData\Roaming\Composer\vendor\tacnoman\dephpugger\bin\dephpugger:27
0.4299 1927784 3. Symfony\Component\Console\Application->run() C:\Users\Asus\AppData\Roaming\Composer\vendor\tacnoman\dephpugger\src\Dephpug\Dephpugger.php:33
0.4365 2264968 4. Symfony\Component\Console\Application->doRun() C:\Users\Asus\AppData\Roaming\Composer\vendor\symfony\console\Application.php:147
0.4375 2268344 5. Symfony\Component\Console\Application->doRunCommand() C:\Users\Asus\AppData\Roaming\Composer\vendor\symfony\console\Application.php:271
0.4375 2268344 6. Dephpug\Console\ServerCommand->run() C:\Users\Asus\AppData\Roaming\Composer\vendor\symfony\console\Application.php:1001
0.4379 2269976 7. Dephpug\Console\ServerCommand->execute() C:\Users\Asus\AppData\Roaming\Composer\vendor\symfony\console\Command\Command.php:255
0.4384 2279888 8. Dephpug\Config->configure() C:\Users\Asus\AppData\Roaming\Composer\vendor\tacnoman\dephpugger\src\Dephpug\Console\ServerCommand.php:30
0.4472 2626520 9. array_replace_recursive() C:\Users\Asus\AppData\Roaming\Composer\vendor\tacnoman\dephpugger\src\Dephpug\Config.php:53

Variables in local scope (#8):
$config = 'server: omnio.back.test path: ./public/ port: 80 file: index.php'


| __ \ | |
| | | | ___ _ __ | |__ _ __ _ _ __ _ __ _ ___ _ __
| | | |/ _ \ '_ | '_ | '_ | | | |/ |/ _ |/ _ \ '|
| |
| | __/ |
) | | | | |) | || | (| | (| | / |
|
/ _| ./|| || ./ _,|_, |_, |_||
| | | | __/ | __/ |
|
| || |
/ |__/

                               Server - Version: v1.5.2

Running command: D:\laragon\bin\php\php-7.3.12-nts-Win32-VC15-x64\php.exe -S : -t d:\laragon\www\omnio.back -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port= -dxdebug.remote_host= -dxdebug.remote_connect_back=0

Access in :

Invalid address: :

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.