Version 1
[yaffs-website] / vendor / symfony / polyfill-php54 / bootstrap.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 use Symfony\Polyfill\Php54 as p;
13
14 if (PHP_VERSION_ID < 50400) {
15     if (!function_exists('trait_exists')) {
16         function trait_exists($class, $autoload = true) { return $autoload && class_exists($class, $autoload) && false; }
17     }
18     if (!function_exists('class_uses')) {
19         function class_uses($class, $autoload = true)
20         {
21             if (is_object($class) || class_exists($class, $autoload) || interface_exists($class, false)) {
22                 return array();
23             }
24
25             return false;
26         }
27     }
28     if (!function_exists('hex2bin')) {
29         function hex2bin($data) { return p\Php54::hex2bin($data); }
30     }
31     if (!function_exists('session_register_shutdown')) {
32         function session_register_shutdown() { register_shutdown_function('session_write_close'); }
33     }
34 }