Initialize action
167664
public function initializeAction() {
        $this->availablePackages = $this->packageManager->getAvailablePackages();
        $this->activePackages = $this->packageManager->getActivePackages();
    }
420402
public function initializeAction()
    {
        parent::initializeAction();

        $this->extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('ke_search');

        $this->do = GeneralUtility::_GET('do');

        $this->perms_clause = $this->getBackendUser()->getPagePermsClause(1);
        $this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause);

        // check access and redirect accordingly
        $access = is_array($this->pageinfo) ? 1 : 0;

        if (($this->id && $access) || ($this->getBackendUser()->isAdmin() && !$this->id)) {
            //proceed normally
        } else {
            if ($this->getActionName() !== 'alert') {
                $this->redirect('alert', $this->getControllerName());
            }
        }
    }
781594
public function onInit()
    {
        $func = Util::get($this->params, '{init}', null);
        if (is_callable($func)) {
            $this->mapState = $func($data);
        }
    }
660949
public function init()
    {
        if (!$this->opts->action) {
            return $this->addError("Parameter 'action' is required.");
        } else {
            $actionName = strtolower($this->opts->action) . 'Action';
            if (!method_exists($this, $actionName)) {
                return $this->addError(sprintf("Action '$actionName' doesn't exists in '%s' cli script.", get_class($this)));
            }

            $this->action = $actionName;
        }

        $this->initialized = true;
        return $this;
    }
155466
protected function initializeAction()
    {
        parent::initializeAction();
        $this->solrConnectionManager = GeneralUtility::makeInstance(ConnectionManager::class);
        $this->apacheSolrDocumentRepository = GeneralUtility::makeInstance(Repository::class);

    }
1050291
function init()
    {
        $this->rc = rcmail::get_instance();

        // Preferences hooks
        if ($this->rc->task == 'settings') {
            $this->add_hook('preferences_list', array($this, 'prefs_list'));
            $this->add_hook('preferences_save', array($this, 'prefs_save'));
        }
        else { // if ($this->rc->task == 'mail') {
            // add script when not in ajax and not in frame and only in main window
            if ($this->rc->output->type == 'html' && empty($_REQUEST['_framed']) && $this->rc->action == '') {
                $this->add_texts('localization/');
                $this->rc->output->add_label('newmail_notifier.title', 'newmail_notifier.body');
                $this->include_script('newmail_notifier.js');
            }

            if ($this->rc->action == 'refresh') {
                // Load configuration
                $this->load_config();

                $this->opt['basic']   = $this->rc->config->get('newmail_notifier_basic');
                $this->opt['sound']   = $this->rc->config->get('newmail_notifier_sound');
                $this->opt['desktop'] = $this->rc->config->get('newmail_notifier_desktop');

                if (!empty($this->opt)) {
                    // Get folders to skip checking for
                    $exceptions = array('drafts_mbox', 'sent_mbox', 'trash_mbox');
                    foreach ($exceptions as $folder) {
                        $folder = $this->rc->config->get($folder);
                        if (strlen($folder) && $folder != 'INBOX') {
                            $this->exceptions[] = $folder;
                        }
                    }

                    $this->add_hook('new_messages', array($this, 'notify'));
                }
             }
        }
    }
122910
protected function initializeActionMethodArguments()
    {
        if ($this->getOriginalRequest()->getControllerActionName() === 'index') {
            switch ($this->request->getHttpRequest()->getMethod()) {
                case 'POST':
                case 'PUT':
                    $arguments = $this->request->getArguments();
                    if (!isset($arguments[$this->resourceArgumentName])) {
                        $arguments[$this->resourceArgumentName] = [];
                    }
                    $arguments[$this->resourceArgumentName] = array_merge_recursive($arguments[$this->resourceArgumentName],
                        $this->extractRequestBody());
                    $this->request->setArguments($arguments);
                    break;
            }
        }
        parent::initializeActionMethodArguments();
    }
699997
protected void initialize() {

        this.addActionListener(new java.awt.event.ActionListener() { 

        	@Override
        	public void actionPerformed(java.awt.event.ActionEvent e) {
        		log.debug("actionPerformed " + lastInvoker.name() + " " + e.getActionCommand());

        	    try {
        	    	if (multiSelect) {
            	    	performActions(getSelectedHistoryReferences());
        	    		
        	    	} else {
	            	    HistoryReference ref = getSelectedHistoryReference();
		        		if (ref != null) {
		            	    try {
		            	    	performAction(ref);
		                    } catch (Exception e1) {
		    					log.error(e1.getMessage(), e1);
		                    }
		        		} else {
		        			log.error("PopupMenuHistoryReference invoker " + lastInvoker + " failed to get history ref");
		        		}
        	    	}
				} catch (Exception e2) {
					log.error(e2.getMessage(), e2);
				}
        	}
        });
	}
133158
function(action, thisp) {
			var is = this.initialized;
			if (arguments.length) {
				if (is) {
					action.call(thisp);
				} else {
					this._initcallbacks = this._initcallbacks || [];
					this._initcallbacks.push(function() {
						if (gui.debug) {
							try {
								action.call(thisp);
							} catch (exception) {
								console.error(action.toString());
								throw exception;
							}
						} else {
							action.call(thisp);
						}
					});
				}
			}
			return is;
		}
795345
public function init()
	{
	    $sapi = php_sapi_name();
        if($sapi == 'cli')
            return;

		// Set the alias path
		if (Yii::getPathOfAlias('analytics') === false)
            Yii::setPathOfAlias('analytics', realpath(dirname(__FILE__) . '/..'));

        parent::init();

		// Don't load up the analytics.js if we don't have any data
		$providers = $this->getProviders();
		if (empty($providers))
			return;

		// Conver options into json
		$json = CJSON::encode($providers);

		// Load up the asset manager
		$asset = Yii::app()->assetManager->publish(__DIR__.DS.'assets'.DS.'js', true, -1, YII_DEBUG);
		$cs    = Yii::app()->getClientScript();

		// Register the appropriate script file
		$cs->registerScriptFile($asset . (YII_DEBUG ? '/analytics.js' : '/analytics.min.js'));

		// Initialize
		$cs->registerScript('analytics.js', "analytics.initialize({$json}); analytics.page();");

		if ($this->lowerBounceRate)
		{
			$cs->registerScript('analytics.js-bounce-rate-15', 'setTimeout(function() { analytics.track("_trackEvent", "15 Seconds"); }, 15000 );');
			$cs->registerScript('analytics.js-bounce-rate-30', 'setTimeout(function() { analytics.track("_trackEvent", "30 Seconds"); }, 30000 );');
			$cs->registerScript('analytics.js-bounce-rate-60', 'setTimeout(function() { analytics.track("_trackEvent", "60 Seconds"); }, 60000 );');
		}

	}
1328365
public function init()
    {
        parent::init();

        if (!isset($this->actionOptions['id'])) {
            $this->actionOptions['id'] = $this->options['id'] . '-action';
        }
        if (!isset($this->actionOptions['class'])) {
            $this->actionOptions['class'] = 'btn btn-gold btn-sm phone-captcha';
        }

        $this->actionLabel = \Yii::t('app', $this->actionLabel);
    }
958994
function init()
    {
        $this->add_js();

        $action = rcube_utils::get_input_value('_a', rcube_utils::INPUT_GPC);

        if ($this->rc->action == 'plugin.enigmakeys') {
            switch ($action) {
                case 'delete':
                    $this->key_delete();
                    break;
/*
                case 'edit':
                    $this->key_edit();
                    break;
*/
                case 'import':
                    $this->key_import();
                    break;

                case 'export':
                    $this->key_export();
                    break;

                case 'generate':
                    $this->key_generate();
                    break;

                case 'create':
                    $this->key_create();
                    break;

                case 'search':
                case 'list':
                    $this->key_list();
                    break;

                case 'info':
                    $this->key_info();
                    break;
            }

            $this->rc->output->add_handlers(array(
                    'keyslist'     => array($this, 'tpl_keys_list'),
                    'keyframe'     => array($this, 'tpl_key_frame'),
                    'countdisplay' => array($this, 'tpl_keys_rowcount'),
                    'searchform'   => array($this->rc->output, 'search_form'),
            ));

            $this->rc->output->set_pagetitle($this->enigma->gettext('enigmakeys'));
            $this->rc->output->send('enigma.keys');
        }
/*
        // Preferences UI
        else if ($this->rc->action == 'plugin.enigmacerts') {
            $this->rc->output->add_handlers(array(
                    'keyslist'     => array($this, 'tpl_certs_list'),
                    'keyframe'     => array($this, 'tpl_cert_frame'),
                    'countdisplay' => array($this, 'tpl_certs_rowcount'),
                    'searchform'   => array($this->rc->output, 'search_form'),
            ));

            $this->rc->output->set_pagetitle($this->enigma->gettext('enigmacerts'));
            $this->rc->output->send('enigma.certs'); 
        }
*/
        // Message composing UI
        else if ($this->rc->action == 'compose') {
            $this->compose_ui();
        }
    }
315754
static public function initialize()
    {
        if (!self::$_instance) {
            $cn = get_called_class();
            self::$_instance = new $cn();
            self::$_instance->name = substr($cn, 0, strpos($cn, '\\'));
        }
        self::$_instance->boot();
        
        if (Rails::cli())
            Rails::console()->run();
    }
271145
function init(): void {
    $helpers = [
      'app' => \Yii::$app,
      'format' => new helpers\Format,
      'html' => new helpers\Html,
      'i18n' => new helpers\I18N,
      'url' => new helpers\Url
    ];

    $options = [
      'charset' => \Yii::$app->charset,
      'entity_flags' => ENT_QUOTES | ENT_SUBSTITUTE,
      'escape' => [Html::class, 'encode'],
      'helpers' => ArrayHelper::merge($helpers, $this->helpers),
      'partials_loader' => new Loader(['viewRenderer' => $this]),
      'strict_callables' => true
    ];

    if ($this->enableCaching) {
      /** @var \yii\caching\Cache $cache */
      $cache = Instance::ensure($this->cache, \yii\caching\Cache::class);
      $this->cache = $cache;
      $options['cache'] = new Cache(['viewRenderer' => $this]);
    }

    if ($this->enableLogging) $options['logger'] = new Logger;
    $this->engine = new \Mustache_Engine($options);

    parent::init();
    $this->helpers = [];
  }
78895
def init_command(self, action, flags=None):
    '''
    '''

    if not isinstance(action, list):
        action = [action]      
    cmd = ['singularity'] + action

    if self.quiet is True:
        cmd.insert(1, '--quiet')
    if self.debug is True:
        cmd.insert(1, '--debug')

    return cmd
910847
protected function initializeControllerContext()
    {

        $request = new ActionRequest(Request::createFromEnvironment());
        $request->setDispatched(true);
        if (isset($this->flowHttpSettings['baseUri'])) {
            $request->getHttpRequest()->setBaseUri(new Uri($this->flowHttpSettings['baseUri']));
        }

        $response = new Response();

        $uriBuilder = new UriBuilder();
        $uriBuilder->setRequest($request);

        $arguments = new Arguments(array());

        $this->controllerContext = new ControllerContext($request, $response, $arguments, $uriBuilder);
    }
794581
public function actionInit() : void
    {
        $this->initSURole();
        $config = $this->loadConfig();
        $this->applyConfig($config);
        $this->applyAssignConfig($config);
        $this->addAssignmentsToSu();
        $this->log(true);
    }