Welcome Guest, Not a member yet? Register   Sign In
Uses of userdata() without params on Profiler Class
#1

Hi, I was starting a new project in CI 2.2.x when version 3 comes to live. I follow all the instrucions to migrate from one version to another and it works fine, but when uses profiler. Using Profiler class along with Session class gives me a Warning Error for a use of Session's Class method userdata() without params. I check out the implementation and it does not suppor default params, but in Profiler Class, line 531 is called that method without params. I changed this to $this->CI->session->all_userdata() (I read is an alias of userdata()) an the warning goes away. Is that a bug or am I doing something wrong migrating?
Reply
#2

Not a bug at all...My mistake migrating...old Session class was left on libraries folder, because new library class is relocated to ...libraries/session/session.php
Reply
#3

This seems odd, since the definition of the userdata method clearly shows a default value of NULL on its single argument: https://github.com/bcit-ci/CodeIgniter/b...n.php#L656

The 2.2.1 version of the session library does not include a default value for the argument, though: https://github.com/bcit-ci/CodeIgniter/b...n.php#L448

It seems that you either have a modified session library loading which was written for CI 2.x or you didn't overwrite your 2.2.1 session library with the 3.0rc3 library.
Reply
#4

Yes, it was my mistake, I did migration following the steps on the user guide, but it does not mention that Session class was relocated to a folder named Session in libraries folder, so I did overwrite the system folder but I did not delete the old Session class, so CI keep using the old version. I think it could be cleared up in the user guide, just for not so smart people like me Wink
Reply
#5

(03-18-2015, 11:50 AM)jpleyjon Wrote: Yes, it was my mistake, I did migration following the steps on the user guide, but it does not mention that Session class was relocated to a folder named Session in libraries folder, so I did overwrite the system folder but I did not delete the old Session class, so CI keep using the old version. I think it could be cleared up in the user guide, just for not so smart people like me  Wink

Overriding stock libraries (as well as using hooks) always comes with the assumption that you know what you're doing and the responsibility for you to follow changes that are internal to the framework. We can't maintain documentation for such things.
Reply
#6

@Narf, I think he is saying that he upgraded CI by copying the CI 3 system files over top of the CI 2 files and it retained the old session class because it was moved in CI 3. Sounds like the best bet would be to delete the CI 2 system folder before copying in CI 3.
Reply
#7

@zepernick that's right. I'm just saying that user guide does not mention that session class was relocated, I think you're right, the best way is delete system folder and paste the new file after.
Reply
#8

Well, step 1 of the upgrade instructions for all CI releases starts with the following:

Quote:Replace all files and directories in your “system” folder

Smile
Reply
#9

@Narf, English is not my mother langague..so I read "replace" and I overwrite system folder, thought it was the same..my bad then..
Reply




Theme © iAndrew 2016 - Forum software by © MyBB