PHP Classes

File: tests/cli/cleanup.php

Recommend this page to a friend!
  Classes of Scott Arciszewski   Chronicle   tests/cli/cleanup.php   Download  
File: tests/cli/cleanup.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Chronicle
Append arbitrary data to a storage container
Author: By
Last change: Update of tests/cli/cleanup.php
Date: 1 year ago
Size: 715 bytes
 

Contents

Class file image Download
<?php
declare(strict_types=1);
namespace
ParagonIE\Chronicle\CliTests;

use
ParagonIE\Chronicle\Chronicle;

if (
file_exists(__DIR__ . '/client.json')) {
    exit(
0);
}
if (
file_exists(__DIR__ . '/client-admin.json')) {
    exit(
0);
}

require_once
__DIR__ . '/cli-include.php';

Chronicle::getDatabase()->beginTransaction();
Chronicle::getDatabase()->delete(
   
'chronicle_clients',
    [
       
'isAdmin' => false,
       
'publicid' => 'CLI-testing-user'
   
]
);
Chronicle::getDatabase()->delete(
   
'chronicle_clients',
    [
       
'isAdmin' => true,
       
'publicid' => 'CLI-admin-user'
   
]
);
Chronicle::getDatabase()->commit();

unlink(__DIR__.'/client.json');
unlink(__DIR__.'/client-admin.json');