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.3 Red Velvet API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 3.3
      • 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
    • Console
    • Controller
    • Core
    • Database
    • Datasource
    • Error
    • Event
    • Filesystem
    • Form
    • Http
      • Client
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • Shell
    • TestSuite
    • Utility
    • Validation
    • View

Class Server

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

Namespace: Cake\Http

Property Summary

  • $_eventClass protected
    string

    Default class name for new event objects.

  • $_eventManager protected
    Cake\Event\EventManager

    Instance of the Cake\Event\EventManager this object is using to dispatch inner events.

  • $app protected
    Cake\Http\BaseApplication
  • $runner protected
    Cake\Http\Runner

Method Summary

  • __construct() public

    Constructor

  • dispatchEvent() public

    Wrapper for creating and dispatching events.

  • emit() public

    Emit the response using the PHP SAPI.

  • eventManager() public

    Returns the Cake\Event\EventManager manager instance for this object.

  • getApp() public

    Get the current application.

  • run() public

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

  • setApp() public

    Set the application.

  • setRunner() public

    Set the runner

Method Detail

__construct() ¶ public

__construct(Cake\Http\BaseApplication $app)

Constructor

Parameters
Cake\Http\BaseApplication $app

The application to use.

dispatchEvent() ¶ public

dispatchEvent(string $name, array|null $data = null, object|null $subject = null): Cake\Event\Event

Wrapper for creating and dispatching events.

Returns a dispatched event.

Parameters
string $name

Name of the event.

array|null $data optional

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

object|null $subject optional

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

Returns
Cake\Event\Event

emit() ¶ public

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

Emit the response using the PHP SAPI.

Parameters
Psr\Http\Message\ResponseInterface $response

The response to emit

Zend\Diactoros\Response\EmitterInterface|null $emitter optional

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

Returns
void

eventManager() ¶ public

eventManager(Cake\Event\EventManager|null $eventManager = null): Cake\Event\EventManager

Returns the Cake\Event\EventManager manager instance for this object.

You can use this instance to register any new listeners or callbacks to the object events, or create your own events and trigger them at will.

Parameters
Cake\Event\EventManager|null $eventManager optional

the eventManager to set

Returns
Cake\Event\EventManager

getApp() ¶ public

getApp(): BaseApplication

Get the current application.

Returns
BaseApplication

run() ¶ public

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

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|null $request optional

The request to use or null.

Psr\Http\Message\ResponseInterface|null $response optional

The response to use or null.

Returns
Psr\Http\Message\ResponseInterface
Throws
RuntimeException
When the application does not make a response.

setApp() ¶ public

setApp(BaseApplication $app): $this

Set the application.

Parameters
BaseApplication $app

The application to set.

Returns
$this

setRunner() ¶ public

setRunner(Cake\Http\Runner $runner): $this

Set the runner

Parameters
Cake\Http\Runner $runner

The runner to use.

Returns
$this

Property Detail

$_eventClass ¶ protected

Default class name for new event objects.

Type
string

$_eventManager ¶ protected

Instance of the Cake\Event\EventManager this object is using to dispatch inner events.

Type
Cake\Event\EventManager

$app ¶ protected

Type
Cake\Http\BaseApplication

$runner ¶ protected

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