예제 #1
0
 public function __invoke(Request $req, Response $res, $args = [])
 {
     $ret = [];
     foreach (Vault::all() as $vault) {
         $ret[] = $vault->serializeArray();
     }
     $jsonResponse = ['Marker' => null, 'VaultList' => $ret];
     return $res->withJson($jsonResponse, 200, JSON_PRETTY_PRINT);
 }
예제 #2
0
 public function __invoke(Request $req, Response $res, $args = [])
 {
     $accessID = $args['accessID'];
     $GLOBALS['vaultStorePath'] = $GLOBALS['config']['storePath'] . "{$accessID}/vaults/";
     foreach (Vault::all() as $vault) {
         $vault->delete();
     }
     return $res->withStatus(200);
 }