bootstrap.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  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\Php54 as p;
  11. if (PHP_VERSION_ID < 50400) {
  12. if (!function_exists('trait_exists')) {
  13. function trait_exists($class, $autoload = true) { return $autoload && class_exists($class, $autoload) && false; }
  14. }
  15. if (!function_exists('class_uses')) {
  16. function class_uses($class, $autoload = true)
  17. {
  18. if (is_object($class) || class_exists($class, $autoload) || interface_exists($class, false)) {
  19. return array();
  20. }
  21. return false;
  22. }
  23. }
  24. if (!function_exists('hex2bin')) {
  25. function hex2bin($data) { return p\Php54::hex2bin($data); }
  26. }
  27. if (!function_exists('session_register_shutdown')) {
  28. function session_register_shutdown() { register_shutdown_function('session_write_close'); }
  29. }
  30. }