本文整理汇总了PHP中JError::raiserError方法的典型用法代码示例。如果您正苦于以下问题:PHP JError::raiserError方法的具体用法?PHP JError::raiserError怎么用?PHP JError::raiserError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JError
的用法示例。
在下文中一共展示了JError::raiserError方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
/**
* TuiyoParameter::load()
*
* @param mixed $data
* @param mixed $xmlFilePath
* @return
*/
public function load($key, $xmlFilePath = NULL)
{
$iniPath = TUIYO_CONFIG . DS . strtolower($key) . ".ini";
$xmlFilePath = empty($xmlFilePath) ? TUIYO_CONFIG . DS . strtolower($key) . ".xml" : $xmlFilePath;
if (!file_exists($iniPath) || !is_file($xmlFilePath)) {
JError::raiserError(TUIYO_SERVER_ERROR, _('The required config element does not exists'));
return false;
}
$content = file_get_contents($iniPath);
$params = new JParameter($content, $xmlFilePath);
return $params;
}
示例2: getMessageFolderFromCode
public function getMessageFolderFromCode($folder_id, $userID)
{
$user = TuiyoAPI::get("user", NULL);
//If we don't have a valid user Type
if (is_null($folder_id) || is_null($userID)) {
JError::raiserError(TUIYO_SERVER_ERROR, "Invalid folder type provided");
return false;
}
//Determine if this user is the sender
$isSender = (int) $userID != $user->id ? false : true;
$sFid = (string) $folder_id;
$recipientDir = (int) $sFid[1];
$senderDir = (int) $sFid[0];
//Folder Maps
$maps = array("folders" => array(0 => "inbox", 1 => "sent", 2 => "inbox", 3 => "trash"));
if ($isSender) {
$folder = $maps["folders"][$senderDir];
} else {
$folder = $maps["folders"][$recipientDir];
}
return $folder;
}