bootstrap.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. return;
  13. }
  14. if (!function_exists('hash_equals')) {
  15. function hash_equals($known_string, $user_string) { return p\Php56::hash_equals($known_string, $user_string); }
  16. }
  17. if (extension_loaded('ldap') && !defined('LDAP_ESCAPE_FILTER')) {
  18. define('LDAP_ESCAPE_FILTER', 1);
  19. }
  20. if (extension_loaded('ldap') && !defined('LDAP_ESCAPE_DN')) {
  21. define('LDAP_ESCAPE_DN', 2);
  22. }
  23. if (extension_loaded('ldap') && !function_exists('ldap_escape')) {
  24. function ldap_escape($value, $ignore = '', $flags = 0) { return p\Php56::ldap_escape($value, $ignore, $flags); }
  25. }
  26. if (50509 === PHP_VERSION_ID && 4 === PHP_INT_SIZE) {
  27. // Missing functions in PHP 5.5.9 - affects 32 bit builds of Ubuntu 14.04LTS
  28. // See https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1315888
  29. if (!function_exists('gzopen') && function_exists('gzopen64')) {
  30. function gzopen($filename, $mode, $use_include_path = 0) { return gzopen64($filename, $mode, $use_include_path); }
  31. }
  32. if (!function_exists('gzseek') && function_exists('gzseek64')) {
  33. function gzseek($fp, $offset, $whence = SEEK_SET) { return gzseek64($fp, $offset, $whence); }
  34. }
  35. if (!function_exists('gztell') && function_exists('gztell64')) {
  36. function gztell($fp) { return gztell64($fp); }
  37. }
  38. }