本文整理汇总了PHP中EventLog类的典型用法代码示例。如果您正苦于以下问题:PHP EventLog类的具体用法?PHP EventLog怎么用?PHP EventLog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EventLog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: save
function save()
{
$rValue = false;
if ($this->name != "" && $this->project_id != "" && $this->version != "") {
global $dbh;
if ($this->file_id == 0) {
$this->file_id = $this->getFileID($this->name, $this->project_id, $this->version);
}
$sql = "INSERT INTO";
$where = "";
if ($this->file_id > 0) {
$sql = "UPDATE";
$where = " WHERE file_id = " . sqlSanitize($this->file_id, $dbh);
}
$Event = new EventLog("files", "file_id", $this->file_id, $sql);
$sql .= " files \n\t\t\t\t\t\tSET file_id \t= " . sqlSanitize($this->file_id, $dbh) . ",\n\t\t\t\t\t\t\tproject_id\t= " . returnQuotedString(sqlSanitize($this->project_id, $dbh)) . ", \n\t\t\t\t\t\t\tversion\t\t= " . returnQuotedString(sqlSanitize($this->version, $dbh)) . ", \n\t\t\t\t\t\t\tname\t\t= " . returnQuotedString(sqlSanitize($this->name, $dbh)) . ",\n\t\t\t\t\t\t\tplugin_id\t= " . returnQuotedString(sqlSanitize($this->plugin_id, $dbh)) . ",\n\t\t\t\t\t\t\tis_active\t= " . $this->is_active . $where;
if (mysql_query($sql, $dbh)) {
if ($this->file_id == 0) {
$this->file_id = mysql_insert_id($dbh);
$Event->key_value = $this->file_id;
}
$rValue = true;
$Event->add();
} else {
echo $sql . "\n";
$GLOBALS['g_ERRSTRS'][1] = mysql_error();
}
} else {
echo "ERROR: One missing:Name: " . $this->name . "Project: " . $this->project_id . "Version: " . $this->version;
}
return $rValue;
}
开发者ID:Tiger66639,项目名称:server-1,代码行数:32,代码来源:file.class.php
示例2: relayAction
public function relayAction($request)
{
if (!isset($this->settings['short' . $request->area])) {
return null;
}
$db = JFactory::getDBO();
$rewriting = array('short', 'tags', 'text', 'params');
foreach ($rewriting as $rw_name) {
$this->settings[$rw_name . $request->area] = AECToolbox::rewriteEngineRQ($this->settings[$rw_name . $request->area], $request);
}
$log_entry = new EventLog();
$log_entry->issue($this->settings['short' . $request->area], $this->settings['tags' . $request->area], $this->settings['text' . $request->area], $this->settings['level' . $request->area], $this->settings['params' . $request->area], $this->settings['force_notify' . $request->area], $this->settings['force_email' . $request->area]);
}
开发者ID:Ibrahim1,项目名称:aec,代码行数:13,代码来源:eventlog.php
示例3: execute
/**
* Executes the cronjob.
*
* @param mixed $last_result What the last execution of this cronjob
* returned.
* @param Array $parameters Parameters for this cronjob instance which
* were defined during scheduling.
*/
public function execute($last_result, $parameters = array())
{
$event_log = new EventLog();
$event_log->cleanup_log_events();
if (!empty($parameters['cronjobs'])) {
$delete = function ($l) {
$l->delete();
};
if ($parameters['cronjobs-error'] > 0) {
CronjobLog::findEachBySql($delete, "exception != 'N;' AND executed + ? < UNIX_TIMESTAMP()", array($parameters['cronjobs-error'] * 24 * 60 * 60));
}
if ($parameters['cronjobs-success'] > 0) {
CronjobLog::findEachBySql($delete, "exception = 'N;' AND executed + ? < UNIX_TIMESTAMP()", array($parameters['cronjobs-success'] * 24 * 60 * 60));
}
}
}
开发者ID:ratbird,项目名称:hope,代码行数:24,代码来源:cleanup_log.class.php
示例4: filter_dash_module_latest_log_activity
/**
* filter_dash_module_latest_log_activity
* Sets theme variables and handles logic for the
* dashboard's log history module.
* @param string $module_id
* @return string The contents of the module
*/
public function filter_dash_module_latest_log_activity( $module, $module_id, $theme )
{
if ( false === ( $num_logs = Modules::get_option( $module_id, 'logs_number_display' ) ) ) {
$num_logs = 8;
}
$params = array(
'where' => array(
'user_id' => User::identify()->id
),
'orderby' => 'id DESC', /* Otherwise, exactly same timestamp values muck it up... Plus, this is more efficient to sort on the primary key... */
'limit' => $num_logs,
);
$theme->logs = EventLog::get( $params );
// Create options form
/* Commented out until fully implemented or it's decided to drop completely. See https://trac.habariproject.org/habari/ticket/1233
$form = new FormUI( 'dash_logs' );
$form->append( 'text', 'logs_number_display', 'option:' . Modules::storage_name( $module_id, 'logs_number_display' ), _t('Number of items') );
$form->append( 'submit', 'submit', _t('Submit') );
$form->properties['onsubmit'] = "dashboard.updateModule({$module_id}); return false;";
*/
$module['title'] = ( User::identify()->can( 'manage_logs' ) ? '<a href="' . Site::get_url('admin') . '/logs">' . _t('Latest Log Activity') . '</a>' : _t('Latest Log Activity') );
//$module['options'] = $form->get();
$module['content'] = $theme->fetch( 'dash_logs' );
return $module;
}
开发者ID:rynodivino,项目名称:system,代码行数:35,代码来源:coredashmodules.plugin.php
示例5: filter_linkit_fetch
public function filter_linkit_fetch($success)
{
$stats = $this->api_getstats();
EventLog::log(_t('Running dashboard fetch for 123LinkIt', 'linkit'), 'info', null, null, $stats);
Options::set('linkit__stats', $stats);
return $success;
}
开发者ID:ringmaster,项目名称:123linkit_habari,代码行数:7,代码来源:123linkit.plugin.php
示例6: action_block_content_latest_log_activity
/**
* Produce the content for the latest log activity block
* @param Block $block The block object
* @param Theme $theme The theme that the block will be output with
*/
public function action_block_content_latest_log_activity($block, $theme)
{
$params = array('where' => array('user_id' => User::identify()->id), 'orderby' => 'id DESC', 'limit' => isset($block->logs_number_display) ? $block->logs_number_display : 8);
$block->logs = EventLog::get($params);
$block->link = URL::get('admin', array('page' => 'logs'));
$block->has_options = true;
}
开发者ID:wwxgitcat,项目名称:habari,代码行数:12,代码来源:coredashmodules.plugin.php
示例7: __static
/**
* Constructor for RenderCache
*
* Sets up paths and gets the list of groups from file
*/
public static function __static()
{
//Define the cache path and url
self::$cache_path = HABARI_PATH . '/' . self::$rel_cache_path;
self::$cache_url = Site::get_url('habari') . '/' . self::$rel_cache_path;
//If the cache directory doesn't exist, make it
if (!is_dir(self::$cache_path)) {
mkdir(self::$cache_path, 0755);
}
//Enable only if the cache directory now exists and is writable
self::$enabled = is_dir(self::$cache_path) && is_writeable(self::$cache_path);
//Give an error if the cache directory is not writable
if (!self::$enabled) {
Session::error(sprintf(_t("The cache directory '%s' is not writable - the cache is disabled. The user, or group, which your web server is running as, needs to have read, write, and execute permissions on this directory."), self::$cache_path), 'RenderCache');
EventLog::log(sprintf(_t("The cache directory '%s' is not writable - the cache is disabled."), self::$cache_path), 'notice', 'RenderCache', 'habari');
return;
}
//Get the list of group names
$group_file = self::get_group_list_file();
if (file_exists($group_file)) {
self::$group_list = unserialize(file_get_contents($group_file));
} else {
self::$group_list = array();
}
}
开发者ID:justinjstark,项目名称:rendercache,代码行数:30,代码来源:rendercache.php
示例8: filter_default_rewrite_rules
public function filter_default_rewrite_rules($rules)
{
if ($this->current_load() > self::KILL_LOAD) {
foreach ($rules as $key => $rule) {
if (strpos($rule['build_str'], 'admin') !== false) {
$rules[$key]['handler'] = 'UserThemeHandler';
$rules[$key]['action'] = 'display_throttle';
}
}
if (Options::get('throttle') == '') {
EventLog::log(sprintf(_t('Kill - Load is %s'), $this->current_load()));
Options::set('throttle', 'kill');
}
} elseif ($this->current_load() > self::MAX_LOAD) {
foreach ($rules as $key => $rule) {
if ($rule['name'] == 'search') {
unset($rules[$key]);
}
}
$rules[] = array('name' => 'search', 'parse_regex' => '%^search(?:/(?P<criteria>[^/]+))?(?:/page/(?P<page>\\d+))?/?$%i', 'build_str' => 'search(/{$criteria})(/page/{$page})', 'handler' => 'UserThemeHandler', 'action' => 'display_throttle', 'priority' => 8, 'description' => 'Searches posts');
if (Options::get('throttle') == '') {
EventLog::log(sprintf(_t('Restrict - Load is %s'), $this->current_load()));
Options::set('throttle', 'restrict');
}
} else {
if (Options::get('throttle') != '') {
EventLog::log(sprintf(_t('Normal - Load is %s'), $this->current_load()));
Options::set('throttle', '');
}
}
return $rules;
}
开发者ID:habari-extras,项目名称:throttle,代码行数:32,代码来源:throttle.plugin.php
示例9: filter_optimize_database
public function filter_optimize_database($result, $paramarray)
{
$space_saved = 0;
$tables = 0;
switch (DB::get_driver_name()) {
case 'mysql':
$q = 'SHOW TABLE STATUS WHERE data_free > 0';
$tables = DB::get_results($q);
if (count($tables) > 0) {
foreach ($tables as $table) {
$q2 = 'OPTIMIZE TABLE ' . $table->Name;
if (DB::query($q2)) {
$space_saved += $table->Data_free;
$tables++;
}
}
EventLog::log('Database Tables Optimized. ' . Utils::human_size($space_saved) . ' reclaimed from ' . HabariLocale::_n('table', 'tables', $tables) . '.');
}
$result = true;
break;
case 'sqlite':
if (DB::exec('VACUUM')) {
$result = true;
EventLog::log('SQLite database VACUUM\'ed successfully.');
} else {
$result = false;
}
break;
default:
$result = false;
break;
}
return $result;
}
开发者ID:habari-extras,项目名称:database_optimizer,代码行数:34,代码来源:database_optimizer.plugin.php
示例10: migrate
function migrate()
{
global $conn;
$sql = getMigrateQueryHeader();
$sql .= Customer::getSchemaSQL();
$sql .= CustomerCar::getSchemaSQL();
$sql .= EventLog::getSchemaSQL();
$sql .= GreaseRatEvent::getSchemaSQL();
$sql .= RepairPost::getSchemaSQL();
$sql .= RepairType::getSchemaSQL();
$sql .= User::getSchemaSQL();
if ($conn->multi_query($sql)) {
do {
if ($result = $conn->store_result()) {
while ($row = $result->fetch_row()) {
printf("%s\n", $row[0]);
}
$result->free();
}
if ($conn->more_results()) {
printf("-----------------\n");
}
} while ($conn->next_result());
}
$conn->close();
}
开发者ID:vugluskr86,项目名称:_autoservice,代码行数:26,代码来源:index.php
示例11: filter_rssblocks_update
public function filter_rssblocks_update($success, $force = false)
{
EventLog::log('Running rrsblocks update');
$blocks = DB::get_results('SELECT b.* FROM {blocks} b WHERE b.type = ?', array('rssblock'), 'Block');
Plugins::act('get_blocks', $blocks);
$success = true;
foreach ($blocks as $block) {
$cachename = array('rssblock', md5($block->feed_url));
if ($force || Cache::expired($cachename)) {
$r = new RemoteRequest($block->feed_url);
$r->set_timeout(10);
$r->execute();
$feed = $r->get_response_body();
try {
if (is_string($feed)) {
new SimpleXMLElement($feed);
// This throws an exception if the feed isn't valid
Cache::set($cachename, $feed, 3600, true);
}
} catch (Exception $e) {
$success = false;
}
}
}
Session::notice('ran rssblocks update');
return $success;
}
开发者ID:habari-extras,项目名称:rssblocks,代码行数:27,代码来源:rssblocks.plugin.php
示例12: load
function load($email, $password)
{
if ($email != "" && $password != "") {
if (eregi('^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z.]{2,5}$', $email)) {
global $addon;
$addon->callHook('user_authentication', array(&$this, $email, $password));
}
}
if ($this->userid > 0) {
$Event = new EventLog("users", "userid", $this->userid, "__auth_success");
$Event->add();
} else {
$Event = new EventLog("users", "userid", $_SERVER['REMOTE_ADDR'] . ":" . $email, "__auth_failure");
$Event->add();
}
return $this->userid;
}
开发者ID:joklaps,项目名称:mytourbook,代码行数:17,代码来源:user.class.php
示例13: action_comment_insert_before
function action_comment_insert_before($comment)
{
// This plugin ignores non-comments and comments already marked as spam
if ($comment->type == Comment::COMMENT && $comment->status != Comment::STATUS_SPAM) {
$comment->status = Comment::STATUS_APPROVED;
EventLog::log('Comment by ' . $comment->name . ' automatically approved.', 'info', 'autoapprove', 'autoapprove');
}
return $comment;
}
开发者ID:anupom,项目名称:my-blog,代码行数:9,代码来源:autoapprove.plugin.php
示例14: action_admin_moderate_comments
function action_admin_moderate_comments($action, $comments, $handler)
{
if ($action == 'approve' || $action == 'approved') {
foreach ($comments as $c) {
$this->update_post_modified($c->post_id);
EventLog::log('bumped post ' . $c->post_id . ', by admin approval', 'info', 'default', 'bumping');
}
}
}
开发者ID:habari-extras,项目名称:bumping,代码行数:9,代码来源:bumping.plugin.php
示例15: action_auth_ajax_extendedlog
function action_auth_ajax_extendedlog($handler)
{
$log = EventLog::get(array('fetch_fn' => 'get_row', 'id' => $handler->handler_vars['log_id'], 'return_data' => true));
if (trim($log->data) == '') {
$log->data = 'No additional data was logged.';
}
echo $log->message . "<hr>\n";
echo $log->data;
}
开发者ID:habari-extras,项目名称:extendedlog,代码行数:9,代码来源:extendedlog.plugin.php
示例16: __construct
/**
* Constructor for APCCache
*/
public function __construct()
{
$this->prefix = Options::get('private-GUID');
$this->enabled = extension_loaded('apc');
if (!$this->enabled) {
Session::error(_t("The APC Cache PHP module is not loaded - the cache is disabled.", "apccache"), 'filecache');
EventLog::log(_t("The APC Cache PHP module is not loaded - the cache is disabled.", "apccache"), 'notice', 'cache', 'apccache');
}
}
开发者ID:habari,项目名称:system,代码行数:12,代码来源:apccache.php
示例17: validate_captcha
/**
* Reject form submission (and repopulate the form) if the captcha fails.
* ...
* @return array Message to return upon failure
**/
public function validate_captcha($unused, $control, $form)
{
$solvemedia_response = solvemedia_check_answer(Options::get('solvemedia__vkey'), $_SERVER["REMOTE_ADDR"], $_POST["adcopy_challenge"], $_POST["adcopy_response"], Options::get('solvemedia__hkey'));
if ($solvemedia_response->is_valid) {
EventLog::log(_t('Comment by %s approved by SolveMedia captcha.', array($comment->name), 'solvemedia'), 'info', 'comment', 'SolveMedia');
} else {
return array(_t('Your CAPTCHA attempt did not succeed: %s', array($solvemedia_response->error), 'solvemedia'));
}
}
开发者ID:habari-extras,项目名称:solvemedia,代码行数:14,代码来源:solvemedia.plugin.php
示例18: get
/**
* gets info for a counterparty asset
* @param string $asset
* @return Response
* */
public function get(Cache $asset_info_cache, $asset)
{
$asset = $asset_info_cache->get(strtoupper($asset));
if (!$asset) {
$message = "The asset {$asset} could not be found";
EventLog::logError('error.getAsset', ['asset' => $asset, 'message' => $message]);
return new JsonResponse(['message' => $message], 500);
}
return json_encode($asset);
}
开发者ID:CryptArc,项目名称:xchain,代码行数:15,代码来源:AssetController.php
示例19: filter_activate_plugin
public function filter_activate_plugin($ok, $file)
{
// Don't bother loading if the gd library isn't active
if (!function_exists('imagecreatefromjpeg')) {
EventLog::log(_t("S3 Silo activation failed. PHP has not loaded the gd imaging library."), 'warning', 'plugin');
Session::error(_t("S3 Silo activation failed. PHP has not loaded the gd imaging library."));
$ok = false;
}
return $ok;
}
开发者ID:ringmaster,项目名称:s3silo,代码行数:10,代码来源:s3silo.plugin.php
示例20: action_comment_insert_before
public function action_comment_insert_before($comment)
{
if ($comment->type == Comment::COMMENT && $comment->status != Comment::STATUS_SPAM) {
if ($this->check_comment($comment) === false) {
$comment->status = Comment::STATUS_SPAM;
EventLog::log(sprintf(_t("Comment by %s automatically marked as spam", 'simpleblacklist'), $comment->name), 'info', 'Simple Blacklist', 'plugin');
}
}
return $comment;
}
开发者ID:habari-extras,项目名称:simpleblacklist,代码行数:10,代码来源:simpleblacklist.plugin.php
注:本文中的EventLog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论