waifung0207 / ci_bootstrap_3

A multi-tenant website template based on CodeIgniter 3 with integration of some useful tools
MIT License
385 stars 316 forks source link

Redeclare of Error class in PHP7 #61

Open uaktags opened 8 years ago

uaktags commented 8 years ago

I seem to be getting an error that the Error class is already in use, so any of the validation functions seem to fail. This is apparently due to PHP7 as can be read in the manual https://secure.php.net/manual/en/class.error.php

Something to keep an eye on. We must rename our error class.

uaktags commented 8 years ago

Change line 77 in Applications/core/My_Controller.php from: $redirect_url = empty($this->mModule) ? 'error' : $this->mModule.'/error'; to $redirect_url = empty($this->mModule) ? 'myerror' : $this->mModule.'/myerror';

Rename Applications/controllers/Error.php to Applications/controllers/Myerror.php

Rename the class in Applications/controllers/Myerror.php from "class Error" to "class Myerror"

Edit as needed. Don't use "myerror" -_-

waifung0207 commented 8 years ago

Thanks for the issue. I will further check with this, and I would prefer rename it to something like "NotFound" instead.

uaktags commented 8 years ago

Definitely: Here's a solution, rename the error controller to syserr or "NotFound" as you suggested: application/config/routes.php:

$route['error/']                         = 'syserr/';