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.
 
 
 
 
 
 

63 lines
1.7 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. test_args="-c \"$TEST_INI\""' -d "open_basedir=" -d "safe_mode=0" -d "output_buffering=0" -d "memory_limit=-1"'
  14. if test -x ./php-cgi ; then
  15. php_cgi=`getAbsolutePath ./php-cgi`
  16. else
  17. php_cgi="`which php-cgi`"
  18. fi
  19. echo '#!/bin/sh' > ./php-cli-test
  20. echo 'exec "'$php_cli'" '$test_args' "$@"' >> php-cli-test
  21. chmod +x ./php-cli-test
  22. echo '#!/bin/sh' > ./php-cgi-test
  23. echo 'exec "'$php_cgi'" '$test_args' "$@"' >> php-cgi-test
  24. chmod +x ./php-cgi-test
  25. TEST_PHP_EXECUTABLE=`getAbsolutePath ./php-cli-test`
  26. TEST_PHP_CGI_EXECUTABLE=`getAbsolutePath ./php-cgi-test`
  27. real_php_src=`getAbsolutePath ./php-src`;
  28. test -z "$TEST_PHP_SRCDIR" && TEST_PHP_SRCDIR=$real_php_src
  29. export TEST_PHP_EXECUTABLE
  30. export TEST_PHP_CGI_EXECUTABLE
  31. export TEST_PHP_SRCDIR
  32. echo "XCache test running with:"
  33. echo "TEST_PHP_CGI_EXECUTABLE: $TEST_PHP_CGI_EXECUTABLE"
  34. echo "TEST_PHP_EXECUTABLE: $TEST_PHP_EXECUTABLE"
  35. echo "TEST_PHP_SRCDIR: $TEST_PHP_SRCDIR"
  36. patch_run_tests_ext() {
  37. if test -z "$TEST_EXT" ; then
  38. sed "s#'ext',##g"
  39. else
  40. cat
  41. fi
  42. }
  43. patch_run_tests_report_leaks() {
  44. if test -z "$TEST_REPORT_MEMLEAKS" ; then
  45. sed "s#'report_memleaks=1',#'report_memleaks=0',#g"
  46. else
  47. cat
  48. fi
  49. }
  50. run_tests_src=$real_php_src/run-tests.php
  51. patch_run_tests_ext < "$run_tests_src" | sed "s#^\\\$test_dirs = array('.*#\\\$test_dirs = array();#" | patch_run_tests_report_leaks > run-tests.php
  52. exec "$TEST_PHP_EXECUTABLE" `getAbsolutePath ./run-tests.php` "$@"