From: Stig Bakken Date: Tue, 18 Jul 2000 11:02:28 +0000 (+0000) Subject: @Set default include_path so PEAR files can be reached (Stig) X-Git-Tag: PRE_FILE_COMPILE_API_CHANGE~234 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7bb67a620032ed679826b103e33282ea2126be70;p=php @Set default include_path so PEAR files can be reached (Stig) --- diff --git a/build-defs.h.in b/build-defs.h.in index f8a94e1fb2..78e365e625 100644 --- a/build-defs.h.in +++ b/build-defs.h.in @@ -88,3 +88,4 @@ #define PHP_VELOCIS_INCLUDE "" #define PHP_VELOCIS_LIBS "" #define PHP_EXTENSION_DIR "@EXTENSION_DIR@" +#define PHP_INCLUDE_PATH "@INCLUDE_PATH@" diff --git a/configure.in b/configure.in index c3dcf12f1f..d10f4cb510 100644 --- a/configure.in +++ b/configure.in @@ -665,6 +665,9 @@ ZEND_MODULE_API_NO=`egrep '#define ZEND_MODULE_API_NO ' $srcdir/Zend/modules.h|s EXTENSION_DIR="$prefix/lib/php/extensions/$PART1-$PART2-$ZEND_MODULE_API_NO" +PEAR_INSTALLDIR="$prefix/lib/php" +INCLUDE_PATH=".:$PEAR_INSTALLDIR" + AC_BUILD_RPATH EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS" @@ -702,6 +705,7 @@ PHP_SUBST(EXTENSION_DIR) PHP_SUBST(EXTRA_LDFLAGS) PHP_SUBST(EXTRA_LIBS) PHP_SUBST(INCLUDES) +PHP_SUBST(INCLUDE_PATH) PHP_SUBST(INSTALL_IT) PHP_SUBST(LEX) PHP_SUBST(LEX_OUTPUT_ROOT) @@ -710,6 +714,7 @@ PHP_SUBST(LIBTOOL) PHP_SUBST(LN_S) PHP_SUBST(NATIVE_RPATHS) PHP_SUBST(PEAR_DIR) +PHP_SUBST(PEAR_INSTALLDIR) PHP_SUBST(PHP_BUILD_DATE) PHP_SUBST(PHP_COMPILE) PHP_SUBST(PHP_LDFLAGS) diff --git a/ext/standard/rand.c b/ext/standard/rand.c index 9766ecfcb3..0413e31269 100644 --- a/ext/standard/rand.c +++ b/ext/standard/rand.c @@ -262,16 +262,16 @@ PHP_FUNCTION(rand) return_value->value.lval = rand(); #endif #endif - /* - * A bit of tricky math here. We want to avoid using a modulus because - * that simply tosses the high-order bits and might skew the distribution - * of random values over the range. Instead we map the range directly. - * - * We need to map the range from 0...M evenly to the range a...b + /* + * A bit of tricky math here. We want to avoid using a modulus because + * that simply tosses the high-order bits and might skew the distribution + * of random values over the range. Instead we map the range directly. + * + * We need to map the range from 0...M evenly to the range a...b * Let n = the random number and n' = the mapped random number - * + * * Then we have: n' = a + n(b-a)/M - * + * * We have a problem here in that only n==M will get mapped to b which # means the chances of getting b is much much less than getting any of # the other values in the range. We can fix this by increasing our range @@ -279,7 +279,7 @@ PHP_FUNCTION(rand) # # n' = a + n(b-a+1)/M * - # Now we only have a problem if n==M which would cause us to produce a + # Now we only have a problem if n==M which would cause us to produce a # number of b+1 which would be bad. So we bump M up by one to make sure # this will never happen, and the final algorithm looks like this: # diff --git a/main/main.c b/main/main.c index 3330f63ca5..f72083bea8 100644 --- a/main/main.c +++ b/main/main.c @@ -237,7 +237,7 @@ PHP_INI_BEGIN() STD_PHP_INI_ENTRY("error_log", NULL, PHP_INI_ALL, OnUpdateString, error_log, php_core_globals, core_globals) STD_PHP_INI_ENTRY("extension_dir", PHP_EXTENSION_DIR, PHP_INI_SYSTEM, OnUpdateStringUnempty, extension_dir, php_core_globals, core_globals) STD_PHP_INI_ENTRY("gpc_order", "GPC", PHP_INI_ALL, OnUpdateStringUnempty, gpc_order, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("include_path", NULL, PHP_INI_ALL, OnUpdateStringUnempty, include_path, php_core_globals, core_globals) + STD_PHP_INI_ENTRY("include_path", PHP_INCLUDE_PATH, PHP_INI_ALL, OnUpdateStringUnempty, include_path, php_core_globals, core_globals) PHP_INI_ENTRY("max_execution_time", "30", PHP_INI_ALL, OnUpdateTimeout) STD_PHP_INI_ENTRY("open_basedir", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, open_basedir, php_core_globals, core_globals) STD_PHP_INI_ENTRY("safe_mode_exec_dir", "1", PHP_INI_SYSTEM, OnUpdateString, safe_mode_exec_dir, php_core_globals, core_globals)