本文整理汇总了PHP中ValueOf函数的典型用法代码示例。如果您正苦于以下问题:PHP ValueOf函数的具体用法?PHP ValueOf怎么用?PHP ValueOf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ValueOf函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Select
public function Select($ServerID)
{
/******************************************************************************/
$__args_types = array('integer');
#-------------------------------------------------------------------------------
$__args__ = Func_Get_Args();
eval(FUNCTION_INIT);
/******************************************************************************/
$Settings = DB_Select('Servers', '*', array('UNIQ', 'ID' => $ServerID));
#-------------------------------------------------------------------------------
switch (ValueOf($Settings)) {
case 'error':
return ERROR | @Trigger_Error('[HostingServer->Select]: не удалось выбрать сервер');
case 'exception':
return new gException('SERVER_NOT_FOUND', 'Указаный сервер не найден');
case 'array':
#-------------------------------------------------------------------------------
$this->SystemID = $Settings['Params']['SystemID'];
#-------------------------------------------------------------------------------
$this->Settings = $Settings;
#-------------------------------------------------------------------------------
if (Is_Error(System_Load(SPrintF('libs/%s.php', $this->SystemID)))) {
@Trigger_Error('[HostingServer->Select]: не удалось загрузить целевую библиотеку');
}
#-------------------------------------------------------------------------------
return TRUE;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
}
示例2: send
public function send(Msg $msg)
{
// Get template file path.
$templatePath = SPrintF('Notifies/SMS/%s.tpl', $msg->getTemplate());
$smarty = JSmarty::get();
if (!$smarty->templateExists($templatePath)) {
throw new jException('Template file not found: ' . $templatePath);
}
$smarty->assign('Config', Config());
foreach (array_keys($msg->getParams()) as $paramName) {
$smarty->assign($paramName, $msg->getParam($paramName));
}
try {
$message = $smarty->fetch($templatePath);
} catch (Exception $e) {
throw new jException(SPrintF("Can't fetch template: %s", $templatePath), $e->getCode(), $e);
}
$recipient = $msg->getParam('User');
if (!$recipient['Params']['NotificationMethods']['SMS']['Address']) {
throw new jException('Mobile phone number not found for user: ' . $recipient['ID']);
}
$taskParams = array('UserID' => $recipient['ID'], 'TypeID' => 'SMS', 'Params' => array($recipient['Params']['NotificationMethods']['SMS']['Address'], $message, $recipient['ID'], $msg->getParam('ChargeFree') ? TRUE : FALSE));
#Debug(SPrintF('[system/classes/SMS.class.php]: msg = %s,',print_r($msg,true)));
$result = Comp_Load('www/Administrator/API/TaskEdit', $taskParams);
switch (ValueOf($result)) {
case 'error':
throw new jException("Couldn't add task to queue: " . $result);
case 'exception':
throw new jException("Couldn't add task to queue: " . $result->String);
case 'array':
return TRUE;
default:
throw new jException("Unexpected error.");
}
}
示例3: FindSystem
public function FindSystem($ExtraIPOrderID, $OrderType, $DependOrderID)
{
/****************************************************************************/
$__args_types = array('integer', 'string', 'integer');
$__args__ = Func_Get_Args();
eval(FUNCTION_INIT);
/****************************************************************************/
/* find server */
Debug(SPrintF('[system/classes/ExtraIPServer]: OrderType = %s', $OrderType));
#-------------------------------------------------------------------------------
$Columns = array(SPrintF('(SELECT `ServerID` FROM `OrdersOwners` WHERE `OrdersOwners`.`ID` = `%sOrdersOwners`.`OrderID`) AS `ServerID`', $OrderType), 'Login');
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$OrderServer = DB_Select(SPrintF('%sOrdersOwners', $OrderType), $Columns, array('UNIQ', 'ID' => $DependOrderID));
switch (ValueOf($OrderServer)) {
case 'error':
return ERROR | @Trigger_Error('[Server->Select]: ошибка поиска зависимого заказа');
case 'exception':
return new gException('DEPEND_ORDER_NOT_FOUND', 'Не найден заказ к которому необходимо добавить/удалить IP адрес');
case 'array':
#-------------------------------------------------------------------------------
$SysInfo = DB_Select('Servers', '*', array('UNIQ', 'ID' => $OrderServer['ServerID']));
switch (ValueOf($SysInfo)) {
case 'error':
return ERROR | @Trigger_Error('[Server->Select]: не удалось выбрать сервер');
case 'exception':
return new gException('SERVER_NOT_FOUND', 'Указаный сервер не найден');
case 'array':
/* find server info */
#-------------------------------------------------------------------------
# add User Login on server
$SysInfo['UserLogin'] = $OrderServer['Login'];
Debug(SPrintF('[system/classes/ExtraIPServer]: OrderType = %s', $OrderType));
Debug(SPrintF('[system/classes/ExtraIPServer]: found ICS: %s', $SysInfo['Params']['SystemID']));
$this->SystemID = $SysInfo['Params']['SystemID'];
$this->Settings = $SysInfo;
if (Is_Error(System_Load(SPrintF('libs/%s.php', $this->SystemID)))) {
@Trigger_Error('[Server->Select]: не удалось загрузить целевую библиотеку');
}
// + надо загрузить собсно либу для работы с IP адресами
#-------------------------------------------------------------------------------
return TRUE;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
default:
return ERROR | @Trigger_Error(101);
}
default:
return ERROR | @Trigger_Error(101);
}
}
示例4: getParams
public function getParams()
{
#-------------------------------------------------------------------------------
$Server = new DomainServer();
#-------------------------------------------------------------------------------
$IsSelected = $Server->Select((int) $this->params['ServerID']);
#-------------------------------------------------------------------------------
switch (ValueOf($IsSelected)) {
#-------------------------------------------------------------------------------
case 'error':
return ERROR | @Trigger_Error(500);
case 'true':
#-------------------------------------------------------------------------------
// For RegRu only
if ($Server->Settings['Params']['SystemID'] == 'RegRu' && In_Array($this->params['Name'], array('ru', 'su', 'рф'))) {
#-------------------------------------------------------------------------------
$Domain = SprintF("%s.%s", $this->params['DomainName'], $this->params['Name']);
#-------------------------------------------------------------------------------
$Result = $Server->GetUploadID($Domain);
#-------------------------------------------------------------------------------
switch (ValueOf($Result)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'array':
#-------------------------------------------------------------------------------
$UploadID = $Result['UploadID'];
#-------------------------------------------------------------------------------
$this->params['UploadID'] = $UploadID;
#-------------------------------------------------------------------------------
Debug(SPrintF('[system/classes/DomainOrdersOnRegisterMsg.class.php]: UploadID = %s', $UploadID));
#-------------------------------------------------------------------------------
break;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
break;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
return $this->params;
#-------------------------------------------------------------------------------
}
示例5: send
public function send(Msg $msg)
{
#-------------------------------------------------------------------------------
// Get template file path.
$templatePath = SPrintF('Notifies/ICQ/%s.tpl', $msg->getTemplate());
#-------------------------------------------------------------------------------
$smarty = JSmarty::get();
#-------------------------------------------------------------------------------
if (!$smarty->templateExists($templatePath)) {
throw new jException('Template file not found: ' . $templatePath);
}
#-------------------------------------------------------------------------------
$smarty->assign('Config', Config());
#-------------------------------------------------------------------------------
foreach (array_keys($msg->getParams()) as $paramName) {
$smarty->assign($paramName, $msg->getParam($paramName));
}
#-------------------------------------------------------------------------------
try {
#-------------------------------------------------------------------------------
$message = $smarty->fetch($templatePath);
#-------------------------------------------------------------------------------
} catch (Exception $e) {
#-------------------------------------------------------------------------------
throw new jException(SPrintF("Can't fetch template: %s", $templatePath), $e->getCode(), $e);
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
$recipient = $msg->getParam('User');
#-------------------------------------------------------------------------------
if (!$recipient['Params']['NotificationMethods']['ICQ']['Address']) {
throw new jException("ICQ UIN not found for user: " . $recipient['ID']);
}
#-------------------------------------------------------------------------------
$taskParams = array('UserID' => $recipient['ID'], 'TypeID' => 'ICQ', 'Params' => array($recipient['Params']['NotificationMethods']['ICQ']['Address'], $message, $recipient['ID']));
#-------------------------------------------------------------------------------
$result = Comp_Load('www/Administrator/API/TaskEdit', $taskParams);
switch (ValueOf($result)) {
case 'error':
throw new jException("Couldn't add task to queue: " . $result);
case 'exception':
throw new jException("Couldn't add task to queue: " . $result->String);
case 'array':
return TRUE;
default:
throw new jException("Unexpected error.");
}
#-------------------------------------------------------------------------------
}
示例6: CreateMap
function CreateMap($ID, &$ParentNode)
{
#-----------------------------------------------------------------------------
$Group = DB_Select('Groups', '*', array('UNIQ', 'ID' => $ID));
#-----------------------------------------------------------------------------
switch (ValueOf($Group)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return ERROR | @Trigger_Error(400);
case 'array':
#-------------------------------------------------------------------------
$Node = new Tag('node', array('TEXT' => $Group['Name'], 'STYLE' => 'bubble', 'BACKGROUND_COLOR' => $Group['IsDepartment'] ? '#F07D00' : '#F9E47D'), new Tag('edge', array('STYLE' => 'sharp_bezier', 'COLOR' => '#D5F66C', 'WIDTH' => 5)), new Tag('font', array('BOLD' => 'true', 'NAME' => 'SansSerif', 'SIZE' => 14)), new Tag('icon', array('BUILTIN' => 'none')));
#-------------------------------------------------------------------------
$Childs = DB_Select('Groups', '*', array('Where' => SPrintF('`ParentID` = %u AND `ParentID` != `ID`', $Group['ID'])));
#-------------------------------------------------------------------------
switch (ValueOf($Childs)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
# No more...
break;
case 'array':
#---------------------------------------------------------------------
foreach ($Childs as $Child) {
CreateMap($Child['ID'], $Node);
}
break;
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------
$ParentNode->AddChild($Node);
#-------------------------------------------------------------------------
return TRUE;
default:
return ERROR | @Trigger_Error(101);
}
}
示例7: Select
public function Select($ServerID)
{
/******************************************************************************/
$__args_types = array('integer');
#-------------------------------------------------------------------------------
$__args__ = Func_Get_Args();
eval(FUNCTION_INIT);
/******************************************************************************/
Debug('[system/classes/DomainServer.class.php]: function Select');
#-------------------------------------------------------------------------------
$Settings = DB_Select('Servers', '*', array('UNIQ', 'ID' => $ServerID));
#-------------------------------------------------------------------------------
switch (ValueOf($Settings)) {
case 'error':
return ERROR | @Trigger_Error('[DomainServer->Select]: не удалось выбрать регистратора');
case 'exception':
return new gException('REGISTRATOR_NOT_FOUND', 'Указаный регистратор не найден');
case 'array':
break;
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
$this->SystemID = $Settings['Params']['SystemID'];
#-------------------------------------------------------------------------------
$this->Settings = $Settings;
#-------------------------------------------------------------------------------
if (Is_Error(System_Load(SPrintF('libs/%s.php', $this->Settings['Params']['SystemID'])))) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return TRUE;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
}
示例8: Debug
case 'array':
break;
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Tasks/GC/WithdrawalOldUsers]: юзер (%s), договор #%u, балланс %s', $User['Email'], $Contract['ID'], $Contract['Balance']));
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Settings['WithdrawSumm'] = Str_Replace(',', '.', $Settings['WithdrawSumm']);
#-------------------------------------------------------------------------------
$Summ = $Contract['Balance'] > $Settings['WithdrawSumm'] ? $Settings['WithdrawSumm'] : $Contract['Balance'];
#-------------------------------------------------------------------------------
$IsUpdate = Comp_Load('www/Administrator/API/PostingMake', array('ContractID' => $Contract['ID'], 'Summ' => -$Summ, 'ServiceID' => 2100, 'Comment' => SPrintF('Хранение клиентской информации за период %s', Date('Y/m', MkTime(4, 0, 0, Date('n') - 1, 5, Date('Y'))))));
#-------------------------------------------------------------------------------
switch (ValueOf($IsUpdate)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return ERROR | @Trigger_Error(400);
case 'array':
break;
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (!$Settings['IsEvent']) {
continue;
}
#-------------------------------------------------------------------------------
示例9: DNSmanagerServer
case 'array':
#-------------------------------------------------------------------------------
$ClassDNSmanagerServer = new DNSmanagerServer();
#-------------------------------------------------------------------------------
$IsSelected = $ClassDNSmanagerServer->Select((int) $DNSmanagerOrder['ServerID']);
#-------------------------------------------------------------------------------
switch (ValueOf($IsSelected)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return ERROR | @Trigger_Error(400);
case 'true':
#-------------------------------------------------------------------------------
$IsActive = $ClassDNSmanagerServer->Active($DNSmanagerOrder['Login'], $DNSmanagerOrder['IsReselling']);
#-------------------------------------------------------------------------------
switch (ValueOf($IsActive)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return $IsActive;
case 'true':
#-------------------------------------------------------------------------------
$Event = array('UserID' => $DNSmanagerOrder['UserID'], 'PriorityID' => 'Hosting', 'Text' => SPrintF('Заказ вторичного DNS логин [%s], тариф (%s) активирован на сервере (%s)', $DNSmanagerOrder['Login'], $DNSmanagerOrder['SchemeName'], $ClassDNSmanagerServer->Settings['Address']));
$Event = Comp_Load('Events/EventInsert', $Event);
if (!$Event) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$GLOBALS['TaskReturnInfo'] = array($ClassDNSmanagerServer->Settings['Address'] => array($DNSmanagerOrder['Login'], $DNSmanagerOrder['SchemeName']));
#-------------------------------------------------------------------------------
return TRUE;
示例10: array
<?php
#-------------------------------------------------------------------------------
/** @author Alex Keda, for www.host-food.ru */
/******************************************************************************/
/******************************************************************************/
$__args_list = array('DNSmanagerOrder');
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
#-------------------------------------------------------------------------------
$ExecuteDate = Time();
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$IsAdd = Comp_Load('www/Administrator/API/TaskEdit', array('UserID' => $DNSmanagerOrder['UserID'], 'TypeID' => 'DNSmanagerCreate', 'ExecuteDate' => $ExecuteDate, 'Params' => array($DNSmanagerOrder['ID'])));
#-------------------------------------------------------------------------------
switch (ValueOf($IsAdd)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return ERROR | @Trigger_Error(400);
case 'array':
return TRUE;
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
示例11: switch
#-------------------------------------------------------------------------------
switch (ValueOf($IsSelected)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return ERROR | @Trigger_Error(400);
case 'true':
break;
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$IsDelete = $ExtraIPServer->DeleteIP($ExtraIPOrder['Login']);
#-------------------------------------------------------------------------------
switch (ValueOf($IsDelete)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return $IsDelete;
case 'true':
break;
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Event = array('UserID' => $ExtraIPOrder['UserID'], 'PriorityID' => 'Billing', 'Text' => SPrintF('Заказ выделенного IP (%s), удален с сервера (%s)', $ExtraIPOrder['Login'], $ExtraIPServer->Settings['Address']));
$Event = Comp_Load('Events/EventInsert', $Event);
if (!$Event) {
return ERROR | @Trigger_Error(500);
示例12: DB_Select
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Scheme = DB_Select(SPrintF('%sSchemes', $Service['Code']), array('*'), array('UNIQ', 'ID' => $DNSmanagerOrder['SchemeID']));
switch (ValueOf($Scheme)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return ERROR | @Trigger_Error(400);
case 'array':
break;
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Params = array('SchemeID' => $DNSmanagerOrder['SchemeID'], 'OrderID' => $DNSmanagerOrder['OrderID'], 'MaxOrders' => $Scheme['MaxOrders'], 'MinOrdersPeriod' => $Scheme['MinOrdersPeriod'], 'ServiceID' => $Service['ID'], 'ServiceName' => $Service['Name'], 'SchemeName' => $Scheme['Name']);
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Services/Orders/OrdersHistory', $Params);
switch (ValueOf($Comp)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return $Comp;
case 'array':
return TRUE;
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
示例13: foreach
#-------------------------------------------------------------------------------
foreach ($Servers as $Server) {
foreach (array('slaveserver.edit') as $Func) {
$Array[] = SPrintF($XML, $Func, $Server['Login'], $Server['Password'], $Server['Params']['Url']);
}
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# строим выхлопную XML'ину
$Out = SPrintF('<?xml version="1.0" encoding="UTF-8"?><doc>%s</doc>', Implode('', $Array));
Debug(SPrintF('[comp/www/API/ISPswSettingURL]: Out XML = %s', $Out));
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$License = DB_Select('ISPswLicenses', array('LicKey'), array('UNIQ', 'Where' => SPrintF('`elid` = %u', $id)));
switch (ValueOf($License)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return new gException('LICENSE_NOT_FOUND', 'Лицензия не найдена');
case 'array':
break;
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
echo Bin2Hex(xxtea_encrypt($Out, $License['LicKey']));
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
示例14: Args
/******************************************************************************/
/******************************************************************************/
$Args = Args();
#-------------------------------------------------------------------------------
$TableID = (string) @$Args['TableID'];
$RowID = (int) @$Args['RowID'];
$UserNotice = (string) @$Args['UserNotice'];
#-------------------------------------------------------------------------------
if (Is_Error(System_Load('modules/Authorisation.mod'))) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Notice = DB_Select(SPrintF('%sOwners', $TableID), array('ID', 'UserNotice', 'UserID'), array('UNIQ', 'ID' => $RowID));
#-------------------------------------------------------------------------------
switch (ValueOf($Notice)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return ERROR | @Trigger_Error(400);
case 'array':
#-------------------------------------------------------------------------------
if ($GLOBALS['__USER']['ID'] != $Notice['UserID']) {
if (!$GLOBALS['__USER']['IsAdmin']) {
return ERROR | @Trigger_Error(700);
}
}
#-------------------------------------------------------------------------------
break;
default:
return ERROR | @Trigger_Error(101);
示例15: Comp_Load
if (Is_Error($ExecutePeriod)) {
return ERROR | @Trigger_Error(500);
}
#------------------------------------------------------------------------------
$ExecuteTime = Comp_Load('Formats/Task/ExecuteTime', array('ExecuteTime' => $Settings['ExecuteTime'], 'DefaultTime' => MkTime(5, 0, 0, Date('n'), Date('j') + 1, Date('Y'))));
if (Is_Error($ExecuteTime)) {
return ERROR | @Trigger_Error(500);
}
#------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Where = array("`StatusID` = 'Active' OR `StatusID` = 'ForTransfer' OR `StatusID` = 'OnTransfer'", SPrintF('UNIX_TIMESTAMP() - %u * 86400 > `UpdateDate`', $Settings['WhoIsUpdatePeriod']), SPrintF('UNIX_TIMESTAMP() - %u * 86400 > `StatusDate`', $Settings['WhoIsBeginUpdate']));
#-------------------------------------------------------------------------------
$Columns = array('ID', 'DomainName', '(SELECT `Name` FROM `DomainSchemes` WHERE `DomainSchemes`.`ID` = `SchemeID`) AS `DomainZone`', '(SELECT `Params` FROM `Servers` WHERE `Servers`.`ID` = `ServerID`) AS `Params`');
$DomainOrders = DB_Select('DomainOrdersOwners', $Columns, array('Where' => $Where, 'Limits' => array(0, $Settings['Limit']), 'SortOn' => array('UpdateDate', 'DomainName')));
#-------------------------------------------------------------------------------
switch (ValueOf($DomainOrders)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
# No more...
break;
case 'array':
#-------------------------------------------------------------------------------
$GLOBALS['TaskReturnInfo'] = array();
#-------------------------------------------------------------------------------
foreach ($DomainOrders as $DomainOrder) {
#-------------------------------------------------------------------------------
$Comp = Comp_Load('www/Administrator/API/DomainOrderWhoIsUpdate', array('DomainOrderID' => $DomainOrder['ID']));
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}