Giter Site home page Giter Site logo

artgris / versioncheckerbundle Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 16 KB

Symfony Bundle to get list of installed packages in your project with a comparative of your versions (Parse composer.lock) and github release (GitHub Api v3) versions. Accessible via Symfony Web Debug Toolbar (using Cache), service and twig extension.

License: MIT License

PHP 52.89% HTML 47.11%
symfony-bundle symfony debugbar

versioncheckerbundle's Introduction

VersionCheckerBundle

Symfony Bundle to get list of installed packages in your project with a comparative of your versions (Parse composer.lock) and github versions (GitHub Api v3) . Accessible via Symfony Web Debug Toolbar (using Cache), service and twig extension.

Image of adding toolbar

Versions available in Symfony Web Debug Toolbar

Requirements

module php_curl

Installation

1) Download

composer require artgris/version-checker-bundle

2) Enable Bundle

// app/AppKernel.php

$bundles = array(
    // ...
      new Artgris\VersionCheckerBundle\ArtgrisVersionCheckerBundle()
);

3) Configure the Bundle

Adds following configurations

to app/config/routing_dev.yml

 _artgris_version_checker:
      resource: "@ArtgrisVersionCheckerBundle/Resources/config/routing.yml"

You don't have to have routing restriction on '/artgris-vcb-ajax'

to app/config/config.yml (optional) :

artgris_version_checker:
    access_token: xxxxx...
    lifetime: 3600

access_token : optional but necessary if you have more than 60 packages - It's your token to use GitHub API without rate limit => Generate your token (required GitHub user account)

lifetime : Cache lifetime (seconds), GitHub Versions have been saved with The Cache Component.

####GitHub Api rate limit

VersionCheckerBundle uses GitHub API v3 to get last releases of your packages.

But GitHub has Rate Limiting policy :

For requests using Basic Authentication or OAuth, you can make up to 5,000 requests per hour. 
For unauthenticated requests, the rate limit allows you to make up to 60 requests per hour.

That's why it's necessary to use a token when you have more than 60 packages.

Usage

Symfony Web Debug Toolbar

(screenshot above)

Service

$this->get('version_checker_service')->versionChecker($gitHubName = null)

exemple :

$this->get('version_checker_service')->versionChecker() 

return an array with all of your packages :

[
    "doctrine/dbal" => [
        "yourVersion" => "v2.5.6"
        "url" => "https://github.com/doctrine/dbal.git"
        "gitHubVersion" => "v2.5.7"
    ],[
    "doctrine/DoctrineBundle" => [
        "yourVersion" => "1.6.6"
        "url" => "https://github.com/doctrine/DoctrineBundle.git"
        "gitHubVersion" => "1.6.6"
    ],[
    ...
    ]      
]

or get a unique package version :

$this->get('version_checker_service')->versionChecker('doctrine/dbal')

Twig extension

same logic :

version_checker()

version_checker(packageName)

No release found

If you have message No release found for a package, it's because he doesn't have any published full release.

versioncheckerbundle's People

Contributors

arkounay avatar artgris avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

arkounay

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.