Skip to content

AwareInterface, Graylog2 with Logstash and Contributing to the new PHPUGHH website - PHP UserGroup

link to meetup event.

Where

Jimdo
Stresemannstraße 375
Hamburg

AwareInterface By Stev Leibelt

  • reminder of dependency injection
  • increases the readability of a class structure
  • defined way of inject object/typ
  • interface injection could lead to a project based rule to distinguish between mandatory and optional dependencies
  • slides available hear.

Logstash and Graylog2 by Alexander Bernhardt

Simple log all.

questions to the log

  • what happens on the other server?
  • what happens when and on what circumstance?
  • what are you logging?

how to solve this?

By using Logstash, Redis and ElasicSearch, aggregate all and push all to a graylog2.

  • graylog can do some kind of monitoring, known as streams.
  • you can add a alert method to each stream.
  • nagios can listen to a graylog stream.
  • could not replace statsd or graphite

Talk And Call For PHPUGHH Website By Stephan Vock And Ole Michaelis

  • two Pages for one user group, which one to choose?
  • the usergroup decides to use the new page.
  • you need to have installed jekyll, rake or use the vagrant box
  • directory structure
    • each speaker should pull his own talk below "talks"

How To Contribute

  • fork repository
  • git checkout -b feature/foo
  • do the changes
  • git commit
  • pull request to the main repository
  • github.io builds new page on its own
  • git remote add upstream [email protected]:phpughh/phpughh.github.com
  • git fetch upstream
  • git merge upstream/master
  • git push
  • issues are available
  • enhancement issues is the roadmap
  • open issues if needed
  • links available as ticket
  • take a look to the bephpug (github)
Translate to de es fr it pt ja

some thoughts about AwareInterfaces and InjectorInterfaces

With the newest version of some fancy php frameworks, i got in touch with the terms of dependency injection and service locator. While the ideas behind the to terms a quick clear so far, i wanted to know how dependency injection is implemented. Because of that, i took a look into some implementations and i'm still in the process of getting a feeling of the terms and process for dependency injection.

Nevertheless, i had to use and implement some AwareInterfaces and here are my thoughts about the.

A AwareInterface should have three methods:

  • getObject()
  • hasObject()
  • setObject(\My\Object $object)

If a class is not useable without the object, it should either throw an runtime exception or implement the InjectInterface.

A InjectInterface should only have one method:

  • injectObject()

Currently, i prefer to define InjectInterfaces if they are needed to use a object. The AwareInterface is used as an addition / nice to have object, for example if you want to inject a logger. This leads to situations that a class only implements a "FooInjectInterface" or a "FooAwareInterface".

Lets see where the journey goes. Hopefully i don't have to overturn the position from above.

Update: 2013-10-02
A teammate made the suggestion to rename the "InjectInterface" to "DependentInterface" to keep the naming in sync with the "AwareInterface".

Translate to de es fr it pt ja