CodeIgniter Forums
CI_Validation has a deprecated constructor - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: CI_Validation has a deprecated constructor (/thread-67635.html)



CI_Validation has a deprecated constructor - cperrot - 03-17-2017

Which version of CI will be ready for PHP7.x?

I am currently running 3.1.3 and some web-hoster just won't let you use error_reporting = ~E_DEPRECATED & ~E_NOTICE & E_ALL
to be able to get rid of these deprecated messages.

Regards

Cedric


RE: CI_Validation has a deprecated constructor - Narf - 03-18-2017

CI runs on PHP 7 just fine, and has for a long time.
There's no CI_Validation class in CI - I don't know where you got that from, but that's your problem.


RE: CI_Validation has a deprecated constructor - InsiteFX - 03-18-2017

Did you check to see what version of PHP they were running?

There was an older version of PHP that showed that error can not remember the version
but I remember getting it and had to turn it off in php.ini.


RE: CI_Validation has a deprecated constructor - cperrot - 03-19-2017

well the system/libraries/validation.php is most definitely a codeigniter file but it might be a remnant of an old CI version.

find the first few lines down below.

/**
* CodeIgniter
*
* An open source application development framework for PHP 4.3.2 or newer
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright © 2008 - 2009, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/

// ------------------------------------------------------------------------

/**
* Validation Class
*
* @package CodeIgniter
* @subpackage Libraries
* @category Validation
* @author ExpressionEngine Dev Team
* @link http://codeigniter.com/user_guide/libraries/validation.html
*/
class CI_Validation {

var $CI;
var $error_string = '';
var $_error_array = array();
var $_rules = array();
var $_fields = array();
var $_error_messages = array();
var $_current_field = '';
var $_safe_form_data = FALSE;
var $_error_prefix = '<p>';
var $_error_suffix = '</p>';



/**
* Constructor


RE: CI_Validation has a deprecated constructor - InsiteFX - 03-19-2017

If you upgraded and followed the instructions then all you needed to do was copy over the ./system folder.