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

Classes

  • Common
  • Oroboros

Interfaces

  • OroborosInterface

Class Common

Final
Namespace: oroboros
Author: Brian Dayhoff brian@mopsyd.me
Since: 0.0.2a
Todo: factor this into a trait
Review: whether or not this class is neccessary any longer. Utilities likely cover it's scope already.
Located at Common.php

Methods summary

public static boolean
# each( array & $subject, mixed $callback )

Applies a callback as a filter to each element of the subject. The callback should expect the first parameter (the value) to be passed by reference, and the second parameter (the key) to be passed normally.

Applies a callback as a filter to each element of the subject. The callback should expect the first parameter (the value) to be passed by reference, and the second parameter (the key) to be passed normally.

The callback parameter may be any of the following: -any calleable argument -an object with a public method called 'execute' -an array, with an object as the first parameter and a public method as the second parameter

Parameters

$subject
$callback

Returns

boolean
[true] if execution occurred, [false] if the callback was invalid.

Since

0.0.2a

See

\oroboros\Common::map() for passback without referential changes
public static array|boolean
# map( array $subject, mixed $callback )

Applies a callback as a filter to each element of the subject. The callback should expect the first parameter (the value) and the second parameter (the key) to be passed normally, and should return a new result. Does not change original subject. Unlike native PHP array_map, this follows the same argument pattern as array walk, and passes the key as the second argument.

Applies a callback as a filter to each element of the subject. The callback should expect the first parameter (the value) and the second parameter (the key) to be passed normally, and should return a new result. Does not change original subject. Unlike native PHP array_map, this follows the same argument pattern as array walk, and passes the key as the second argument.

The callback parameter may be any of the following: -any calleable argument -an object with a public method called 'execute' -an array, with an object as the first parameter and a public method as the second parameter

Parameters

$subject
$callback

Returns

array|boolean
The results of the callback, or [false] if the callback was invalid.

Since

0.0.2a

See

\oroboros\Common::each() for referential changes
public static mixed
# cast( string $type, mixed $data, type $delimiter = ' ', array $flags = array() )

Casts the supplied data [$data] to the type specified by [$type]. Will use [$delimiter] for implode/explode operations.

Casts the supplied data [$data] to the type specified by [$type]. Will use [$delimiter] for implode/explode operations.

Parameters

$type
[string|array|object|int|bool]
$data
The data to cast
$delimiter
(optional) A delimiter for implode/explode operations, when casting strings to objects or arrays.
$flags
(optional) Accepts [ ::recursive:: ] (unimplemented)

Returns

mixed
Returns [$data] cast to the type specified by [$type], or NULL if not possible.

Since

0.0.2a
public static boolean
# isInternetAccessible( )

This method is meant to help prevent requests if the system is running on a dev machine without an internet connection. This makes a safe check to determine whether to serve resources from a CDN or locally.

This method is meant to help prevent requests if the system is running on a dev machine without an internet connection. This makes a safe check to determine whether to serve resources from a CDN or locally.

Returns

boolean
[true] if connected to the internet, [false] if no network connection available.

Since

0.0.2a

Note

The site used here [example.com] is maintained by IANA, and should never be down unless the entire internet is down, which should circumvent any false flags.

Constants summary

string FLAG_RECURSIVE
# '::recursive::'
Oroboros Core API documentation generated by ApiGen