-
Notifications
You must be signed in to change notification settings - Fork 0
/
index_cli.php
43 lines (37 loc) · 1022 Bytes
/
index_cli.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
namespace PMVC\App\dimension;
use PMVC\Action;
use PMVC\MappingBuilder;
use DomainException;
$b = new MappingBuilder();
$b->addAction('decode');
$b->addAction('encode');
$b->addForward('dump',[_TYPE=>'view']);
${_INIT_CONFIG}[_CLASS] =
__NAMESPACE__.
'\DimensionCliAction';
${_INIT_CONFIG}[_INIT_BUILDER] = $b;
class DimensionCliAction extends Action
{
const PLAIN_TEXT_EXT='.plaintext';
static public function encode($m, $f)
{
$folderConf = \PMVC\getOption('dimensionFolder');
$encryption = \PMVC\plug('dimension')->
encryption($folderConf, $f['key'])->
encode();
$go = $m['dump'];
$go->set('O.K.');
return $go;
}
static public function decode($m, $f)
{
$folderConf = \PMVC\getOption('dimensionFolder');
$encryption = \PMVC\plug('dimension')->
encryption($folderConf, $f['key'])->
decode();
$go = $m['dump'];
$go->set('O.K.');
return $go;
}
}