PHPackages                             jbt/console - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. jbt/console

ActiveLibrary[CLI &amp; Console](/categories/cli)

jbt/console
===========

php burnners console package

v0.1.1(8y ago)021MITPHP

Since Feb 22Pushed 8y ago1 watchersCompare

[ Source](https://github.com/JoueBien/phpBurnerConsole)[ Packagist](https://packagist.org/packages/jbt/console)[ RSS](/packages/jbt-console/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (3)Used By (0)

php Burner Console (jbt/console)
================================

[](#php-burner-console-jbtconsole)

A small console for php5/7 for logging and dumping into a browsers js console. This package has been designed to work with php Burner 5 however it can also be used as a standalone library for native PHP or your favourite php framework.

Note that this is beta software and is not considered 100% production ready. Previous versions of the console have been used in php Burner 4, however, all these systems have been decommissioned. This iteration of the console is still being tested in php Burner 5 (in active development) and has yet to be tested in Laravel 5\_6/5\_5/5\_4.

Installation
------------

[](#installation)

### php Burner 5

[](#php-burner-5)

1. Add the package to your package.json `composer require jbt/console:0.1.1`
2. In the www/index.php file add the following

```
use jbt\Console\Console as Console;

$app->use('console',Console::start());

```

### standard php

[](#standard-php)

1. Add the package to your package.json `composer require jbt/console:0.1.1`
2. include the composer autoloader by adding

```
require_once ( './../vendor/autoload.php'); //include composer libs

```

to the top of you page

3. then import the namespace using

```
use jbt\Console\Console as Console;

```

4. and finally, init the console Class

```
$console = Console::start());

```

inti options
------------

[](#inti-options)

### Development and Production Modes

[](#development-and-production-modes)

The development mode is turned on by default when you call

```
Console::start();

```

to visually specify the development mode is on it is recommended that you init the console using

```
Console::start('dev');

```

Alternatively, if you want to disable the console for production than you can init the console using

```
Console::start('live');

```

This returns an empty class with empty members and thus will not log anything into the js console

Use
---

[](#use)

### dumping vars to the js console

[](#dumping-vars-to-the-js-console)

You can dump variables (arrays and objects) into the js console so that they are rendered as JSON object in the js console. To do this you use the `->dump(varToDump)` member function.

```
//php burner 5
$console = $app->getLib('console'); // get console var
$TestVar = array();
$console->dump($TestVar); //add a var to dump
$console->show(); //echo to page - should be the last thing you call in your php

```

```
//native & other
$console = Console::start();
$TestVar = array();
$console->dump($TestVar);
$console->show(); //echo to page - should be the last thing you call in your php

```

### logging a string or number

[](#logging-a-string-or-number)

You can log strings or numbers to the js console by using the `->log(varToDump)` member function. Do not pass objects or arrays into the log funciton unless they have a toString meathod.

```
//php burner 5
$console = $app->getLib('console'); // get console var
$testStr = "testStr";
$testNum = "testNum";
//add a vars to log
$console->log($testStr);
$console->log($testNum);
$console->log("passing a string"."concat");
$console->log(10);
$console->show(); //echo to page - should be the last thing you call in your php

```

```
//native & other
$console = Console::start();
$testStr = "testStr";
$testNum = "testNum";
//add a vars to log
$console->log($testStr);
$console->log($testNum);
$console->log("passing a string"."concat");
$console->log(10);
$console->show(); //echo to page - should be the last thing you call in your php

```

### logging warnings

[](#logging-warnings)

Sometimes you might need to log warnings - this is particularly true if your writing db or file managment code using native php. The member function `->warning ("message as a string", "function name", "class name", "the php warning and stack trace string");`is used to log warnings to the browsers js console.

```
public function db_MYSQL ($console,$host,$username,$password,$dbname){
    try {
    $database = new PDO("mysql:host=$host;dbname=$dbname", $username, $password, array( PDO::ATTR_PERSISTENT => false));
    $database->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $this->db=$database;
    return true;
    }catch (PDOException $e){
      $console->warning(
         " MySQL databse could not conected to $dbname.",
            "db_MYSQL('$host','$username','$password','$dbname')",
            "DatabaseConection",
            $e
       );
       return false;
    }
  }

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3005d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/60804fa535526f4e1da4ecfd12b63c0b9e26ec1bdca5aea431a7c74c86c17253?d=identicon)[JoueBien](/maintainers/JoueBien)

---

Top Contributors

[![JoueBien](https://avatars.githubusercontent.com/u/7506155?v=4)](https://github.com/JoueBien "JoueBien (15 commits)")

### Embed Badge

![Health badge](/badges/jbt-console/health.svg)

```
[![Health](https://phpackages.com/badges/jbt-console/health.svg)](https://phpackages.com/packages/jbt-console)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
