CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Team
    • Issues (Github)
    • YouTube Channel
    • Get Involved
    • Bakery
    • Featured Resources
    • Newsletter
    • Certification
    • My CakePHP
    • CakeFest
    • Facebook
    • Twitter
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.8 Red Velvet API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 3.8
      • 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

  • Cake
    • Auth
      • Storage
    • Cache
      • Engine
    • Collection
      • Iterator
    • Command
    • Console
      • Exception
    • Controller
      • Component
      • Exception
    • Core
      • Configure
        • Engine
      • Exception
      • Retry
    • Database
      • Driver
      • Exception
      • Expression
      • Schema
      • Statement
      • Type
    • Datasource
      • Exception
    • Error
      • Middleware
    • Event
      • Decorator
    • Filesystem
    • Form
    • Http
      • Client
        • Adapter
        • Auth
      • Cookie
      • Exception
      • Middleware
      • Session
    • I18n
      • Formatter
      • Middleware
      • Parser
    • Log
      • Engine
    • Mailer
      • Exception
      • Transport
    • Network
      • Exception
    • ORM
      • Association
      • Behavior
        • Translate
      • Exception
      • Locator
      • Rule
    • Routing
      • Exception
      • Filter
      • Middleware
      • Route
    • Shell
      • Helper
      • Task
    • TestSuite
      • Fixture
      • Stub
    • Utility
      • Exception
    • Validation
    • View
      • Exception
      • Form
      • Helper
      • Widget
  • None

Classes

  • ActionDispatcher
  • BaseApplication
  • Client
  • ControllerFactory
  • CorsBuilder
  • MiddlewareQueue
  • Response
  • ResponseEmitter
  • Runner
  • Server
  • ServerRequest
  • ServerRequestFactory
  • Session

Class ServerRequestFactory

Factory for making ServerRequest instances.

This subclass adds in CakePHP specific behavior to populate the basePath and webroot attributes. Furthermore the Uri's path is corrected to only contain the 'virtual' path for the request.

Zend\Diactoros\ServerRequestFactory
Extended by Cake\Http\ServerRequestFactory
Abstract
Namespace: Cake\Http
Location: Http/ServerRequestFactory.php

Method Summary

  • createUri() public static
    Create a new Uri instance from the provided server data.
  • fromGlobals() public static
  • getBase() protected static
    Calculate the base directory and webroot directory.
  • marshalUriFromServer() public static
    Build a UriInterface object.
  • updatePath() protected static
    Updates the request URI to remove the base directory.

Method Detail

createUri() public static ¶

createUri( array $server = [] )

Create a new Uri instance from the provided server data.

Parameters
array $server optional []

Array of server data to build the Uri from. $_SERVER will be added into the $server parameter.

Returns
Psr\Http\Message\UriInterface
New instance.

fromGlobals() public static ¶

fromGlobals( array $server = null , array $query = null , array $body = null , array $cookies = null , array $files = null )

getBase() protected static ¶

getBase( Psr\Http\Message\UriInterface $uri , array $server )

Calculate the base directory and webroot directory.

Parameters
Psr\Http\Message\UriInterface $uri
The Uri instance.
array $server
The SERVER data to use.
Returns
array
An array containing the [baseDir, webroot]

marshalUriFromServer() public static ¶

marshalUriFromServer( array $server , array $headers )

Build a UriInterface object.

Add in some CakePHP specific logic/properties that help preserve backwards compatibility.

Parameters
array $server
The server parameters.
array $headers
The normalized headers
Returns
Psr\Http\Message\UriInterface
a constructed Uri

updatePath() protected static ¶

updatePath( string $base , Psr\Http\Message\UriInterface $uri )

Updates the request URI to remove the base directory.

Parameters
string $base
The base path to remove.
Psr\Http\Message\UriInterface $uri
The uri to update.
Returns
Psr\Http\Message\UriInterface
The modified Uri instance.
Follow @CakePHP
#IRC
OpenHub
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Logos & Trademarks
  • Community
  • Team
  • Issues (Github)
  • YouTube Channel
  • Get Involved
  • Bakery
  • Featured Resources
  • Newsletter
  • Certification
  • My CakePHP
  • CakeFest
  • Facebook
  • Twitter
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs