public static function instance($page = null) {
        // Use the passed $page if given, otherwise the $PAGE global.
        if (!$page) {
            global $PAGE;
            $page = $PAGE;
        }
        if (self::$instance === null || ($page && self::$instance->page !== $page)) {
            self::$instance = new self($page);
        }
        return self::$instance;
    }
public static function instance($page = null) {
        // Use the passed $page if given, otherwise the $PAGE global.
        if (!$page) {
            global $PAGE;
            $page = $PAGE;
        }
        if (self::$instance === null || ($page && self::$instance->page !== $page)) {
            self::$instance = new self($page);
        }
        return self::$instance;
    }
public static function instance ( $ page = null ) { // Use the passed $page if given, otherwise the $PAGE global. if ( ! $ page ) { global $ PAGE ; $ page = $ PAGE ; } if ( self :: $ instance === null || ( $ page && self :: $ instance -> page !== $ page ) ) { self :: $ instance = new self ( $ page ) ; } return self :: $ instance ; }
Returns a singleton instance of a manager

Note as of Moodle 3.3, this will call setup for you.

@return core_media_manager
Returns a singleton instance of a manager