forked from pbergman/KeePass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest.php
56 lines (46 loc) · 1.38 KB
/
Test.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
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* @author Philip Bergman <pbergman@live.nl>
*/
require_once 'vendor/autoload.php';
$container = new \KeePass\Application(
function(){
return readline('Keepass database password: ');
}
);
// Run directly from kps
echo $container->get('keepass')
->getKpScript()
->get('GenPw')->setCount(100)->run(true);exit;
echo $container->get('keepass')
->getKpScript()
->get('GetEntryString')
->setField('Password')
->setRef('UUID','3F64A5B641F6F84E84BE05B35A2B8E7E')
->run(true);
// Remove cache
/** @var KeePass\EntityController\Controller $ec */
/*
$ec = $container->get('entity_controller');
$ec->removeCache(true,true);exit;
*/
///** @var \KeePass\KeePass $kp */
//$kp = $container->get('keepass');
//$ec = $kp->getEntityController();
///** @var KeePass\EntityController\Filters\Group $groups */
//$groups = $ec->getEntities('group');
//$result = $groups
// ->where('name','Z%', 'like')
// ->getEntries()
// ->whereInData('url','%zicht.nl','like')
// ->getGroup()
// ->getResult();
//
//// Get entries from group matching pattern
////$result = $groups
//// ->where('name','Z5')
//// ->getEntries()
//// ->whereInData('url', '%zicht.nl', 'like')
//// ->getResult();
//
//var_dump($result);