HEX
Server: nginx/1.18.0
System: Linux mail.dakarash.co.id 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User: www-data (33)
PHP: 8.1.2-1ubuntu2.23
Disabled: NONE
Upload Files
File: /home/dakarash.co.id/public_html/wp-content/plugins/presto-player/inc/Controller.php
<?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();
        }
    }
}