Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variety of changes for PHP agent #5

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jrschumacher
Copy link

I made a number of changes to the PHP agent. Each commit is the iteration of changes and should describe what I did. In brief:

  • Moved classes into their own files
  • Append Loggr_ to each class as to not pollute the global space (thought about namespaces, but probably too limiting to your audience)
  • Fixed lack of references in Fluent Events class (when returning $this)
  • Deprecated some methods in Fluent Events (all the formatting methods) and added formatting ability to non-F methods
  • Added a number of enhancements to Fluent Events methods including trimming all whitespace, typecasting, geo IP support
  • Various housecleaning

I tried to keep this as backwards compatible as possible, but for various reasons something are not possible. I will work on updated the Markdown file for instructions and more detail use of the library.

Lastly, have not tested in < PHP 5.3 so will need to do that... :/

Let me know if you notice anything or what-not.

…rds compatibility, updated tests

Separated logger classes into multiple files to keep with common OOP PHP library development.

Prefixed classes with Loggr so as to not pollute global space with common terms such as Event or Events, etc.

Added static functions for semi-backwards compatibility. In test.php an example showed LogClient() created Loggr::LogClient, but of course Loggr_LogClient could be used as well.
- nl2br instead of str_replace
- comments
- use ' instead of " unless new line
Loggr Fluent Events
- deprecated formatting methods in favor of method with formatting support
- removed latitude and longitude in geo method in favor of geo var, added support for IP address (either defined or automatic)
- updated post method to require text attribute or bail returning this (optional: turn off suppress errors so you can debug)
- updated value to cast all input as float (since Loggr doc says it does it too)
- added addValue and subValue which adds value by input or subtracts value by input, respectively
- added support for arrays of tags, joins array by space
- added trimming of input to all methods to reduce unnecessary white space and bytes
- added datatype comparison of case-insensitive 'html' to either use html or plaintext

Loggr Log Client
- cleaned up spacing and added geo support
- added tag array test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant