izartu API

bootstrap.php

Application bootstrap: fixed paths, class autoloading and configuration.

Every entry point (public/index.php, private/cli/*, the test suite) requires this file; config.php holds the operator-editable settings.

Table of Contents

Constants

PRIVATE_DIR  : mixed = __DIR__ . '/'
Application bootstrap: fixed paths, class autoloading and configuration.
PUBLIC_DIR  : mixed = \dirname(__DIR__) . '/public/'

Functions

env()  : string
An environment variable as a string, or a default when unset/empty.
basePath()  : string
The base URL path the request came in on: '' at a domain root, '/sub' in a sub-directory install. Off the web there is no request, so the CLI and the test suite get ''.
asset()  : string
A web-root-relative asset path carrying a cache-busting query string.

Constants

PRIVATE_DIR

Application bootstrap: fixed paths, class autoloading and configuration.

public mixed PRIVATE_DIR = __DIR__ . '/'

Every entry point (public/index.php, private/cli/*, the test suite) requires this file; config.php holds the operator-editable settings.

PUBLIC_DIR

public mixed PUBLIC_DIR = \dirname(__DIR__) . '/public/'

Functions

env()

An environment variable as a string, or a default when unset/empty.

env(string $name[, string $default = '' ]) : string
Parameters
$name : string

The variable name.

$default : string = ''

Value when the variable is unset or empty.

Return values
string

basePath()

The base URL path the request came in on: '' at a domain root, '/sub' in a sub-directory install. Off the web there is no request, so the CLI and the test suite get ''.

basePath() : string
Return values
string

asset()

A web-root-relative asset path carrying a cache-busting query string.

asset(string $path) : string

The file's modification time gives every deployed version its own URL, so a browser never keeps an old copy against new markup. A leading slash is dropped, so the path stays relative for <base href> (sub-directory installs). A missing file, a directory and a path with a .. segment (which may name a file outside the web root) get the plain path.

Parameters
$path : string

Path under the web root, for example 'style/main.css'.

Return values
string —

The relative path, with '?v=' appended when it names a readable file under the web root.

On this page

Search results