firephp / firephp-core

FirePHP server library for sending PHP variables to the browser.
http://www.firephp.org
222 stars 78 forks source link

fb() func isn't working #37

Closed Sogl closed 5 years ago

Sogl commented 8 years ago

Hi!

I'm trying to use firephp with composer. I added this library to my project, my composer.json:

{
    "name": "mezin.a/hashids",
    "require": {
        "hashids/hashids": "^1.0",
        "firephp/firephp-core": "^0.4.0"
    }
}

Next step is index.php:

<?php
    error_reporting(E_ALL ^ E_DEPRECATED);
    ini_set("display_errors", 1);

    require 'vendor/autoload.php';

    fb('111');
?>

Got an error:

Fatal error: Call to undefined function fb()

Works only with these lines:

$firephp = FirePHP::getInstance(true);
$firephp->fb('value', 'var', FirePHP::WARN);

How to get it working with fb() only?

Sogl commented 8 years ago

Also works with fb::send('test'), but I want shorter line.

cadorn commented 6 years ago

Seems like the autoloading does not expose the global fb() function. We can fix that as part of the composer related updates: https://github.com/firephp/firephp-core/issues/44

okneloper commented 5 years ago

@cadorn this has been resolved as far as I can see. Just need to tag a new release. Is there anything preventing you from doing this?

cadorn commented 5 years ago

Confirmed that function is available via a test: https://github.com/firephp/firephp-core/blob/eea75c30310fea699c6a78955445270475e266c9/tests/Features/12-FB.php#L13