Coder Social home page Coder Social logo

thangnm93 / yii2-decomposer Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 475 KB

Yii 2 Decomposer decomposes and lists all the installed packages and their dependencies along with the Yii 2 Framework & the Server environment details your app is running in. All these just on the hit of a single route at your-domain/decomposer

License: MIT License

PHP 84.90% CSS 1.73% JavaScript 13.38%
decomposer yii2-extension yii2-decomposer yii2

yii2-decomposer's Introduction

Decomposer Extension for Yii 2


For license information check the LICENSE-file.

Latest Stable Version Total Downloads License PRs

Introduction


Yii 2 Decomposer decomposes and lists all the installed packages and their dependencies along with the Yii 2 Framework & the Server environment details your app is running in. All these just on the hit of a single route at your-domain/decomposer.

The demo of this extension is available at HERE

This extension base on lubusIN/laravel-decomposer wrapper for Laravel user component.

Requirements


Installation


The preferred way to install this extension is through composer.

Either run

composer require thangnm93/yii2-decomposer

or add

"thangnm93/yii2-decomposer": "*"

to the require section of your composer.json file.

Usage


Once the extension is installed, simply modify your application configuration as follows:

return [
    'bootstrap' => ['decomposer'],
    'modules' => [
        'decomposer' => [
            'class' => 'thangnm93\decomposer\Module',
        ],
        // ...
    ],
    ...
];

Config common/config/main.php to use Yii::$app->decompose

return [
    'components' => [
        'decompose' => [
            'class' => 'thangnm93\decomposer\Decomposer',
        ],
    ],
    ...
];

Get Report as an Array

  • You might want to access the Decomposer Report in your code so that it could be passed to any third party services like Bugsnag, etc. or maybe you want to log it yourself somewhere if required.

  • The getReportArray() helper method has been introduced to solve the same requirement.

  • First use the Decomposer class at the top as follows:

    use thangnm93\decomposer\helpers\DecomposerHelper;
  • Then use the getReportArray() helper method as follows:

    $decomposerStats = DecomposerHelper::getReportArray();
  • It returns a multi-dimensional associative array with 4 keys: Server Environment, Yii 2 Environment & Installed Packages & Extra stats(If you or a package in your app have added any) having the respective details as an associative array.

Get Report as JSON

  • You might want to access the same Decomposer Report as JSON

  • The getReportJson() helper method has been introduced to solve the same requirement.

  • First use the Decomposer class at the top as follows:

    use thangnm93\decomposer\helpers\DecomposerHelper;
  • Then use the getReportJson() helper method as follows:

    $decomposerStats = DecomposerHelper::getReportJson();
  • It returns the report as JSON

Testing

$ ./vendor/bin/phpunit --testdox --coverage-text --coverage-clover=coverage.clover

Contributing


Thank you for considering contributing to the Yii 2 Decomposer. You can read the contribution guide lines here

Security


If you discover any security related issues, please email to [email protected].

Credits


yii2-decomposer's People

Contributors

thangnm93 avatar

Stargazers

 avatar  avatar  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.