菜谱项目

bootstrap.php 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. use Symfony\Polyfill\Php56 as p;
  11. if (PHP_VERSION_ID < 50600) {
  12. if (!function_exists('hash_equals')) {
  13. function hash_equals($knownString, $userInput) { return p\Php56::hash_equals($knownString, $userInput); }
  14. }
  15. if (extension_loaded('ldap') && !function_exists('ldap_escape')) {
  16. define('LDAP_ESCAPE_FILTER', 1);
  17. define('LDAP_ESCAPE_DN', 2);
  18. function ldap_escape($subject, $ignore = '', $flags = 0) { return p\Php56::ldap_escape($subject, $ignore, $flags); }
  19. }
  20. if (50509 === PHP_VERSION_ID && 4 === PHP_INT_SIZE) {
  21. // Missing functions in PHP 5.5.9 - affects 32 bit builds of Ubuntu 14.04LTS
  22. // See https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1315888
  23. if (!function_exists('gzopen') && function_exists('gzopen64')) {
  24. function gzopen($filename, $mode, $use_include_path = 0) { return gzopen64($filename, $mode, $use_include_path); }
  25. }
  26. if (!function_exists('gzseek') && function_exists('gzseek64')) {
  27. function gzseek($zp, $offset, $whence = SEEK_SET) { return gzseek64($zp, $offset, $whence); }
  28. }
  29. if (!function_exists('gztell') && function_exists('gztell64')) {
  30. function gztell($zp) { return gztell64($zp); }
  31. }
  32. }
  33. }