Oroboros Core
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Namespaces

  • None
  • oroboros
    • core
      • abstracts
        • adapters
        • bootstrap
        • controllers
        • libraries
          • auth
          • bootstrap
          • cache
          • codex
          • config
          • container
          • data
          • database
          • dns
          • entity
          • enum
          • error
          • event
          • extension
          • file
          • flags
          • hooks
          • job
          • logger
          • manager
          • message
          • prototype
          • request
          • response
          • routine
          • shell
          • startup
          • stream
          • template
          • uri
          • utility
          • validation
            • workers
          • worker
        • models
        • patterns
          • behavioral
          • creational
        • utilities
          • exception
            • cache
            • container
          • http
        • views
      • interfaces
        • adapters
          • interpreters
          • sdk
        • api
          • adapters
          • bootstrap
          • controllers
          • psr
        • contract
          • adapters
          • bootstrap
          • codex
          • components
          • controllers
          • data
          • entities
          • errors
          • events
          • extensions
          • jobs
          • libraries
            • auth
            • cache
            • config
            • container
            • enum
            • file
            • flags
            • hooks
            • module
            • promise
            • record
            • request
            • response
            • server
            • shutdown
            • site
            • stream
            • template
            • theme
            • uri
          • models
          • patterns
            • behavioral
            • concurrency
            • creational
            • structural
          • routes
          • routines
            • bootload
            • declarative
            • procedural
            • subsystem
          • services
            • consumer
              • cgi
              • rest
                • local
                • remote
                  • authenticated
                  • unauthenticated
            • provider
              • cgi
              • rest
                • local
                • remote
                  • authenticated
                  • unauthenticated
          • utilities
            • datetime
            • exception
              • cache
              • container
            • filebase
            • http
            • math
            • parser
            • regex
            • session
          • views
        • enumerated
          • environment
          • flags
          • http
          • views
        • libraries
          • manager
          • worker
      • libraries
        • api
        • codex
        • container
        • enum
          • http
        • file
        • hooks
        • logger
        • math
        • psr4
        • request
        • response
        • stream
        • uri
      • patterns
        • creational
      • traits
        • adapters
        • bootstrap
        • codex
        • components
        • controllers
        • data
        • entities
        • events
        • extensions
        • jobs
        • libraries
          • container
          • file
          • request
          • response
          • stream
          • uri
        • models
        • modules
        • patterns
          • behavioral
          • concurrency
          • creational
          • structural
        • routes
        • services
        • utilities
          • core
            • api
            • config
            • contract
              • contract
            • enum
            • environment
            • routines
          • datetime
          • error
          • exception
          • filebase
          • hooks
          • html
          • http
          • logic
          • math
          • parsers
          • regex
          • session
        • views
      • utilities
        • exception
          • cache
          • container
        • http
      • views
    • tests
      • patterns
        • creational
      • psr
        • psr7
      • utilities
        • exception
  • PasswordCompat
    • binary
  • PHP

Interfaces

  • BootstrapContract

Interface BootstrapContract

This interface enforces the methods required for a valid bootstrap object. These methods may be manually honored, or may be satisfied by using the corresponding bootstrap trait.Traits that extend upon this functionality should be expected to implement this for you.


Contract interfaces enforce expected behavior in a non-colliding way. They are tasked with enforcing methods, and extending interfaces provided by standards and other packages for compatibility.

All valid oroboros classes MUST extend at

least one Contract Interface to be considered valid.

oroboros\core\interfaces\contract\bootstrap\BootstrapContract implements oroboros\core\interfaces\contract\BaseContract

Direct known implementers

oroboros\core\abstracts\bootstrap\AbstractBootstrap

Indirect known implementers

Bootstrap

Namespace: oroboros\core\interfaces\contract\bootstrap
Package: oroboros\core\codex
Category: contract-interfaces
License: The MIT License (MIT)
Author: Brian Dayhoff mopsyd@me.com
Version: 0.2.4-alpha
Since: 0.2.4-alpha
See: oroboros\core\traits\bootstrap\BootstrapTrait
See: oroboros\core\interfaces\api\bootstrap\BootstrapApi
Link: bitbucket.org/oroborosframework/oroboros-core/wiki/development/api/contract_interface.md
Located at core/interfaces/contract/bootstrap/BootstrapContract.php

Methods summary

public
# __construct( array $params = null, array $flags = null )

Instantiates the bootstrap object. Can be called with no parameters, but accepts substitution parameters for unit testing specific requests, or requesting specific functionality that is normally out of scope for the current environment. Also accepts flags, which it will propogate to any controllers that it references automatically through dependency injection.

Instantiates the bootstrap object. Can be called with no parameters, but accepts substitution parameters for unit testing specific requests, or requesting specific functionality that is normally out of scope for the current environment. Also accepts flags, which it will propogate to any controllers that it references automatically through dependency injection.

If you intend to do full initialization within the constructor, you should call the initialize method manually within your constructor, and still place your initialization logic in that method. This allows for re-initialization without the weight of creating a new object.

Parameters

$params
(optional) An array of parameters to pass into the bootstrap, to replace it's normally defined values. This may be used for unit-testing the bootstrap process with specific overrides of local dependencies before deploying them into the normal codebase, or to create a localized bootstrap that works as a subroutine, with custom parameters it would not otherwise use.
$flags
(optional) An array of flags to pass into the bootstrap, which will be propogated to controllers and routers it controls to modify their behavior. This presents a simple way for setting up debug, testing, profiling, or benchmarking paradigms, and allows for an easy way to pass environmental considerations (such as dev vs production), that will automatically propogate through all subsequent objects in the stack on execution.

Returns


$this
public
# __destruct( )

The Bootstrap destructor MUST release all dependent objects and their children, and manually release it's memory footprint also. It should be configured to tell the webserver not to reserve it's memory and release it back into the pool for the actual machine hardware as well (apache does not do this by default, which can be problematic on servers with low memory or a lot of shared threads), though this action SHALL NOT be executed unless explicitly requested via a flag passed at either instantiation, initialization, or reset.

The Bootstrap destructor MUST release all dependent objects and their children, and manually release it's memory footprint also. It should be configured to tell the webserver not to reserve it's memory and release it back into the pool for the actual machine hardware as well (apache does not do this by default, which can be problematic on servers with low memory or a lot of shared threads), though this action SHALL NOT be executed unless explicitly requested via a flag passed at either instantiation, initialization, or reset.

public
# initialize( array $params = null, array $flags = null )

Initializes the bootstrap object. This method separates instantiation from initialization, and provides a reset point to restore to in the event that instantiation did not pass all of the values required, or if you needed multiple instances of the bootstrap object with different parameters.

Initializes the bootstrap object. This method separates instantiation from initialization, and provides a reset point to restore to in the event that instantiation did not pass all of the values required, or if you needed multiple instances of the bootstrap object with different parameters.

This method should contain ALL logic that needs to be performed prior to execution of the primary task of the Bootstrap object.

Parameters

$params
//null no-ops, empty array erases, populated array provides parameters. Parameters are not retained if replaced, reset, or reinitialized.
$flags
//null no-ops, empty array erases, populated array provides flags. Flags are not retained if replaced, reset, or reinitialized.
public
# reset( array $params = null, array $flags = null )

Resets the Bootstrap object to its state immediately after execution fires successfully, so it is initialized, but does not have any remnant data that was obtained through any action that occurred after initialization. The purpose of this method is to allow a degree of external control over the execution plan, and allow it to be called repeatedly if needed, without the weight of reinitialization.

Resets the Bootstrap object to its state immediately after execution fires successfully, so it is initialized, but does not have any remnant data that was obtained through any action that occurred after initialization. The purpose of this method is to allow a degree of external control over the execution plan, and allow it to be called repeatedly if needed, without the weight of reinitialization.

Parameters

$params
//null no-ops, empty array erases, populated array provides parameters. Parameters are not retained if replaced, reset, or reinitialized.
$flags
//null no-ops, empty array erases, populated array provides flags. Flags are not retained if replaced, reset, or reinitialized.
public
# launch( )

Launches the application. If the bootstrap has not already initialized fully, it will do so at this point using it's default values (bootstraps should be capable of autonomous operation, but not assume it).

Launches the application. If the bootstrap has not already initialized fully, it will do so at this point using it's default values (bootstraps should be capable of autonomous operation, but not assume it).

At this point it will obtain it's routes, check for a match, load the appropriate controller if a match is found, load the default (or supplied) error controller if no match is found, initialize it's selected controller and pass any flags into it that were given to the bootstrap, and execute the controller route.

public
# shutdown( )

This method terminates the bootstrap object, and causes it to release all objects that it has instantiated along with their own chid objects. This should clear it's entire stack and memory footprint, and leave the bootstrap in an empty, uninitialized state. This SHALL NOT terminate the object, but will leave it to be either reinitialized or unset as determined by it's controlling logic.

This method terminates the bootstrap object, and causes it to release all objects that it has instantiated along with their own chid objects. This should clear it's entire stack and memory footprint, and leave the bootstrap in an empty, uninitialized state. This SHALL NOT terminate the object, but will leave it to be either reinitialized or unset as determined by it's controlling logic.

Oroboros Core API documentation generated by ApiGen