Browse Source

@Set default include_path so PEAR files can be reached (Stig)

PHP-4.0.5
Stig Bakken 26 years ago
parent
commit
7bb67a6200
  1. 1
      build-defs.h.in
  2. 5
      configure.in
  3. 18
      ext/standard/rand.c
  4. 2
      main/main.c

1
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@"

5
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)

18
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:
#

2
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)

Loading…
Cancel
Save