本文整理汇总了PHP中Log::Message方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::Message方法的具体用法?PHP Log::Message怎么用?PHP Log::Message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Log
的用法示例。
在下文中一共展示了Log::Message方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
public function delete()
{
if (!$this->exists()) {
return false;
}
// Deleting the from from disk path is the most common place for
// something to go wrong, so we do that first.
$file = $this->getStorageLocation();
if (file_exists($file) && is_file($file)) {
unlink($file);
}
// Delete all the references to this image.
ArticleAttachment::OnAttachmentDelete($this->m_data['id']);
// Delete the description
Translation::deletePhrase($this->m_data['fk_description_id']);
$tmpData = $this->m_data;
// Delete the record in the database
$success = parent::delete();
$logtext = getGS('File #$1 "$2" deleted.', $tmpData['id'], $tmpData['file_name']);
Log::Message($logtext, null, 39);
return $success;
} // fn delete
示例2: create
/**
* @param array $p_values
* @return boolean
*/
public function create($p_values = null)
{
$success = parent::create($p_values);
$publicationObj = new Publication($this->m_data['IdPublication']);
if (function_exists("camp_load_translation_strings")) {
camp_load_translation_strings("api");
}
$logtext = getGS('The default subscription time for ($1 "$2":$3) has been added.', getGS("Publication"), $publicationObj->getName(), $this->m_data['CountryCode']);
Log::Message($logtext, null, 4);
return $success;
} // fn create
示例3: RemoveTopicFromArticle
/**
* Unlink a topic from an article.
* @param int $p_topicId
* @param int $p_articleNumber
* @return void
*/
public static function RemoveTopicFromArticle($p_topicId, $p_articleNumber)
{
global $g_ado_db;
$queryStr = "DELETE FROM ArticleTopics WHERE NrArticle=$p_articleNumber AND TopicId=$p_topicId";
$g_ado_db->Execute($queryStr);
if (function_exists("camp_load_translation_strings")) {
camp_load_translation_strings("api");
}
$logtext = getGS('Article topic $1 deleted from article $2', $p_topicId, $p_articleNumber);
Log::Message($logtext, null, 145);
} // fn RemoveTopicFromArticle
示例4: AddAuthorTypeToAuthor
/**
* @param int $p_authorId
* @param int $p_authorTypeId
* @return void
*/
public static function AddAuthorTypeToAuthor($p_authorId, $p_authorTypeId)
{
global $g_ado_db;
$queryStr = 'INSERT IGNORE INTO ' . self::TABLE . ' (fk_author_id, fk_type_id)
VALUES (' . (int) $p_authorId . ', ' . (int) $p_authorTypeId . ')';
$g_ado_db->Execute($queryStr);
if (function_exists("camp_load_translation_strings")) {
camp_load_translation_strings("api");
}
$logText = getGS('Author type $1 linked to author $2', $p_authorTypeId, $p_authorId);
Log::Message($logText, null, 175);
}
示例5: delete
public function delete()
{
$articleNumber = $this->getArticleNumber();
$deleted = parent::delete();
if ($deleted) {
if (function_exists("camp_load_translation_strings")) {
camp_load_translation_strings("api");
}
$logtext = getGS('Scheduled action deleted from Article #$1',
$articleNumber);
Log::Message($logtext, null, 37);
}
return $deleted;
} // fn delete
示例6: move
/**
* Moves a template from current folder to destination folder.
* It does not take care on database info upgrade because
* it trusts of the cool Template::UpdateStatus() function.
*
* @param string $p_current_folder
* @param string $p_destination_folder
* @return bool true on succes or false on failure
*/
public function move($p_current_folder, $p_destination_folder) {
global $Campsite;
global $g_user;
if (self::IsValidPath($p_current_folder) &&
self::IsValidPath($p_destination_folder)) {
$currentFolder = ($p_current_folder == '/') ? '' : $p_current_folder;
$destinationFolder = ($p_destination_folder == '/') ? '' : $p_destination_folder;
$currentFullPath = $Campsite['TEMPLATE_DIRECTORY']
. $currentFolder
. '/' . basename($this->getName());
$destinationFullPath = $Campsite['TEMPLATE_DIRECTORY']
. $destinationFolder
. '/' . basename($this->getName());
if (rename($currentFullPath, $destinationFullPath)) {
$logtext = getGS('Template $1 was moved to $2',
mysql_real_escape_string($currentFolder . '/' . basename($this->getName())),
mysql_real_escape_string($destinationFolder . '/' . basename($this->getName())));
Log::Message($logtext, $g_user->getUserId(), 117);
return true;
}
}
return false;
} // fn move
示例7: delete
/**
* Delete the language, this will also delete the language files unless
* the parameter specifies otherwise.
*
* @return boolean
*/
public function delete($p_deleteLanguageFiles = true)
{
if (is_link($GLOBALS['g_campsiteDir'] . '/' . $this->getCode() . '.php')) {
unlink($GLOBALS['g_campsiteDir'] . '/' . $this->getCode() . '.php');
}
if ($p_deleteLanguageFiles) {
$result = Localizer::DeleteLanguageFiles($this->getCode());
if (PEAR::isError($result)) {
return result;
}
}
$tmpData = $this->m_data;
$success = parent::delete();
if ($success) {
CampCache::singleton()->clear('user');
if (function_exists("camp_load_translation_strings")) {
camp_load_translation_strings("api");
}
$logtext = getGS('Language "$1" ($2) deleted', $tmpData['Name'], $tmpData['OrigName']);
Log::Message($logtext, null, 102);
}
return $success;
} // fn delete
示例8: setName
/**
* Set the name of the country.
* @param string $p_value
* @return boolean
*/
public function setName($p_value)
{
$oldValue = $this->m_data['Name'];
$success = $this->setProperty('Name', $p_value);
if ($success) {
if (function_exists("camp_load_translation_strings")) {
camp_load_translation_strings("api");
}
$logtext = getGS('Country name $1 changed', $this->m_data['Name']." (".$this->m_data['Code'].")");
Log::Message($logtext, null, 133);
}
return $success;
} // fn setName
示例9: getGS
$email = Input::Get("f_email");
if (stristr($email, "@") == false) { // || stristr($email, ".")==false)
$errors[] = getGS("Email: incorrect format.");
}
if (!isset($errors)) {
$usr = User::FetchUserByEmail($email);
if ($usr!=null && is_numeric($usr->getUserId()) && $usr->getUserId()>0) {
$usr->setPasswordResetToken();
$token = $usr->getPasswordResetToken();
send_token($email, $token);
$sent = true;
$logMessage = getGS('Password recovery request for $1', $email);
Log::Message($logMessage, NULL, 54);
}
else {
$errors[] = getGS("No user is registered with this email.");
}
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en">
<head>
<script src="<?php echo $Campsite['WEBSITE_URL']; ?>/js/crypt.js" type="text/javascript"></script>
<link rel="shortcut icon" href="<?php echo $Campsite['ADMIN_STYLE_URL']; ?>/images/7773658c3ccbf03954b4dacb029b2229.ico" />
<link rel="stylesheet" type="text/css" href="<?php echo $Campsite['ADMIN_STYLE_URL']; ?>/admin_stylesheet_new.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $Campsite['ADMIN_STYLE_URL']; ?>/admin_stylesheet.css" />
示例10: syncPhorumUser
/**
* Sync campsite and phorum users.
*/
public function syncPhorumUser()
{
$phorumUser = Phorum_user::GetByUserName($this->m_data['UName']);
if ($phorumUser->setPassword($this->m_data['Password'])
&& $phorumUser->setEmail($this->m_data['EMail'])) {
if (function_exists("camp_load_translation_strings")) {
camp_load_translation_strings("api");
}
$logtext = getGS('Base data synchronized to phorum user for "$1" ($2)', $this->m_data['Name'], $this->m_data['UName']);
Log::Message($logtext, null, 161);
}
} // fn syncPhorumUser
示例11: delete
/**
* Delete the user type.
*
* @return bool
* TRUE on success, FALSE on failure
*/
public function delete()
{
global $LiveUserAdmin;
$filter = array('group_id' => $this->m_data['group_id']);
if ($LiveUserAdmin->perm->removeGroup($filter)) {
$this->m_exists = false;
if (function_exists("camp_load_translation_strings")) {
camp_load_translation_strings("api");
}
$logtext = getGS('User type "$1" deleted', $this->m_data['group_define_name']);
Log::Message($logtext, null, 122);
return true;
}
return false;
} // fn delete
示例12: delete
/**
* @return boolean
*/
public function delete()
{
if (!$this->exists()) {
return false;
}
// Unlink articles
ArticleAuthor::OnAuthorDelete($this->getId());
// Unlink aliases
AuthorAlias::OnAuthorDelete($this->getId());
// Unlink authors
AuthorAssignedType::OnAuthorDelete($this->getId());
// Unlink biographies
AuthorBiography::OnAuthorDelete($this->getId());
// Save author data for logging purposes
$tmpData = $this->m_data;
// Delete row from Authors table.
$result = parent::delete();
if ($result) {
if (function_exists("camp_load_translation_strings")) {
camp_load_translation_strings("api");
}
$logText = getGS('Author #$1 "$2" deleted.',
$tmpData['id'], $tmpData['first_name'] . ' ' . $tmpData['last_name']);
Log::Message($logText, null, 174);
}
return $result;
}
示例13: Subscription
}
$subscription = new Subscription();
$created = $subscription->create(array(
'IdUser' => $f_user_id,
'IdPublication' => $f_publication_id,
'Active' => $f_subscription_active,
'Type' => $subsType));
if (!$created) {
$errorMsgs[] = getGS('The subscription could not be added.')
.' '.getGS("Please check if there isn't another subscription to the same publication.");
} else {
$logtext = getGS('Subscription added for user #$1 (Publication: $2, Active: $3, Type: $4)',
$f_user_id, $f_publication_id, $f_subscription_active, $subsType);
Log::Message($logtext, null, 181);
}
if ($created && ($f_add_sections_now == 'Y')) {
$columns = array('StartDate' => $f_subscription_start_date,
'Days' => $f_subscription_days,
'PaidDays' => $paidDays);
foreach ($f_language_id as $language_id) {
$created = SubscriptionSection::AddSubscriberToPublication(
$subscription->getSubscriptionId(),
$f_publication_id,
$language_id,
$columns);
if (!$created) {
$errorMsgs[] = getGS('The sections could not be added successfully. Some of them were already added !');
break;
示例14: getGS
if (!$canManage) {
$error = getGS("You do not have the right to change user type permissions.");
camp_html_display_error($error);
exit;
}
$uTypeId = Input::Get('UType', 'string', '');
if (is_numeric($uTypeId) && $uTypeId > 0) {
$userType = new UserType($uTypeId);
if ($userType->getName() == '') {
camp_html_display_error(getGS('No such user type.'));
exit;
}
} else {
camp_html_display_error(getGS('No such user type.'));
exit;
}
$rightsFields = User::GetDefaultConfig();
foreach ($rightsFields as $field=>$value) {
$val = Input::Get($field, 'string', 'off');
$userType->setPermission($field, ($val != 'off'));
}
$logtext = getGS('Permissions changed for user type "$1"', $userType->getName());
Log::Message($logtext, $userType->getName(), 123);
$msg = getGS("Permissions successfully modified");
camp_html_add_msg($msg, 'ok');
camp_html_goto_page("/$ADMIN/user_types/access.php?UType=$uTypeId");
?>
示例15: delete
/**
* @return boolean
*/
public function delete()
{
if (!$this->exists()) {
return false;
}
// Unlink articles
ArticleAuthor::OnAuthorTypeDelete($this->getId());
// Unlink authors
AuthorAssignedType::OnAuthorTypeDelete($this->getId());
// Delete this author type
$authorType = $this->getName();
$result = parent::delete();
if ($result) {
if (function_exists("camp_load_translation_strings")) {
camp_load_translation_strings("api");
}
$logText = getGS('Article type "$1" deleted.', $authorType);
Log::Message($logText, null, 176);
}
return $result;
}