HEX
Server: Apache
System: Linux webm020.cluster128.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: thanexcelr (29537)
PHP: 7.3.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/thanexcelr/www/wp-content/plugins/nextgen-gallery/pope/lib/class.component_factory.php
<?php

if (!defined('POPE_VERSION')) { die('Use autoload.php'); }

/**
 * A factory for hatching (instantiating) components
 */
class C_Component_Factory extends C_Component
{
    static $_instances = array();

    function define($context=FALSE)
    {
		parent::define($context);
        $this->implement('I_Component_Factory');
    }

    function create($method, $args=array())
    {
        // Format the arguments for the method call
        $args = func_get_args();
        array_shift($args);

        // Create the component and apply the adapters
        $component = $this->call_method($method, $args);

        return $component;
    }

    static function &get_instance($context = False)
    {
		if (!isset(self::$_instances[$context])) {
			self::$_instances[$context] = new C_Component_Factory($context);
		}
		return self::$_instances[$context];
    }
}