Skip to content

Add method to parse a supplied User Agent string.#970

Closed
CroNiX wants to merge 1 commit into
bcit-ci:developfrom
CroNiX:patch-1
Closed

Add method to parse a supplied User Agent string.#970
CroNiX wants to merge 1 commit into
bcit-ci:developfrom
CroNiX:patch-1

Conversation

@CroNiX
Copy link
Copy Markdown
Contributor

@CroNiX CroNiX commented Jan 25, 2012

CI has a pretty good user agent parser, but, why limit it to only the current user? There are times where it is useful to be able to parse a string, like processing log files or the user session table, and be able to use the goodness built into this class.

@CroNiX
Copy link
Copy Markdown
Contributor Author

CroNiX commented Apr 24, 2012

@jamesmills You mentioned earlier that it didn't work for you and you were receiving fatal errors. I did test it when I committed it, but that was 3 months ago and I haven't tried it with the changes implemented in CI since then. Is it working for you now or ?

@jamesmills
Copy link
Copy Markdown

Hi,

I did make a comment and I submitted it and then I realised I was commenting on the wrong post! I was also reading a blog post you had put up saying that you can put this in MY_User_agent.php but if you do that you will get errors because its calling private functions in CI_User_agent.php.

I have copied your code into my CI_User_agent.php (it hurt doing it) so that I can use it in one of the projects I am working on at the moment. I spoke to Phil and he said there were issues because it clears the active users info... he also added a comment that in CI3 there will not be a problem adding it to MY_User_agent... Hummmm....

Thanks for the code. Its in a live project and its working well. I will keep my eye on this!

James

@CroNiX
Copy link
Copy Markdown
Contributor Author

CroNiX commented Apr 24, 2012

Yes, I thought about adding a method to reset it so that it will continue to use the current users info instead of the supplied one, but no one seemed interested in this until now so I never got around to it. It did work in MY_User_agent when I wrote it. They might have redeclared some properties/methods since then. I'm glad you find it useful.

@FDiskas
Copy link
Copy Markdown

FDiskas commented May 8, 2012

Go go go - I need this to.

narfbg added a commit that referenced this pull request Jan 8, 2014
@narfbg
Copy link
Copy Markdown
Contributor

narfbg commented Jan 8, 2014

Because this PR is 2 years old, I took the freedom to implement it myself instead of asking you to make corrections. See the above referenced commit.

@narfbg narfbg closed this Jan 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants