Application class is differente, you use "new" keyword because it's the
first class to be created. That's why constructor will perform quite a
bit of initialization.
Do not redefine constructor but instead use init();
$realm defines a top-level name of your application. This impacts all
id= prefixes in your HTML code, form field names and many other things,
such as session name. If you have two application classes which are part
of same web app and may want to use same realm, but in other cases it's
preferably that you keep realm unique on your domain in the interests
of security.