Documentation

App
in package

Application helper class

Tags
category

Pop

author

Nick Sagona, III nick@popphp.org

copyright

Copyright (c) 2009-2026 Nick Sagona, III

license

https://www.popphp.org/license New BSD License

version
5.0.0

Table of Contents

Properties

$application  : Application|null
Application object

Methods

autoloader()  : ClassLoader|null
Get autoloader
config()  : mixed
Get configuration
env()  : mixed
Get environment value
environment()  : string|null|bool
Get application environment
events()  : mixed
Get event manager
get()  : Application|null
Get application object
has()  : bool
Has application object
isDev()  : bool
Check if application environment is dev
isDown()  : bool
Check if application is in maintenance mode
isLocal()  : bool
Check if application environment is local
isProduction()  : bool
Check if application environment is production
isSecretRequest()  : bool
Check if application is in not maintenance mode
isStaging()  : bool
Check if application environment is staging
isTesting()  : bool
Check if application environment is testing
isUp()  : bool
Check if application is in not maintenance mode
middlewareDisabled()  : string
Get the normalized MIDDLEWARE_DISABLED value
modules()  : mixed
Get module manager
name()  : string|null
Get application name
router()  : Router|null
Get router
services()  : mixed
Get service locator
set()  : void
Set application object
url()  : string|null
Get application URL

Properties

$application

Application object

private static Application|null $application = null

Methods

autoloader()

Get autoloader

public static autoloader() : ClassLoader|null
Return values
ClassLoader|null

config()

Get configuration

public static config([string|null $key = null ]) : mixed
Parameters
$key : string|null = null

env()

Get environment value

public static env(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string
$default : mixed = null

environment()

Get application environment

public static environment([mixed $env = null ]) : string|null|bool
Parameters
$env : mixed = null
Return values
string|null|bool

events()

Get event manager

public static events([string|null $key = null ]) : mixed
Parameters
$key : string|null = null

has()

Has application object

public static has() : bool
Return values
bool

isDev()

Check if application environment is dev

public static isDev() : bool
Return values
bool

isDown()

Check if application is in maintenance mode

public static isDown() : bool
Return values
bool

isLocal()

Check if application environment is local

public static isLocal() : bool
Return values
bool

isProduction()

Check if application environment is production

public static isProduction() : bool
Return values
bool

isSecretRequest()

Check if application is in not maintenance mode

public static isSecretRequest() : bool
Return values
bool

isStaging()

Check if application environment is staging

public static isStaging() : bool
Return values
bool

isTesting()

Check if application environment is testing

public static isTesting() : bool
Return values
bool

isUp()

Check if application is in not maintenance mode

public static isUp() : bool
Return values
bool

middlewareDisabled()

Get the normalized MIDDLEWARE_DISABLED value

public static middlewareDisabled() : string

Guards two failure modes of comparing the raw env value directly: env() coercing a literal 'true' value into a real bool, which then loosely equals every non-empty string (silently matching 'route' as well as 'all'), and any value outside the recognized set ('all', 'route') otherwise being compared as-is instead of being treated as not set.

Return values
string

modules()

Get module manager

public static modules([string|null $key = null ]) : mixed
Parameters
$key : string|null = null

name()

Get application name

public static name() : string|null
Return values
string|null

router()

Get router

public static router() : Router|null
Return values
Router|null

services()

Get service locator

public static services([string|null $key = null ]) : mixed
Parameters
$key : string|null = null

url()

Get application URL

public static url() : string|null
Return values
string|null

        
On this page

Search results