ElggPlugin::start PHP Method

start() public method

Start the plugin.
public start ( integer $flags ) : true
$flags integer Start flags for the plugin. See the constants in lib/plugins.php for details.
return true
    public function start($flags)
    {
        // include classes
        if ($flags & ELGG_PLUGIN_REGISTER_CLASSES) {
            $this->registerClasses();
            $autoload_file = 'vendor/autoload.php';
            if ($this->canReadFile($autoload_file)) {
                require_once "{$this->path}/{$autoload_file}";
            }
        }
        // include start file if it exists
        if ($flags & ELGG_PLUGIN_INCLUDE_START) {
            if ($this->canReadFile('start.php')) {
                $this->includeFile('start.php');
            }
        }
        // include languages
        if ($flags & ELGG_PLUGIN_REGISTER_LANGUAGES) {
            // should be loaded before the first function that touches the static config (elgg-plugin.php)
            // so translations can be used... for example in registering widgets
            $this->registerLanguages();
        }
        // include views
        if ($flags & ELGG_PLUGIN_REGISTER_VIEWS) {
            $this->registerViews();
        }
        // include actions
        if ($flags & ELGG_PLUGIN_REGISTER_ACTIONS) {
            $this->registerActions();
        }
        // include widgets
        if ($flags & ELGG_PLUGIN_REGISTER_WIDGETS) {
            // should load after views because those are used during registration
            $this->registerWidgets();
        }
        return true;
    }