Initialize the plugin
433616
def initialize_plugin(self):
        
        # Generate a list of blacklisted packages from the configuration and
        # store it into self.blacklist_package_names attribute so this
        # operation doesn't end up in the fastpath.
        if not self.whitelist_package_names:
            self.whitelist_package_names = self._determine_unfiltered_package_names()
            logger.info(
                f"Initialized project plugin {self.name}, filtering "
                + f"{self.whitelist_package_names}"
            )
898320
protected function init()
    {
        $this->bindContainerObjects();
        $this->metaFile = storage_path('cms/disabled.json');
        $this->loadDisabled();
        $this->loadPlugins();

        if ($this->app->runningInBackend()) {
            $this->loadDependencies();
        }
    }
78416
public function _initialize()
    {
        parent::_initialize();

        $this->configBackCompat();

        $adminPath = $this->config['adminPath'];
        $this->loginUrl = str_replace('wp-admin', 'wp-login.php', $adminPath);
        $this->adminPath = rtrim($adminPath, '/');
        $this->pluginsPath = $this->adminPath . '/plugins.php';
    }
964680
public static function init() {

		// bail if the CTFW_Widget class is loaded elsewhere
		if( class_exists( 'CTFW_Widget' ) ){
			return;
		}

		$pluginDir = untrailingslashit( plugin_dir_path( __FILE__ ) );
		$pluginURL = untrailingslashit( plugin_dir_url( __FILE__ ) );

		define( 'CTFW_WIDGETS_INC_DIR', $pluginDir . '/includes' );
		define( 'CTFW_WIDGETS_CLASS_DIR', CTFW_WIDGETS_INC_DIR . '/classes' );
		define( 'CTFW_WIDGETS_ADMIN_DIR', CTFW_WIDGETS_INC_DIR . '/admin' );
		define( 'CTFW_WIDGETS_WIDGET_TEMPLATE_DIR', CTFW_WIDGETS_INC_DIR . '/widget-templates' );
		define( 'CTFW_WIDGETS_JS_DIR', CTFW_WIDGETS_INC_DIR . '/js' );
		define( 'CTFW_WIDGETS_CSS_DIR', CTFW_WIDGETS_INC_DIR . '/css' );
		define( 'CTFW_WIDGETS_DIR_URL', $pluginURL );
		define( 'CTFW_WIDGETS_JS_DIR_URL', $pluginURL . '/js' );
		define( 'CTFW_WIDGETS_CSS_DIR_URL', $pluginURL . '/css' );
		define( 'CTFW_WIDGETS_VERSION', 1.0 );

        add_action( 'plugins_loaded', array( __CLASS__, 'setup') );

    }
849944
public void load() {
        PluginDefinition definition = getDefinition();

        if (!initialized && definition != null) {
            BaseComponent top;

            try {
                initialized = true;
                top = container.getFirstChild();

                if (top == null) {
                    top = PageUtil.createPage(definition.getUrl(), container).get(0);
                }
            } catch (Throwable e) {
                container.destroyChildren();
                throw createChainedException("Initialize", e, null);
            }

            if (pluginControllers != null) {
                for (Object controller : pluginControllers) {
                    top.wireController(controller);
                }
            }

            findListeners(container);
            executeAction(PluginAction.LOAD, true);
        }
    }
257141
public static function init() {

		if ( self::can_switch_themes() ) {
			add_action( 'admin_bar_menu', array( __CLASS__, 'admin_bar_menu' ), 90 );
			add_action( 'wp_ajax_tts_set_theme', array( __CLASS__, 'set_theme' ) );
		}

		load_plugin_textdomain( 'toolbar-theme-switcher', false, dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/lang' );
	}
1262218
public function callInitialize()
    {
        foreach ($this->pluginCollection as $plugin) {
            $subscriber = new EventSubscriber();
            $plugin->initialize($subscriber);

            $this->eventSubscriberPlugins[] = [$plugin, $subscriber];

            $this->addListeners($plugin, $subscriber);
        }
    }
605765
protected function initialize()
    {
        // Sanity check; must be on (or after) `plugins_loaded` hook.
        // If uninstalling, must be on (or after) `init` hook.

        if (!did_action('plugins_loaded')) {
            throw new Exception('`plugins_loaded` action not done yet.');
        } elseif ($this->Config->§uninstall && !did_action('init')) {
            throw new Exception('`init` action not done yet.');
        }
        // Check for any known conflicts.

        if ($this->s::conflictsExist()) {
            return; // Stop here.
        }
        // Check for any unsatisfied dependencies.

        if ($this->s::dependenciesUnsatisfied()) {
            return; // Stop here.
        }
        // Add app instance to collection.

        if ($this->Parent && $this->Parent->is_core && !$this->Config->§uninstall) {
            $this->Parent->s::addApp($this);
        }
        // Remaining routines are driven by setup hook.

        if ($this->Config->§uninstall || did_action($this->Config->§setup['§hook'])) {
            $this->onSetup(); // Run setup immediately.
        } else { // Delay setup routines; i.e., attach to hook.
            add_action($this->Config->§setup['§hook'], [$this, 'onSetup'], $this->Config->§setup['§hook_priority']);
        }
    }
648809
public static function init()
    {
        /*
         * Push the Services into the Dependency Injector.
         */
        call_user_func(function() {
            if (file_exists(self::$basePath . '/.manifest/plugins/services.php')) {
                /** @noinspection PhpIncludeInspection */
                include self::$basePath . '/.manifest/plugins/services.php';
            }
            /** @noinspection PhpIncludeInspection */
            require self::$basePath . '/boot/services.php';
        });

        /*
         * Bootstrap the framework.
         */
        call_user_func(function() {
            /** @noinspection PhpIncludeInspection */
            require self::$basePath . '/boot/bootstrap.php';
            if (file_exists(self::$basePath . '/.manifest/plugins/bootstrap.php')) {
                /** @noinspection PhpIncludeInspection */
                include self::$basePath . '/.manifest/plugins/bootstrap.php';
            }
        });
    }
366753
public function init()
    {
        parent::init();
        $this->pluginOptions['carousel'] = true;
        $this->pluginOptions['container'] = '#' . $this->htmlOptions['id'] . '-videocarousel';
    }
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();
        }
    }
795274
public function init()
	{
		if ($this->language === null) {
			$this->language = App::$Request->getLanguage();
		}

        if ($this->targetClass === null) {
            $this->targetClass = 'wysiwyg';
        }

        if ($this->config === null || !Arr::in($this->config, ['config-small', 'config-full', 'config-medium'])) {
            $this->config = 'config-default';
        }

        $this->baseUrl = App::$Alias->scriptUrl . '/vendor/phpffcms/ffcms-ckeditor/assets';
	}
85439
public function init()
    {
        // get some helper functions
        $this->div = GeneralUtility::makeInstance(PluginBaseHelper::class, $this);

        $this->typoScriptService = GeneralUtility::makeInstance(TypoScriptService::class);
        // set start of query timer
        if (!$GLOBALS['TSFE']->register['ke_search_queryStartTime']) {
            $GLOBALS['TSFE']->register['ke_search_queryStartTime'] = GeneralUtility::milliseconds();
        }

        // make settings from flexform available in general configuration ($this->conf)
        $this->moveFlexFormDataToConf();

        // in pi2 (the list plugin) fetch the configuration from pi1 (the search
        // box plugin) since all the configuration is done there
        if (!empty($this->conf['loadFlexformsFromOtherCE'])) {
            $data = $this->pi_getRecord('tt_content', intval($this->conf['loadFlexformsFromOtherCE']));
            $this->cObj->data = $data;
            $this->moveFlexFormDataToConf();
        }

        // clean piVars
        $this->piVars = $this->div->cleanPiVars($this->piVars);

        // get preselected filter from rootline
        $this->getFilterPreselect();

        // add stdWrap properties to each config value (not to arrays)
        foreach ($this->conf as $key => $value) {
            if (!is_array($this->conf[$key])) {
                $this->conf[$key] = $this->cObj->stdWrap($value, $this->conf[$key . '.']);
            }
        }

        // set some default values (this part have to be after stdWrap!!!)
        if (!$this->conf['resultPage']) {
            $this->conf['resultPage'] = $GLOBALS['TSFE']->id;
        }
        if (!isset($this->piVars['page'])) {
            $this->piVars['page'] = 1;
        } else {
            // redirect ones after search submit to get nice looking url
            if ($this->piVars['redirect'] === 0) {
                $this->piVars['redirect'] = 1;
                $red_url = $this->pi_linkTP_keepPIvars_url();
                HttpUtility::redirect($red_url);
            }
        }
        if (!empty($this->conf['additionalPathForTypeIcons'])) {
            $this->conf['additionalPathForTypeIcons'] = rtrim($this->conf['additionalPathForTypeIcons'], '/') . '/';
        }

        // hook: modifyFlexFormData
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFlexFormData'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFlexFormData'] as $_classRef) {
                $_procObj = &GeneralUtility::makeInstance($_classRef);
                $_procObj->modifyFlexFormData($this->conf, $this->cObj, $this->piVars);
            }
        }

        // prepare database object
        $this->db = GeneralUtility::makeInstance(Db::class, $this);

        // set startingPoints
        $this->startingPoints = $this->div->getStartingPoint();

        // get filter class
        $this->filters = GeneralUtility::makeInstance(Filters::class);

        // get extension configuration array
        $this->extConf = SearchHelper::getExtConf();
        $this->extConfPremium = SearchHelper::getExtConfPremium();

        // initialize filters
        $this->filters->initialize($this);

        // get first startingpoint
        $this->firstStartingPoint = $this->div->getFirstStartingPoint($this->startingPoints);

        // build words searchphrase
        /** @var Searchphrase $searchPhrase */
        $searchPhrase = GeneralUtility::makeInstance(Searchphrase::class);
        $searchPhrase->initialize($this);
        $searchWordInformation = $searchPhrase->buildSearchPhrase();

        // Hook: modifySearchWords
        if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifySearchWords'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifySearchWords'] as $classRef) {
                $hookObj = GeneralUtility::makeInstance($classRef);
                if (method_exists($hookObj, 'modifySearchWords')) {
                    $hookObj->modifySearchWords($searchWordInformation, $this);
                }
            }
        }

        // set searchword and tag information
        $this->sword = $searchWordInformation['sword'];
        $this->swords = $searchWordInformation['swords'];
        $this->wordsAgainst = $searchWordInformation['wordsAgainst'];
        $this->scoreAgainst = $searchWordInformation['scoreAgainst'];
        $this->tagsAgainst = $searchWordInformation['tagsAgainst'];

        $this->isEmptySearch = $this->isEmptySearch();

        // Since sorting for "relevance" in most cases ist the most useful option and
        // this sorting option is not available until a searchword is given, make it
        // the default sorting after a searchword has been given.
        // Set default sorting to "relevance" if the following conditions are true:
        // * sorting by user is allowed
        // * sorting for "relevance" is allowed (internal: "score")
        // * user did not select his own sorting yet
        // * a searchword is given
        $isInList = GeneralUtility::inList($this->conf['sortByVisitor'], 'score');
        if ($this->conf['showSortInFrontend'] && $isInList && !$this->piVars['sortByField'] && $this->sword) {
            $this->piVars['sortByField'] = 'score';
            $this->piVars['sortByDir'] = 'desc';
        }

        // after the searchword is removed, sorting for "score" is not possible
        // anymore. So remove this sorting here and put it back to default.
        if (!$this->sword && $this->piVars['sortByField'] == 'score') {
            unset($this->piVars['sortByField']);
            unset($this->piVars['sortByDir']);
        }

        // perform search at this point already if we need to calculate what
        // filters to display.
        if ($this->conf['checkFilterCondition'] != 'none') {
            $this->db->getSearchResults();
        }

        // add cssTag to header if set
        $cssFile = $GLOBALS['TSFE']->tmpl->getFileName($this->conf['cssFile']);
        if (!empty($cssFile)) {
            /** @var \TYPO3\CMS\Core\Page\PageRenderer $pageRenderer */
            $pageRenderer = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class);
            $pageRenderer->addCssFile($cssFile);
        }
    }
662270
public function init()
	{
		parent::init();

		self::$plugin = $this;

		$requestService = Craft::$app->getRequest();

		$this->setComponents([
            'methods' => Service::class,
        ]);

		$this->_configureTemplateVariable();

		if ($requestService->getIsCpRequest())
		{
			$this->_configureCpResources();
			$this->_configureAssetThumbnails();
			$this->_configureAssetIndexAttributes();
		}
	}
862655
public function init() {
        if (null != $this->url) {
            $this->pluginOptions['url'] = $this->url;
        } else {
            $this->pluginOptions['url'] = Url::to([$this->view->context->id.'/nodeMove']);
        }

		parent::init();
		$this->registerAssets();

        Html::addCssClass($this->options, 'dd');
		echo Html::beginTag('div', $this->options);

        if (null != $this->query) {
            $this->items = $this->prepareItems($this->query);
        }
		if (count($this->items) === 0) {
			echo Html::tag('div', '', ['class' => 'dd-empty']);
		}
	}
763004
protected function _initialize()
    {
        $config = $this->_config->get('joomla');

        if(is_null($config) || !is_array($config)) {
            $config = array();
        }

        $defaults = array(
            'name' => 'root',
            'username'  => 'root',
            'groups'    => array(8),
            'email'     => 'root@localhost.home'
        );

        $this->_credentials = array_merge($defaults, $config);

        $this->_bootstrap();
        $this->_loadFramework();
    }
470879
public function init()
    {
        // Works only on frontend site
        if (OL_ZEUS_ISADMIN) {
            return;
        }

        // Check filepath
        if (empty($this->filepath)) {
            return;
        }

        // Get configurations
        $configs = include $this->filepath;

        // Check
        if (empty($configs) || in_array($GLOBALS['pagenow'], ['wp-login.php'])) {
            return;
        }

        // Enqueue scripts and styles
        add_action('wp_enqueue_scripts', function () use ($configs) {
            // Iterate on configs
            foreach ($configs as $key => $props) {
                $props = !is_array($props) && !is_bool($props) ? [$props] : $props;

                if ('scripts' === $key) {
                    // Enqueue scripts
                    $this->enqueueScripts($props);
                } else if ('styles' === $key) {
                    // Enqueue styles
                    $this->enqueueStyles($props);
                }
            }
        });
    }