XCache is a fast, stable PHP opcode cacher that has been proven and is now running on production servers under high load. https://xcache.lighttpd.net/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.3 KiB

  1. #!/bin/sh
  2. getAbsolutePath() {
  3. which readlink >/dev/null 2>&1 && readlink -f "$@" || echo "$@"
  4. }
  5. # use symlink first
  6. if test -x ./php-cli ; then
  7. php_cli=`getAbsolutePath ./php-cli`
  8. elif test ! -z "$TEST_PHP_EXECUTABLE" && test -x "$TEST_PHP_EXECUTABLE"; then
  9. php_cli="$TEST_PHP_EXECUTABLE"
  10. else
  11. php_cli="`which php`"
  12. fi
  13. if test -x ./php-cgi ; then
  14. php_cgi=`getAbsolutePath ./php-cgi`
  15. else
  16. php_cgi="`which php-cgi`"
  17. fi
  18. TEST_PHP_EXECUTABLE="$php_cli"
  19. TEST_PHP_CGI_EXECUTABLE="$php_cgi"
  20. real_php_src=`getAbsolutePath ./php-src`;
  21. test -z "$TEST_PHP_SRCDIR" && TEST_PHP_SRCDIR=$real_php_src
  22. export TEST_PHP_EXECUTABLE
  23. export TEST_PHP_CGI_EXECUTABLE
  24. export TEST_PHP_SRCDIR
  25. echo "XCache test running with:"
  26. echo "TEST_PHP_CGI_EXECUTABLE: $TEST_PHP_CGI_EXECUTABLE"
  27. echo "TEST_PHP_EXECUTABLE: $TEST_PHP_EXECUTABLE"
  28. echo "TEST_PHP_SRCDIR: $TEST_PHP_SRCDIR"
  29. patch_run_tests_ext() {
  30. if test -z "$TEST_EXT" ; then
  31. sed "s#'ext',##g"
  32. else
  33. cat
  34. fi
  35. }
  36. patch_run_tests_report_leaks() {
  37. if test -z "$TEST_REPORT_MEMLEAKS" ; then
  38. sed "s#'report_memleaks=1',#'report_memleaks=0',#g"
  39. else
  40. cat
  41. fi
  42. }
  43. run_tests_src=$real_php_src/run-tests.php
  44. patch_run_tests_ext < "$run_tests_src" | patch_run_tests_report_leaks > run-tests.php
  45. exec "$php_cli" -d "open_basedir=" -d "safe_mode=0" -d "output_buffering=0" -d "memory_limit=-1" `getAbsolutePath ./run-tests.php` "$@"