GithubHelp home page GithubHelp logo

kendrick-k / symfony-debug-toolbar-git Goto Github PK

View Code? Open in Web Editor NEW
29.0 8.0 8.0 756 KB

Get the latest Git commit information into Symfony debug toolbar

License: MIT License

PHP 64.28% HTML 35.72%
symfony symfony-bundle git toolbar debug debugbar

symfony-debug-toolbar-git's Introduction

Symfony Debug Toolbar Git

SensioLabsInsight

Latest Stable Version Total Downloads Latest Unstable Version License

Monthly Downloads Daily Downloads

Travis CI Scrutinizer CI Scrutinizer CI Dependency Status

Symfony toolbar add-on

Get the latest git commit into Symfony debug toolbar

And visualize quickly the latest commit into your repository by clicking on the Commit ID.

SymfonyDebugToolbarGit

SymfonyDebugToolbarGit2.8

Information displayed :

  • Branch : active branch
  • Time since last commit : time since last commit at page generation
  1. less than one hour : minutes + seconds | colored in green, then in red :
  2. more than one hour : hour(s)
  3. more than 24h : count in days
  4. more than 1 month : count in months

Useful for local development but also for a continuous integration (CI) process on a development server.

If no git repository have been initiated, there will be no display into the toolbar.

Status information : mouse over

Information displayed :

  • Commit ID : links to the commit URL on your repository (Github, Bitbucket..), base url is to set into repository_commit_url parameter
  • Merge : merge IDs if there is
  • Author
  • Email : email with active link
  • Date : full date of latest commit
  • Commit message

Installation

Composer

composer require kendrick/symfony-debug-toolbar-git

Register into AppKernel

app/AppKernel.php :

if (in_array($this->getEnvironment(), array('dev', 'test'))) {
    [...]
    $bundles[] = new Kendrick\SymfonyDebugToolbarGit\SymfonyDebugToolbarGit();

Parameters

app/config/config_dev.yml :

symfony_debug_toolbar_git:
    repository_commit_url: ""

repository_commit_url, ex : https://bitbucket.org/team/project/commits/ or https://github.com/user/project/commit/

More tools

Google Analytics API v4 Symfony bundle : https://github.com/mediafigaro/google-analytics-api-symfony

symfony-debug-toolbar-git's People

Contributors

gastonnina avatar kendrick-k avatar mediafigaro avatar phiamo avatar rafaelgfirmino avatar stephanvierkant 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

symfony-debug-toolbar-git's Issues

Compatibility with Symfony 4.x

The symfony_debug_toolbar_git.data_collector.template with value "SymfonyDebugToolbarGit:Collector:git" is not found in symfony 4.x because it search over the main templates not over the vendors.

If I extend it to my templates folders works.

I don't know if there is a way to pass the correct route to this to handle the vendors once

Here is the error log

request.CRITICAL: Uncaught PHP Exception UnexpectedValueException: "The profiler template "SymfonyDebugToolbarGit:Collector:git.html.twig" for data collector "datacollector_git" does not exist." at /var/www/mydemo/vendor/symfony/web-profiler-bundle/Profiler/TemplateManager.php line 90 {"exception":"[object] (UnexpectedValueException(code: 0): The profiler template \"SymfonyDebugToolbarGit:Collector:git.html.twig\" for data collector \"datacollector_git\" does not exist. at /var/www/mydemo/vendor/symfony/web-profiler-bundle/Profiler/TemplateManager.php:90)"} []

Layout broken

In symfony2.3.30 layout is broken. Yep, its very old, but vendors list in application is huge and nightmare vendor upgrade are still in progress.

image

just wonder - is it only vendors issue?

Feature to see all directories versioned by git

Currently the toolbar only sees versioned directories in the root of application.
I like to discuss the viability of implement a feature to make the toolbar see all versioned packages. For example, some isolated bundles in other directories.
What do you think?

Refactoring

We need to apply some improvements in the code before you make the changes to get catch any git repository.
I will apply the extract methods.

example:
elseif (strpos($d, 'Author') === 0) you get author commit,

we would do something like:
$this->data['author'] = Git::shell('git log -1 --pretty=%an');
or
$this->data['author'] = Git::shell(GitCommand::AUTOR_LAST_COMMIT):

What do you think ?

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.