File "Controller.php"

Full Path: /home/tekvhqgl/public_html/dev2024_old_skip/wp-content/plugins/presto-player/inc/Controller.php
File size: 978 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

namespace PrestoPlayer;

class Controller
{
    /**
     * The settings page handler.
     *
     * @var Component[]
     */
    private $components = [];

    /**
     * The core plugin API.
     *
     * @var Core
     */
    private $core;

    /**
     * Creates an instance of the plugin controller.
     *
     * @since 2.3.0 Component parameters replaced with factory-cofigured array.
     *
     * @param Core        $core       The core API.
     * @param Component[] $components An array of plugin components.
     */
    public function __construct(Core $core, array $components)
    {
        $this->core       = $core;
        $this->components = $components;
    }

    /**
     * Starts the plugin for real.
     *
     * @return void
     */
    public function run()
    {
        // Set plugin singleton.
        Core::set_instance($this->core);

        foreach ($this->components as $component) {
            $component->register();
        }
    }
}