本文整理汇总了PHP中Logger::LogEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP Logger::LogEvent方法的具体用法?PHP Logger::LogEvent怎么用?PHP Logger::LogEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logger
的用法示例。
在下文中一共展示了Logger::LogEvent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ModuleConfig
public function ModuleConfig(DBLayer $ampdb, $modname)
{
$this->ampdb = $ampdb;
if ($modname) {
$this->modname = $modname;
} else {
import('com.solarix.ampoliros.io.log.Logger');
$log = new Logger(AMP_LOG);
$log->LogEvent('ampoliros.modules_library.moduleconfig_class.moduleconfig', 'Empty module name', LOGGER_WARNING);
}
}
示例2: getContent
public function getContent()
{
$result = false;
if (strlen($this->mNode)) {
import('carthag.core.Registry');
$reg = Registry::instance();
// Tries specified language catalog
//
if (file_exists($reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/help/' . $this->mNode . '_' . $this->mLanguage . '.helpnode')) {
$help_node_file = $reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/help/' . $this->mNode . '_' . $this->mLanguage . '.helpnode';
} else {
if (file_exists($reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/help/' . $this->mNode . '.helpnode')) {
$help_node_file = $reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/help/' . $this->mNode . '.helpnode';
} else {
if (file_exists($reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/help/' . $this->mNode . '_' . AMP_LANG . '.helpnode')) {
$help_node_file = $reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/help/' . $this->mNode . '_' . AMP_LANG . '.helpnode';
} else {
if (file_exists($reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/help/' . $this->mNode . '_en.helpnode')) {
$help_node_file = $reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/help/' . $this->mNode . '_en.helpnode';
} else {
import('com.solarix.ampoliros.io.log.Logger');
$log = new Logger(AMP_LOG);
$log->LogEvent('ampoliros.helpnode_library.helpnode_class.getcontent', 'Unable to find an help node file for the specified help node (' . $this->mNode . ') and language (' . $this->mLanguage . ') or fallback to another language', LOGGER_ERROR);
}
}
}
}
if (!empty($help_node_file)) {
$fh = @fopen($help_node_file, 'r');
if ($fh) {
$result = file_get_contents($help_node_file);
@fclose($fh);
}
}
}
return $result;
}
示例3: open
public function open()
{
$result = false;
import('carthag.core.Registry');
$reg = Registry::instance();
OpenLibrary('configman.library');
$country_file = new ConfigFile($reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/locale/' . $this->mCountry . '.country');
if ($country_file->Opened()) {
$this->mCountryShort = $country_file->Value('COUNTRYSHORT');
$this->mLanguage = $country_file->Value('LANGUAGE');
$this->mDecimalSeparator = $country_file->Value('DECIMALSEPARATOR');
$this->mThousandsSeparator = $country_file->Value('THOUSANDSSEPARATOR');
$this->mPositiveSign = $country_file->Value('POSITIVESIGN');
$this->mNegativeSign = $country_file->Value('NEGATIVESIGN');
$this->mCurrencySymbol = $country_file->Value('CURRENCYSYMBOL');
$this->mMoneyDecimalSeparator = $country_file->Value('MONEYDECIMALSEPARATOR');
$this->mMoneyThousandsSeparator = $country_file->Value('MONEYTHOUSANDSSEPARATOR');
$this->mFractDigits = $country_file->Value('FRACTDIGITS');
$this->mPositivePrefixCurrency = $country_file->Value('POSITIVEPREFIXCURRENCY');
$this->mPositiveSignPosition = $country_file->Value('POSITIVESIGNPOSITION');
$this->mNegativePrefixCurrency = $country_file->Value('NEGATIVEPREFIXCURRENCY');
$this->mNegativeSignPosition = $country_file->Value('NEGATIVESIGNPOSITION');
$this->mTimeFormat = $country_file->Value('TIMEFORMAT');
$this->mDateFormat = $country_file->Value('DATEFORMAT');
$this->mShortDateFormat = $country_file->Value('SHORTDATEFORMAT');
$this->mStartWeekOnMonday = $country_file->Value('STARTWEEKONMONDAY');
$this->mDateSeparator = $country_file->Value('DATESEPARATOR');
$this->mDateOrder = $country_file->Value('DATEORDER');
$this->mCharSet = $country_file->Value('CHARSET');
$result = true;
} else {
import('com.solarix.ampoliros.io.log.Logger');
$log = new Logger(AMP_LOG);
$log->LogEvent('ampoliros.locale_library.country_class.open', 'Unable to open country file ' . $reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/locale/' . $this->mCountry . '.country', LOGGER_ERROR);
}
return $result;
}
示例4: checkDiffs
public function checkDiffs()
{
$result = FALSE;
if (strlen($this->mOldTable) and strlen($this->mNewTable)) {
$this->mOldTableHandler->Parse($this->mOldTableHandler->mData);
$this->mNewTableHandler->Parse($this->mNewTableHandler->mData);
if (is_array($this->mOldTableHandler->mFieldsList)) {
reset($this->mOldTableHandler->mFieldsList);
while (list(, $old_column) = each($this->mOldTableHandler->mFieldsList)) {
if (!isset($this->mNewTableHandler->mFieldsList[$old_column])) {
$this->mDiffOldColumns[] = $old_column;
}
}
}
if (is_array($this->mNewTableHandler->mFieldsList)) {
reset($this->mNewTableHandler->mFieldsList);
while (list(, $new_column) = each($this->mNewTableHandler->mFieldsList)) {
if (!isset($this->mOldTableHandler->mFieldsList[$new_column])) {
$this->mDiffNewColumns[$new_column] = $this->mNewTableHandler->mFields[$new_column];
}
}
}
$this->mParsed = $result = TRUE;
} else {
import('com.solarix.ampoliros.io.log.Logger');
$log = new Logger(AMP_LOG);
$log->LogEvent('ampoliros.dblayer_parser_library.xmldbupdater_class.checkdiffs', 'Old and new table files not specified', LOGGER_ERROR);
}
return $result;
}
示例5: removeGroup
public function removeGroup($deleteuserstoo)
{
$result = false;
import('com.solarix.ampoliros.util.Hook');
$hook = new Hook($this->mrAmpDb, 'ampoliros', 'site.group.remove');
if ($hook->CallHooks('calltime', $this, array('siteserial' => $this->siteserial, 'groupid' => $this->groupid)) == HOOK_RESULT_OK) {
if ($this->groupid != 0) {
if ($this->mrSiteDb->Execute('DELETE FROM groups ' . 'WHERE id=' . (int) $this->groupid)) {
// Check if we must delete users in this group
if ($deleteuserstoo == true) {
$usersquery =& $this->mrAmpDb->Execute('SELECT id ' . 'FROM users ' . 'WHERE siteid=' . (int) $this->siteserial . ' AND groupid=' . (int) $this->groupid);
$numusers = $usersquery->NumRows();
if ($numusers > 0) {
// Remove users in this group
while (!$usersquery->eof) {
$usdata = $usersquery->Fields();
Carthag::import('com.solarix.ampoliros.site.user.User');
$tmpuser = new user($this->mrAmpDb, $this->siteserial, $usdata['id']);
$tmpuser->removeuser();
$usersquery->MoveNext();
//delete $tmpuser;
}
}
} else {
$this->mrAmpDb->Execute("UPDATE users SET groupid = '0' WHERE groupid=" . (int) $this->groupid . ' AND siteid =' . $this->siteserial);
}
if ($hook->CallHooks('groupremoved', $this, array('siteserial' => $this->siteserial, 'groupid' => $this->groupid)) != HOOK_RESULT_OK) {
$result = false;
}
$this->groupid = 0;
}
} else {
import('com.solarix.ampoliros.io.log.Logger');
$log = new Logger(AMP_LOG);
$log->LogEvent('ampoliros.users_library.group_class.removegroup', "Attempted to call a member of an object that doesn't refer to any group", LOGGER_ERROR);
}
}
return $result;
}
示例6: logEvent
public function logEvent($destinations, $context, $eventString, $eventType = LOGGER_GENERIC, $die = false)
{
global $gEnv;
// Root
//
if (isset($destinations['root'])) {
$tmp_log = new Logger($gEnv['root']['log']);
$tmp_log->LogEvent($context, $eventString, $eventType);
unset($tmp_log);
}
// Root db
//
if (isset($destinations['rootdb'])) {
$tmp_log = new Logger($gEnv['root']['dblog']);
$tmp_log->LogEvent($context, $eventString, $eventType);
unset($tmp_log);
}
// Remote
//
if (isset($destinations['remote'])) {
$tmp_log = new Logger($gEnv['remote']['log']);
$tmp_log->LogEvent($context, $eventString, $eventType);
unset($tmp_log);
}
// PHP
//
if (isset($destinations['php'])) {
$tmp_log = new Logger($gEnv['core']['error']['log']);
$tmp_log->LogEvent($context, $eventString, $eventType);
unset($tmp_log);
}
// Module
//
if (isset($destinations['module']) and is_dir(MODULE_PATH . $this->mModule)) {
$tmp_log = new Logger(MODULE_PATH . $this->mModule . '/module.log');
$tmp_log->LogEvent($context, $eventString, $eventType);
unset($tmp_log);
}
// Site
//
if (isset($destinations['site'])) {
$tmp_log = new Logger($gEnv['site']['log']);
$tmp_log->LogEvent($context, $eventString, $eventType);
unset($tmp_log);
}
// Site db
//
if (isset($destinations['sitedb'])) {
$tmp_log = new Logger($gEnv['sit']['dblog']);
$tmp_log->LogEvent($context, $eventString, $eventType);
unset($tmp_log);
}
if ($die) {
AmpDie($eventString);
}
return true;
}
示例7: checkEnabledSites
public function checkEnabledSites($modserial)
{
$result = FALSE;
if (!empty($modserial)) {
$ensites = array();
$query = $this->mrAmpDb->Execute('SELECT sites.siteid FROM sites,activemodules WHERE ' . 'activemodules.siteid=sites.id AND activemodules.moduleid=' . (int) $modserial);
if ($query->NumRows()) {
while (!$query->eof) {
$ensites[] = $query->Fields('siteid');
$query->MoveNext();
}
$result = $ensites;
}
} else {
import('com.solarix.ampoliros.io.log.Logger');
$log = new Logger(AMP_LOG);
$log->LogEvent('ampoliros.modules_library.moddeps_class.checkenabledsites', 'Empty module serial', LOGGER_ERROR);
}
return $result;
}
示例8: getColorsSet
public function getColorsSet()
{
$result = array();
OpenLibrary('configman.library');
$cfg_file = new ConfigFile(CONFIG_PATH . $this->mSetName . '.huicolorsset');
if ($cfg_file->Opened()) {
$result['pages']['bgcolor'] = $cfg_file->Value('COLORSET.PAGES.BGCOLOR');
$result['pages']['border'] = $cfg_file->Value('COLORSET.PAGES.BORDER');
$result['buttons']['text'] = $cfg_file->Value('COLORSET.BUTTONS.TEXT');
$result['buttons']['disabledtext'] = $cfg_file->Value('COLORSET.BUTTONS.DISABLEDTEXT');
$result['buttons']['selected'] = $cfg_file->Value('COLORSET.BUTTONS.SELECTED');
$result['buttons']['notselected'] = $cfg_file->Value('COLORSET.BUTTONS.NOTSELECTED');
$result['bars']['color'] = $cfg_file->Value('COLORSET.BARS.COLOR');
$result['bars']['shadow'] = $cfg_file->Value('COLORSET.BARS.SHADOW');
$result['frames']['border'] = $cfg_file->Value('COLORSET.FRAMES.BORDER');
$result['statusbars']['bgcolor'] = $cfg_file->Value('COLORSET.STATUSBARS.BGCOLOR');
$result['titlebars']['bgcolor'] = $cfg_file->Value('COLORSET.TITLEBARS.BGCOLOR');
$result['titlebars']['textcolor'] = $cfg_file->Value('COLORSET.TITLEBARS.TEXTCOLOR');
$result['toolbars']['separator'] = $cfg_file->Value('COLORSET.TOOLBARS.SEPARATOR');
$result['tables']['bgcolor'] = $cfg_file->Value('COLORSET.TABLES.BGCOLOR');
$result['tables']['headerbgcolor'] = $cfg_file->Value('COLORSET.TABLES.HEADERBGCOLOR');
$result['tables']['gridcolor'] = $cfg_file->Value('COLORSET.TABLES.GRIDCOLOR');
} else {
import('com.solarix.ampoliros.io.log.Logger');
$log = new Logger(AMP_LOG);
$log->LogEvent('ampoliros.huithemes_library.huicolorsset_class.getcolorsset', 'Unable to open colors set file ' . CONFIG_PATH . $this->mSetName . '.huicolorsset', LOGGER_ERROR);
}
return $result;
}
示例9: pass_setcountry
function pass_setcountry($eventData)
{
global $hui_mainstatus, $amp_locale, $hui_page;
$log = new Logger(AMP_LOG);
$amp_config = new ConfigFile(AMP_CONFIG);
$amp_config->SetValue('AMP_COUNTRY', $eventData['country']);
$log->LogEvent('Ampoliros', 'Changed Ampoliros root country', LOGGER_NOTICE);
$hui_mainstatus->mArgs['status'] = $amp_locale->GetStr('countryset_status');
$hui_page->mArgs['javascript'] = 'parent.frames.sum.location.reload()';
}
示例10: logFailedAccess
public function logFailedAccess($user = '', $root = false, $ip = '')
{
Carthag::import('com.solarix.ampoliros.io.log.Logger');
$log = new Logger($this->mAccessLog);
$log->LogEvent('ampoliros', 'Wrong access from ' . ($root ? 'root ' : 'user ' . $user . ' ') . (strlen($ip) ? 'from address ' . $ip : ''), LOGGER_NOTICE);
return true;
}
示例11: disableAllModules
public function disableAllModules($ampolirosToo = true)
{
$result = false;
if ($this->ampdb) {
// Checks the enabled modules
//
$modsquery =& $this->ampdb->Execute('SELECT id ' . 'FROM activemodules,modules ' . 'WHERE activemodules.siteid=' . (int) $this->siteserial . ' ' . 'AND activemodules.moduleid=modules.id');
$modules = array();
while (!$modsquery->eof) {
$modules[$modsquery->Fields('id')] = $modsquery->Fields('id');
$modsquery->MoveNext();
}
$nummodules = $modsquery->NumRows();
$ampquery = $this->ampdb->Execute('SELECT id ' . 'FROM modules ' . 'WHERE modid=' . $this->ampdb->Format_Text('ampoliros'));
if (!$ampolirosToo) {
unset($modules[$ampquery->Fields('id')]);
$nummodules--;
}
// Tries to disable every module since all modules are disabled, following dependencies
//
while (count($modules) > 0) {
$modid = current($modules);
if (count($modules) == 1 and $modid == $ampquery->Fields('id') or count($modules) > 1 and $modid != $ampquery->Fields('id') or !$ampolirosToo) {
OpenLibrary('modulesbase.library');
$tmpmod = new Module($this->ampdb, $modid);
if ($tmpmod->Disable($this->siteserial)) {
import('com.solarix.ampoliros.io.log.Logger');
$log = new Logger(AMP_LOG);
$log->LogEvent($this->siteid, 'Disabled module ' . $tmpmod->modname, LOGGER_NOTICE);
$this->sitelog->LogEvent($this->siteid, 'Disabled module ' . $tmpmod->modname, LOGGER_NOTICE);
unset($modules[$modid]);
}
}
if (!next($modules)) {
reset($modules);
}
}
$result = true;
}
return $result;
}
示例12: getStyle
public function getStyle()
{
$result = array();
OpenLibrary('configman.library');
$cfg_file = new ConfigFile(CONFIG_PATH . $this->mStyleName . '.huistyle');
if ($cfg_file->Opened()) {
$values = $cfg_file->ValuesArray();
while (list($key, $val) = each($values)) {
$key = trim($key);
$val = trim($val);
$realkey = strtolower(substr($key, strpos($key, '.') + 1));
if ($realkey != 'name') {
$result[$realkey]['value'] = $val;
$result[$realkey]['base'] = $this->mStyleName;
}
}
} else {
import('com.solarix.ampoliros.io.log.Logger');
$log = new Logger(AMP_LOG);
$log->LogEvent('ampoliros.huithemes_library.huistyle_class.getstyle', 'Unable to open style file ' . CONFIG_PATH . $this->mStyleName . '.huistyle', LOGGER_ERROR);
}
return $result;
}
示例13: pass_setadvanced
function pass_setadvanced($eventData)
{
global $hui_mainstatus, $amp_locale, $hui_page, $env, $hui_comments, $compressed_ob;
$log = new Logger(AMP_LOG);
$amp_cfg = new ConfigFile(AMP_CONFIG);
$amp_cfg->SetValue('AMP_HUI_COMMENTS', $eventData['hui-comments'] == 'on' ? '1' : '0');
$amp_cfg->SetValue('AMP_COMPRESSED_OB', $eventData['compressed-ob'] == 'on' ? '1' : '0');
$hui_comments = 'false';
$compressed_ob = 'false';
if ($eventData['hui-comments'] == 'on') {
$hui_comments = 'true';
}
if ($eventData['compressed-ob'] == 'on') {
$compressed_ob = 'true';
}
$log->LogEvent('Ampoliros', 'Changed Ampoliros advanced interface settings', LOGGER_NOTICE);
$hui_mainstatus->mArgs['status'] = $amp_locale->GetStr('advancedset_status');
$hui_page->mArgs['javascript'] = 'parent.frames.sum.location.reload()';
}
示例14: openCatalog
public function openCatalog()
{
$result = false;
import('carthag.core.Registry');
$reg = Registry::instance();
if ($this->catalog != null and $this->lang != null) {
// Tries specified language catalog
//
if (file_exists($reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/locale/' . $this->catalog . '_' . $this->lang . '.catalog')) {
$catfile = $reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/locale/' . $this->catalog . '_' . $this->lang . '.catalog';
} else {
if (file_exists($reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . '/var/locale/' . $this->catalog . '.catalog')) {
$catfile = $reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/locale/' . $this->catalog . '.catalog';
} else {
if (file_exists($reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/locale/' . $this->catalog . '_' . AMP_LANG . '.catalog')) {
$catfile = $reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/locale/' . $this->catalog . '_' . AMP_LANG . '.catalog';
} else {
if (file_exists($reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/locale/' . $this->catalog . '_en.catalog')) {
$catfile = $reg->getEntry('amp.config')->getKey('PRIVATE_TREE') . 'var/locale/' . $this->catalog . '_en.catalog';
} else {
import('com.solarix.ampoliros.io.log.Logger');
$log = new Logger(AMP_LOG);
$log->LogEvent('ampoliros.locale_library.locale_class.opencatalog', 'Unable to find a catalog file for the specified catalog (' . $this->catalog . ') and language (' . $this->lang . ') or fallback to another language', LOGGER_ERROR);
}
}
}
}
if (!empty($catfile)) {
// New way to read locale catalogs
//
OpenLibrary('configman.library');
$loc = new configfile($catfile);
$this->locales = $loc->valuesarray();
$result = true;
/*
if ( sizeof( $this->locales ) == 0 )
{
if ( $fh = @fopen( $catfile, 'r' ) )
{
fclose( $fh );
include( $catfile );
$this->catversion = $catversion;
$this->catdate = $catdate;
$this->locales = $locale;
}
}
*/
}
}
return $result;
}
示例15: strtolower
private function &_getElementStructure(&$element)
{
$result = false;
$element_type = 'Hui' . strtolower($element['tag']);
$element_name = '';
$element_args = array();
$element_children = array();
// Parse the element definition
//
if (isset($element['children']) and is_array($element['children'])) {
while (list(, $node) = each($element['children'])) {
switch ($node['tag']) {
case 'NAME':
$element_name = $node['value'];
break;
case 'ARGS':
if (isset($node['children']) and is_array($node['children'])) {
while (list(, $arg) = each($node['children'])) {
$attrs = isset($arg['attributes']) ? $arg['attributes'] : '';
$type = 'text';
if (is_object($attrs) or is_array($attrs)) {
while (list($attr, $value) = each($attrs)) {
if ($attr == 'TYPE' and $value == 'array') {
$type = 'array';
}
if ($attr == 'TYPE' and $value == 'encoded') {
$type = 'encoded';
}
}
}
if ($type == 'array') {
$value = huixml_decode($arg['value']);
} else {
if ($type == 'encoded') {
$value = urldecode($arg['value']);
} else {
$value = $arg['value'];
}
}
$element_args[strtolower($arg['tag'])] = $value;
}
}
break;
case 'CHILDREN':
if (isset($node['children']) and is_array($node['children'])) {
while (list(, $child_node) = each($node['children'])) {
$relem =& $element_children[];
$relem['args'] = array();
if (strtolower($child_node['tag']) == 'huiobject') {
$relem['element'] = unserialize(urldecode($child_node['value']));
} else {
$relem['element'] =& $this->_GetElementStructure($child_node);
}
// Add not standard parameters
//
if (isset($child_node['attributes']) and is_array($child_node['attributes'])) {
while (list($attr, $value) = each($child_node['attributes'])) {
$relem['args'][strtolower($attr)] = $value;
}
}
}
}
break;
}
}
}
if (!strlen($element_name)) {
$element_name = $element_type . rand();
}
// Build element arguments array
//
while (list($key, $val) = each($element_args)) {
$element_args[$key] = $val;
}
// Tries to load the widget if it wasn't loaded.
//
if (!class_exists($element_type)) {
$widget_name = strtolower($element['tag']);
if (!defined(strtoupper($widget_name . '_HUI')) and file_exists(HANDLER_PATH . $widget_name . '.hui')) {
include_once HANDLER_PATH . $widget_name . '.hui';
}
}
// Create the element and add children if any
//
if (class_exists($element_type)) {
$result = new $element_type($element_name, $element_args);
while (list(, $child_element) = each($element_children)) {
if (isset($child_element['element']) and is_object($child_element['element'])) {
unset($tmp_array);
$tmp_array[] = $child_element['element'];
$args = array_merge($tmp_array, $child_element['args']);
call_user_func_array(array(&$result, 'AddChild'), $args);
}
}
} else {
import('com.solarix.ampoliros.io.log.Logger');
$log = new Logger(AMP_LOG);
$log->LogEvent('ampoliros.xml_hui.huixml_class._getelementstructure', 'Element of type ' . $element_type . ' is not defined', LOGGER_WARNING);
}
return $result;
//.........这里部分代码省略.........