/**
  * Constructor
  *
  * @param  \Zend_Application|\Zend_Application_Bootstrap_Bootstrapper $application
  * @return void
  */
 public function __construct($application)
 {
     parent::__construct($application);
     self::$_instanceOfSelf = $this;
     // DIRECTORIES USED BY LOADER
     $dirs = $this->getOption('loaderDirs');
     if ($dirs) {
         $newDirs = array();
         foreach ($dirs as $key => $path) {
             if (defined($key)) {
                 $newDirs[constant($key)] = $path;
             } else {
                 $newDirs[$key] = $path;
             }
         }
         $dirs = $newDirs;
     } else {
         global $GEMS_DIRS;
         // Use $GEMS_DIRS if defined
         if (isset($GEMS_DIRS)) {
             $dirs = array();
             foreach ($GEMS_DIRS as $prefix => $dir) {
                 $dirs[$prefix] = $dir . '/' . strtr($prefix, '_', '/');
             }
         } else {
             // Default setting
             $dirs = array(GEMS_PROJECT_NAME_UC => APPLICATION_PATH . '/classes/' . GEMS_PROJECT_NAME_UC, 'Gems' => GEMS_LIBRARY_DIR . '/classes/Gems');
         }
     }
     // \MUtil_Echo::track($dirs);
     $this->_loaderDirs = array_reverse($dirs);
     foreach ($this->_loaderDirs as $prefix => $path) {
         if ($prefix) {
             \MUtil_Model::addNameSpace($prefix);
         }
     }
     // PROJECT LOADER
     $this->_projectLoader = new \MUtil_Loader_PluginLoader($this->_loaderDirs);
     // FIRE BUG
     $firebug = $application->getOption('firebug');
     $this->_startFirebird = $firebug['log'];
     // START SESSIE
     $sessionOptions['name'] = GEMS_PROJECT_NAME_UC . '_' . md5(APPLICATION_PATH) . '_SESSID';
     $sessionOptions['cookie_path'] = strtr(dirname($_SERVER['SCRIPT_NAME']), '\\', '/');
     $sessionOptions['cookie_httponly'] = true;
     $sessionOptions['cookie_secure'] = APPLICATION_ENV == 'production' || APPLICATION_ENV === 'acceptance';
     \Zend_Session::start($sessionOptions);
 }