protected static function register()
    {
        if (self::$registered) {
            return;
        }

        if (@stream_wrapper_unregister('file') === false) {
            throw new \BadFunctionCallException('Cannot unregister file:// stream wrapper.', 1396340331);
        }
        if (@stream_wrapper_register('file', __CLASS__) === false) {
            throw new \BadFunctionCallException('A handler has already been registered for the file:// scheme.', 1396340332);
        }

        self::$registered = true;
    }