Merge branch 'issue1' into 'develop'
Solves #1 See merge request service-web-lab/tracabilite-loue!8
This commit is contained in:
commit
4490eddfb5
4 changed files with 5 additions and 83 deletions
|
|
@ -1,79 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
/*
|
||||
* Command Name: LDC Web Status Checker
|
||||
* Description: Envoi des infos Serveur/Laravel vers LDC Web
|
||||
* Version: 1.0
|
||||
* Author: Vincent BRIDIER
|
||||
* Author URI: vincent.bridier@ldc.fr
|
||||
*/
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class LDCWebStatusChecker extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'ldcweb:statuschecker';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Envoi des infos Serveur/Laravel vers LDC Web';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$data = [];
|
||||
$data['uuid'] = config('app.project_uuid');
|
||||
|
||||
// Sitemap.xml ?
|
||||
if (file_exists(public_path() . '/sitemap.xml')) {
|
||||
$data['sitemap'] = 'true';
|
||||
} else {
|
||||
$data['sitemap'] = 'false';
|
||||
}
|
||||
|
||||
// Robots.txt ?
|
||||
if (file_exists(public_path() . '/robots.txt')) {
|
||||
$data['robots'] = 'true';
|
||||
} else {
|
||||
$data['robots'] = 'false';
|
||||
}
|
||||
|
||||
// Check logs .
|
||||
$data['logs'] = 0;
|
||||
$patherror = storage_path('/logs');
|
||||
$files = glob($patherror . '/laravel-*.log');
|
||||
if (count($files) > 0) {
|
||||
foreach ($files as $file) {
|
||||
$data['logs'] = $data['logs'] + filesize($file);
|
||||
}
|
||||
}
|
||||
|
||||
$data['code']['version'] = app()->version();
|
||||
|
||||
try {
|
||||
Http::post(
|
||||
'https://ldc-web.s-web.test/api/status-checker',
|
||||
['token' => 'CE8S52Qq7stf5k8frF4T', 'datas' => json_encode($data)]
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -38,6 +38,7 @@ class Kernel extends ConsoleKernel
|
|||
|
||||
$schedule->job(XmlFluxEggJob::class, 'tracea')->onOneServer()->dailyAt('02:00');
|
||||
$schedule->job(XmlFluxPoultryJob::class, 'tracea')->onOneServer()->dailyAt('22:00');
|
||||
$schedule->command('xml:clean_olds')->onOneServer()->dailyAt('06:00');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@
|
|||
"kwaadpepper/enum": "^2.1",
|
||||
"kwaadpepper/exception-handler": "^0.0.6",
|
||||
"kwaadpepper/refresh-sitemap": "^1.0",
|
||||
"laravel/ui": "^3.0",
|
||||
"laravel/framework": "^8.0",
|
||||
"laravel/tinker": "^2.0",
|
||||
"laravel/ui": "^3.0",
|
||||
"laravelcollective/html": "^6.0",
|
||||
"ldc/web-admin-secure-laravel": "1.0.1",
|
||||
"ldc/web-status-checker-laravel": "1.0.3",
|
||||
"ldc/web-status-checker-laravel": "^1.0",
|
||||
"mews/purifier": "^3.3",
|
||||
"nesbot/carbon": "^2.29",
|
||||
"spatie/laravel-mix-preload": "^1.3"
|
||||
|
|
|
|||
4
composer.lock
generated
4
composer.lock
generated
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "040c7f9d55df10bfbad67ab4fc1eec41",
|
||||
"content-hash": "3b8a85ff97e17a3645c1bb8dcb6a15bf",
|
||||
"packages": [
|
||||
{
|
||||
"name": "arondeparon/laravel-request-sanitizer",
|
||||
|
|
@ -9303,5 +9303,5 @@
|
|||
"ext-xml": "*"
|
||||
},
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "2.2.0"
|
||||
"plugin-api-version": "2.3.0"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue