本文整理汇总了PHP中BxDolService::isSerializedService方法的典型用法代码示例。如果您正苦于以下问题:PHP BxDolService::isSerializedService方法的具体用法?PHP BxDolService::isSerializedService怎么用?PHP BxDolService::isSerializedService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BxDolService
的用法示例。
在下文中一共展示了BxDolService::isSerializedService方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addTransientJobService
public function addTransientJobService($sName, $mixedService)
{
if (is_array($mixedService)) {
$mixedService = call_user_func_array('BxDolService::getSerializedService', $mixedService);
}
if (!BxDolService::isSerializedService($mixedService)) {
return false;
}
$sQuery = $this->prepare("INSERT INTO `sys_cron_jobs` SET `name`=?, `time`='transient', `service_call`=?", $sName, $mixedService);
return (int) $this->query($sQuery) > 0;
}
示例2: updateCache
public function updateCache()
{
$aWidgets = array();
$this->oDb->getWidgets(array('type' => 'all_with_notices'), $aWidgets, false);
$aResult = array();
foreach ($aWidgets as $aWidget) {
if (BxDolService::isSerializedService($aWidget['cnt_notices'])) {
$aService = unserialize($aWidget['cnt_notices']);
$sNotices = BxDolService::call($aService['module'], $aService['method'], array_merge(array($aWidget), $aService['params']), $aService['class']);
}
$aResult[$aWidget['id']] = $sNotices;
}
$oCache = $this->oDb->getDbCacheObject();
$sCacheKey = $this->oDb->genDbCacheKey($this->sCacheKeyNotices);
return $oCache->setData($sCacheKey, $aResult);
}
示例3: processInjection
/**
* * * * Static methods for work with template injections * * *
*
* Static method is used to add/replace the content of some key in the template.
* It's usefull when you don't want to modify existing template but need to add some data to existing template key.
*
* @param integer $iPageIndex - page index where injections would processed. Use 0 if you want it to be done on all the pages.
* @param string $sKey - template key.
* @param string $sValue - the data to be added.
* @return string the result of operation.
*/
function processInjection($iPageIndex, $sKey, $sValue = "")
{
if ($iPageIndex != 0 && isset($this->aPage['injections']['page_0'][$sKey]) && isset($this->aPage['injections']['page_' . $iPageIndex][$sKey])) {
$aSelection = @array_merge($this->aPage['injections']['page_0'][$sKey], $this->aPage['injections']['page_' . $iPageIndex][$sKey]);
} else {
if (isset($this->aPage['injections']['page_0'][$sKey])) {
$aSelection = $this->aPage['injections']['page_0'][$sKey];
} else {
if (isset($this->aPage['injections']['page_' . $iPageIndex][$sKey])) {
$aSelection = $this->aPage['injections']['page_' . $iPageIndex][$sKey];
} else {
$aSelection = array();
}
}
}
if (is_array($aSelection)) {
foreach ($aSelection as $aInjection) {
if (isset($GLOBALS['bx_profiler'])) {
$GLOBALS['bx_profiler']->beginInjection($sRand = time() . rand());
}
$sInjData = '';
switch ($aInjection['type']) {
case 'text':
$sInjData = $aInjection['data'];
break;
case 'service':
if (BxDolService::isSerializedService($aInjection['data'])) {
$sInjData = BxDolService::callSerialized($aInjection['data']);
}
break;
}
if ((int) $aInjection['replace'] == 1) {
$sValue = $sInjData;
} else {
$sValue .= $sInjData;
}
if (isset($GLOBALS['bx_profiler'])) {
$GLOBALS['bx_profiler']->endInjection($sRand, $aInjection);
}
}
}
return $sValue != '__' . $sKey . '__' ? str_replace('__' . $sKey . '__', '', $sValue) : $sValue;
}
示例4: alert
/**
* Notifies the necessary handlers about the alert.
*/
public function alert()
{
if (isset($this->_aAlerts[$this->sUnit]) && isset($this->_aAlerts[$this->sUnit][$this->sAction])) {
foreach ($this->_aAlerts[$this->sUnit][$this->sAction] as $iHandlerId) {
$aHandler = $this->_aHandlers[$iHandlerId];
if (isset($GLOBALS['bx_profiler']) && 'bx_profiler' != $aHandler['name']) {
$GLOBALS['bx_profiler']->beginAlert($this->sUnit, $this->sAction, $aHandler['name']);
}
if (!empty($aHandler['file']) && !empty($aHandler['class']) && file_exists(BX_DIRECTORY_PATH_ROOT . $aHandler['file'])) {
if (!class_exists($aHandler['class'], false)) {
require_once BX_DIRECTORY_PATH_ROOT . $aHandler['file'];
}
$oHandler = new $aHandler['class']();
$oHandler->response($this);
} else {
if (!empty($aHandler['service_call']) && BxDolService::isSerializedService($aHandler['service_call'])) {
$aService = unserialize($aHandler['service_call']);
$aParams = array($this);
if (isset($aService['params']) && is_array($aService['params'])) {
$aParams = array_merge($aParams, $aService['params']);
}
BxDolService::call($aService['module'], $aService['method'], $aParams, isset($aService['class']) ? $aService['class'] : 'Module');
}
}
if (isset($GLOBALS['bx_profiler']) && 'bx_profiler' != $aHandler['name']) {
$GLOBALS['bx_profiler']->endAlert($this->sUnit, $this->sAction, $aHandler['name']);
}
}
}
}
示例5: _getRequestedDataBySystem
protected function _getRequestedDataBySystem($aSystem, $iCachedData = 0)
{
if (!BxDolService::isSerializedService($aSystem['service_call'])) {
return false;
}
$aResponce = BxDolService::callSerialized($aSystem['service_call'], array('count' => (int) $iCachedData));
if (empty($aResponce) || !is_array($aResponce) || !isset($aResponce['count'], $aResponce['method'])) {
return false;
}
return $aResponce;
}
示例6: runJob
function runJob($aJob)
{
if (!empty($aJob['file']) && !empty($aJob['class']) && file_exists(BX_DIRECTORY_PATH_ROOT . $aJob['file'])) {
if (!class_exists($aJob['class'])) {
require_once BX_DIRECTORY_PATH_ROOT . $aJob['file'];
}
$oHandler = new $aJob['class']();
$oHandler->processing();
} else {
if (!empty($aJob['service_call']) && BxDolService::isSerializedService($aJob['service_call'])) {
BxDolService::callSerialized($aJob['service_call']);
}
}
}
示例7: field
protected function field($aItem)
{
$aField = array();
switch ($aItem['type']) {
case 'digit':
$aField = array('type' => 'text', 'name' => $aItem['name'], 'caption' => _t($aItem['caption']), 'value' => $aItem['value'], 'db' => array('pass' => 'Xss'));
break;
case 'text':
$aField = array('type' => 'textarea', 'name' => $aItem['name'], 'caption' => _t($aItem['caption']), 'value' => $aItem['value'], 'db' => array('pass' => 'XssHtml'));
break;
case 'checkbox':
$aField = array('type' => 'checkbox', 'name' => $aItem['name'], 'caption' => _t($aItem['caption']), 'value' => 'on', 'checked' => $aItem['value'] == 'on', 'db' => array('pass' => 'Xss'));
break;
case 'list':
case 'rlist':
$aField = array('type' => 'checkbox_set', 'name' => $aItem['name'], 'caption' => _t($aItem['caption']), 'value' => !empty($aItem['value']) ? explode(',', $aItem['value']) : array(), 'reverse' => $aItem['type'] == 'rlist', 'db' => array('pass' => 'Xss'));
if (BxDolService::isSerializedService($aItem['extra'])) {
$aField['values'] = BxDolService::callSerialized($aItem['extra']);
} else {
foreach (explode(',', $aItem['extra']) as $sValue) {
$aField['values'][$sValue] = $sValue;
}
}
break;
case 'select':
$aField = array('type' => 'select', 'name' => $aItem['name'], 'caption' => _t($aItem['caption']), 'value' => $aItem['value'], 'values' => array(), 'db' => array('pass' => 'Xss'));
if (BxDolService::isSerializedService($aItem['extra'])) {
$aField['values'] = BxDolService::callSerialized($aItem['extra']);
} else {
foreach (explode(',', $aItem['extra']) as $sValue) {
$aField['values'][] = array('key' => $sValue, 'value' => $sValue);
}
}
break;
case 'file':
$aField = array('type' => 'file', 'name' => $aItem['name'], 'caption' => _t($aItem['caption']), 'value' => $aItem['value'], 'db' => array('pass' => 'Xss'));
break;
}
return $aField;
}
示例8: _getRequestedData
protected function _getRequestedData($iIndex = 0, $bIndexCheck = false)
{
$aResult = array();
foreach ($this->_aSystems as $aSystem) {
if (empty($aSystem) || !is_array($aSystem) || (int) $aSystem['active'] != 1) {
continue;
}
if ($bIndexCheck && $iIndex % (int) $aSystem['frequency'] != 0) {
continue;
}
if (!BxDolService::isSerializedService($aSystem['service_call'])) {
continue;
}
$aResponce = BxDolService::callSerialized($aSystem['service_call']);
if (empty($aResponce) || !is_array($aResponce) || !isset($aResponce['count'], $aResponce['method'])) {
continue;
}
$aResult[$aSystem['name']] = $aResponce;
}
return $aResult;
}
示例9: getEmptyValue
protected function getEmptyValue($aOption)
{
$mixedValue = '';
switch ($aOption['type']) {
case 'digit':
$mixedValue = 0;
break;
case 'select':
if (BxDolService::isSerializedService($aOption['extra'])) {
$aValues = BxDolService::callSerialized($aOption['extra']);
} else {
$aValues = explode(',', $aOption['extra']);
}
$mixedValue = $aValues[0];
break;
case 'text':
case 'checkbox':
case 'file':
$mixedValue = "";
break;
}
return $mixedValue;
}