当前位置: 首页>>代码示例>>PHP>>正文


PHP KService::getInstance方法代码示例

本文整理汇总了PHP中KService::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP KService::getInstance方法的具体用法?PHP KService::getInstance怎么用?PHP KService::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KService的用法示例。


在下文中一共展示了KService::getInstance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getInstance

 /**
  * Return the singleton instnace of PlgContentfilterChain. This method also imports all the
  * content filter plugins.
  *
  * @return PlgContentfilterChain
  */
 public static function getInstance()
 {
     static $_instance;
     if (!$_instance) {
         $_instance = new self(new KConfig(array('service_container' => KService::getInstance())));
         KService::set('plg:contentfilter.chain', $_instance);
         JPluginHelper::importPlugin('contentfilter');
     }
     return $_instance;
 }
开发者ID:stonyyi,项目名称:anahita,代码行数:16,代码来源:chain.php

示例2: __construct

 /**
  * Constructor
  *
  * Prevent creating instances of this class by making the contructor private
  * 
  * @param  array  An optional array with configuration options.
  */
 private final function __construct($config = array())
 {
     //Initialize the path
     $this->_path = dirname(__FILE__);
     //Load the legacy functions
     require_once $this->_path . '/legacy.php';
     //Setup the loader
     require_once $this->_path . '/loader/loader.php';
     $loader = KLoader::getInstance($config);
     //Setup the factory
     $service = KService::getInstance($config);
     $service->set('koowa:loader', $loader);
 }
开发者ID:JSWebdesign,项目名称:intranet-platform,代码行数:20,代码来源:koowa.php

示例3: __construct

 /**
  * Constructor
  */
 public function __construct($dispatcher, $config = array())
 {
     if (!$config instanceof KConfig) {
         $config = new KConfig($config);
     }
     //Inject the identifier
     $config->service_identifier = KService::getIdentifier('plg:koowa.' . $config['name']);
     //Inject the service container
     $config->service_container = KService::getInstance();
     parent::__construct($config);
     //Set the plugin params
     if (is_string($config->params)) {
         $config->params = $this->_parseParams($config->params);
     }
     $this->_params = $config->params;
     //Setup lazy wiring for publishers we are subscribing too
     foreach ($config->event_publishers as $publisher) {
         KService::setConfig($publisher, array('event_subscribers' => array($this)));
     }
     if ($dispatcher instanceof KEventDispatcher) {
         $dispatcher->addEventSubscriber($this);
     }
 }
开发者ID:stonyyi,项目名称:anahita,代码行数:26,代码来源:default.php

示例4: __construct

 /**
  * Constructor
  */
 function __construct($dispatcher, $config = array())
 {
     if (isset($config['params'])) {
         if ($config['params'] instanceof JRegistry) {
             $this->_params = $config['params'];
         } else {
             $this->_params = new JRegistry();
             $this->_params->loadINI($config['params']);
         }
     }
     if (isset($config['name'])) {
         $this->_name = $config['name'];
     }
     if (isset($config['type'])) {
         $this->_type = $config['type'];
     }
     //Inject the identifier
     $config['service_identifier'] = KService::getIdentifier('plg:koowa.' . $this->_name);
     //Inject the service container
     $config['service_container'] = KService::getInstance();
     //Inject the dispatcher
     $config['dispatcher'] = $dispatcher;
     parent::__construct(new KConfig($config));
 }
开发者ID:janssit,项目名称:www.marlinfishingcanaria.com,代码行数:27,代码来源:default.php

示例5: __construct

 /**
  * Constructor
  */
 function __construct($dispatcher, $config = array())
 {
     if (isset($config['params'])) {
         if ($config['params'] instanceof JRegistry) {
             $this->_params = $config['params'];
         } else {
             $this->_params = new JRegistry();
             if (version_compare(JVERSION, '1.6', '<')) {
                 $this->_params->loadINI($config['params']);
             } else {
                 $this->_params->loadString($config['params'], 'INI');
             }
         }
     }
     if (isset($config['name'])) {
         $this->_name = $config['name'];
     }
     if (isset($config['type'])) {
         $this->_type = $config['type'];
     }
     //Inject the identifier
     $config['service_identifier'] = KService::getIdentifier('plg:koowa.' . $this->_name);
     //Inject the service container
     $config['service_container'] = KService::getInstance();
     //Inject the dispatcher
     $config['dispatcher'] = KService::get('com://admin/default.event.dispatcher');
     parent::__construct(new KConfig($config));
 }
开发者ID:Roma48,项目名称:mayak,代码行数:31,代码来源:default.php


注:本文中的KService::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。