require ldc/web-status-checker-laravel + remove obsolete command

This commit is contained in:
Jérémy Munsch 2022-08-11 09:44:36 +02:00
parent f25b458c97
commit 138c0ef2f2
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
3 changed files with 119 additions and 78 deletions

View file

@ -1,76 +0,0 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
/**
* Command Name: LDC Web Status Checker
* Description: Envoi des infos Serveur/Laravel vers LDC Web
* Version: 1.1
* Author: Vincent BRIDIER
* Author URI: vincent.bridier@ldc.fr
*/
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('ldcweb.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 . '/*.log');
if (count($files) > 0) {
foreach ($files as $file) {
$data['logs'] = $data['logs'] + filesize($file);
}
}
$data['code']['version'] = app()->version();
// * Send by cURL
$url = 'https://ldc-web.ldc.fr/api/status-checker';
$ch = curl_init($url);
$payload = ['token' => 'CE8S52Qq7stf5k8frF4T', 'datas' => json_encode($data)];
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
return 0;
}
}

View file

@ -23,6 +23,7 @@
"laravel/framework": "^8.12",
"laravel/tinker": "^2.5",
"laravel/ui": "^3.3",
"ldc/web-status-checker-laravel": "^1.0",
"mews/purifier": "^3.3"
},
"require-dev": {
@ -72,5 +73,11 @@
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
},
"repositories": [
{
"type": "composer",
"url": "https://gitlab.com/api/v4/group/16669037/-/packages/composer/packages.json"
}
]
}

112
composer.lock generated
View file

@ -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": "48bedcbceaa0780c9be7661db3e1190b",
"content-hash": "47a64c62b7e388c80216db44f86f0d44",
"packages": [
{
"name": "asm89/stack-cors",
@ -2154,6 +2154,116 @@
},
"time": "2022-05-20T13:38:08+00:00"
},
{
"name": "ldc/web-status-checker",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://gitlab.com/service-web-lab/ldc-web-status-checker.git",
"reference": "70a4f96a272f42f9caaf8f614190a3e061273bc8"
},
"dist": {
"type": "zip",
"url": "https://gitlab.com/api/v4/projects/37071268/packages/composer/archives/ldc/web-status-checker.zip?sha=70a4f96a272f42f9caaf8f614190a3e061273bc8",
"reference": "70a4f96a272f42f9caaf8f614190a3e061273bc8",
"shasum": ""
},
"require": {
"ext-curl": "*",
"php": "~7.3|7.4|~8"
},
"require-dev": {
"slevomat/coding-standard": "^7.0",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"autoload": {
"psr-4": {
"LDC\\WebStatusChecker\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"LDC\\WebStatusChecker\\Tests\\": "tests"
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Jérémy Munsch",
"email": "jeremy.munsch@ldc.fr",
"homepage": "https://jeremydev.ovh"
}
],
"description": "Status checker: report status to ldc-web"
},
{
"name": "ldc/web-status-checker-laravel",
"version": "1.0.3",
"source": {
"type": "git",
"url": "https://gitlab.com/service-web-lab/ldc-web-status-checker-laravel.git",
"reference": "32965e7425060c4167b40e5c0868c438ea94c14f"
},
"dist": {
"type": "zip",
"url": "https://gitlab.com/api/v4/projects/37071488/packages/composer/archives/ldc/web-status-checker-laravel.zip?sha=32965e7425060c4167b40e5c0868c438ea94c14f",
"reference": "32965e7425060c4167b40e5c0868c438ea94c14f",
"shasum": ""
},
"require": {
"illuminate/support": "~8|~9",
"laravel/framework": "~8|~9",
"ldc/web-status-checker": "^1.0",
"php": "~7.3|7.4|~8"
},
"require-dev": {
"orchestra/testbench": "^6.24",
"phpunit/php-code-coverage": "^9.2",
"phpunit/phpunit": "~9.0",
"slevomat/coding-standard": "^7.0",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"LDC\\WebStatusCheckerLaravel\\StatusCheckerServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"LDC\\WebStatusCheckerLaravel\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"LDC\\WebStatusCheckerLaravel\\Tests\\": "tests"
}
},
"scripts": {
"test": [
"vendor/bin/phpunit"
],
"post-autoload-dump": [
"@php ./vendor/bin/testbench package:discover --ansi"
]
},
"license": [
"MIT"
],
"authors": [
{
"name": "Jérémy Munsch",
"email": "jeremy.munsch@ldc.fr",
"homepage": "https://jeremydev.ovh"
}
],
"description": "Status checker: report status to ldc-web"
},
{
"name": "league/commonmark",
"version": "1.6.7",