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 Server

Runs an application invoking all the PSR7 middleware and the registered application.

Cake\Http\Server implements Cake\Event\EventDispatcherInterface uses Cake\Event\EventDispatcherTrait
Namespace: Cake\Http
Location: Http/Server.php

Properties summary

  • $app protected
    Cake\Core\HttpApplicationInterface
  • $runner protected
    Cake\Http\Runner

Inherited Properties

  • _eventClass, _eventManager

Method Summary

  • __construct() public
    Constructor
  • bootstrap() protected
    Application bootstrap wrapper.
  • emit() public
    Emit the response using the PHP SAPI.
  • eventManager() public deprecated
    Get/set the application's event manager.
  • getApp() public
    Get the current application.
  • getEventManager() public
    Get the application's event manager or the global one.
  • run() public
    Run the request/response through the Application and its middleware.
  • setEventManager() public
    Get/set the application's event manager.
  • setRunner() public
    Set the runner

Method Detail

__construct() public ¶

__construct( Cake\Core\HttpApplicationInterface $app )

Constructor

Parameters
Cake\Core\HttpApplicationInterface $app
The application to use.

bootstrap() protected ¶

bootstrap( )

Application bootstrap wrapper.

Calls bootstrap() and events() if application implements EventApplicationInterface. After the application is bootstrapped and events are attached, plugins are bootstrapped and have their events attached.

emit() public ¶

emit( Psr\Http\Message\ResponseInterface $response , Zend\Diactoros\Response\EmitterInterface $emitter = null )

Emit the response using the PHP SAPI.

Parameters
Psr\Http\Message\ResponseInterface $response
The response to emit
Zend\Diactoros\Response\EmitterInterface $emitter optional null

The emitter to use. When null, a SAPI Stream Emitter will be used.

eventManager() public deprecated ¶

eventManager( Cake\Event\EventManager $events = null )

Get/set the application's event manager.

If the application does not support events and this method is used as a setter, an exception will be raised.

Deprecated
3.6.0 Will be removed in 4.0
Parameters
Cake\Event\EventManager $events optional null
The event manager to set.
Returns
Cake\Event\EventManager|Cake\Http\Server
$this
Implementation of
Cake\Event\EventDispatcherInterface::eventManager()

getApp() public ¶

getApp( )

Get the current application.

Returns
Cake\Core\HttpApplicationInterface
The application that will be run.

getEventManager() public ¶

getEventManager( )

Get the application's event manager or the global one.

Returns
Cake\Event\EventManager

run() public ¶

run( Psr\Http\Message\ServerRequestInterface $request = null , Psr\Http\Message\ResponseInterface $response = null )

Run the request/response through the Application and its middleware.

This will invoke the following methods:

  • App->bootstrap() - Perform any bootstrapping logic for your application here.
  • App->middleware() - Attach any application middleware here.
  • Trigger the 'Server.buildMiddleware' event. You can use this to modify the from event listeners.
  • Run the middleware queue including the application.
Parameters
Psr\Http\Message\ServerRequestInterface $request optional null
The request to use or null.
Psr\Http\Message\ResponseInterface $response optional null
The response to use or null.
Returns
Psr\Http\Message\ResponseInterface
Throws
RuntimeException
When the application does not make a response.

setEventManager() public ¶

setEventManager( Cake\Event\EventManager $events )

Get/set the application's event manager.

If the application does not support events and this method is used as a setter, an exception will be raised.

Parameters
Cake\Event\EventManager $events
The event manager to set.
Returns

$this

setRunner() public ¶

setRunner( Cake\Http\Runner $runner )

Set the runner

Parameters
Cake\Http\Runner $runner
The runner to use.
Returns

$this

Methods used from Cake\Event\EventDispatcherTrait

dispatchEvent() public ¶

dispatchEvent( string $name , array|null $data = null , object|null $subject = null )

Wrapper for creating and dispatching events.

Returns a dispatched event.

Parameters
string $name
Name of the event.
array|null $data optional null

Any value you wish to be transported with this event to it can be read by listeners.

object|null $subject optional null

The object that this event applies to ($this by default).

Returns
Cake\Event\Event

Magic methods inherited from Cake\Event\EventDispatcherInterface

getEventManager()

Properties detail

$app ¶

protected Cake\Core\HttpApplicationInterface

$runner ¶

protected Cake\Http\Runner
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