Пример #1
0
function performAndPrintTests()
{
    global $settings;
    global $_testInstall_Ok;
    ?>
		<table summary="PHP settings">
			<tr> <th> PHP settings </th> <th> Value </th> <th> Result </th> </tr>
			<tr> <td> PHP version </td> <td> <?php 
    echo phpversion();
    ?>
 </td> <td> <?php 
    showResult(version_compare(PHP_VERSION, '5.3.0') >= 0, true, "", "PHP 5.3 or later is recommended");
    ?>
 </td> </tr>
			<tr> <td> timezone settings </td> <td> <?php 
    echo ini_get("date.timezone");
    ?>
 </td> <td> <?php 
    showResult(ini_get("date.timezone"), true, "", "Please specify date.timezone in your PHP.ini");
    ?>
 </td> </tr>
			<tr> <td> Open base dir </td> <td> <?php 
    echo ini_get("open_basedir");
    ?>
 </td> <td> <?php 
    showResult(!ini_get("open_basedir"), true, "", "Not empty, <strong>might</strong> be a problem");
    ?>
 </td> </tr>
			<tr> <td> Allow furl open </td> <td> <?php 
    echo ini_get("allow_url_fopen");
    ?>
 </td> <td> <?php 
    showResult(ini_get("allow_url_fopen") == 1, true, "", "allow_url_fopen not on -- will cause problems to retrieve external data");
    ?>
 </td> </tr>
			<tr> <td> PHP safe mode </td> <td> <?php 
    echo ini_get("safe_mode");
    ?>
 </td> <td> <?php 
    showResult(!ini_get("safe_mode"), true, "", "Safe mode set -- will cause problems for retrieve.php");
    ?>
 </td> </tr>
			<tr> <td> Memory limit </td> <td> <?php 
    echo ini_get("memory_limit");
    ?>
 </td> <td> <?php 
    showResult(return_bytes(ini_get("memory_limit")) >= 128 * 1024 * 1024, true, "", "memory_limit below 128M");
    ?>
 </td> </tr>
		</table>
		<br />

		<table summary="PHP extensions">
			<tr> <th colspan="2"> PHP extension </th> <th> Result </th> </tr>
			<tr> <td colspan="2"> ctype </td> <td> <?php 
    showResult(extension_loaded('ctype'), true);
    ?>
 </td> </tr>
			<tr> <td colspan="2"> curl </td> <td> <?php 
    showResult(extension_loaded('curl'), true);
    ?>
 </td> </tr>
			<tr> <td colspan="2"> DOM </td> <td> <?php 
    showResult(extension_loaded('dom'), true);
    ?>
 </td> </tr>
			<tr> <td colspan="2"> gettext </td> <td> <?php 
    showResult(extension_loaded('gettext'), false);
    ?>
 </td> </tr>
			<tr> <td colspan="2"> mbstring </td> <td> <?php 
    showResult(extension_loaded('mbstring'), true);
    ?>
 </td> </tr>
			<tr> <td colspan="2"> xml </td> <td> <?php 
    showResult(extension_loaded('xml'), true);
    ?>
 </td> </tr>
			<tr> <td colspan="2"> zip </td> <td> <?php 
    showResult(extension_loaded('zip'), false, "", "You need this module to select multiple NZB files");
    ?>
 </td> </tr>
			<tr> <td colspan="2"> zlib </td> <td> <?php 
    showResult(extension_loaded('zlib'), true);
    ?>
 </td> </tr>

			<tr> <th colspan="2"> Database support </th> <td> <?php 
    showResult(extension_loaded('mysql') || extension_loaded('pdo_mysql') || extension_loaded('pdo_pgsql'), true);
    ?>
 </td> </tr>
			<tr> <td colspan="2"> DB::mysql </td> <td> <?php 
    showResult(extension_loaded('mysql'), false);
    ?>
 </td> </tr>
			<tr> <td colspan="2"> DB::pdo_mysql </td> <td> <?php 
    showResult(extension_loaded('pdo_mysql'), false);
    ?>
 </td> </tr>
			<tr> <td colspan="2"> DB::pgsql </td> <td> <?php 
    showResult(extension_loaded('pdo_pgsql'), false);
    ?>
 </td> </tr>

		<?php 
    if (extension_loaded('gd')) {
        $gdInfo = gd_info();
    }
    ?>
			<tr> <th colspan="2"> GD </th> <td> <?php 
    showResult(extension_loaded('gd'), true);
    ?>
 </td> </tr>
			<tr> <td colspan="2"> FreeType Support </td> <td> <?php 
    showResult($gdInfo['FreeType Support'], true);
    ?>
 </td> </tr>
			<tr> <td colspan="2"> GIF Read Support </td> <td> <?php 
    showResult($gdInfo['GIF Read Support'], true);
    ?>
 </td> </tr>
			<tr> <td colspan="2"> GIF Create Support </td> <td> <?php 
    showResult($gdInfo['GIF Create Support'], true);
    ?>
 </td> </tr>
			<tr> <td colspan="2"> JPEG Support </td> <td> <?php 
    showResult($gdInfo['JPEG Support'] || $gdInfo['JPG Support'], true);
    ?>
 </td> </tr> <!-- Previous to PHP 5.3.0, the JPEG Support attribute was named JPG Support. -->
			<tr> <td colspan="2"> PNG Support </td> <td> <?php 
    showResult($gdInfo['PNG Support'], true);
    ?>
 </td> </tr>
			<tr> <th colspan="3"> OpenSSL </th> </tr>
		<?php 
    require_once "lib/services/Signing/Services_Signing_Base.php";
    require_once "lib/services/Signing/Services_Signing_Php.php";
    require_once "lib/services/Signing/Services_Signing_Openssl.php";
    $spotSigning = Services_Signing_Base::newServiceSigning();
    $privKey = $spotSigning->createPrivateKey($settings['openssl_cnf_path']);
    /* We need either one of those 3 extensions, so set the error flag manually */
    if (!extension_loaded('openssl') && !extension_loaded('gmp') && !extension_loaded('bcmath')) {
        $_testInstall_Ok = false;
    }
    # if
    ?>
	<tr> <td rowspan="3"> At least 1 of these must be OK <br />these modules are sorted from fastest to slowest</td> <td> openssl </td> <td> <?php 
    showResult(extension_loaded('openssl'), false);
    ?>
 </td> </tr>
			<tr> <td> gmp </td> <td> <?php 
    showResult(extension_loaded('gmp'), false);
    ?>
 </td> </tr>
			<tr> <td> bcmath </td> <td> <?php 
    showResult(extension_loaded('bcmath'), false);
    ?>
 </td> </tr>
			<tr> <td colspan="2"> Can create private key? </td> <td> <?php 
    showResult(isset($privKey['public']) && !empty($privKey['public']) && !empty($privKey['private']), true);
    ?>
 </td> </tr>
		</table>
		<br />

		<table summary="Include files">
			<tr> <th> Include files  </th> <th> Result </th> </tr>
			<tr> <td> Settings file </td> <td> <?php 
    $result = testInclude("settings.php");
    echo showResult($result, true, $result);
    ?>
 </td> </tr>
			<tr> <td> Own settings file </td> <td> <?php 
    $result = testInclude("ownsettings.php");
    echo showResult($result, true, $result, "optional");
    ?>
 </td> </tr>
		</table>
		<br />

		<?php 
    if ($_testInstall_Ok) {
        ?>
			<table summary="result" class="tableresult">
				<tr> 
						<th colspan="2"> Please continue to setup Spotweb </th> 
						<th> <a href="?page=1" class="button" >Next</a> </th>
				</tr>
			</table>
			<br />
		<?php 
    } else {
        ?>
			
			<table summary="result">
				<tr> <th> Please fix above errors before you can continue to install Spotweb </th> </tr>
			</table>
			<br />
		<?php 
    }
    ?>
			

		</body>
		</html>
<?php 
}
Пример #2
0
 </td> </tr>
	<?php 
}
?>
</table>
<br />

<table summary="Include files">
	<tr> <th> Include files  </th> <th> Result </th> </tr>
	<tr> <td> Settings file </td> <td> <?php 
$result = testInclude("settings.php");
echo showResult($result, $result);
?>
 </td> </tr>
	<tr> <td> Own settings file </td> <td> <?php 
$result = testInclude("ownsettings.php");
echo showResult($result, $result, "optioneel");
?>
 </td> </tr>
</table>
<br />

</body>
</html><?php 
function return_bytes($val)
{
    $val = trim($val);
    $last = strtolower($val[strlen($val) - 1]);
    switch ($last) {
        // The 'G' modifier is available since PHP 5.1.0
        case 'g':
Пример #3
0
# testInclude
set_error_handler("ownWarning", E_WARNING);
?>

	<table>
		<tr> <th> Include files  </th> <th> OK ? </th> </tr>
		<tr> <td> Settings file </td> <td> <?php 
echo testInclude("settings.php") ? "OK" : "settings.php cannot be read";
?>
  </td> </tr>
		<tr> <td> PEAR </td> <td> <?php 
echo testInclude("System.php") ? "OK" : "PEAR cannot be found";
?>
 </td> </tr>
		<tr> <td> PEAR Net/NNTP </td> <td> <?php 
echo testInclude("Net/NNTP/Client.php") ? "OK" : "PEAR Net/NNTP package cannot be found";
?>
 </td> </tr>
		<tr> <td> NNTP server </td> <td> <?php 
echo !empty($settings['nntp_nzb']['host']) === false ? "No server entered" : "OK";
?>
  </td> </tr>
	</table>
	
	<br> <br>
	
	<table>
		<tr> <th> Path </th> <th> PEAR found? </th> <th> Net/NNTP found? </th> <tr>
		
<?php 
$arInclude = explode(":", ini_get("include_path"));
Пример #4
0
	<tr> <td> NNTP server </td> <td> <?php showResult(empty($settings['nntp_nzb']['host']) === false, $settings['nntp_nzb']['host'], "No server entered"); ?> </td> </tr>
	<?php if ($settings['nntp_nzb'] != $settings['nntp_hdr']) { ?>
	<tr> <td> NNTP server (headers) </td> <td> <?php showResult(empty($settings['nntp_hdr']['host']) === false, $settings['nntp_hdr']['host'], "No server entered"); ?> </td> </tr>
	<?php }
	if ($settings['nntp_nzb'] != $settings['nntp_post']) { ?>
	<tr> <td> NNTP server (post) </td> <td> <?php showResult(empty($settings['nntp_post']['host']) === false, $settings['nntp_post']['host'], "No server entered"); ?> </td> </tr>
	<?php } ?>
</table>
<br />

<table summary="Include files">
	<tr> <th> Include files  </th> <th> Result </th> </tr>
	<tr> <td> Settings file </td> <td> <?php $result=testInclude("settings.php"); echo showResult($result, $result); ?> </td> </tr>
	<tr> <td> Own settings file </td> <td> <?php $result=testInclude("ownsettings.php"); echo showResult($result, $result, "optioneel"); ?> </td> </tr>
	<tr> <td> <a href="http://pear.php.net/">PEAR</a> </td> <td> <?php $result=testInclude("System.php"); echo showResult($result, $result); ?> </td> </tr>
	<tr> <td> <a href="http://pear.php.net/package/Net_NNTP">Net_NNTP</a> </td> <td> <?php $result=testInclude("Net".DIRECTORY_SEPARATOR."NNTP".DIRECTORY_SEPARATOR."Client.php"); echo showResult($result, $result); ?> </td> </tr>
</table>
<br />

</body>
</html><?php
	function return_bytes($val) {
		$val = trim($val);
		$last = strtolower($val[strlen($val)-1]);
		switch($last) {
			// The 'G' modifier is available since PHP 5.1.0
			case 'g':
				$val *= 1024;
			case 'm':
				$val *= 1024;
			case 'k':