Giter Site home page Giter Site logo

barbushin / php-console Goto Github PK

View Code? Open in Web Editor NEW
1.3K 1.3K 282.0 261 KB

Handle PHP errors, dump variables, execute PHP code remotely in Google Chrome

Home Page: https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef

License: MIT License

PHP 100.00%

php-console's People

Contributors

0xflotus avatar barbushin avatar chi-teck avatar nhorvath avatar rubensainiuc avatar timschmittmann avatar tm1000 avatar unfulvio avatar xelan 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  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

php-console's Issues

PHP OOM errors when PHPConsole enabled

This is kind of complicated to replicate, and I even took a while to nail down for sure that PHPConsole was causing it it but I will try to explain as best I can.

Initially, PHPConsole will work fine, however after some use (maybe 30 mins of developing, so lots of page refreshes and page loads) the server will start returning 500 errors but most pages will actually load fine. The PHPConsole icon will disappear from the address bar. It must be that the errors occur during the flush handler for PHPConsole. PHP error log shows OOM errors but the strange thing is that the memory limit is set MUCH higher then the number in the error. Once the 500 errors start occurring they continue until cookies are cleared. Then they will go away for a similar period of time as the initial period and then reoccur.

Disabling PHPConsole eliminates this issue.

I've tried increasing the memory limit in php all the way up to absurd numbers but it doesn't help, the reported max in the OOM error message remains the same. PHP is reading the configs I set because ini_get('memory_limit') reflects the values I set it to.

(feature request) Parse XMLHttpResponses?

It would be awesome if php-console could recognize and parse XMLHttpResponses (similar to that of FirePHP).

Or did I missing something, and it already does this?

Illegal character encoding specified

E_WARNING  mb_convert_encoding(): Illegal character encoding specified - /vendor/php-console/php-console/src/PhpConsole/Connector.php:362 

My initialisation logic:

if (PHP_CONSOLE) {
    $phpConsoleConnector = \PhpConsole\Connector::getInstance();

    if ($phpConsoleConnector->isActiveClient()) {
        $phpConsoleConnector->setSourcesBasePath(ROOT_PATH);
        $phpConsoleConnector->setPassword('password');

        \PhpConsole\Helper::register();

        $handler = PhpConsole\Handler::getInstance();
        $handler->start(); // initialize handlers
    }
}

Wrong chars in eval terminal popup

â—� Press Ctrl+Enter to evaluate PHP code, and see result in JavaScript Console(Ctrl+Shift+J).
â—� Press Ctrl+Up or Ctrl+Down to navigate eval history.
â—� Don't forget t......

Forwarding all errors

Old version was forwarding all errors to phpconsole. In new version i can only achieve this behaviour by \PhpConsole\OldVersionAdapter::register();
Why it isn`t enabled by default?

PHP Console notification and tab opens every time I open a new incognito session

I can live with the PHP console notification, but having the documentation tab open each time is annoying.

Steps to repeat:

  • Start Chrome
  • Open a new incognito session window

Issue description:

crash on debugging some data

i've got crashes on sending some sequenced data to console.

crash:

while ($row = $tyreRS->fetch_assoc()) {
    if ($zz<=8) d($row, "row".$zz); 
    $zz++;
       ........
}

Not crashes:

while ($row = $tyreRS->fetch_assoc()) {
    if ($zz<=7) d($row, "row".$zz); 
    $zz++;
       ........
}

Not crashes:

while ($row = $tyreRS->fetch_assoc()) {
    if ($zz==8) d($row, "row".$zz); 
    $zz++;
       ........
}

so it's not about any object that i'm dumping - it's something about sequence of data sent to client side.

JS error in Chrome Extension: 
Uncaught SyntaxError: Unexpected token < chrome-extension://nfhmhhlpfleoednkpnnnkolmclajemef/background.html:1

object #8 in console look like:

Object {id: "149785", season: "Летние", seasonNameShortName: "leto", radius: "17", href: "/shini/maker/bridgestone/ecopia_ep200/225-55-R17-V97-tsize_074301"…}
count: "8"
height: "55"
href: "/shini/maker/bridgestone/ecopia_ep200/225-55-R17-V97-tsize_074301"
id: "149785"
imageURL: "imglib/_newimage/shini/maker/bridgestone/ecopia_ep200/bridgestone_ecopia_ep200.jpg"
loadIndex: "97"
manufacturerName: "Bridgestone"
price: "6751"
radius: "17"
radius_name: "R17"
season: "Летние"
seasonNameShortName: "leto"
shortDescription: ""
speedIndex: "V"
tSize: "225/55 R17"
tyreName: "Ecopia EP200"
width: "225"

connection code

// PHP Console debugger
require_once('php-console/src/PhpConsole/__autoload.php');

// Call debug from global PC class-helper (most short & easy way)
PhpConsole\Helper::register(); // required to register PC class in global namespace, must be called only once
$connector = PhpConsole\Connector::getInstance();
$connector->setPassword('*****', true);
//$connector->setSourcesBasePath('/Users/info/_sites/ik');
// USING: http://php-console.com/instance/examples/#debug_vars
//PC::debug('called from PC::debug()', 'db');
//PC::db($connector); // means "db" will be handled as debug tag

// Configure eval provider
$evalProvider = $connector->getEvalDispatcher()->getEvalProvider();
$evalProvider->addSharedVar('post', $_POST); // so "return $post" code will return $_POST
$evalProvider->setOpenBaseDirs(array(__DIR__)); // see http://php.net/open-basedir

$connector->startEvalRequestsListener(); // must be called in the end of all configurations



$handler = PhpConsole\Handler::getInstance();

    // You can override default Handler behavior:
    // $handler->setHandleErrors(false);  // disable errors handling
    // $handler->setHandleExceptions(false); // disable exceptions handling
    // $handler->setCallOldHandlers(false); // disable passing errors & exceptions to prviously defined handlers

$handler->start(); // initialize handlers


// use: d($var, "tag");
function d($var, $tags = null) {
    PhpConsole\Connector::getInstance()->getDebugDispatcher()->dispatchDebug($var, $tags, 1);
}

i have this issue not only in this code - it happens from quite often for me.
disappointed several times per day :))

This just not an ISSUE but just an START UP help request

Hi, I am trying to use php-console.
I installed the chrome plug-in and in my php project I just added the following lines.

Are good enough to see something in the chrome console?

thanks
ciao

require_once($_SERVER['DOCUMENT_ROOT'].'/myproject/php/php-console/src/PhpConsole/__autoload.php');
$handler = PhpConsole\Handler::getInstance();
$handler->start();
$handler->debug('called from handler debug', 'some.three.tags');

Unable to set error level (error_reporting())

Maybe I don't understand how it's supposed to be used. But I get E_STRICT warnings I don't want to get. And I don't see how to set the error level in php-console.

There is

error_reporting($this->errorsHandlerLevel ? : E_ALL | E_STRICT);

but no way to set PhpConsole\Handler::errorsHandlerLevel.

Support Opera Next

Opera Next 18.0.1284.7 supports setup PHP Console Chrome Extension v 3.0.17
whether to support the work it of this platform?

Ajax scripts debugging

Hi there,
Great tool, excellent improvements from v2!

I have a problem when trying to debug ajax scripts,

the file content.js from the google addon has the following code :
if(a._id==e||a._url==window.location.href)

Now ajax scripts are not from the same window.location.href obviously, and I don't see an _id paramater anywhere....

I have commented this part of the code in the content.js , and it actually sends messages to the plugin from ajax requests, but perhaps it is not a way to go..
Do you have any other option for this matter??

Running session_start() after initializing the class kills any output.

Example:

Working output:

if(!isset($_SESSION)) session_start();
error_reporting(E_ALL);
require_once(__DIR__ . '/vendors/PhpConsole/__autoload.php');
$connector = \PhpConsole\Connector::getInstance();
function d($var, $tags = null) {
    \PhpConsole\Connector::getInstance()->getDebugDispatcher()->dispatchDebug($var, $tags, 1);
}

d('message');

No output

error_reporting(E_ALL);
require_once(__DIR__ . '/vendors/PhpConsole/__autoload.php');
$connector = \PhpConsole\Connector::getInstance();
function d($var, $tags = null) {
    \PhpConsole\Connector::getInstance()->getDebugDispatcher()->dispatchDebug($var, $tags, 1);
}

if(!isset($_SESSION)) session_start();

d('message');

Sub-domains support

Add PhpConsole\Connector::setBaseDomain($domain) so authorization credentials and client/server cookies must be initialized to be available for all sub-domains.

Add "Order error after debug" option

Now in JS console errors are always displayed after debug entries. It's important because if long list of messages comes from server, so users see only end of this list, so if there was error in some of the first messages they will not see it until scroll top.

But the bad thing is that if error is ordered to the end, so users cannot understand between what debug messages it was happened.

Anyway this feature must be optional.

Use with WordPress MAMP Installation

I've installed both the Chrome extension and the archive into my project which is through MAMP with a WordPress install.

I've updated config.php line 6 to match my server but I'm not sure if MAMP has it's own unique SERVER_KEY.

Whenever I try to call the console, it causes my local project to crash (e.g. blank white screen). What am I doing wrong? I've made sure the path to the archive is properly set as I can view it using my localhost:8888 path url.

Any advice would be much appreciated.

Thank you very much for your time.

No popup messages for debug() function

Since the update to v3.0 I don't see the normal debug messages anymore. I also used the example pages and checked the settings. Javascript errors are displayed using console and notification popup.

The php console icon is also not visible in the address bar. If I check 'isActiveClient()' then it returns true, so there is some connection.

This is the console error (via background.html):

webRequestInternal.addEventListener: '://localhost:9021/' is not a valid URL pattern.
at G.addListener (chrome-extension://nfhmhhlpfleoednkpnnnkolmclajemef/background.js:18:183)
at y (chrome-extension://nfhmhhlpfleoednkpnnnkolmclajemef/background.js:8:176)

It has something to do with my XAMPP setup? (port 9021)

Phar package not working.

I can't getting the Phar package to work. Right off the bat, it gives invalid or missing when trying to require PhpConsole\Connector from the PhpConsole.phar. I tried to include it directly, and it failed:

    require_once('phar:///var/www/PhpConsole.phar');
    $connector = PhpConsole\Connector::getInstance();

( ! ) Warning: require_once(phar://PhpConsole\Connector.php): failed to open stream: phar error: invalid url or non-existent phar "phar://PhpConsole\Connector.php" in /var/www/PhpConsole.phar on line 5

    require_once('phar:///var/www/PhpConsole.phar/PhpConsole/Connector.php');
    $connector = PhpConsole\Connector::getInstance();

( ! ) Warning: require_once(phar:///var/www/PhpConsole.phar/PhpConsole/Connector.php): failed to open stream: phar error: "PhpConsole/Connector.php" is not a file in phar "/var/www/PhpConsole.phar" in /var/www/html/index.php on line 136

In addition: your example is incorrect. You're missing a slash for a full path. The protocol is 'phar://' so a fail in /path/to... is actually phar:///path/to...

Xdebug's var_dump VS. PhpConsole's Handler

Hello.
I'm using an xdebug extension, which overloads default var_dump() with xdebug's own func. Xdebug highlights variables. I`ve found that enabling PhpConsole's Handler disables xdebug's behaviour.

$var = array('Some', 'var');
var_dump($var);    // xdebug

$handler = PhpConsole\Handler::getInstance();
$handler->start(); // start handling PHP errors & exceptions
echo '<div>PhpConsole\Handler started</div>';

var_dump($var);    // native

Any idea what's wrong?

image

PHP: 5.4.15
xdebug: 2.2.3

Installation success but not working

Hello,
when I add PHPConsole to Chome, it is showing a Popup that it was installed successfully,
but there is no icon shown in the addressbar when I for example visit the demo page?

Any idea whats wrong?

I am using Chome 30.0.1599.66 OSX

No extension icon in address bar & no data in console. OS X

Testing on http://php-console.com/instance/examples/features/debug_vars.php
Extension is installed and working (notification popups about are error are randomly popping out). Debug headers are visible in the browser. However, extension icon does not appear in the address bar and the output does not appear in the console. Looks like headers could not reach the extension.

Tried on Chromium 33.0.1704.0 and Chrome 33.0.1750.117. Running on OS X 10.9.1.
Any experimental flags should be set in about:flags?

Could not install package

Chrome say:
An error has occurred
Could not install package: 'UTILITY_PROCESS_CRASHED_WHILE_TRYING_TO_INSTALL'

Version 30.0.1599.114
Ubuntu 12.04 LTS

CGI Mode

Why the library can't start in cgi mode? What i can do if i've a server in cgi mode active?

Can't we have the option of js debug?

Hi, It will be better if you add js debugging because sometime we work in mix code php and js and we have to open console every time to see js debug values, so it will be much better if we can see the js debug values also in the popups.

e.g.

<script> PC_Debug("showing debug value"); </script>

Cannot see messages

Hi there,
I updated to the latest version 3.0.14 with chrome browser v31.0.1650.63 , and nothing happens. I went to the example page, but nothing happens.
Tried to enable developer mode to see if there were any errors with the js and nothing.
Checked the content.js file and all I can see is that the onMessage listener never gets fired. I had it working previously, not sure if it´s the update that broke it, or if it´s the version of chrome browser.

Cross-domain API not logging into the console

I'm not sure if it's an issue or a miss-configuration from my side, but since my configuration is working when I try to call directly my API and nobody is answering on SO, I felt I should post here.

So here is the SO question

The thing is that I have a UI accessible on www.myserver.com and I'm using as backend an API which is on api.myserver.com. Doing some GET request by typing the URL of it in the browser's address bar shows the log from php-console in the chrome console. But if I go to www.myserver.com which is doing the same requests to api.myserver.com via jQuery $.ajax(), the Chrome console does not show anymore the log I was getting when going directly to the API from browser address bar.

Am I missing some configuration or is this an issue?

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.