bootstrap.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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\Php83 as p;
  11. if (\PHP_VERSION_ID >= 80300) {
  12. return;
  13. }
  14. if (!function_exists('json_validate')) {
  15. function json_validate(string $json, int $depth = 512, int $flags = 0): bool { return p\Php83::json_validate($json, $depth, $flags); }
  16. }
  17. if (!function_exists('stream_context_set_options')) {
  18. function stream_context_set_options($context, array $options): bool { return stream_context_set_option($context, $options); }
  19. }
  20. if (!function_exists('str_increment')) {
  21. function str_increment(string $string): string { return p\Php83::str_increment($string); }
  22. }
  23. if (!function_exists('str_decrement')) {
  24. function str_decrement(string $string): string { return p\Php83::str_decrement($string); }
  25. }
  26. if (\PHP_VERSION_ID < 80000) {
  27. require __DIR__.'/bootstrap72.php';
  28. }
  29. if (extension_loaded('mbstring')) {
  30. if (!function_exists('mb_str_pad')) {
  31. function mb_str_pad(?string $string, ?int $length, ?string $pad_string = ' ', ?int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Php83::mb_str_pad((string) $string, (int) $length, (string) $pad_string, (int) $pad_type, $encoding); }
  32. }
  33. }
  34. if (\PHP_VERSION_ID >= 80100) {
  35. return require __DIR__.'/bootstrap81.php';
  36. }
  37. if (!function_exists('ldap_exop_sync') && function_exists('ldap_exop')) {
  38. function ldap_exop_sync($ldap, string $request_oid, ?string $request_data = null, ?array $controls = null, &$response_data = null, &$response_oid = null): bool { return ldap_exop($ldap, $request_oid, $request_data, $response_data, $response_oid); }
  39. }
  40. if (!function_exists('ldap_connect_wallet') && function_exists('ldap_connect')) {
  41. function ldap_connect_wallet(?string $uri, string $wallet, string $password, int $auth_mode = \GSLC_SSL_NO_AUTH) { return ldap_connect($uri, $wallet, $password, $auth_mode); }
  42. }