($sid) { session_delete(array('sid' => $sid)); session_data_delete(array('sid' => $sid)); return TRUE; } function sess_gc($maxlifetime) { global $time; $expiry = $time - $maxlifetime; $arrlist = session_find(array('last_date' => array('<' => $expiry)), array(), 1, 10000, '', array('sid', 'bigdata', 'last_date')); if (!$arrlist) return TRUE; $expiry = $time - 21600; // 超6小时未提交丢弃上传图片和附件 $sidarr = array(); foreach ($arrlist as $val) { if ($val['last_date'] > $expiry && $val['bigdata']) continue; $sidarr[] = $val['sid']; } if (empty($sidarr)) return TRUE; session_delete(array('sid' => $sidarr)); session_data_delete(array('sid' => $sidarr)); return TRUE; } function sess_start() { global $conf, $sid, $g_session; ini_set('session.name', $conf['cookie_pre'] . 'sid'); ini_set('session.use_cookies', TRUE); ini_set('session.use_only_cookies', TRUE); ini_set('session.cookie_domain', $conf['cookie_domain']); // 为空则表示当前目录和子目录 ini_set('session.cookie_path', $conf['cookie_path']); // 打开后只有通过 https 才有效 ini_set('session.cookie_secure', FALSE); ini_set('session.cookie_lifetime', 8640000); // 打开后 js 获取不到 HTTP 设置的 cookie, 有效防止 XSS,对于安全很重要,除非有 BUG,否则不要关闭。 ini_set('session.cookie_httponly', TRUE); // 活动时间 ini_set('session.gc_maxlifetime', $conf['online_hold_time']); // 垃圾回收概率 = gc_probability/gc_divisor ini_set('session.gc_probability', 1); // 垃圾回收时间 5 秒,在线人数 * 10 / 每1000个请求回收一次垃圾 ini_set('session.gc_divisor', 1000); session_set_save_handler('sess_open', 'sess_close', 'sess_read', 'sess_write', 'sess_destroy', 'sess_gc'); // register_shutdown_function 会丢失当前目录,需要 chdir(APP_PATH) $conf['url_rewrite_on'] > 1 and function_exists('chdir') and chdir(APP_PATH); // 这个必须有,否则 ZEND 会提前释放 $db 资源 register_shutdown_function('session_write_close'); session_start(); $sid = session_id(); return $sid; } // 刷新页面清理附件缓存 废弃 function sess_clear_attach() { global $sid, $time; $arr = session_read($sid); if (!$arr || 0 == $arr['bigdata']) return TRUE; session_update($sid, array('bigdata' => 0, 'last_date' => $time)); session_data_delete(array('sid' => $sid)); return TRUE; } function online_count() { return session_count(); } function online_list_cache() { static $cache = array(); $key = 'online_list'; if (isset($cache[$key])) return $cache[$key]; $cache[$key] = cache_get($key); if (NULL === $cache[$key]) { $cache[$key] = session_find(array('uid' => array('>' => 0)), array('last_date' => -1), 1, 1000); foreach ($cache[$key] as &$online) { $user = user_read_cache($online['uid']); $online['username'] = $user['username']; $online['gid'] = $user['gid']; $online['ip_fmt'] = safe_long2ip($online['ip']); $online['last_date_fmt'] = date('Y-n-j H:i', $online['last_date']); } cache_set('online_list', $cache[$key], 300); } return $cache[$key]; } function online_user_list_cache() { static $cache = array(); $key = 'online_user_list'; if (isset($cache[$key])) return $cache[$key]; $cache[$key] = cache_get($key); if (NULL === $cache[$key]) { $cache[$key] = session_find(array('uid' => array('>' => 0)), array(), 1, 1000, 'uid', array('uid')); cache_set('online_user_list', $cache[$key], 300); } return $cache[$key]; } ?>英语中 already 的用法|江阴雨辰互联

英语中 already 的用法

英语中 already 的用法


2024年4月6日发(作者:vivo s10配置)

already 是一个常见的副词,用来强调某事在其他事情发生之前就已经完成

了,用于肯定句或疑问句中,一般不用于否定句中,它是学英语必须学会的重

要副词之一,特别是与英语时态的搭配更是家喻户晓的用法,所以如果不会用

already,就不能说自己会英语。

一、already 译为“已经,早已”,用来强调某事在其他事情发生之前就已经完

成了,所以通常与现在完成时和过去完成时连用,用哪个时态取决于说话者的

时间点是现在还是过去,例如:

现在完成时:

People have already arrived at the theater.

人们已经到了剧院。

The meeting has already begun.

会议已经开始了。

过去完成时:

We got there early but Mike had already left.

我们及早到了那里,但是迈克已经离开了。

He had already left when I called.

我打电话时他已经走了。

注意:在美式英语中,already 有时还用于一般过去时,且一般多用于口语

中,但是有些美国人还是认为这种用法是不可取的,所以在实际应用中要尽量

避免,例如:

I already did it.

我已经完成了。

Did you eat yet?

你吃饭了吗?

二、already 译为“已经,都”,用来表示惊奇,试比较以下两个句子:

It’s twelve o’clock.

十二点了。

解析:现在十二点了,说话者不惊讶。

It’s twelve o’clock already.

已经十二点了。

解析:已经十二点了,说话者很惊讶,没想到会这么晚。

Is it seven o’clock?

七点了吗?

解析:七点了,说话者不惊讶。

Is it seven o’clock already?

已经七点了吗?

解析:已经七点了,说话者很惊讶,说话者没想到会这么晚。

There are already about ten people here.

这里已经有十个人了。

解析:已经有十个人了,我很惊讶。

We should go home because it is already dark.

我们应该回家,因为天已经黑了。

My homework is already done.

我的作业已经做完了。

The doctor found out the patient was already dead.

医生发现病人已经死了。

三、already 译为“已经”,强调情况或问题存在,通常与形容词连用,例如:

四、already 的位置

1、already 置于中间位置

a、一般放在实义动词之前,例如:

We already knew that he was coming to visit.

我们已经知道他要来拜访。

His family had already heard the news.

他的家人已经听说了这个消息。

Joe’s already here, so we can begin.

乔已经来了,我们可以开始了。

b、be 动词、第一助动词或情态动词之后,例如:

c、要注意区分 already 与 have 连接时,have 是实义动词还是助动词;若

have 是助动词,则 already 置于其后,若是实义动词,则置于其前,例如:

We need to tap the expertise of the people we already have.

我们需要利用我们现有人员的专业知识。

We need double the amount we already have.

我们需要现有数量的两倍。

解析:以上两句中的 have 都是实义动词,译为“有,拥有”,所以 already 要

置于 have 前面。

He's been in the dock several times already.

他已受审多次。

Have you booked a flight already?

你已经订好机票了吗?

2、already 置于句末,用来来加强强调或表示更大的惊奇,主要用语在非正式

场合的口语中,例如:

3、already 很少置于句首(主语之前),通常用于正式的场合,一般不用于非

正式的谈话中,例如:

Already more than fifty thousand tickets have been sold for Saturday’s

cup final match.

周六的杯赛决赛门票已经售出五万多张。

五、使用 already 常犯的错误

1、除了偶尔用在在美式英语中,否则 already 一般不用于一般过去时。

2、already 不能置于实义动词与其对应的宾语中间,例如:

我今天已经喝了三杯咖啡了!

正确:I’ve already drunk three coffees today!

错误:I’ve drunk already three coffees today!


发布者:admin,转转请注明出处:http://www.yc00.com/num/1712354441a2045061.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信