adaptation à la nouvelle gestion de la config
FossilOrigin-Name: 8021f28f6ba17ffafbb4a1e5ffb4cb8486c3b585a486afd6a24f61db0b64841c
This commit is contained in:
parent
b2885f3c01
commit
fcac139b89
7 changed files with 125 additions and 110 deletions
25
install.php
25
install.php
|
|
@ -1,10 +1,23 @@
|
|||
<?php
|
||||
namespace Paheko;
|
||||
use Paheko\Entities\Files\File;
|
||||
|
||||
use Paheko\Files\Files;
|
||||
|
||||
$nom_plugin = $plugin->get('name');
|
||||
const SIGNATURE_DEFAUT = 'default_signature.png';
|
||||
const CONFIG_INIT = 'config.json';
|
||||
|
||||
// configuration initiale
|
||||
$config_init = json_decode(file_get_contents(Plugins::getPath($nom_plugin) . '/' . CONFIG_INIT),
|
||||
true);
|
||||
|
||||
// enregistrer dans la config du plugin
|
||||
foreach ($config_init as $cle => $valeur) {
|
||||
$plugin->setConfigProperty($cle, $valeur);
|
||||
}
|
||||
$plugin->save();
|
||||
|
||||
// « signature » par défaut à remplacer (voir l'onglet de configuration)
|
||||
$path = __DIR__ . '/data/default_signature.png';
|
||||
$default_signature_file = (new File)->createAndStore('skel/plugin/recusfiscaux',
|
||||
'default_signature.png',
|
||||
$path,
|
||||
null);
|
||||
$path = __DIR__ . '/data/' . SIGNATURE_DEFAUT;
|
||||
$default_signature_file = Files::createFromPath('ext/' . $nom_plugin . '/' . SIGNATURE_DEFAUT,
|
||||
$path);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue