Example #1
0
        return false;
    }
    return infra_theme($folder . $result);
}, array($fdata['path']), isset($_GET['re']));
$ans = array('src' => $isrc);
if (!$src) {
    if (!infra_isphp()) {
        header('HTTP/1.0 404 Not Found');
    }
    return;
}
$fdata = infra_srcinfo($src);
if (in_array($fdata['ext'], array('docx'))) {
    $txt = files\Docx::get($src);
    return Ans::txt($txt);
}
if (in_array($fdata['ext'], array('mht'))) {
    $txt = files\Mht::get($src);
    return Ans::txt($txt);
}
if (in_array($fdata['ext'], array('xls', 'xlsx'))) {
    $ans = files\Xlsx::get($src);
    return Ans::ans($ans);
}
if (in_array($fdata['ext'], array('tpl', 'html', 'htm', 'php'))) {
    $txt = infra_loadTEXT($src);
    return Ans::txt($txt);
}
if (!infra_isphp()) {
    header('HTTP/1.0 400 Bad Request');
}
Example #2
0
if (sizeof($preview['links']) != 1) {
    return Ans::err($ans, 'Cant read links ' . $name . ' ' . sizeof($preview['links']));
}
if (sizeof($preview['images']) != 2) {
    return Ans::err($ans, 'Cant read images ' . $name . ' ' . sizeof($preview['images']));
}
if (mb_strlen($preview['preview']) != 521) {
    return Ans::err($ans, 'Cant read ' . $name . ' preview ' . strlen($preview['preview']));
}
$name = 'test.tpl';
$text = Mht::get('*files/tests/resources/' . $name);
if (mb_strlen($text) != 1935) {
    return Ans::err($ans, 'Cant read ' . $name . ' ' . strlen($text));
}
$name = 'test.html';
$text = Mht::get('*files/tests/resources/' . $name);
if (strlen($text) != 1073) {
    return Ans::err($ans, 'Cant read ' . $name . ' ' . strlen($text));
}
$data = Xlsx::init('*files/tests/resources/test.xlsx');
if (!$data) {
    return Ans::err($ans, 'Cant read test.xlsx');
}
$data = Xlsx::init('*files/tests/resources/test.csv');
if (!$data) {
    return Ans::err($ans, 'Cant read test.csv');
}
if (sizeof($data['childs']) != 1) {
    return Ans::err($ans, 'Cant read test.csv ' . sizeof($data['childs']));
}
$num = ini_get('mbstring.func_overload');