/**
  * Although is is preferrable to call $this->object->method(), sometimes
  * it's nice to use $this->method() instead.
  * @param string $method
  * @param array $args
  * @return mixed
  */
 function __call($method, $args)
 {
     if ($this->object->has_method($method)) {
         return call_user_func_array(array(&$this->object, $method), $args);
     }
 }
 /**
  * Loads the Pope Framework
  */
 function _load_pope()
 {
     // No need to initialize pope again
     if ($this->_pope_loaded) {
         return;
     }
     // Pope requires a a higher limit
     $tmp = ini_get('xdebug.max_nesting_level');
     if ($tmp && (int) $tmp <= 300) {
         @ini_set('xdebug.max_nesting_level', 300);
     }
     // Include pope framework
     require_once implode(DIRECTORY_SEPARATOR, array(NGG_PLUGIN_DIR, 'pope', 'lib', 'autoload.php'));
     // Enable/disable pope caching. For now, the pope cache will not be used in multisite environments
     if (class_exists('C_Pope_Cache')) {
         if (C_Pope_Cache::$enabled = NGG_POPE_CACHE) {
             $blogid = is_multisite() ? get_current_blog_id() : NULL;
             if (isset($_SERVER['SERVER_ADDR'])) {
                 $cache_key_prefix = abs(crc32(implode('|', array($blogid, site_url(), AUTH_KEY, $_SERVER['SERVER_ADDR']))));
             } else {
                 $cache_key_prefix = abs(crc32(implode('|', array($blogid, site_url(), AUTH_KEY))));
             }
             C_Pope_Cache::set_driver('C_Pope_Cache_SingleFile');
             C_Pope_Cache::add_key_prefix($cache_key_prefix);
         }
     }
     // Enforce interfaces
     if (property_exists('ExtensibleObject', 'enforce_interfaces')) {
         ExtensibleObject::$enforce_interfaces = EXTENSIBLE_OBJECT_ENFORCE_INTERFACES;
     }
     // Get the component registry
     $this->_registry = C_Component_Registry::get_instance();
     // Add the default Pope factory utility, C_Component_Factory
     $this->_registry->add_utility('I_Component_Factory', 'C_Component_Factory');
     // Blacklist any modules which are known NOT to work with this version of NextGEN Gallery
     // We need to check if we have this ability as it's only available with Pope 0.9
     if (method_exists($this->_registry, 'blacklist_module_file')) {
         $this->_registry->blacklist_module_file('module.nextgen_pro_lightbox_legacy.php');
         $this->_registry->blacklist_module_file('module.protect_image.php');
         // TODO: Add module id for protect image
     }
     // If Pro is incompatible, then we need to blacklist all of Pro's modules
     // TODO: Pope needs a better way of introspecting into a product's list of provided modules
     if ($this->is_pro_incompatible()) {
         $pro_modules = array('photocrati-comments', 'photocrati-galleria', 'photocrati-nextgen_pro_slideshow', 'photocrati-nextgen_pro_horizontal_filmstrip', 'photocrati-nextgen_pro_thumbnail_grid', 'photocrati-nextgen_pro_blog_gallery', 'photocrati-nextgen_pro_film', 'photocrati-nextgen_pro_masonry', 'photocrati-nextgen_pro_albums', 'photocrati-nextgen_pro_lightbox', 'photocrati-nextgen_pro_lightbox_legacy', 'photocrati-nextgen_pro_ecommerce', 'photocrati-paypal_express_checkout', 'photocrati-paypal_standard', 'photocrati-stripe');
         foreach ($pro_modules as $mod) {
             $this->_registry->blacklist_module_file($mod);
         }
     }
     // Load embedded products. Each product is expected to load any
     // modules required
     $this->_registry->add_module_path(NGG_PRODUCT_DIR, 2, false);
     $this->_registry->load_all_products();
     // Give third-party plugins that opportunity to include their own products
     // and modules
     do_action('load_nextgen_gallery_modules', $this->_registry);
     // Initializes all loaded modules
     $this->_registry->initialize_all_modules();
     $this->_pope_loaded = TRUE;
 }