Skip to content

Commit 3c669ee

Browse files
committed
Fix debug page to show basic info by vender/bin
1 parent db1aa30 commit 3c669ee

File tree

5 files changed

+33
-197
lines changed

5 files changed

+33
-197
lines changed

bin/debug

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/php
2+
<?php
3+
4+
/*
5+
* This file is part of laravel-filemanager.
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
11+
$composerLock = file_get_contents('composer.lock');
12+
$jsonComposerLock = json_decode($composerLock);
13+
foreach ($jsonComposerLock->packages as $package) {
14+
if ($package->name == 'unisharp/laravel-filemanager')
15+
$lfmVersion = $package->version;
16+
17+
if ($package->name == 'laravel/framework')
18+
$laravelVersion = $package->version;
19+
20+
if (isset($lfmVersion) && isset($laravelVersion))
21+
break;
22+
}
23+
$imagickCheck = extension_loaded('imagick') ? 'Install' : 'Not Install';
24+
$gfCheck = extension_loaded('gd') ? 'Install' : 'Not Install';
25+
26+
// show the basic information for debug message
27+
echo 'OS System & Version: ' . php_uname() . PHP_EOL;
28+
echo 'Laravel Version: ' . $laravelVersion . PHP_EOL;
29+
echo 'File Manager Version: ' . $lfmVersion . PHP_EOL;
30+
echo 'imagick Extension: ' . $imagickCheck . PHP_EOL;
31+
echo 'gd Extension: ' . $gfCheck . PHP_EOL;

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,6 @@
4040
"psr-4": {
4141
"Unisharp\\Laravelfilemanager\\": "src/"
4242
}
43-
}
43+
},
44+
"bin": ["bin/debug"]
4445
}

src/controllers/DebugController.php

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/routes.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,4 @@
8787
]);
8888

8989
Route::get('/demo', 'DemoController@index');
90-
91-
// debug page
92-
Route::get('/debug', 'DebugController@index');
9390
});

src/views/debug.blade.php

Lines changed: 0 additions & 162 deletions
This file was deleted.

0 commit comments

Comments
 (0)