• Getting ready for hacking
Skip to end of metadata
Go to start of metadata

Jumping into the deep end

This section is about how to get ready for developing the great Icinga-web extensions that came to your mind. Although we're trying to make your life as easy as can be, some background knowledge about the technologies used in icinga-web are indispensible (but believe me, it's not too hard :) ).

The languages used: PHP and JavaScript

You should be familiar with the key concepts in PHP and JavaScript. If you're not, here are some good sources that might help you getting an overview about how those languages look like (believe me, it's not too hard).

Start slowly


Icinga-Web is no small web-page that uses some php-inline scripts. It's a web-application. In fact, it's almost two applications: The PHP-Backend which provides authentication and data-access services and the client-side, which provides presentation logic and the GUI.
That's why we use several frameworks like ExtJS, Agavi or Doctrine.
It's not to make beginners life harder, as many think in the first place, but easier! You can find tons of examples in the web, don't have to care about what's going on in the backyard of the frameworks developer, etc.

Don't try to master every detail of the framework in the beginning, that's not necessary. Start with your project or a bug, and work your way to the target step by step. And if you have problems, don't hesitate to ask in the mailing list!

Jump start for JavaScript 

JavaScript is no difficult language, but has very specific behaviours that makes it very extensible. As always, you needn't to know any specific detail about the language to start developing for icinga-web (but it helps).

  • Great presentation on the Google IO conference that gives you a good overview of the language features: [Google IO: Learning to love JavaScript|http://www.youtube.com/watch?v=seX7jYI96GE ]
  • The JavaScript guide on the Mozilla Dev JavaScript pages. Some years ago, I would have killed for a documentation like this. 
  • The ExtJS Documentation. At this time 3.1, but we'll switch to ExtJS 4 as quickly as possible. 

Getting ready for the server side

Icinga-Web uses PHP as it's serverside backend. in order to make routing, parameter and database handling easier, we're relying on 2 Frameworks.

  • Agavi is the base MVC Framework. In normal development, you needn't to know much about the details of this framework. Reading the quickstart guide on their page is recommended.
  • Doctrine (1.x) is used as a database abstraction and ORM layer, allowing you to directly persist objects in your database.
  • PHP itself is documented on the Official PHP site. Make sure to be compatible with PHP 3.2.x. 

Coding guideline

If you want your code to be accepted, it should comply with our icinga-web coding guideline:

  • Open braces always at the end of a line
  • Closed braces always in the new line
  • Intendation: Four spaces, no tabs
  • TBD

Further, you should try to follow the following (general) rules we consider for best practice:

  • Instead of writing huge methods and classes, split it up in smaller parts
  • Documentation of code is good, but write your methods and classes in a way that you can understand it without looking at the comments
  • Eval is evil. If you need it, you are doing something wrong
  • Use the ExtJS/Agavi/AppKit Helper methods and functions instead of writing your own functions for common actions. If something is missing, make it generally accessible and reusable if possible.
  • No labels