|
| 1 | +/* |
| 2 | + +----------------------------------------------------------------------+ |
| 3 | + | APC | |
| 4 | + +----------------------------------------------------------------------+ |
| 5 | + | Copyright (c) 2006-2011 The PHP Group | |
| 6 | + +----------------------------------------------------------------------+ |
| 7 | + | This source file is subject to version 3.01 of the PHP license, | |
| 8 | + | that is bundled with this package in the file LICENSE, and is | |
| 9 | + | available through the world-wide-web at the following url: | |
| 10 | + | http://www.php.net/license/3_01.txt | |
| 11 | + | If you did not receive a copy of the PHP license and are unable to | |
| 12 | + | obtain it through the world-wide-web, please send a note to | |
| 13 | + | license@php.net so we can mail you a copy immediately. | |
| 14 | + +----------------------------------------------------------------------+ |
| 15 | +
|
| 16 | + This software was contributed to PHP by Community Connect Inc. in 2002 |
| 17 | + and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. |
| 18 | + Future revisions and derivatives of this source code must acknowledge |
| 19 | + Community Connect Inc. as the original contributor of this module by |
| 20 | + leaving this note intact in the source code. |
| 21 | +
|
| 22 | + All other licensing and usage conditions are those of the PHP Group. |
| 23 | +
|
| 24 | + */ |
| 25 | + |
| 26 | +#include "apc_time.h" |
| 27 | +#include "apc_globals.h" |
| 28 | +#include "SAPI.h" |
| 29 | + |
| 30 | +time_t apc_time(void) |
| 31 | +{ |
| 32 | + if (APCG(use_request_time)) { |
| 33 | + if (!APCG(request_time)) |
| 34 | + APCG(request_time) = (time_t) sapi_get_request_time(); |
| 35 | + return APCG(request_time); |
| 36 | + } else { |
| 37 | + return time(0); |
| 38 | + } |
| 39 | +} |
| 40 | + |
| 41 | +/* |
| 42 | + * Local variables: |
| 43 | + * tab-width: 4 |
| 44 | + * c-basic-offset: 4 |
| 45 | + * End: |
| 46 | + * vim>600: noexpandtab sw=4 ts=4 sts=4 fdm=marker |
| 47 | + * vim<600: noexpandtab sw=4 ts=4 sts=4 |
| 48 | + */ |
0 commit comments