Location: PHPKode > projects > Rain Framework > rain framework/inc/constants.php
<?php
	
//-------------------------------------------------------------
//
//					 Settings
//
//-------------------------------------------------------------

	define( "DEBUG", true );
	define( "TIMEZONE", "Europe/Rome" );
	define( "CHARSET", "utf-8" );


//-------------------------------------------------------------
//
//					 Directories
//
//-------------------------------------------------------------

	// cms
	define( "INC_DIR",	"inc/" );
	define( "TPL_DIR",	"tpl/" );
	define( "MOD_DIR",	"mod/" );
	define( "LANG_DIR",	"lang/" );	
	define( "UPS_DIR", 	"ups/" );	 //uploads
	define( "LOG_DIR",	"log/" );
	define( "TMP_DIR",	"tmp/" );	 //temp dir
	define( "JS_DIR",	"inc/js/" ); //js dir
	define( "SITE_DIR", substr( dirname( __FILE__ ), 0, strlen(dirname(__FILE__)) - strlen( INC_DIR ) ) . "/" );		// site directory

//-------------------------------------------------------------
//
//					 User Info
//
//-------------------------------------------------------------
	
		// browser calculation
		$known = array('msie', 'firefox', 'safari', 'webkit', 'opera', 'netscape', 'konqueror', 'gecko');
		preg_match_all( '#(?<browser>' . join('|', $known) . ')[/ ]+(?<version>[0-9]+(?:\.[0-9]+)?)#', strtolower($_SERVER['HTTP_USER_AGENT']), $match );
		preg_match_all( '#\((.*?);#', $_SERVER['HTTP_USER_AGENT'], $os );
		if( isset( $match['browser'][1] ) )	$browser = $match['browser'][1]; elseif( isset( $match['browser'][1] ) ) $browser = $match['browser'][0]; else $browser = null; 
		if( isset( $match['version'][1] ) ) $version = $match['version'][1]; elseif ( isset( $match['version'][0] ) ) $version = $match['version'][0]; else $version = null;
	
	// user IP
	define( "IP", ( $ip = getenv( "HTTP_X_FORWARDED_FOR" ) ) ? $ip : getenv( "REMOTE_ADDR" ) );
	define( "BROWSER_LANG_ID", array_shift( explode("-",$_SERVER["HTTP_ACCEPT_LANGUAGE"]) ) );
	define( "BROWSER", $browser );
	define( "BROWSER_VERSION", $version );
	define( "BROWSER_OS", $os[1][0] );

	define( "USER_ONLINE_TIME", 600 );	// user is considered online before 10 minutes of inactivity
	
//-------------------------------------------------------------
//
//					 Server Info
//
//-------------------------------------------------------------
	
	preg_match( "#\((.*?)\)#si", $_SERVER[ "SERVER_SOFTWARE" ], $os );
	define( "OS", strtolower($os[1]) );															// server OS


	
	


	
//-------------------------------------------------------------
//
//					Constants
//
//-------------------------------------------------------------

	//default value
	define( "PUBLISHED",true );
	define( "YES",      true );
	define( "NO",       false );
	define( "ENABLED",  true );
	define( "DISABLED", false );
	define( "LOW",      0 );
	define( "MED",      1 );
	define( "HIGH",     2 );

	
	//time
	define( "TIME"	, time() );		// timestamp
	define( "SECOND", 1 );
	define( "MINUTE", 60 );			// seconds in minute
	define( "HOUR"	, 3600 );		// seconds in hour
	define( "DAY"	, 86400 );		// seconds in day 
	define( "WEEK"	, 604800 );		// seconds in week
	define( "MONTH" , 2592000 );	// seconds in month
	define( "YEAR"  , 31536000 );	// seconds in year
	
	
?>
Return current item: Rain Framework