當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。