public function __construct(App $app, $moduleName, $commandName, $actionName, $initialize = true)
 {
     $this->app = $app;
     $this->moduleName = $moduleName;
     $this->commandName = $commandName;
     $this->actionName = $actionName;
     $this->params = $app->getParams();
     $this->screen = Screen::instance($app);
     $this->trace = $this->params->shift('trace', false);
     $this->isVerbose = $this->params->shift('verbose', false);
     $this->isDebuging = $this->params->shift('debug', false);
     if ($initialize) {
         $this->init();
     }
 }
 public function __construct(App $app)
 {
     $this->app = $app;
     $this->loader = $app->cliLoader();
 }
Exemple #3
0
 /**
  * Create a new module object
  *
  * @param ApplicationBootstrap  $app
  * @param string                $name
  * @param string                $basedir
  */
 public function __construct(ApplicationBootstrap $app, $name, $basedir)
 {
     $this->app = $app;
     $this->name = $name;
     $this->basedir = $basedir;
     $this->cssdir = $basedir . '/public/css';
     $this->jsdir = $basedir . '/public/js';
     $this->libdir = $basedir . '/library';
     $this->configdir = $app->getConfigDir('modules/' . $name);
     $this->appdir = $basedir . '/application';
     $this->localedir = $basedir . '/application/locale';
     $this->formdir = $basedir . '/application/forms';
     $this->controllerdir = $basedir . '/application/controllers';
     $this->runScript = $basedir . '/run.php';
     $this->configScript = $basedir . '/configuration.php';
     $this->metadataFile = $basedir . '/module.info';
 }
Exemple #4
0
 /**
  * Setup internationalization using gettext
  *
  * Uses the preferred user language or the configured default and system default, respectively.
  *
  * @return  self
  */
 protected function setupInternationalization()
 {
     parent::setupInternationalization();
     if ($this->user !== null && $this->user->getPreferences() !== null && ($locale = $this->user->getPreferences()->get('app.language') !== null)) {
         try {
             Translator::setupLocale($locale);
         } catch (Exception $error) {
             Logger::warning('Cannot set locale "' . $locale . '" configured in ' . 'preferences of user "' . $this->user->getUsername() . '"');
         }
     }
     return $this;
 }
Exemple #5
0
 public function __construct(App $app)
 {
     $this->app = $app;
     $this->coreAppDir = $app->getApplicationDir('clicommands');
 }
 /**
  * Create a new TranslationHelper object
  *
  * @param   ApplicationBootstrap    $bootstrap  The application's bootstrap object
  * @param   string                  $locale     The locale to be used by this helper
  */
 public function __construct(ApplicationBootstrap $bootstrap, $locale)
 {
     $this->moduleMgr = $bootstrap->getModuleManager()->loadEnabledModules();
     $this->appDir = $bootstrap->getApplicationDir();
     $this->libDir = $bootstrap->getLibraryDir('Icinga');
     $this->locale = $locale;
 }