-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.php
executable file
·57 lines (47 loc) · 1.19 KB
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* an example call
*
* @package mpv
* @version $Id$
* @copyright (c) 2010 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*
*/
$phpEx = substr(strrchr(__FILE__, '.'), 1);
$root_path = './';
// Will define all needed things.
require('./mpv_config.' . $phpEx);
if (version_compare(PHP_VERSION, '5.2.0', '<'))
{
die($lang['MIN_PHP']);
}
require('./includes/functions_mpv.' . $phpEx);
require('./includes/mpv.' . $phpEx);
//Override HTML format
define('HTML_FORMAT', true);
register_shutdown_function('end_output');
error_reporting(E_ALL);
$mpv = new mpv(null, mpv::UNZIP_PREFERENCE, false);
$mpv->output_type = ((HTML_FORMAT) ? mpv::OUTPUT_HTML : mpv::OUTPUT_BBCODE);
mpv::$exec_php = mpv::EXEC_PHP;
$mpv->validate('./test-file.zip');
if (HTML_HEADERS)
{
print '<!DOCTYPE html>'
print '<html>
<head>
<title>' . $lang['TITLE'] . '</title>
<link rel="stylesheet" href="style.css">
</head>
<body>';
}
print '<div class="wrapper">';
print '<header>';
print '<h2>' . $lang['VALIDATION_RESULTS'] . "</h2><br /></header>";
print '<section>';
print ((HTML_FORMAT) ? nl2br($mpv) : $mpv);
print '</section>';
print '</div>';
print '</body></html> ';
?>