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

Traits

  • BaseTrait
  • CoreTrait

Trait CoreTrait

Provides functionality for the global static accessor contract.

Direct Known Users

oroboros\Oroboros

Namespace: oroboros\core\traits
Author: Brian Dayhoff mopsyd@me.com
Requires: \oroboros\core\interfaces\api\UtilityApi
Located at core/traits/CoreTrait.php

Methods summary

public
# __construct( array $options = array(), array $flags = array() )
public
# setLogger( Psr\Log\LoggerInterface $logger )

Aliases the static setLoggerObject method, for Psr-3 compliance. This method MAY be used to set the logger, but this class does not otherwise need to be instantiated.

Aliases the static setLoggerObject method, for Psr-3 compliance. This method MAY be used to set the logger, but this class does not otherwise need to be instantiated.

Parameters

$logger
public
# initialize( array $options = array(), array $flags = array() )

Proxy for static init

Proxy for static init

Parameters

$options
$flags
public static
# init( array $options = array(), array $flags = array() )
public static
# isInitialized( )
public static string|boolean
# filepath( string|Directory|File $path = NULL )

Returns a system-compliant absolute file path from a supplied relative path, or alternately from the location it was called. NOTE: DO NOT USE WITHOUT SUPPLYING A PATH IN CLOSURES. If used in a closure, pass DIR as the path, or it will throw an exception.

Returns a system-compliant absolute file path from a supplied relative path, or alternately from the location it was called. NOTE: DO NOT USE WITHOUT SUPPLYING A PATH IN CLOSURES. If used in a closure, pass DIR as the path, or it will throw an exception.

Parameters

$path
(optional) The specified relative path. Also supports native PHP file and directory objects. If not supplied, will attempt to return the path to the file where it was called.

Returns

string|boolean
Returns [false] if path is not valid. Otherwise returns the fully qualified absolute path.

Throws

oroboros\core\utilities\exception\Exception
If called within a closure without supplying a path parameter, which will break execution otherwise.
public static
# getLoggerObject( Psr\Log\LoggerInterface $logger,… )

Returns a new instance of the logger, already initialized to the current core settings. You may use this to quickly grab a logger instance from anywhere. Individual instances are prototyped against the CURRENT GLOBAL LOGGER. This is not a singleton, so you will need to check that you have the one you need, otherwise use the factory to build one.

Returns a new instance of the logger, already initialized to the current core settings. You may use this to quickly grab a logger instance from anywhere. Individual instances are prototyped against the CURRENT GLOBAL LOGGER. This is not a singleton, so you will need to check that you have the one you need, otherwise use the factory to build one.

Parameters

$logger,…
public static
# setAutoloader( oroboros\core\libraries\psr4\Autoloader $autoloader )

You should probably just call the bootload routine instead of these unless you have a really good reason for doing so.

You should probably just call the bootload routine instead of these unless you have a really good reason for doing so.

public static
# setLoggerObject( Psr\Log\LoggerInterface $logger )

Sets a logger object. Must implement the Psr-3 logger interface

Sets a logger object. Must implement the Psr-3 logger interface

Parameters

$logger
public static type
# log( $level, $message, array $context = array() )

Logs an entry using whatever Psr3 Compliant logger the system currently has.

Logs an entry using whatever Psr3 Compliant logger the system currently has.

Returns

type
public static type
# config( type $key = NULL )

Parameters

$key

Returns

type

Since

0.0.1a This method fetches parts of the initialization settings. If the optional key is supplied, it will attempt to return that section, or false if it does not exist. Otherwise it returns the entire settings index.


private static
# _setEnv( )

Determines the current environment, and sets basic runtime parameters to help avoid common errors that result from environmental assumptions that are missing or not defined as expected.

Determines the current environment, and sets basic runtime parameters to help avoid common errors that result from environmental assumptions that are missing or not defined as expected.

private static
# _setLogger( array $settings = array(), array $flags = array() )
private static
# _getDefaultSettings( )

Properties summary

private static array $_log_modes

Todo

clean up this deprecated mess, and use the static control api pattern to overload extension method decorators.
# array( "default" => self::LOGGER_DEFAULT, "file" => self::LOGGER_FILE, "database" => self::LOGGER_DATABASE, "null" => self::LOGGER_NULL, "screen" => self::LOGGER_SCREEN, "cli" => self::LOGGER_CLI, "css" => self::LOGGER_CSS, "js" => self::LOGGER_JS, "ajax" => self::LOGGER_AJAX, )
private static array $_valid_log_levels
# [ \Psr\Log\LogLevel::EMERGENCY, \Psr\Log\LogLevel::ALERT, \Psr\Log\LogLevel::CRITICAL, \Psr\Log\LogLevel::ERROR, \Psr\Log\LogLevel::WARNING, \Psr\Log\LogLevel::NOTICE, \Psr\Log\LogLevel::INFO, \Psr\Log\LogLevel::DEBUG, ]
private static $_env
#
private static boolean $_initialized
# false
private static $_logger
#
private static $_autoloader
#
private static array $_settings
# array()
private static $_codex
#
private static $_mode
#
private static array $_valid_modes
# array()
Oroboros Core API documentation generated by ApiGen