CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.6 Red Velvet API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 3.6
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Global
  • Cake
    • Auth
    • Cache
    • Collection
    • Command
    • Console
    • Controller
    • Core
    • Database
    • Datasource
    • Error
    • Event
    • Filesystem
    • Form
    • Http
      • Client
      • Cookie
      • Exception
      • Middleware
      • Session
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • Shell
    • TestSuite
    • Utility
    • Validation
    • View

Class
RequestTransformer

Translate and transform from PSR7 requests into CakePHP requests.

This is an important step for maintaining backwards compatibility with existing CakePHP applications, which depend on the CakePHP request object.

There is no reverse transform as the 'application' cannot return a mutated request object.

Namespace: Cake\Http
Deprecated: 3.4.0 No longer used. Will be removed in 4.0.0

Method Summary

  • convertFile() protected static

    Convert a single file back into an array.

  • convertFiles() protected static

    Convert a nested array of files to arrays.

  • getFiles() protected static

    Extract the uploaded files out of the request object.

  • getParams() protected static

    Extract the routing parameters out of the request object.

  • toCake() public static

    Transform a PSR7 request into a CakePHP one.

Method Detail

convertFile() ¶ protected static

convertFile(Psr\Http\Message\UploadedFileInterface $file): array

Convert a single file back into an array.

Parameters
Psr\Http\Message\UploadedFileInterface $file

The file to convert.

Returns
array

convertFiles() ¶ protected static

convertFiles(array $data, array $files, string $path = ''): array

Convert a nested array of files to arrays.

Parameters
array $data

The data to add files to.

array $files

The file objects to convert.

string $path optional

The current array path.

Returns
array

getFiles() ¶ protected static

getFiles(Psr\Http\Message\ServerRequestInterface $request): array

Extract the uploaded files out of the request object.

CakePHP expects to get arrays of file information and not the parsed objects that PSR7 requests contain. Downsample the data here.

Parameters
Psr\Http\Message\ServerRequestInterface $request

The request to extract files from.

Returns
array

getParams() ¶ protected static

getParams(Psr\Http\Message\ServerRequestInterface $request): array

Extract the routing parameters out of the request object.

Parameters
Psr\Http\Message\ServerRequestInterface $request

The request to extract params from.

Returns
array

toCake() ¶ public static

toCake(Psr\Http\Message\ServerRequestInterface $request): Cake\Http\ServerRequest

Transform a PSR7 request into a CakePHP one.

Parameters
Psr\Http\Message\ServerRequestInterface $request

The PSR7 request.

Returns
Cake\Http\ServerRequest
OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs