Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
introwit committed Feb 17, 2017
0 parents commit 85509c7
Show file tree
Hide file tree
Showing 9 changed files with 225 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/vendor
composer.lock
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) <Harish Toshniwal>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
76 changes: 76 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<p align="center"><img src="https://cloud.githubusercontent.com/assets/11228182/23066989/3dd8f21c-f543-11e6-8f74-f64ccf814d51.png"></p>

<p align="center">
<a href="https://packagist.org/packages/lubusin/laravel-decomposer"><img src="https://poser.pugx.org/lubusin/laravel-decomposer/v/stable" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/lubusin/laravel-decomposer"><img src="https://poser.pugx.org/lubusin/laravel-decomposer/downloads" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/lubusin/laravel-decomposer"><img src="https://poser.pugx.org/lubusin/laravel-decomposer/license" alt="License"></a>
</p>

## Introduction

Laravel Decomposer is used to decompose and list all the installed packages and their dependencies in your laravel app on the hit of a single route as shown below.This package aims to solve the following hassles we encounter during the development of a laravel project & maintaining while its up & live in the prodcution environment :

- To see the list of all installed packages in the laravel app directly from the browser
- To have the log of each dependency of those packages
- It can also help you in other ways like suppose you have a package installed that is using illuminate/support v5.1, and an another package using illuminate/support v5.3, so getting these facts quickly by just hitting to a route can make you aware of possible unstability and you can report that to the respective package developer

<img src="https://cloud.githubusercontent.com/assets/11228182/23072231/08485020-f557-11e6-8a6b-85b5bc5e924b.png" alt="dc-screenshot">

> **Kind Attention**
This is the initial version which will be improved actively. You can have a look at the Roadmap. If you have any suggestions for code improvements, new features or enhancements, create an issue so you,us or any open source believer can start working on it.

## Roadmap

- Make UI more informative & user-friendly
- Check for package updates & show if any available for the respective packages
- Compare same dependency versions for different packages
- Generate quick reports/stats about the installed packages,their dependencies,updates,etc.
- We have created the [issues](https://github.com/lubusIN/laravel-decomposer/issues) & [labels](https://github.com/lubusIN/laravel-decomposer/labels) with the appropriate titles , where you can contribute your ideas or let us know if you are working on a PR for that. Always more than happy to learn new things from the community.

## Installation

You can install this package via composer using this command:

```bash
composer require lubusin/laravel-decomposer
```

Next, add the service provider:

```php
// config/app.php
'providers' => [
...
Lubusin\Decomposer\DecomposerServiceProvider::class,
];
```

Add a route in your web routes file:

```php
Route::get('decompose','\Lubusin\Decomposer\Controllers\DecomposerController@index');
```
Go to http://yourapp/decompose or the route you configured above in the routes file.

> If you want to modify the view this package provides, Laravel has got your back - [How?](https://laravel.com/docs/5.4/packages#views)
## Contributing

Thank you for considering contributing to the Laravel Decomposer. You can read the contribution guide lines [here](contributing.md)

## Security

If you discover any security related issues, please email to [[email protected]](mailto:[email protected]).

## Credits

- [Harish Toshniwal](https://github.com/introwit)

## About LUBUS
[LUBUS](http://lubus.in) is a web design agency based in Mumbai.

## License
Laravel Decomposer is open-sourced software licensed under the [MIT license](LICENSE.txt)

## Changelog
Please see the [Changelog](https://github.com/lubusIN/laravel-decomposer/blob/master/changelog.md) for the details
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Changelog

All notable changes to the Laravel Decomposer will be documented in this file

## v0.5 - 17-02-2017
- Initial release
25 changes: 25 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "lubusin/laravel-decomposer",
"description": "A Laravel package to decompose and list your installed packages and their dependencies",
"license": "MIT",
"authors": [
{
"name": "Harish Toshniwal",
"email": "[email protected]"
}
],
"autoload": {
"psr-4": {
"Lubusin\\Decomposer\\": "src/"
}
},
"require": {
"php": "^7.0",
"illuminate/database": "~5.3",
"illuminate/support": "~5.3"
},
"require-dev": {
"illuminate/routing": "~5.3",
"illuminate/http": "~5.3"
}
}
3 changes: 3 additions & 0 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Decomposer Contribution Guide

We have created the [issues](https://github.com/lubusIN/laravel-decomposer/issues) & [labels](https://github.com/lubusIN/laravel-decomposer/labels) with the appropriate titles , where you can contribute your ideas or let us know if you are working on a PR for that. Always more than happy to learn new things from the community :)
17 changes: 17 additions & 0 deletions src/DecomposerServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Lubusin\Decomposer;

use Illuminate\Support\ServiceProvider;

class DecomposerServiceProvider extends ServiceProvider
{
public function boot()
{
$this->loadViewsFrom(__DIR__.'/views', 'Decomposer');
}
public function register()
{

}
}
32 changes: 32 additions & 0 deletions src/controllers/DecomposerController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace Lubusin\Decomposer\Controllers;

use Illuminate\Routing\Controller;
use Illuminate\Support\Collection;

class DecomposerController extends Controller
{
public function index()
{
$json = file_get_contents(base_path('composer.json'));
$composerArray = json_decode($json,true);
$packagesArray = $composerArray['require'];

foreach($packagesArray as $key => $value)
{
if($key == 'php') {}
else
{
$json2 = file_get_contents(base_path("/vendor/{$key}/composer.json"));
$dependenciesArray = json_decode($json2,true);
$dependencies = $dependenciesArray['require'];
$packages[] = ['name' => $key,
'version' => $value,
'dependencies' => $dependencies];
}
}

return view('Decomposer::index',compact('packages'));
}
}
43 changes: 43 additions & 0 deletions src/views/index.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="{{ config('app.locale') }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>Laravel Decomposer</title>

<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!-- Styles -->
<style>
body {
padding: 25px;
}
.ld-version-tag {
background-color: #F5716C;
}
</style>
</head>
<body>
<div class="container">
<table class="table table-hover table-striped table-bordered">
<tr>
<th>Package Name : Version</th>
<th>Dependency Name : Version</th>
</tr>
@foreach($packages as $package)
<tr>
<td>{{ $package['name'] }} : <span class="label ld-version-tag">{{ $package['version'] }}</span></td>
<td>
@foreach($package['dependencies'] as $dependencyName => $dependencyVersion)
{{ $dependencyName }} : <span class="label ld-version-tag">{{ $dependencyVersion }}</span> <br>
@endforeach
</td>
</tr>
@endforeach
</table>
</div>
</body>
</html>

0 comments on commit 85509c7

Please sign in to comment.