Skip to content
Permalink
Browse files

Added check for iconv and mbstring during install. Logic checks for i…

…conv function exists first, if it does then it will not check for mbstring as only 1 is needed.

If neither are available then it will prompt for user to enable mbstring. This is only based on the assumption mbstring is better/quicker and should also be easier to enable in php by a user.
  • Loading branch information...
ecommercehq committed Apr 6, 2014
1 parent 53c376a commit 8f4a58899e5ca0316b3e3be49a1171ccf3b0db26
Showing with 18 additions and 3 deletions.
  1. +9 −2 upload/install/controller/step_2.php
  2. +9 −1 upload/install/view/template/step_2.tpl
@@ -10,7 +10,7 @@ public function index() {
if (isset($this->error['warning'])) {
$this->data['error_warning'] = $this->error['warning'];
} else {
$this->data['error_warning'] = '';
$this->data['error_warning'] = '';
}
$this->data['action'] = $this->url->link('step_2');
@@ -31,7 +31,7 @@ public function index() {
$this->children = array(
'header',
'footer'
);
);
$this->response->setOutput($this->render());
}
@@ -69,6 +69,13 @@ private function validate() {
$this->error['warning'] = 'Warning: ZLIB extension needs to be loaded for OpenCart to work!';
}
if (!function_exists('iconv')) {
// iconv or mbstrings are used in the utf8 helper. Only 1 is needed but suggested to enable mbstring if iconv is not set
if (!extension_loaded('mbstring')) {
$this->error['warning'] = 'Warning: mbstring extension needs to be loaded for OpenCart to work!';
}
}
if (!file_exists(DIR_OPENCART . 'config.php')) {
$this->error['warning'] = 'Warning: config.php does not exist. You need to rename config-dist.php to config.php!';
} elseif (!is_writable(DIR_OPENCART . 'config.php')) {
@@ -93,6 +93,14 @@
<td>On</td>
<td align="center"><?php echo extension_loaded('zlib') ? '<img src="view/image/good.png" alt="Good" />' : '<img src="view/image/bad.png" alt="Bad" />'; ?></td>
</tr>
<?php if (!function_exists('iconv')) { ?>
<tr>
<td>mbstring:</td>
<td><?php echo extension_loaded('mbstring') ? 'On' : 'Off'; ?></td>
<td>On</td>
<td align="center"><?php echo extension_loaded('mbstring') ? '<img src="view/image/good.png" alt="Good" />' : '<img src="view/image/bad.png" alt="Bad" />'; ?></td>
</tr>
<?php } ?>
</table>
</fieldset>
<p>3. Please make sure you have set the correct permissions on the files list below.</p>
@@ -167,4 +175,4 @@
</div>
</form>
</div>
<?php echo $footer; ?>
<?php echo $footer; ?>

0 comments on commit 8f4a588

Please sign in to comment.
You can’t perform that action at this time.