本文整理匯總了PHP中Wekit::getInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP Wekit::getInstance方法的具體用法?PHP Wekit::getInstance怎麽用?PHP Wekit::getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Wekit
的用法示例。
在下文中一共展示了Wekit::getInstance方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* 構造函數,默認啟動埋在此鉤子下的擴展服務
*
* @param string $hookKey 鉤子點,默認為類名
* @param string $interface
* @param object $srv
* @return void
*/
private function __construct($hookKey)
{
if (!($hooks = PwHook::getRegistry('s_' . $hookKey))) {
return;
}
if (!($map = PwHook::resolveActionHook($hooks))) {
return;
}
foreach ($map as $key => $value) {
$this->appendDo(Wekit::getInstance($value['class'], $value['loadway']), $value['method']);
}
}
示例2: init
/**
* 初始化
*/
private function init($clearType)
{
$types = $this->getClearTypes();
$num = 0;
foreach ($clearType as $item) {
$_type = isset($types[$item]) ? $types[$item] : array();
if (!$_type || !$_type['class']) {
continue;
}
/* @var $instance iPwDoHookProcess */
$this->appendDo(Wekit::getInstance($_type['class'], 'load'));
$num++;
}
return $num;
}
示例3: _prepare
protected function _prepare()
{
if ($this->_ready) {
return !empty($this->_do);
}
!$this->_srv && ($this->_srv = $this);
foreach ($this->_key as $key => $hookKey) {
if (!($hooks = PwHook::getRegistry($hookKey))) {
continue;
}
if (!($map = PwHook::resolveActionHook($hooks, $this->_srv))) {
continue;
}
foreach ($map as $key => $value) {
$this->appendDo(Wekit::getInstance($value['class'], $value['loadway'], array($this->_srv)));
}
}
$this->_ready = true;
return !empty($this->_do);
}