0
class CMSInstallerPage1 extends CMSInstallerPage
0
function CMSInstallerPage1(&$smarty, $errors)
0
$this->CMSInstallerPage(1, $smarty, $errors);
0
$this->continueon = true;
0
$this->special_failed = false;
0
$this->images = array();
0
- $this->images['true'] = '<img src="images/true.gif" alt="Success" height="16" width="16" border="0" />';
0
- $this->images['false'] = '<img src="images/false.gif" alt="Failure" height="16" width="16" border="0" />';
0
- $this->images['red'] = '<img src="images/red.gif" alt="Failure" height="16" width="16" border="0" />';
0
+ $this->images['true'] = '<img src="images/true.gif" alt="Success" height="16" width="16" border="0" />';
0
+ $this->images['false'] = '<img src="images/false.gif" alt="Failure" height="16" width="16" border="0" />';
0
+ $this->images['red'] = '<img src="images/red.gif" alt="Failure" height="16" width="16" border="0" />';
0
$this->images['yellow'] = '<img src="images/yellow.gif" alt="Caution" height="16" width="16" border="0" />';
0
- $this->images['green']
= '<img src="images/green.gif" alt="Success" height="16" width="16" border="0" />';
0
+ $this->images['green']
= '<img src="images/green.gif" alt="Success" height="16" width="16" border="0" />';
0
function assignVariables()
0
@@ -54,10 +55,10 @@ class CMSInstallerPage1 extends CMSInstallerPage
0
$settings['recommended'][] = $this->testBoolean(0, 'Checking for basic XML (expat) support', function_exists('xml_parser_create'), 'XML support is not compiled into your php install. You can still use the system, but will not be able to use any of the remote module installation functions.');
0
- $settings['recommended'][] = $this->test
Boolean(0, 'Checking file uploads', ini_get('file_uploads'), 'You will not be able to use any of the file uploading facilities included in CMS Made Simple. If possible, this restriction should be lifted by your system admin to properly use all file management features of the system. Proceed with caution.');
0
+ $settings['recommended'][] = $this->test
IniBoolean(0, 'Checking file uploads', 'file_uploads', 'When file uploads are disabled you will not be able to use any of the file uploading facilities included in CMS Made Simple. If possible, this restriction should be lifted by your system admin to properly use all file management features of the system. Proceed with caution.');
0
- $settings['recommended'][] = $this->testRange('Checking PHP memory limit', ini_get('memory_limit'), '8M', '128M', 'You may not have enough memory to run CMSMS correctly. If possible, you should try to get your system admin to raise this value to 128M or greater. Proceed with caution.', true);
0
- $settings['recommended'][] = $this->testRange('Checking max upload file size', ini_get('upload_max_filesize'), '2M', '10M', 'You will probably not be able to upload larger files using the included file management functions. Please be aware of this restriction.', true);
0
+ $settings['recommended'][] = $this->testIniRange(0, 'Checking PHP memory limit', 'memory_limit', '8M', '128M', 'You may not have enough memory to run CMSMS correctly. If possible, you should try to get your system admin to raise this value. Proceed with caution.');
0
+ $settings['recommended'][] = $this->testIniRange(0, 'Checking max upload file size', 'upload_max_filesize', '2M', '10M', 'You will probably not be able to upload (larger) files using the included file management functions. Please be aware of this restriction.');
0
$f = cms_join_path(CMS_BASE, 'uploads');
0
$settings['recommended'][] = $this->testBoolean(0, "Checking if $f is writable", is_writable($f), 'The uploads folder is not writable. You can still install the system, but you will not be able to upload files via the Admin Panel.');
0
$f = cms_join_path(CMS_BASE, 'modules');
0
@@ -69,7 +70,7 @@ class CMSInstallerPage1 extends CMSInstallerPage
0
$settings['recommended'][] = $this->testBoolean(0, 'Checking if ini_set works', $result, 'Although the ability to override php ini settings is not mandatory, some addon (optional) functionality uses ini_set to extend timeouts, and allow uploading of larger files, etc. You may have difficulty with some addon functionality without this capability.');
0
$settings['recommended'][] = $this->testBoolean(0, 'Checking if sessions are enabled', isset($_GET['sessiontest']) && isset($_SESSION['test']), 'Although the PHP support for sessions is not mandatory, it is highly recommended. Logins and other things may slow down and you may have difficulty with some addon functionality without this capability.');
0
$settings['recommended'][] = $this->testBoolean(0, 'Checking for tokenizer functions', function_exists('token_get_all'), 'Not having the tokenizer could cause pages to render as purely white. We recommend you have this installed, but your website may work fine without it.');
0
- $settings['recommended'][] = $this->test
Boolean(0, 'Checking for Safe mode', (! (bool) ini_get('safe_mode')), 'PHP Safe mode could create some problems with uploading files and other functions. It all depends on how strict your server safe mode settings are.');
0
+ $settings['recommended'][] = $this->test
IniBoolean(0, 'Checking for Safe mode', 'safe_mode', 'PHP Safe mode could create some problems with uploading files and other functions. It all depends on how strict your server safe mode settings are.', true);
0
$this->smarty->assign('images', $this->images);
0
@@ -78,44 +79,67 @@ class CMSInstallerPage1 extends CMSInstallerPage
0
$this->smarty->assign('special_failed', $this->special_failed);
0
- function & testBoolean($required, $title, $result, $message = NULL)
0
+ * @var boolean $required
0
+ * @var boolean $result
0
+ * @var string $message
0
+ function & testBoolean($required, $title, $result, $message = '')
0
$test =&new StdClass();
0
+ if (
(bool) $result == false)
0
- $this->continueon = false;
0
- $this->special_failed = true;
0
+ $required == true ? $this->continueon = false : $this->special_failed = true;
0
+ if (trim($message) != '')
0
$test->message = $message;
0
- $test->resultimage = $required ? $this->images['true'] : $this->images['green'];
0
+ $test->resultimage = $required ? $this->images['false'] : $this->images['yellow'];
0
- $test->resultimage = $required ? $this->images['
false'] : $this->images['yellow'];
0
+ $test->resultimage = $required ? $this->images['
true'] : $this->images['green'];
0
- function & testRange($title, $value, $minimum, $recommended, $message = NULL, $compare_as_bytes = false)
0
+ * @var boolean $required
0
+ * @var boolean $result
0
+ * @var string $message
0
+ * @var boolean $negative_test
0
+ function & testIniBoolean($required, $title, $varname, $message = '', $negative_test = false)
0
+ $str = ini_get($varname);
0
+ $result = $negative_test ? (! (bool) $str) : (bool) $str;
0
+ return $this->testBoolean($required, $title, $result, $message);
0
+ * @var boolean $required
0
+ * @var mixed $recommended
0
+ * @var string $message
0
+ * @var boolean $test_as_bytes
0
+ function & testRange($required, $title, $value, $minimum, $recommended, $message = '', $test_as_bytes = false)
0
$test =& new StdClass();
0
- $test->title = $title . " (min $minimum, recommend $recommended)";
0
+ $test->title = $title . " (min $minimum, recommend $recommended)";
0
- if (
! is_int($minimum) && ! is_int($recommended) && $compare_as_bytes == TRUE)
0
$value = $this->returnBytes($value);
0
$minimum = $this->returnBytes($minimum);
0
@@ -125,7 +149,7 @@ class CMSInstallerPage1 extends CMSInstallerPage
0
$test->resultimage = $this->images['red'];
0
- $
this->special_failed = true;
0
+ $
required == true ? $this->continueon = false : $this->special_failed = true;
0
elseif ($value < $recommended)
0
@@ -136,7 +160,7 @@ class CMSInstallerPage1 extends CMSInstallerPage
0
$test->resultimage = $this->images['green'];
0
- if ($value < $recommended
)
0
+ if ($value < $recommended
&& trim($message) != '')
0
$test->message = $message;
0
@@ -144,20 +168,58 @@ class CMSInstallerPage1 extends CMSInstallerPage
0
- function returnBytes($val) {
0
- $last = strtolower($val{strlen($val)-1});
0
+ * @var boolean $required
0
+ * @var string $varname
0
+ * @var string $minimum
0
+ * @var string $recommended
0
+ * @var string $message
0
+ * @var boolean $test_as_bytes
0
+ function & testIniRange($required, $title, $varname, $minimum, $recommended, $message = '', $test_as_bytes = true)
0
+ $str = ini_get($varname);
0
+ $error = 'Could not retrieve a value.... passing anyways.';
0
+ if ((string) get_cfg_var($varname) != '')
0
+ $str = (string) get_cfg_var($varname);
0
+ $error .= '<br />Displaying the value originally set in the config file (this may not be accurate).';
0
+ $test =& $this->testRange($required, $title, $str, $minimum, $recommended, $message, $test_as_bytes);
0
- // The 'G' modifier is available since PHP 5.1.0
0
+ $test->error = $error;
0
+ function returnBytes($val)
0
+ if (is_string($val) && $val != '')
0
+ $last = strtolower($val{strlen($val)-1});
Comments
No one has commented yet.