PHP Classes

File: tests/bootstrap.php

Recommend this page to a friend!
  Classes of Cesar D. Rodas   PHP JSON API Server   tests/bootstrap.php   Download  
File: tests/bootstrap.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP JSON API Server
Handle REST API requests with functions in scripts
Author: By
Last change:
Date: 7 years ago
Size: 662 bytes
 

Contents

Class file image Download
<?php

require __DIR__ . '/../vendor/autoload.php';
require
__DIR__ . '/SessionStorage.php';

rrmdir(__DIR__ . '/tmp');
@
mkdir(__DIR__ . '/tmp');

function
rrmdir($dir)
{
    if (
is_dir($dir)) {
       
$objects = scandir($dir);
        foreach (
$objects as $object) {
            if (
$object != "." && $object != "..") {
                if (
is_dir($dir."/".$object))
                   
rrmdir($dir."/".$object);
                else
                   
unlink($dir."/".$object);
            }
        }
       
rmdir($dir);
    }
}

crodas\FileUtil\File::overrideFilepathGenerator(function($prefix) {
    return
__DIR__ . '/tmp/' . $prefix . '/';
});