CodeIgniter Forums
Community Auth for CI3 Parse error in Auth_Controller.php line 142 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: External Resources (https://forum.codeigniter.com/forumdisplay.php?fid=7)
+--- Forum: Addins (https://forum.codeigniter.com/forumdisplay.php?fid=13)
+--- Thread: Community Auth for CI3 Parse error in Auth_Controller.php line 142 (/showthread.php?tid=67904)



Community Auth for CI3 Parse error in Auth_Controller.php line 142 - jimconnors - 04-21-2017

Went through the installation process, receiving this error when I try to browse to the root.

Quote:A PHP Error was encountered
Severity: Parsing Error
Message: syntax error, unexpected '[', expecting ')'
Filename: core/Auth_Controller.php
Line Number: 142
Backtrace:

I went to the code in question at application/third_party/community_auth/core/Auth_Controller.php line 142
PHP Code:
        $this->load->library([
            
'session','tokens','Authentication'
        
])->helper([
            
'serialization','cookie'
        
])->model('auth_model'); 

The only thing I can figure is that for whatever reason php doesn't like the use of [] brackets to define the array and expects instead to see array()?  I didn't want to start modifying code that I didn't 100% understand so figured I would post the question as to how best to address this.
Thanks in advance,
Jim


RE: Community Auth for CI3 Parse error in Auth_Controller.php line 142 - skunkbad - 04-21-2017

What version of PHP are you attempting to use this with? You must use at least PHP version 5.4.

See details:

http://php.net/manual/en/language.types.array.php


RE: Community Auth for CI3 Parse error in Auth_Controller.php line 142 - jimconnors - 05-08-2017

(04-21-2017, 05:17 PM)skunkbad Wrote: What version of PHP are you attempting to use this with? You must use at least PHP version 5.4.

See details:

http://php.net/manual/en/language.types.array.php

Confused  I'm an idiot... I was looking at my MySQL version... not PHP.  Updated and solved!  Thanks!