[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] phpgwapi/inc class.shm.inc.php
From: |
Dave Hall |
Subject: |
[Phpgroupware-cvs] phpgwapi/inc class.shm.inc.php |
Date: |
Fri, 22 Sep 2006 03:05:41 +0000 |
CVSROOT: /cvsroot/phpgwapi
Module name: phpgwapi
Changes by: Dave Hall <skwashd> 06/09/22 03:05:41
Modified files:
inc : class.shm.inc.php
Log message:
move the defines out of the constructor and document them, add a sane
tmp default
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/class.shm.inc.php?cvsroot=phpgwapi&r1=1.8&r2=1.9
Patches:
Index: class.shm.inc.php
===================================================================
RCS file: /cvsroot/phpgwapi/phpgwapi/inc/class.shm.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- class.shm.inc.php 19 Sep 2006 16:04:51 -0000 1.8
+++ class.shm.inc.php 22 Sep 2006 03:05:41 -0000 1.9
@@ -63,9 +63,50 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package phpgwapi
* @subpackage application
- * @version $Id: class.shm.inc.php,v 1.8 2006/09/19 16:04:51 skwashd Exp
$
+ * @version $Id: class.shm.inc.php,v 1.9 2006/09/22 03:05:41 skwashd Exp
$
*/
+ //This makes sure there is something set for temp
+ if ( !isset($GLOBALS['phpgw_info']['server']['temp_dir']) )
+ {
+ if ( substr(PHP_OS, 3) == 'WIN' )
+ {
+ $GLOBALS['phpgw_info']['server']['temp_dir'] =
'C:\\temp';
+ }
+ else
+ {
+ $GLOBALS['phpgw_info']['server']['temp_dir'] = '/tmp/';
+ }
+ }
+
+ /**
+ * How long to cache data, in seconds
+ */
+ define('PHPGW_SHM_CACHE_SECONDS', 60 * 60);
+
+ /**
+ * Log data being stored ?
+ */
+ define('PHPGW_SHM_LOG', false);
+
+ /**
+ * File to store debug data in
+ */
+ define('PHPGW_SHM_LOG_FILE',
$GLOBALS['phpgw_info']['server']['temp_dir'] . '/phpgw-shm-debug.log' );
+
+ /**
+ * The prime number for the hasing routine?
+ */
+ define('PHPGW_SHM_HASH_PRIME', 2147483647); //2^31 -1
+
+ /**
+ * The path to store the lock files
+ */
+ define('PHPGW_SHM_LOCK', $GLOBALS['phpgw_info']['server']['temp_dir']);
+
+ /**
+ * Shared memory handler class
+ */
class shm
{
/**
@@ -77,15 +118,7 @@
* Constructor
*/
function shm()
- {
-
- define('PHPGW_SHM_CACHE_SECONDS', 60 * 60);
- define('PHPGW_SHM_LOG', false);
- define('PHPGW_SHM_LOG_FILE', '/tmp/debug.log' );
- define('PHPGW_SHM_HASH_PRIME', 2147483647); //2^31 -1
- define('PHPGW_SHM_LOCK',
$GLOBALS['phpgw_info']['server']['temp_dir']);
- // DEFINE('PHPGW_SHM_HASHID', 'hash_table_key');
- }
+ {}
/**
* Log a message
- [Phpgroupware-cvs] phpgwapi/inc class.shm.inc.php,
Dave Hall <=