本文整理汇总了PHP中_warning函数的典型用法代码示例。如果您正苦于以下问题:PHP _warning函数的具体用法?PHP _warning怎么用?PHP _warning使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_warning函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _error
<?php
if (empty($attributes['id'])) {
_error("ENoLanguageGiven", "No language given");
} else {
if ($oLanguageManager->removeLanguagesByID($attributes['id'])) {
_message("MLanguagesRemoved", "Languages removed successfully");
} else {
_warning("WLanguageNotRemoved", "Lanugage was not removed");
}
}
_xfa($myself . "admin.showLanguages");
示例2: _warning
<?php
if (!empty($attributes['fCode']) && isset($attributes['fName'])) {
if (!$oPropertyManager->setProperty($attributes['fCode'], array('code' => $attributes['fCode'], 'name' => $attributes['fName']))) {
_warning("WPropertyNotSaved", "Something happened when storing property, probably property with such code already exists");
} else {
_message("MPropertySaved", "Property was sucessfully saved");
}
} else {
_error("EWrongFormSubmitted", "Wrong form submitted, or else...");
}
_xfa($myself . "admin.showProperties");
示例3: _info
if (($x = $stanza->exists('x', NS_MUC . '#user')) !== false) {
if (($status = $x->exists('status', null, array('code' => '110'))) !== false) {
$item = $x->exists('item');
_info("xmlns #user exists with x " . $x->ns . " status " . $status->attrs['code'] . ", affiliation:" . $item->attrs['affiliation'] . ", role:" . $item->attrs['role']);
} else {
_info("xmlns #user have no x child element");
}
} else {
_warning("=======> odd case 1");
}
} else {
if (strtolower($from->bare) == strtolower($room_full_jid->bare)) {
if (($x = $stanza->exists('x', NS_MUC . '#user')) !== false) {
$item = $x->exists('item');
echo "presence stanza of type " . ($stanza->type ? $stanza->type : "available") . " received from " . $from->resource . ", affiliation:" . $item->attrs['affiliation'] . ", role:" . $item->attrs['role'] . PHP_EOL;
} else {
_warning("=======> odd case 2");
}
} else {
_warning("=======> odd case 3");
}
}
});
$client->add_cb('on_disconnect', function () {
_info("got on_disconnect cb");
});
//
// finally start configured xmpp stream
//
$client->start();
echo "done\n";
示例4: _warning
<?php
if (isset($attributes['fCode']) && isset($attributes['fXCode']) && isset($attributes['fName']) && isset($attributes['fPos'])) {
if (strlen($attributes['fCode']) > 0) {
if (isset($attributes['entryid'])) {
if (!$oPropertyManager->setDictionaryEntryByID($attributes['entryid'], array('code' => $attributes['fCode'], 'xcode' => $attributes['fXCode'], 'name' => $attributes['fName'], 'pos' => $attributes['fPos']))) {
_warning("WPropertyDictionaryEntryNotStored", "Something happened while saving property dictionary entry to DB, probably another entry exists with same code or no entry with such ID (already) exists");
} else {
_message("MPropertyDictionaryEntryStored", "Property dictionary entry successfully stored");
}
} elseif (isset($attributes['propertycode'])) {
if (!$oPropertyManager->addDictionaryEntry($attributes['propertycode'], array('code' => $attributes['fCode'], 'xcode' => $attributes['fXCode'], 'name' => $attributes['fName'], 'pos' => $attributes['fPos']))) {
_warning("WPropertyDictionaryEntryNotAdded", "Something happened while adding property dictionary entry to DB, probably entry with such code already exists");
} else {
_message("MPropertyDictionaryEntryAdded", "Property dictionary entry successfully added");
}
} else {
_error("ENoPropertyOrEntryFound", "No property or dictionary entry given");
}
} else {
_warning("WPropertyDictionaryEntryCodeCannotBeEmpty", "Property dictionary entry code cannot be empty");
}
} else {
_error("EWrongEntryFormSubmitted", "Invalid property dictionary form submitted");
}
_xfa($myself . "admin.showPropertyDictionary&code=" . $attributes['propertycode']);
示例5: function
// add necessary event callbacks here
//
$client->add_cb('on_auth_success', function () {
global $client;
_info("got on_auth_success cb, jid " . $client->full_jid->to_string());
// create node
//$client->xeps['0060']->create_node('pubsub.localhost', 'dummy_node');
// subscribe
$client->xeps['0060']->subscribe('pubsub.localhost', 'dummy_node');
});
$client->add_cb('on_auth_failure', function ($reason) {
global $client;
$client->send_end_stream();
_info("got on_auth_failure cb with reason {$reason}");
});
$client->add_cb('on_headline_message', function ($stanza) {
global $client;
if ($event = $stanza->exists('event', NS_PUBSUB . '#event')) {
_info("got pubsub event");
} else {
_warning("unknown headline message rcvd");
}
});
$client->add_cb('on_disconnect', function () {
_info("got on_disconnect cb");
});
//
// finally start configured xmpp stream
//
$client->start();
echo "done\n";
示例6: _warning
_warning("WArticleNotStored", "Something happened while storing article");
}
} else {
_warning("WArticleCannotBeConverted", "Article cannot be converted to " . $l->getEncoding());
}
}
$tmpFormFieldName = 'title_' . $l->getID();
if (isset($attributes[$tmpFormFieldName])) {
$strTitle = html_entity_decode($attributes[$tmpFormFieldName], ENT_COMPAT, $l->getEncoding());
if ($strTitle !== false) {
if (!$ogArticleManager->pushTitle($attributes['fuseactionid'], $l->getID(), $attributes['token'], $strTitle)) {
_warning("WArticleTitleNotStored", "Something happened while storing article title");
}
} else {
_warning("WArticleTitleCannotBeConverted", "Article title cannot be converted to " . $l->getEncoding());
}
}
}
$tmpFormFieldName = 'description';
if (isset($attributes[$tmpFormFieldName])) {
if (!$ogArticleManager->pushDescription($attributes['fuseactionid'], $attributes['token'], $attributes[$tmpFormFieldName])) {
_warning("WArticleDescriptionNotStored", "Something happened while storing article description");
}
}
} else {
_error("ENoTokenGiven", "No token is given");
}
} else {
_error("ENoFuseactionGiven", "No page is given");
}
echo "<script>window.opener.location.reload(); window.close();</script>";
示例7: handle_other
public function handle_other($event, $args)
{
$stanza = $args[0];
$stanza = new XMPPStanza($stanza);
$ev = 'on_' . $stanza->name . '_stanza';
if ($this->ev->exists($ev)) {
return $this->ev->emit($ev, array($stanza));
} else {
_warning("event '" . $event . "' catched in handle_other with stanza name " . $stanza->name);
}
}
示例8: _message
<?php
if (!empty($attributes['id'])) {
if (is_numeric($attributes['id'])) {
if ($oSecurityManager->checkGroupByID($attributes['id'])) {
if ($oSecurityManager->removeGroupsByID($attributes['id'])) {
_message("MGroupRemoved", "Group removed");
}
} else {
_warning("WNoSuchGroup", "No such group found");
}
} elseif (is_array($attributes['id'])) {
if ($oSecurityManager->removeGroupsByID($attributes['id'])) {
_message("MGroupsRemoved", "Groups removed");
}
} else {
_error("EInvalidGroupID", "Invalid group ID");
}
} else {
_error("ENoGroupGiven", "No security group is given to delete");
}
_xfa($myself . "admin.showGroups");
示例9: _error
<?php
if (empty($attributes['id']) && empty($attributes['key'])) {
_error("ENoFuseactionGiven", "No page or action is given");
} else {
$tmpFuseaction = false;
if (isset($attributes['id']) && intval($attributes['id']) > 0) {
$tmpFuseaction = $oFuseManager->getFuseactionByID(intval($attributes['id']));
} elseif (isset($attributes['key'])) {
$tmpFuseaction = $oFuseManager->getFuseaction($attributes['key']);
} else {
_error("ENoValidFuseactionGiven", "No valid page or action is given");
}
if (!$tmpFuseaction) {
_error("ENoFuseactionFound", "No such page or action found in DB");
} else {
$tmpFuseaction->setResponsibility($attributes['fResponsibility']);
if ($oFuseManager->setFuseaction($tmpFuseaction->getName(), $tmpFuseaction)) {
_message("MFuseactionStored", "Page/action responsibilities stored successfully");
} else {
_warning("WFuseactionNotStored", "Page/action responsibilities not saved");
}
}
}
if (!_gotxfa()) {
_xfa($myself . "admin.showFuseaction&id={$attributes['id']}");
}
示例10: _log
<?php
$tmpUser = false;
if (!empty($attributes['fLogin'])) {
if ($tmpUser = $oUserManager->getUser($attributes['fLogin'])) {
_log("Changing password for user " . $tmpUser->getLogin());
$strNewUserPassword = $oUserManager->resetPassword($tmpUser->getLogin());
} else {
_warning("WNoSuchUser", "No user with such login exists");
}
} else {
_error("EWrongFormSubmitted", "Wrong form submitted");
}
_xfa($myself . "home.showPasswordRecoverConfirmation");
示例11: _error
<?php
if (!empty($attributes['id'])) {
if (is_numeric($attributes['id'])) {
if (!($tmpUser = $oUserManager->getUserByID($attributes['id']))) {
_error("ENoSuchUser", "There is no user with ID = " . $attributes['id']);
}
} else {
_error("EInvalidUserID", "Invalid user ID");
}
} else {
$attributes['id'] = 0;
$tmpUser = new User();
}
if (isset($attributes['id']) && isset($attributes['fLogin']) && isset($attributes['fPwd']) && isset($attributes['fPwd2']) && isset($attributes['fEmail'])) {
$tmpUser->setID($attributes['id']);
if (!$tmpUser->setLogin($attributes['fLogin'])) {
_warning("WInvalidLogin", "Login is invalid or empty");
}
if (!$tmpUser->setEmail($attributes['fEmail'])) {
_warning("WInvalidEmail", "Email address is invalid or empty");
}
$tmpUser->setFirstName($attributes['fFirstName']);
$tmpUser->setMiddleName($attributes['fMiddleName']);
$tmpUser->setLastName($attributes['fLastName']);
$tmpUser->setBirthDate($attributes['fBirthDate']);
}
_assign("arrCountries", $oPropertyManager->getDictionary("fCountry"));
_assign("tmpUser", $tmpUser);
_display("admin/dspUserForm.tpl");
示例12: _warning
<?php
if (empty($attributes['token']) && !empty($attributes['article'])) {
$attributes['token'] = $attributes['article'];
} else {
if (empty($attributes['article']) && !empty($attributes['token'])) {
$attributes['article'] = $attributes['token'];
}
}
if (!empty($attributes['token']) && !empty($attributes['fName']) && !empty($attributes['fComment'])) {
if (strlen($_SESSION['SecretUserString']) > 0) {
if (!empty($attributes['fHString'])) {
if ($_SESSION['SecretUserString'] != $attributes['fHString']) {
_warning("WCaptchaStringNotMatch", "Secret user string not match");
} else {
if ($ogArticleManager->storeComment($attributes['token'], $attributes['fName'], $attributes['fComment'])) {
_message("MCommentAdded", "Your comment is added");
_xfa($myself . "home.showArticleComments&article=" . $attributes['token']);
} else {
_warning("WErrorSavingComment", "Error happened while saving comment, please try again");
}
}
} else {
_warning("WCaptchaStringEmpty", "Secret user string is empty");
}
} else {
_warning("WCaptchaStringUnknown", "Secret user string is unknown");
}
} else {
_warning("WEnterComment", "Please enter your name and your comment");
}
示例13: foreach
$arrUserGroups = $oSecurityManager->pullUserGroups($userlogged->getID());
$userXFA = $fusebox['defaultFuseaction'];
if ($arrUserGroups) {
$userlogged->setGroups($arrUserGroups);
if (!_gotxfa()) {
//find valid user's home page
foreach ($arrUserGroups as $tmpGroup) {
if ($tmpGroup->getHomePage() && $oFuseManager->getFuseaction($tmpGroup->getHomePage())) {
$userXFA = $tmpGroup->getHomePage();
}
}
}
}
_xfa($myself . $userXFA);
$oUser = $userlogged;
$log .= "'... success!";
} else {
_warning("WIncorrectPassword", "Password provided for login {$attributes['fLogin']} is incorrect");
$log .= "'... failed.";
}
_log($log);
} else {
_warning("WNoSuchUser", "There is no user {$attributes['fLogin']} registered with system");
}
} else {
_warning("WEmptyLoginCredentials", "Cannot log in with empty login or password");
}
if (!_gotErrors() && !_gotWarnings()) {
_log("After successful login user became " . $oUser->getFullName() . " (" . $oUser->getLogin() . ", " . $oUser->getID() . ")");
}
}
示例14: array
/*
* storing data
*/
if (!_gotErrors() && !_gotWarnings()) {
if (empty($attributes['id'])) {
$params = array("title" => $attributes['title'], "file" => $oFile->getFileName(), "mime" => $oFile->getFileMimeType());
if (!$ogArticleAttachmentManager->addAttachment($attributes['token'], $params)) {
$oFileManager->deleteFile($oFile);
_warning("WAttachmentNotStored", "Something happened while storing attachment");
}
} else {
$arrAttachment = $ogArticleAttachmentManager->getAttachment(intval($attributes['id']));
$params = array("title" => $attributes['title']);
if ($oFile) {
$params['file'] = $oFile->getFileName();
$params['mime'] = $oFile->getFileMimeType();
}
if ($ogArticleAttachmentManager->updateAttachment(intval($attributes['id']), $params)) {
if ($oFile) {
@unlink($fusebox['pathArticleAttachment'] . $arrAttachment['file']);
}
} else {
if ($oFile) {
$oFileManager->deleteFile($oFile);
}
_warning("WAttachmentNotStored", "Something happened while storing attachment");
}
}
} else {
$arrAttachment = $attributes;
}
示例15: foreach
<?php
$result = false;
if (isset($attributes['fuseactionid']) && is_numeric($attributes['fuseactionid'])) {
$result = true;
foreach ($attributes as $k => $a) {
if (strpos($k, "sq_") !== false) {
$arrID = explode("_", $k);
if (!$oSecurityManager->pushGroupAccessByID($arrID[1], $a)) {
$result = false;
}
}
}
} else {
_error("ENoFuseactionGiven", "No fuseaction given");
}
if (!$result) {
_warning("WExceptionSavingSecurity", "Something happened while permissions update performed");
} else {
_message("MSecurityUpdated", "Permissions updated");
}
_xfa($myself . "admin.showFuseactionSecurityTokens&id=" . $attributes['fuseactionid']);