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'); }
$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'); if ($num != 0) { $ans['class'] = 'bg-warning'; return Ans::err($ans, 'mbstring.func_overload should be 0, not ' . $num); } else { $data = Xlsx::get('*files/tests/resources/test.xls'); if (sizeof($data['childs'][0]['data']) != 30) { return Ans::err($ans, 'Cant read test.xls ' . sizeof($data['childs'][0]['data'])); } } return Ans::ret($ans, 'tpl, mht, docx, xls, xlsx read ok!');