Code Monkey home page Code Monkey logo

halt's Introduction

Halt plugin for CakePHP

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require malekim/halt

It is also required to have Debug Kit installed.

Then register the plugin in src/Application.php:

$this->addPlugin(\Halt\Plugin::class);
Configure::write('DebugKit.panels', ['Halt.Halt']);

Recommended way is to add those lines between debug condition and then DebugKit load should be similar to:

if (Configure::read('debug')) {
    $this->addPlugin(\Halt\Plugin::class);
    Configure::write('DebugKit.panels', ['Halt.Halt']);
    $this->addPlugin(\DebugKit\Plugin::class);
}

Usage

The plugin adds new panel to DebugKit Toolbar. You can see all your halts in that panel.

To halt simple use function:

halt($variable);

Inside halt you can see line number, file and content of halted variable.

For instance:

// inside PagesController.php
public function display(...$path) {
    halt($path);
    // rest of the code
}

And then halt shows:

Array
(
    [line] => 43
    [file] => /Users/malekim/Projects/halttest/src/Controller/PagesController.php
    [var] => Array
        (
            [0] => home
        )

)

Halt can be used to any type of variable and any sort of data.

It is important to note that halt() does not terminate script execution, so you can use any nuber of halt() during request. So it is helpful solution if you need to debug complicated things.

halt's People

Contributors

malekim avatar

Watchers

 avatar

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.