Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert session_save_path from error to warning. Determine if it even exists. #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions health_check/acc.health_check.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ function _check_status()

$vars = array();
$vars['errors'] = array(); // store our errors here
$vars['warnings'] = array(); // store warnings here

// an array of files or directories and the required permission for each
$files = array(
Expand All @@ -246,9 +247,14 @@ function _check_status()
}
}

// check if save_session_path is writable
if (!@is_writable(session_save_path())) {
$vars['errors']["Your PHP session_save_path is not writable"] = "chmod ". decoct(DIR_WRITE_MODE) ." " . session_save_path();
// check if save_session_path exists
if (session_save_path() == '') {
$vars['warnings']["No PHP session_save_path exists"] = "This should not affect EE performance but could affect some addons.";
} else {
// if it exists, is it writable?
if (!@is_writable(session_save_path())) {
$vars['errors']["Your PHP session_save_path is not writable"] = "chmod ". decoct(DIR_WRITE_MODE) ." " . session_save_path();
}
}

// check if extensions are installed
Expand Down
2 changes: 1 addition & 1 deletion health_check/views/filemanager.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="filemanager chunk">
<h5>File Upload Directories</h5>
<h6>File Upload Directories</h6>

<table>
<thead>
Expand Down
25 changes: 23 additions & 2 deletions health_check/views/status.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<div class="status chunk">
<?php
if (isset($errors)) {
echo "<h6>Errors</h6>";
if (count($errors) == 0) {
echo "<p>Everything looks great. All systems go, captain.</p>";
echo "<p>No errors. Everything looks great. All systems go, captain.</p>";
} elseif (count($errors) == 1) {
echo '<p><span class="health_check_badge">1</span> There is 1 potential issue you should check out.</p>';
} else {
Expand All @@ -16,7 +17,27 @@
}
echo "</ul>";
} else {
echo "<p>Everything looks great. All systems go, captain.</p>";
echo "<p>No errors. Everything looks great. All systems go, captain.</p>";
}

if (isset($warnings)) {
echo "<h6>Warnings</h6>";
if (count($warnings) == 0) {
echo "<p>No warnings. Everything looks great. All systems go, captain.</p>";
} elseif (count($warnings) == 1) {
echo '<p><span class="health_check_badge">1</span> There is 1 potential issue you should check out.</p>';
} else {
echo '<p><span class="health_check_badge">'.count($warnings).'</span> There are ' . count($warnings) . ' potential issues you should check out.</p>';
}

echo "<ul>";
foreach($warnings as $warning => $fix) {
echo "<li>{$warning}";
echo "<span>{$fix}</span></li>";
}
echo "</ul>";
} else {
echo "<p>No warnings. Everything looks great. All systems go, captain.</p>";
}
?>
</div> <!-- /.status -->
4 changes: 2 additions & 2 deletions health_check/views/sys_info.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="sysinfo chunk">
<h5>System Info</h5>
<h6>System Info</h6>
<table>
<thead>
<tr>
Expand Down Expand Up @@ -35,7 +35,7 @@
<table>
<thead>
<tr>
<th colspan="2">File permission constants</th>
<th colspan="2">File permission constants</th>
</tr>
</thead>
<tr>
Expand Down
1 change: 1 addition & 0 deletions themes/third_party/health_check/healthcheck.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#health_check .accessorySection {border: none; margin-bottom: 2em;}
#health_check .accessorySection h5 {margin-bottom: 8px !important;}
#health_check .accessorySection h6 {font-size: 16px; margin-bottom: 8px !important; font-weight: normal;}
#health_check p,
#health_check table,
#health_check ul {margin-bottom: 10px;}
Expand Down