-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.1.0 - added test to check compatibility with FT3
- Loading branch information
Showing
9 changed files
with
209 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
require_once("../../global/library.php"); | ||
ft_init_module_page(); | ||
|
||
$page_vars = array( | ||
"php_version" => phpversion(), | ||
"php_version_compatible" => version_compare(phpversion(), 5.3, ">="), | ||
"pdo_available" => extension_loaded("PDO"), | ||
"pdo_mysql_available" => extension_loaded("pdo_mysql") | ||
); | ||
|
||
$page_vars["head_string"] =<<< EOF | ||
<script src="{$g_root_url}/modules/system_check/global/scripts/tests.js"></script> | ||
<link type="text/css" rel="stylesheet" href="{$g_root_url}/modules/system_check/global/css/styles.css"> | ||
EOF; | ||
|
||
ft_display_module_page("templates/ft3.tpl", $page_vars); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
/** | ||
* This file gets included if the user has PDO installed on their system. It attempts to check the connection to | ||
* the database using PDO. | ||
*/ | ||
|
||
|
||
function sc_check_pdo_connection($port) | ||
{ | ||
global $g_db_hostname, $g_db_name, $g_db_username, $g_db_password; | ||
|
||
try { | ||
$dsn = sprintf("mysql:host=%s;port=%s;dbname=%s;charset=utf8", $g_db_hostname, $port, $g_db_name); | ||
new PDO($dsn, $g_db_username, $g_db_password, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); | ||
} catch (PDOException $e) { | ||
return array("success" => false, "msg" => $e->getMessage(), "port" => $port); | ||
} | ||
|
||
return array("success" => true, "port" => $port); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
{include file='modules_header.tpl'} | ||
|
||
<table cellpadding="0" cellspacing="0"> | ||
<tr> | ||
<td width="45"><img src="images/icon.png" width="34" height="34" /></td> | ||
<td class="title"> | ||
<a href="../../admin/modules">{$LANG.word_modules}</a> | ||
<span class="joiner">»</span> | ||
<a href="./">{$L.module_name}</a> | ||
<span class="joiner">»</span> | ||
{$L.phrase_ft3_compatibility} | ||
</td> | ||
</tr> | ||
</table> | ||
|
||
{include file="messages.tpl"} | ||
|
||
<div class="margin_bottom_large"> | ||
{$L.text_ft3_compatibility} | ||
</div> | ||
|
||
<table class="list_table" cellspacing="1" cellpadding="0" style="width: 600px"> | ||
<tr> | ||
<th>{$L.word_test}</th> | ||
<th>{$L.word_result}</th> | ||
<th>{$L.word_result}</th> | ||
</tr> | ||
<tr> | ||
<td class="pad_left_small medium_grey">Compatible PHP Version</td> | ||
<td class="pad_left_small">{$php_version}</td> | ||
<td align="center"> | ||
{if $php_version_compatible} | ||
<span class="green">{$LANG.word_pass|upper}</span> | ||
{else} | ||
<span class="red">{$LANG.word_fail|upper}</span> | ||
{/if} | ||
</td> | ||
</tr> | ||
<tr> | ||
<td class="pad_left_small medium_grey">PDO Available</td> | ||
<td class="pad_left_small"> | ||
{if $pdo_available} | ||
{$LANG.word_yes} | ||
{else} | ||
{$LANG.word_no} | ||
{/if} | ||
</td> | ||
<td align="center"> | ||
{if $pdo_available} | ||
<span class="green">{$LANG.word_pass|upper}</span> | ||
{else} | ||
<span class="red">{$LANG.word_fail|upper}</span> | ||
{/if} | ||
</td> | ||
</tr> | ||
<tr> | ||
<td class="pad_left_small medium_grey">PDO-MySQL extension available</td> | ||
<td class="pad_left_small"> | ||
{if $pdo_mysql_available} | ||
{$LANG.word_yes} | ||
{else} | ||
{$LANG.word_no} | ||
{/if} | ||
</td> | ||
<td align="center"> | ||
{if $pdo_mysql_available} | ||
<span class="green">{$LANG.word_pass|upper}</span> | ||
{else} | ||
<span class="red">{$LANG.word_fail|upper}</span> | ||
{/if} | ||
</td> | ||
</tr> | ||
</table> | ||
|
||
{if $php_version_compatible && $pdo_available && $pdo_mysql_available} | ||
|
||
<br /> | ||
|
||
<p><b>Test Database Connection</b></p> | ||
|
||
<p> | ||
This attempts to make a database connection using PDO. By default PDO connects on port <b>3306</b>. | ||
</p> | ||
|
||
<p> | ||
Port: | ||
<input type="text" id="pdo_port" size="6" value="3306" /> | ||
<input type="button" id="pdo_test_btn" value="{$L.phrase_run_test}" onclick="sc_ns.test_pdo_connection()" /> | ||
<span id="pdo_test_loading"></span> | ||
</p> | ||
|
||
<div id="pdo_result_error" class="error pdo_result hidden"> | ||
<div style="padding: 6px"> | ||
Sorry, there was a problem connecting. Here's the error that was returned: | ||
<p><b id="pdo_result_error_msg"></b></p> | ||
</div> | ||
</div> | ||
|
||
<div id="pdo_result_success" class="notify pdo_result hidden"> | ||
<div style="padding: 6px"> | ||
Excellent! You will be able to upgrade to Form Tools 3 without making any changes to your configuration. | ||
</div> | ||
</div> | ||
|
||
<div id="pdo_result_success_with_port" class="notify pdo_result hidden"> | ||
<div style="padding: 6px"> | ||
Excellent! You will be able to upgrade to Form Tools 3 but will need to add the following setting to your | ||
<b>/global/config.php</b> file: | ||
<p><b>$g_db_port = <span id="custom_port"></span>;</b></p> | ||
</div> | ||
</div> | ||
|
||
{/if} | ||
|
||
{include file='modules_footer.tpl'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters