maj dumpser
This commit is contained in:
parent
b20e7380e7
commit
b17cf4ebad
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/php
|
||||
<?php
|
||||
require $_composer_autoload_path?? __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
use nulib\tools\DumpserApp;
|
||||
|
||||
DumpserApp::run();
|
|
@ -80,12 +80,13 @@
|
|||
}
|
||||
},
|
||||
"bin": [
|
||||
"bin/dumpser.php",
|
||||
"bin/csv2xlsx.php",
|
||||
"nur_bin/compctl.php",
|
||||
"nur_bin/compdep.php",
|
||||
"nur_bin/datectl.php",
|
||||
"nur_bin/fsvdiff.php",
|
||||
"nur_bin/cachectl.php",
|
||||
"nur_bin/dumpser.php",
|
||||
"nur_bin/ldap-delete.php",
|
||||
"nur_bin/ldap-get-infos.php",
|
||||
"nur_bin/ldap-search.php",
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
||||
__uaddpath "@@dest@@/nur_bin" PATH
|
||||
__uaddpath "@@dest@@/bin:@@dest@@/nur_bin" PATH
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
namespace nulib\tools;
|
||||
|
||||
use nulib\app\cli\Application;
|
||||
use nulib\ext\yaml;
|
||||
use nulib\file\SharedFile;
|
||||
use nulib\output\msg;
|
||||
|
||||
class DumpserApp extends Application {
|
||||
const ARGS = [
|
||||
"merge" => parent::ARGS,
|
||||
"purpose" => "afficher des données sérialisées",
|
||||
];
|
||||
|
||||
protected $args;
|
||||
|
||||
function main() {
|
||||
$files = [];
|
||||
foreach ($this->args as $arg) {
|
||||
if (is_file($arg)) {
|
||||
$files[] = $arg;
|
||||
} else {
|
||||
msg::warning("$arg: fichier invalide ou introuvable");
|
||||
}
|
||||
}
|
||||
$showSection = count($files) > 1;
|
||||
foreach ($files as $file) {
|
||||
if ($showSection) msg::section($file);
|
||||
$sfile = new SharedFile($file);
|
||||
yaml::dump($sfile->unserialize());
|
||||
}
|
||||
}
|
||||
}{
|
||||
}
|
Loading…
Reference in New Issue