Documentation

Documentation

Packages

Application
CodeIgniter4
org
bovigo

Namespaces

Config
App
CodeIgniter
Laminas
Kint
Psr
CodeIgniter4
Composer
Doctrine
Faker
org
DeepCopy
PhpParser
PharIo
phpDocumentor
Prophecy
PHPUnit
Predis
SebastianBergmann
PHP_CodeSniffer
Symfony
TheSeer
Webmozart

Interfaces, Classes and Traits

ComposerAutoloaderInit66b555c03b1bdd972d10d22cdbe0b48d
PHPUnit_Util_ErrorHandler
PHPUnit_TextUI_ResultPrinter
BC_PHPUnit_Framework_TestCase
A modified version of PHPUnit's TestCase to rid ourselves of deprecation warnings since we're using two different versions of PHPUnit in this branch (PHPUnit 4 and 5).
NaiveDistributor
SimpleDebuggableConnection
Standard connection to Redis servers implemented on top of PHP's streams.
EventsListener
IncrementExistingKeysBy
Base class used to implement an higher level abstraction for commands based on Lua scripting with EVAL and EVALSHA.
HashMultipleGetAll
Base class used to implement an higher level abstraction for commands based on Lua scripting with EVAL and EVALSHA.

Table of Contents

APPPATH  = ealpath( trim($paths->appDirectory, '\/ ')) . DIRECTORY_SEPARATOR
ARGS  = '\((?<args>[^()]*+(?:\((?&args)\)[^()]*+)*+)\)'
ENVIRONMENT  = 'testing'
EVENT_PRIORITY_HIGH  = 10
EVENT_PRIORITY_LOW  = 200
EVENT_PRIORITY_NORMAL  = 100
FCPATH  = __DIR__ . DIRECTORY_SEPARATOR
KINT_DIR  = __DIR__
KINT_DIR  = __DIR__
KINT_PHP56  = ersion_compare(PHP_VERSION, '5.6') >= 0
KINT_PHP56  = ersion_compare(PHP_VERSION, '5.6') >= 0
KINT_PHP70  = ersion_compare(PHP_VERSION, '7.0') >= 0
KINT_PHP70  = ersion_compare(PHP_VERSION, '7.0') >= 0
KINT_PHP72  = ersion_compare(PHP_VERSION, '7.2') >= 0
KINT_PHP72  = ersion_compare(PHP_VERSION, '7.2') >= 0
KINT_PHP73  = ersion_compare(PHP_VERSION, '7.3') >= 0
KINT_PHP73  = ersion_compare(PHP_VERSION, '7.3') >= 0
KINT_PHP74  = ersion_compare(PHP_VERSION, '7.4') >= 0
KINT_PHP74  = ersion_compare(PHP_VERSION, '7.4') >= 0
KINT_WIN  = DIRECTORY_SEPARATOR !== '/'
KINT_WIN  = DIRECTORY_SEPARATOR !== '/'
LIB  = '(?(DEFINE) (?<singleQuotedString>'[^\\']*+(?:\\.[^\\']*+)*+') (?<doubleQuotedString>"[^\\"]*+(?:\\.[^\\"]*+)*+") (?<string>(?&singleQuotedString)|(?&doubleQuotedString)) (?<comment>/\*[^*]*+(?:\*(?!/)[^*]*+)*+\*/) (?<code>\{[^'"/{}]*+(?:(?:(?&string)|(?&comment)|(?&code)|/)[^'"/{}]*+)*+}) )'
PARAMS  = '\[(?<params>[^[\]]*+(?:\[(?&params)\][^[\]]*+)*+)\]'
PHP_CODESNIFFER_CBF  = alse
PHP_CODESNIFFER_IN_TESTS  = rue
PHP_CODESNIFFER_VERBOSITY  = 0
ROOTPATH  = ealpath(APPPATH . '../') . DIRECTORY_SEPARATOR
SYSTEMPATH  = ealpath( trim($paths->systemDirectory, '\/ ')) . DIRECTORY_SEPARATOR
T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG  = 'PHPCS_T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG'
T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG  = 'PHPCS_T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG'
T_ANON_CLASS  = 'PHPCS_T_ANON_CLASS'
T_ARRAY_HINT  = 'PHPCS_T_ARRAY_HINT'
T_ASPERAND  = 'PHPCS_T_ASPERAND'
T_ATTRIBUTE  = 'PHPCS_T_ATTRIBUTE'
T_ATTRIBUTE_END  = 'PHPCS_T_ATTRIBUTE_END'
T_BACKTICK  = 'PHPCS_T_BACKTICK'
T_BAD_CHARACTER  = 'PHPCS_T_BAD_CHARACTER'
T_BINARY_CAST  = 'PHPCS_T_BINARY_CAST'
T_BITWISE_AND  = 'PHPCS_T_BITWISE_AND'
T_BITWISE_NOT  = 'PHPCS_T_BITWISE_NOT'
T_BITWISE_OR  = 'PHPCS_T_BITWISE_OR'
T_BITWISE_XOR  = 'PHPCS_T_BITWISE_XOR'
T_BOOLEAN_NOT  = 'PHPCS_T_BOOLEAN_NOT'
T_CLOSE_CURLY_BRACKET  = 'PHPCS_T_CLOSE_CURLY_BRACKET'
T_CLOSE_OBJECT  = 'PHPCS_T_CLOSE_OBJECT'
T_CLOSE_PARENTHESIS  = 'PHPCS_T_CLOSE_PARENTHESIS'
T_CLOSE_SHORT_ARRAY  = 'PHPCS_T_CLOSE_SHORT_ARRAY'
T_CLOSE_SQUARE_BRACKET  = 'PHPCS_T_CLOSE_SQUARE_BRACKET'
T_CLOSE_USE_GROUP  = 'PHPCS_T_CLOSE_USE_GROUP'
T_CLOSURE  = 'PHPCS_T_CLOSURE'
T_COALESCE  = 'PHPCS_T_COALESCE'
T_COALESCE_EQUAL  = 'PHPCS_T_COALESCE_EQUAL'
T_COLON  = 'PHPCS_T_COLON'
T_COLOUR  = 'PHPCS_T_COLOUR'
T_COMMA  = 'PHPCS_T_COMMA'
T_DIVIDE  = 'PHPCS_T_DIVIDE'
T_DOC_COMMENT_CLOSE_TAG  = 'PHPCS_T_DOC_COMMENT_CLOSE_TAG'
T_DOC_COMMENT_OPEN_TAG  = 'PHPCS_T_DOC_COMMENT_OPEN_TAG'
T_DOC_COMMENT_STAR  = 'PHPCS_T_DOC_COMMENT_STAR'
T_DOC_COMMENT_STRING  = 'PHPCS_T_DOC_COMMENT_STRING'
T_DOC_COMMENT_TAG  = 'PHPCS_T_DOC_COMMENT_TAG'
T_DOC_COMMENT_WHITESPACE  = 'PHPCS_T_DOC_COMMENT_WHITESPACE'
T_DOLLAR  = 'PHPCS_T_DOLLAR'
T_DOUBLE_QUOTED_STRING  = 'PHPCS_T_DOUBLE_QUOTED_STRING'
T_ELLIPSIS  = 'PHPCS_T_ELLIPSIS'
T_EMBEDDED_PHP  = 'PHPCS_T_EMBEDDED_PHP'
T_END_NOWDOC  = 'PHPCS_T_END_NOWDOC'
T_EQUAL  = 'PHPCS_T_EQUAL'
T_FALSE  = 'PHPCS_T_FALSE'
T_FINALLY  = 'PHPCS_T_FINALLY'
T_FN  = 'PHPCS_T_FN'
T_FN_ARROW  = 'PHPCS_T_FN_ARROW'
T_GOTO_LABEL  = 'PHPCS_T_GOTO_LABEL'
T_GREATER_THAN  = 'PHPCS_T_GREATER_THAN'
T_HASH  = 'PHPCS_T_HASH'
T_HEREDOC  = 'PHPCS_T_HEREDOC'
T_INLINE_ELSE  = 'PHPCS_T_INLINE_ELSE'
T_INLINE_THEN  = 'PHPCS_T_INLINE_THEN'
T_LABEL  = 'PHPCS_T_LABEL'
T_LESS_THAN  = 'PHPCS_T_LESS_THAN'
T_MATCH  = 'PHPCS_T_MATCH'
T_MATCH_ARROW  = 'PHPCS_T_MATCH_ARROW'
T_MATCH_DEFAULT  = 'PHPCS_T_MATCH_DEFAULT'
T_MINUS  = 'PHPCS_T_MINUS'
T_MODULUS  = 'PHPCS_T_MODULUS'
T_MULTIPLY  = 'PHPCS_T_MULTIPLY'
T_NAME_FULLY_QUALIFIED  = 'T_NAME_FULLY_QUALIFIED'
T_NAME_FULLY_QUALIFIED  = 'PHPCS_T_NAME_FULLY_QUALIFIED'
T_NAME_QUALIFIED  = 'T_NAME_QUALIFIED'
T_NAME_QUALIFIED  = 'PHPCS_T_NAME_QUALIFIED'
T_NAME_RELATIVE  = 'PHPCS_T_NAME_RELATIVE'
T_NONE  = 'PHPCS_T_NONE'
T_NOWDOC  = 'PHPCS_T_NOWDOC'
T_NULL  = 'PHPCS_T_NULL'
T_NULLABLE  = 'PHPCS_T_NULLABLE'
T_NULLSAFE_OBJECT_OPERATOR  = 'PHPCS_T_NULLSAFE_OBJECT_OPERATOR'
T_OBJECT  = 'PHPCS_T_OBJECT'
T_OPEN_CURLY_BRACKET  = 'PHPCS_T_OPEN_CURLY_BRACKET'
T_OPEN_PARENTHESIS  = 'PHPCS_T_OPEN_PARENTHESIS'
T_OPEN_SHORT_ARRAY  = 'PHPCS_T_OPEN_SHORT_ARRAY'
T_OPEN_SQUARE_BRACKET  = 'PHPCS_T_OPEN_SQUARE_BRACKET'
T_OPEN_USE_GROUP  = 'PHPCS_T_OPEN_USE_GROUP'
T_PARAM_NAME  = 'PHPCS_T_PARAM_NAME'
T_PARENT  = 'PHPCS_T_PARENT'
T_PHPCS_DISABLE  = 'PHPCS_T_PHPCS_DISABLE'
T_PHPCS_ENABLE  = 'PHPCS_T_PHPCS_ENABLE'
T_PHPCS_IGNORE  = 'PHPCS_T_PHPCS_IGNORE'
T_PHPCS_IGNORE_FILE  = 'PHPCS_T_PHPCS_IGNORE_FILE'
T_PHPCS_SET  = 'PHPCS_T_PHPCS_SET'
T_PLUS  = 'PHPCS_T_PLUS'
T_POW  = 'PHPCS_T_POW'
T_POW_EQUAL  = 'PHPCS_T_POW_EQUAL'
T_PROPERTY  = 'PHPCS_T_PROPERTY'
T_PROTOTYPE  = 'PHPCS_T_PROTOTYPE'
T_REGULAR_EXPRESSION  = 'PHPCS_T_REGULAR_EXPRESSION'
T_RETURN_TYPE  = 'PHPCS_T_RETURN_TYPE'
T_SELF  = 'PHPCS_T_SELF'
T_SEMICOLON  = 'PHPCS_T_SEMICOLON'
T_SPACESHIP  = 'PHPCS_T_SPACESHIP'
T_START_NOWDOC  = 'PHPCS_T_START_NOWDOC'
T_STRING_CONCAT  = 'PHPCS_T_STRING_CONCAT'
T_STYLE  = 'PHPCS_T_STYLE'
T_THIS  = 'PHPCS_T_THIS'
T_TRUE  = 'PHPCS_T_TRUE'
T_TYPE_UNION  = 'PHPCS_T_TYPE_UNION'
T_TYPEOF  = 'PHPCS_T_TYPEOF'
T_URL  = 'PHPCS_T_URL'
T_YIELD  = 'PHPCS_T_YIELD'
T_YIELD_FROM  = 'PHPCS_T_YIELD_FROM'
T_ZSR  = 'PHPCS_T_ZSR'
T_ZSR_EQUAL  = 'PHPCS_T_ZSR_EQUAL'
TESTPATH  = ealpath( trim($paths->testsDirectory, '\/ ')) . DIRECTORY_SEPARATOR
VENDORPATH  = ealpath(ROOTPATH . 'vendor') . DIRECTORY_SEPARATOR
VENDORPATH  = ealpath(ROOTPATH . 'vendor') . DIRECTORY_SEPARATOR
WRITEPATH  = ealpath( trim($paths->writableDirectory, '\/ ')) . DIRECTORY_SEPARATOR
register_ci_instance()  : mixed
get_instance()  : BaseController
app_timezone()  : string
Returns the timezone the application has been set to display dates in. This might be different than the timezone set at the server level, as you often want to stores dates in UTC and convert them on the fly for the user.
cache()  : CacheInterface|mixed
A convenience method that provides access to the Cache object. If no parameter is provided, will return the object, otherwise, will attempt to return the cached value.
clean_path()  : string
A convenience method to clean paths for a nicer looking output. Useful for exception handling, error logging, etc.
command()  : false|string
Runs a single command.
config()  : mixed
More simple way of getting config instances from Factories
cookie()  : Cookie
Simpler way to create a new Cookie instance.
cookies()  : CookieStore
Fetches the global `CookieStore` instance held by `Response`.
csrf_token()  : string
Returns the CSRF token name.
csrf_header()  : string
Returns the CSRF header name.
csrf_hash()  : string
Returns the current hash value for the CSRF protection.
csrf_field()  : string
Generates a hidden input field for use within manually generated forms.
csrf_meta()  : string
Generates a meta tag for use within javascript calls.
db_connect()  : BaseConnection
Grabs a database connection and returns it to the user.
dd()  : mixed
Prints a Kint debug report and exits.
env()  : mixed
Allows user to retrieve values from the environment variables that have been set. Especially useful for retrieving values set from the .env file for use in config files.
esc()  : string|array<string|int, mixed>
Performs simple auto-escaping of data for security reasons.
force_https()  : mixed
Used to force a page to be accessed in via HTTPS.
function_usable()  : bool
Function usable
helper()  : mixed
Loads a helper file into memory. Supports namespaced helpers, both in and out of the 'helpers' directory of a namespaced directory.
is_cli()  : bool
Check if PHP was invoked from the command line.
is_really_writable()  : bool
Tests for file writability
lang()  : string
A convenience method to translate a string or array of them and format the result with the intl extension's MessageFormatter.
log_message()  : mixed
A convenience/compatibility method for logging events through the Log system.
model()  : mixed
More simple way of getting model instances from Factories
old()  : mixed|null
Provides access to "old input" that was set in the session during a redirect()->withInput().
redirect()  : RedirectResponse
Convenience method that works with the current global $request and $router instances to redirect using named/reverse-routed routes to determine the URL to go to. If nothing is found, will treat as a traditional redirect and pass the string in, letting $response->redirect() determine the correct method and code.
remove_invisible_characters()  : string
Remove Invisible Characters
route_to()  : false|string
Given a controller/method string and any params, will attempt to build the relative URL to the matching route.
session()  : Session|mixed|null
A convenience method for accessing the session instance, or an item that has been set in the session.
service()  : mixed
Allows cleaner access to the Services Config file.
single_service()  : mixed
Always returns a new instance of the class.
slash_item()  : string|null
Fetch a config file item with slash appended (if not empty)
stringify_attributes()  : string
Stringify attributes for use in HTML tags.
timer()  : Timer|mixed
A convenience method for working with the timer.
trace()  : mixed
Provides a backtrace to the current execution point, from Kint.
view()  : string
Grabs the current RendererInterface-compatible class and tells it to render the specified view. Simply provides a convenience method that can be used in Controllers, libraries, and routed closures.
view_cell()  : string
View cells are used within views to insert HTML chunks that are managed by other classes.
class_basename()  : string
Get the class "basename" of the given object / class.
class_uses_recursive()  : array<string|int, mixed>
Returns all traits used by a class, its parent classes and trait of their traits.
trait_uses_recursive()  : array<string|int, mixed>
Returns all traits used by a trait and its traits.
dot_array_search()  : mixed
Searches an array through dot syntax. Supports wildcard searches, like foo.*.bar
array_deep_search()  : mixed|null
Returns the value of an element at a key in an array of uncertain depth.
array_sort_by_multiple_keys()  : bool
Sorts a multidimensional array by its elements values. The array columns to be used for sorting are passed as an associative array of key names and sorting flags.
array_flatten_with_dots()  : array<string|int, mixed>
Flatten a multidimensional array using dots as separators.
set_cookie()  : mixed
Set cookie
get_cookie()  : mixed
Fetch an item from the $_COOKIE array
delete_cookie()  : void
Delete a cookie
has_cookie()  : bool
Checks if a cookie exists by name.
now()  : int
Get "now" time
timezone_select()  : string
Generates a select field of all available timezones
directory_map()  : array<string|int, mixed>
Create a Directory Map
directory_mirror()  : void
Recursively copies the files and directories of the origin directory into the target directory, i.e. "mirror" its contents.
write_file()  : bool
Write File
delete_files()  : bool
Delete Files
get_filenames()  : array<string|int, mixed>
Get Filenames
get_dir_file_info()  : array<string|int, mixed>
Get Directory File Information
get_file_info()  : array<string|int, mixed>|null
Get File Info
symbolic_permissions()  : string
Symbolic Permissions
octal_permissions()  : string
Octal Permissions
same_file()  : bool
Checks if two files both exist and have identical hashes
set_realpath()  : string
Set Realpath
form_open()  : string
Form Declaration
form_open_multipart()  : string
Form Declaration - Multipart type
form_hidden()  : string
Hidden Input Field
form_input()  : string
Text Input Field. If 'type' is passed in the $type field, it will be used as the input type, for making 'email', 'phone', etc input fields.
form_password()  : string
Password Field
form_upload()  : string
Upload Field
form_textarea()  : string
Textarea field
form_multiselect()  : string
Multi-select menu
form_dropdown()  : string
Drop-down Menu
form_checkbox()  : string
Checkbox Field
form_radio()  : string
Radio Button
form_submit()  : string
Submit Button
form_reset()  : string
Reset Button
form_button()  : string
Form Button
form_label()  : string
Form Label Tag
form_datalist()  : string
Datalist
form_fieldset()  : string
Fieldset Tag
form_fieldset_close()  : string
Fieldset Close Tag
form_close()  : string
Form Close Tag
set_value()  : string|array<string|int, string>
Form Value
set_select()  : string
Set Select
set_checkbox()  : string
Set Checkbox
set_radio()  : string
Set Radio
parse_form_attributes()  : string
Parse the form attributes
ul()  : string
Unordered List
ol()  : string
Ordered List
_list()  : string
Generates the list
img()  : string
Image
img_data()  : string
Image (data)
doctype()  : string
Doctype
script_tag()  : string
Script
link_tag()  : string
Link
video()  : string
Video
audio()  : string
Audio
_media()  : string
Generate media based tag
source()  : string
Source
track()  : string
Track
object()  : string
Object
param()  : string
Param
embed()  : string
Embed
_has_protocol()  : false|int
Test the protocol of a URI.
_space_indent()  : string
Provide space indenting.
singular()  : string
Singular
plural()  : string
Plural
counted()  : string
Counted
camelize()  : string
Camelize
pascalize()  : string
Pascalize
underscore()  : string
Underscore
humanize()  : string
Humanize
is_pluralizable()  : bool
Checks if the given word has a plural version.
dasherize()  : string
Replaces underscores with dashes in the string.
ordinal()  : string
Returns the suffix that should be added to a number to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th.
ordinalize()  : string
Turns a number into an ordinal string used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th.
number_to_size()  : bool|string
Formats a numbers as bytes, based on size, and adds the appropriate suffix
number_to_amount()  : bool|string
Converts numbers to a more readable representation when dealing with very large numbers (in the thousands or above), up to the quadrillions, because you won't often deal with numbers larger than that.
number_to_currency()  : string
format_number()  : string
A general purpose, locale-aware, number_format method.
number_to_roman()  : string|null
Convert a number to a roman numeral.
sanitize_filename()  : string
Sanitize a filename to use in a URI.
strip_image_tags()  : string
Strip Image Tags
encode_php_tags()  : string
Convert PHP tags to entities
fake()  : object|array<string|int, mixed>
Creates a single item using Fabricator.
word_limiter()  : string
Word Limiter
character_limiter()  : string
Character Limiter
ascii_to_entities()  : string
High ASCII to Entities
entities_to_ascii()  : string
Entities to ASCII
word_censor()  : string
Word Censoring Function
highlight_code()  : string
Code Highlighter
highlight_phrase()  : string
Phrase Highlighter
convert_accented_characters()  : string
Convert Accented Foreign Characters to ASCII
word_wrap()  : string
Word Wrap
ellipsize()  : string
Ellipsize String
strip_slashes()  : mixed
Strip Slashes
strip_quotes()  : string
Strip Quotes
quotes_to_entities()  : string
Quotes to Entities
reduce_double_slashes()  : string
Reduce Double Slashes
reduce_multiples()  : string
Reduce Multiples
random_string()  : string
Create a Random String
increment_string()  : string
Add's _1 to a string or increment the ending number to allow _2, _3, etc
alternator()  : string
Alternator
excerpt()  : string
Excerpt.
site_url()  : string
Returns a site URL as defined by the App config.
base_url()  : string
Returns the base URL as defined by the App config.
current_url()  : string|URI
Returns the current full URL based on the IncomingRequest.
previous_url()  : URI|mixed|string
Returns the previous URL the current visitor was on. For security reasons we first check in a saved session variable, if it exists, and use that.
uri_string()  : string
URL String
index_page()  : string
Index page
anchor()  : string
Anchor Link
anchor_popup()  : string
Anchor Link - Pop-up version
mailto()  : string
Mailto Link
safe_mailto()  : string
Encoded Mailto Link
auto_link()  : string
Auto-linker
prep_url()  : string
Prep URL - Simply adds the http:// or https:// part if no scheme is included.
url_title()  : string
Create URL Title
mb_url_title()  : string
Create URL Title that takes into account accented characters
url_to()  : string
Get the full, absolute URL to a controller method (with additional arguments)
url_is()  : bool
Determines if current url path contains the given path. It may contain a wildcard (*) which will allow any valid character.
xml_convert()  : string
Convert Reserved XML characters to Entities
is_cli()  : bool
Is CLI?
d()  : int|string
Alias of Kint::dump().
s()  : int|string
Alias of Kint::dump(), however the output is in plain text.
composerRequire66b555c03b1bdd972d10d22cdbe0b48d()  : mixed
d()  : int|string
Alias of Kint::dump().
s()  : int|string
Alias of Kint::dump(), however the output is in plain text.
customErrorHandler()  : mixed
preprocessGrammar()  : mixed
resolveNodes()  : mixed
resolveMacros()  : mixed
assertArgs()  : mixed
resolveStackAccess()  : mixed
removeTrailingWhitespace()  : mixed
regex()  : mixed
magicSplit()  : mixed
ensureDirExists()  : mixed
execCmd()  : mixed
redis_version()  : mixed
zpop()  : mixed
printPHPCodeSnifferTestOutput()  : void
A global util function to help print unit test fixing data.
trigger_deprecation()  : void
Triggers a silenced deprecation notice.
ctype_alnum()  : mixed
ctype_alpha()  : mixed
ctype_cntrl()  : mixed
ctype_digit()  : mixed
ctype_graph()  : mixed
ctype_lower()  : mixed
ctype_print()  : mixed
ctype_punct()  : mixed
ctype_space()  : mixed
ctype_upper()  : mixed
ctype_xdigit()  : mixed
ctype_alnum()  : bool
ctype_alpha()  : bool
ctype_cntrl()  : bool
ctype_digit()  : bool
ctype_graph()  : bool
ctype_lower()  : bool
ctype_print()  : bool
ctype_punct()  : bool
ctype_space()  : bool
ctype_upper()  : bool
ctype_xdigit()  : bool

Constants

APPPATH

public Paths APPPATH = ealpath( trim($paths->appDirectory, '\/ ')) . DIRECTORY_SEPARATOR

ARGS

public mixed ARGS = '\((?<args>[^()]*+(?:\((?&args)\)[^()]*+)*+)\)'

ENVIRONMENT

public mixed ENVIRONMENT = 'testing'

EVENT_PRIORITY_HIGH

public mixed EVENT_PRIORITY_HIGH = 10

EVENT_PRIORITY_LOW

public mixed EVENT_PRIORITY_LOW = 200

EVENT_PRIORITY_NORMAL

public mixed EVENT_PRIORITY_NORMAL = 100

FCPATH

public mixed FCPATH = __DIR__ . DIRECTORY_SEPARATOR

KINT_DIR

public mixed KINT_DIR = __DIR__

KINT_DIR

public mixed KINT_DIR = __DIR__

KINT_PHP56

public mixed KINT_PHP56 = ersion_compare(PHP_VERSION, '5.6') >= 0

KINT_PHP56

public mixed KINT_PHP56 = ersion_compare(PHP_VERSION, '5.6') >= 0

KINT_PHP70

public mixed KINT_PHP70 = ersion_compare(PHP_VERSION, '7.0') >= 0

KINT_PHP70

public mixed KINT_PHP70 = ersion_compare(PHP_VERSION, '7.0') >= 0

KINT_PHP72

public mixed KINT_PHP72 = ersion_compare(PHP_VERSION, '7.2') >= 0

KINT_PHP72

public mixed KINT_PHP72 = ersion_compare(PHP_VERSION, '7.2') >= 0

KINT_PHP73

public mixed KINT_PHP73 = ersion_compare(PHP_VERSION, '7.3') >= 0

KINT_PHP73

public mixed KINT_PHP73 = ersion_compare(PHP_VERSION, '7.3') >= 0

KINT_PHP74

public mixed KINT_PHP74 = ersion_compare(PHP_VERSION, '7.4') >= 0

KINT_PHP74

public mixed KINT_PHP74 = ersion_compare(PHP_VERSION, '7.4') >= 0

KINT_WIN

public mixed KINT_WIN = DIRECTORY_SEPARATOR !== '/'

KINT_WIN

public mixed KINT_WIN = DIRECTORY_SEPARATOR !== '/'

LIB

public mixed LIB = '(?(DEFINE) (?<singleQuotedString>'[^\\']*+(?:\\.[^\\']*+)*+') (?<doubleQuotedString>"[^\\"]*+(?:\\.[^\\"]*+)*+") (?<string>(?&singleQuotedString)|(?&doubleQuotedString)) (?<comment>/\*[^*]*+(?:\*(?!/)[^*]*+)*+\*/) (?<code>\{[^'"/{}]*+(?:(?:(?&string)|(?&comment)|(?&code)|/)[^'"/{}]*+)*+}) )'

PARAMS

public mixed PARAMS = '\[(?<params>[^[\]]*+(?:\[(?&params)\][^[\]]*+)*+)\]'

PHP_CODESNIFFER_CBF

public mixed PHP_CODESNIFFER_CBF = alse

PHP_CODESNIFFER_IN_TESTS

public mixed PHP_CODESNIFFER_IN_TESTS = rue

PHP_CODESNIFFER_VERBOSITY

public mixed PHP_CODESNIFFER_VERBOSITY = 0

ROOTPATH

public mixed ROOTPATH = ealpath(APPPATH . '../') . DIRECTORY_SEPARATOR

SYSTEMPATH

public Paths SYSTEMPATH = ealpath( trim($paths->systemDirectory, '\/ ')) . DIRECTORY_SEPARATOR

T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG

public mixed T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG = 'PHPCS_T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG'

T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG

public mixed T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG = 'PHPCS_T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG'

T_ANON_CLASS

public mixed T_ANON_CLASS = 'PHPCS_T_ANON_CLASS'

T_ARRAY_HINT

public mixed T_ARRAY_HINT = 'PHPCS_T_ARRAY_HINT'

T_ASPERAND

public mixed T_ASPERAND = 'PHPCS_T_ASPERAND'

T_ATTRIBUTE

public mixed T_ATTRIBUTE = 'PHPCS_T_ATTRIBUTE'

T_ATTRIBUTE_END

public mixed T_ATTRIBUTE_END = 'PHPCS_T_ATTRIBUTE_END'

T_BACKTICK

public mixed T_BACKTICK = 'PHPCS_T_BACKTICK'

T_BAD_CHARACTER

public mixed T_BAD_CHARACTER = 'PHPCS_T_BAD_CHARACTER'

T_BINARY_CAST

public mixed T_BINARY_CAST = 'PHPCS_T_BINARY_CAST'

T_BITWISE_AND

public mixed T_BITWISE_AND = 'PHPCS_T_BITWISE_AND'

T_BITWISE_NOT

public mixed T_BITWISE_NOT = 'PHPCS_T_BITWISE_NOT'

T_BITWISE_OR

public mixed T_BITWISE_OR = 'PHPCS_T_BITWISE_OR'

T_BITWISE_XOR

public mixed T_BITWISE_XOR = 'PHPCS_T_BITWISE_XOR'

T_BOOLEAN_NOT

public mixed T_BOOLEAN_NOT = 'PHPCS_T_BOOLEAN_NOT'

T_CLOSE_CURLY_BRACKET

public mixed T_CLOSE_CURLY_BRACKET = 'PHPCS_T_CLOSE_CURLY_BRACKET'

T_CLOSE_OBJECT

public mixed T_CLOSE_OBJECT = 'PHPCS_T_CLOSE_OBJECT'

T_CLOSE_PARENTHESIS

public mixed T_CLOSE_PARENTHESIS = 'PHPCS_T_CLOSE_PARENTHESIS'

T_CLOSE_SHORT_ARRAY

public mixed T_CLOSE_SHORT_ARRAY = 'PHPCS_T_CLOSE_SHORT_ARRAY'

T_CLOSE_SQUARE_BRACKET

public mixed T_CLOSE_SQUARE_BRACKET = 'PHPCS_T_CLOSE_SQUARE_BRACKET'

T_CLOSE_USE_GROUP

public mixed T_CLOSE_USE_GROUP = 'PHPCS_T_CLOSE_USE_GROUP'

T_CLOSURE

public mixed T_CLOSURE = 'PHPCS_T_CLOSURE'

T_COALESCE

public mixed T_COALESCE = 'PHPCS_T_COALESCE'

T_COALESCE_EQUAL

public mixed T_COALESCE_EQUAL = 'PHPCS_T_COALESCE_EQUAL'

T_COLON

public mixed T_COLON = 'PHPCS_T_COLON'

T_COLOUR

public mixed T_COLOUR = 'PHPCS_T_COLOUR'

T_COMMA

public mixed T_COMMA = 'PHPCS_T_COMMA'

T_DIVIDE

public mixed T_DIVIDE = 'PHPCS_T_DIVIDE'

T_DOC_COMMENT_CLOSE_TAG

public mixed T_DOC_COMMENT_CLOSE_TAG = 'PHPCS_T_DOC_COMMENT_CLOSE_TAG'

T_DOC_COMMENT_OPEN_TAG

public mixed T_DOC_COMMENT_OPEN_TAG = 'PHPCS_T_DOC_COMMENT_OPEN_TAG'

T_DOC_COMMENT_STAR

public mixed T_DOC_COMMENT_STAR = 'PHPCS_T_DOC_COMMENT_STAR'

T_DOC_COMMENT_STRING

public mixed T_DOC_COMMENT_STRING = 'PHPCS_T_DOC_COMMENT_STRING'

T_DOC_COMMENT_TAG

public mixed T_DOC_COMMENT_TAG = 'PHPCS_T_DOC_COMMENT_TAG'

T_DOC_COMMENT_WHITESPACE

public mixed T_DOC_COMMENT_WHITESPACE = 'PHPCS_T_DOC_COMMENT_WHITESPACE'

T_DOLLAR

public mixed T_DOLLAR = 'PHPCS_T_DOLLAR'

T_DOUBLE_QUOTED_STRING

public mixed T_DOUBLE_QUOTED_STRING = 'PHPCS_T_DOUBLE_QUOTED_STRING'

T_ELLIPSIS

public mixed T_ELLIPSIS = 'PHPCS_T_ELLIPSIS'

T_EMBEDDED_PHP

public mixed T_EMBEDDED_PHP = 'PHPCS_T_EMBEDDED_PHP'

T_END_NOWDOC

public mixed T_END_NOWDOC = 'PHPCS_T_END_NOWDOC'

T_EQUAL

public mixed T_EQUAL = 'PHPCS_T_EQUAL'

T_FALSE

public mixed T_FALSE = 'PHPCS_T_FALSE'

T_FINALLY

public mixed T_FINALLY = 'PHPCS_T_FINALLY'

T_FN

public mixed T_FN = 'PHPCS_T_FN'

T_FN_ARROW

public mixed T_FN_ARROW = 'PHPCS_T_FN_ARROW'

T_GOTO_LABEL

public mixed T_GOTO_LABEL = 'PHPCS_T_GOTO_LABEL'

T_GREATER_THAN

public mixed T_GREATER_THAN = 'PHPCS_T_GREATER_THAN'

T_HASH

public mixed T_HASH = 'PHPCS_T_HASH'

T_HEREDOC

public mixed T_HEREDOC = 'PHPCS_T_HEREDOC'

T_INLINE_ELSE

public mixed T_INLINE_ELSE = 'PHPCS_T_INLINE_ELSE'

T_INLINE_THEN

public mixed T_INLINE_THEN = 'PHPCS_T_INLINE_THEN'

T_LABEL

public mixed T_LABEL = 'PHPCS_T_LABEL'

T_LESS_THAN

public mixed T_LESS_THAN = 'PHPCS_T_LESS_THAN'

T_MATCH

public mixed T_MATCH = 'PHPCS_T_MATCH'

T_MATCH_ARROW

public mixed T_MATCH_ARROW = 'PHPCS_T_MATCH_ARROW'

T_MATCH_DEFAULT

public mixed T_MATCH_DEFAULT = 'PHPCS_T_MATCH_DEFAULT'

T_MINUS

public mixed T_MINUS = 'PHPCS_T_MINUS'

T_MODULUS

public mixed T_MODULUS = 'PHPCS_T_MODULUS'

T_MULTIPLY

public mixed T_MULTIPLY = 'PHPCS_T_MULTIPLY'

T_NAME_FULLY_QUALIFIED

public mixed T_NAME_FULLY_QUALIFIED = 'T_NAME_FULLY_QUALIFIED'

T_NAME_FULLY_QUALIFIED

public mixed T_NAME_FULLY_QUALIFIED = 'PHPCS_T_NAME_FULLY_QUALIFIED'

T_NAME_QUALIFIED

public mixed T_NAME_QUALIFIED = 'T_NAME_QUALIFIED'

T_NAME_QUALIFIED

public mixed T_NAME_QUALIFIED = 'PHPCS_T_NAME_QUALIFIED'

T_NAME_RELATIVE

public mixed T_NAME_RELATIVE = 'PHPCS_T_NAME_RELATIVE'

T_NONE

public mixed T_NONE = 'PHPCS_T_NONE'

T_NOWDOC

public mixed T_NOWDOC = 'PHPCS_T_NOWDOC'

T_NULL

public mixed T_NULL = 'PHPCS_T_NULL'

T_NULLABLE

public mixed T_NULLABLE = 'PHPCS_T_NULLABLE'

T_NULLSAFE_OBJECT_OPERATOR

public mixed T_NULLSAFE_OBJECT_OPERATOR = 'PHPCS_T_NULLSAFE_OBJECT_OPERATOR'

T_OBJECT

public mixed T_OBJECT = 'PHPCS_T_OBJECT'

T_OPEN_CURLY_BRACKET

public mixed T_OPEN_CURLY_BRACKET = 'PHPCS_T_OPEN_CURLY_BRACKET'

T_OPEN_PARENTHESIS

public mixed T_OPEN_PARENTHESIS = 'PHPCS_T_OPEN_PARENTHESIS'

T_OPEN_SHORT_ARRAY

public mixed T_OPEN_SHORT_ARRAY = 'PHPCS_T_OPEN_SHORT_ARRAY'

T_OPEN_SQUARE_BRACKET

public mixed T_OPEN_SQUARE_BRACKET = 'PHPCS_T_OPEN_SQUARE_BRACKET'

T_OPEN_USE_GROUP

public mixed T_OPEN_USE_GROUP = 'PHPCS_T_OPEN_USE_GROUP'

T_PARAM_NAME

public mixed T_PARAM_NAME = 'PHPCS_T_PARAM_NAME'

T_PARENT

public mixed T_PARENT = 'PHPCS_T_PARENT'

T_PHPCS_DISABLE

public mixed T_PHPCS_DISABLE = 'PHPCS_T_PHPCS_DISABLE'

T_PHPCS_ENABLE

public mixed T_PHPCS_ENABLE = 'PHPCS_T_PHPCS_ENABLE'

T_PHPCS_IGNORE

public mixed T_PHPCS_IGNORE = 'PHPCS_T_PHPCS_IGNORE'

T_PHPCS_IGNORE_FILE

public mixed T_PHPCS_IGNORE_FILE = 'PHPCS_T_PHPCS_IGNORE_FILE'

T_PHPCS_SET

public mixed T_PHPCS_SET = 'PHPCS_T_PHPCS_SET'

T_PLUS

public mixed T_PLUS = 'PHPCS_T_PLUS'

T_POW

public mixed T_POW = 'PHPCS_T_POW'

T_POW_EQUAL

public mixed T_POW_EQUAL = 'PHPCS_T_POW_EQUAL'

T_PROPERTY

public mixed T_PROPERTY = 'PHPCS_T_PROPERTY'

T_PROTOTYPE

public mixed T_PROTOTYPE = 'PHPCS_T_PROTOTYPE'

T_REGULAR_EXPRESSION

public mixed T_REGULAR_EXPRESSION = 'PHPCS_T_REGULAR_EXPRESSION'

T_RETURN_TYPE

public mixed T_RETURN_TYPE = 'PHPCS_T_RETURN_TYPE'

T_SELF

public mixed T_SELF = 'PHPCS_T_SELF'

T_SEMICOLON

public mixed T_SEMICOLON = 'PHPCS_T_SEMICOLON'

T_SPACESHIP

public mixed T_SPACESHIP = 'PHPCS_T_SPACESHIP'

T_START_NOWDOC

public mixed T_START_NOWDOC = 'PHPCS_T_START_NOWDOC'

T_STRING_CONCAT

public mixed T_STRING_CONCAT = 'PHPCS_T_STRING_CONCAT'

T_STYLE

public mixed T_STYLE = 'PHPCS_T_STYLE'

T_THIS

public mixed T_THIS = 'PHPCS_T_THIS'

T_TRUE

public mixed T_TRUE = 'PHPCS_T_TRUE'

T_TYPE_UNION

public mixed T_TYPE_UNION = 'PHPCS_T_TYPE_UNION'

T_TYPEOF

public mixed T_TYPEOF = 'PHPCS_T_TYPEOF'

T_URL

public mixed T_URL = 'PHPCS_T_URL'

T_YIELD

public mixed T_YIELD = 'PHPCS_T_YIELD'

T_YIELD_FROM

public mixed T_YIELD_FROM = 'PHPCS_T_YIELD_FROM'

T_ZSR

public mixed T_ZSR = 'PHPCS_T_ZSR'

T_ZSR_EQUAL

public mixed T_ZSR_EQUAL = 'PHPCS_T_ZSR_EQUAL'

TESTPATH

public Paths TESTPATH = ealpath( trim($paths->testsDirectory, '\/ ')) . DIRECTORY_SEPARATOR

VENDORPATH

public mixed VENDORPATH = ealpath(ROOTPATH . 'vendor') . DIRECTORY_SEPARATOR

VENDORPATH

public mixed VENDORPATH = ealpath(ROOTPATH . 'vendor') . DIRECTORY_SEPARATOR

WRITEPATH

public Paths WRITEPATH = ealpath( trim($paths->writableDirectory, '\/ ')) . DIRECTORY_SEPARATOR

Functions

app_timezone()

Returns the timezone the application has been set to display dates in. This might be different than the timezone set at the server level, as you often want to stores dates in UTC and convert them on the fly for the user.

app_timezone() : string
Return values
string

cache()

A convenience method that provides access to the Cache object. If no parameter is provided, will return the object, otherwise, will attempt to return the cached value.

cache([string|null $key = null ]) : CacheInterface|mixed

Examples: cache()->save('foo', 'bar'); $foo = cache('bar');

Parameters
$key : string|null = null
Return values
CacheInterface|mixed

clean_path()

A convenience method to clean paths for a nicer looking output. Useful for exception handling, error logging, etc.

clean_path(string $path) : string
Parameters
$path : string
Return values
string

command()

Runs a single command.

command(string $command) : false|string

Input expected in a single string as would be used on the command line itself:

command('migrate:create SomeMigration');

Parameters
$command : string
Return values
false|string

config()

More simple way of getting config instances from Factories

config(string $name[, bool $getShared = true ]) : mixed
Parameters
$name : string
$getShared : bool = true
Return values
mixed

Simpler way to create a new Cookie instance.

cookie(string $name[, string $value = '' ][, array<string|int, mixed> $options = [] ]) : Cookie
Parameters
$name : string

Name of the cookie

$value : string = ''

Value of the cookie

$options : array<string|int, mixed> = []

Array of options to be passed to the cookie

Tags
throws
CookieException
Return values
Cookie

cookies()

Fetches the global `CookieStore` instance held by `Response`.

cookies([array<string|int, Cookie$cookies = [] ][, bool $getGlobal = true ]) : CookieStore
Parameters
$cookies : array<string|int, Cookie> = []

If getGlobal is false, this is passed to CookieStore's constructor

$getGlobal : bool = true

If false, creates a new instance of CookieStore

Return values
CookieStore

csrf_token()

Returns the CSRF token name.

csrf_token() : string

Can be used in Views when building hidden inputs manually, or used in javascript vars when using APIs.

Return values
string

csrf_header()

Returns the CSRF header name.

csrf_header() : string

Can be used in Views by adding it to the meta tag or used in javascript to define a header name when using APIs.

Return values
string

csrf_hash()

Returns the current hash value for the CSRF protection.

csrf_hash() : string

Can be used in Views when building hidden inputs manually, or used in javascript vars for API usage.

Return values
string

csrf_field()

Generates a hidden input field for use within manually generated forms.

csrf_field([string|null $id = null ]) : string
Parameters
$id : string|null = null
Return values
string

csrf_meta()

Generates a meta tag for use within javascript calls.

csrf_meta([string|null $id = null ]) : string
Parameters
$id : string|null = null
Return values
string

db_connect()

Grabs a database connection and returns it to the user.

db_connect([ConnectionInterface|array<string|int, mixed>|string|null $db = null ][, bool $getShared = true ]) : BaseConnection

This is a convenience wrapper for \Config\Database::connect() and supports the same parameters. Namely:

When passing in $db, you may pass any of the following to connect:

  • group name
  • existing connection instance
  • array of database configuration values

If $getShared === false then a new connection instance will be provided, otherwise it will all calls will return the same instance.

Parameters
$db : ConnectionInterface|array<string|int, mixed>|string|null = null
$getShared : bool = true
Return values
BaseConnection

dd()

Prints a Kint debug report and exits.

dd(array<string|int, mixed> ...$vars) : mixed
Parameters
$vars : array<string|int, mixed>
Tags
codeCoverageIgnore

Can't be tested ... exits

Return values
mixed

env()

Allows user to retrieve values from the environment variables that have been set. Especially useful for retrieving values set from the .env file for use in config files.

env(string $key[, string|null $default = null ]) : mixed
Parameters
$key : string
$default : string|null = null
Return values
mixed

esc()

Performs simple auto-escaping of data for security reasons.

esc(string|array<string|int, mixed> $data[, string $context = 'html' ][, string $encoding = null ]) : string|array<string|int, mixed>

Might consider making this more complex at a later date.

If $data is a string, then it simply escapes and returns it. If $data is an array, then it loops over it, escaping each 'value' of the key/value pairs.

Valid context values: html, js, css, url, attr, raw, null

Parameters
$data : string|array<string|int, mixed>
$context : string = 'html'
$encoding : string = null
Tags
throws
InvalidArgumentException
Return values
string|array<string|int, mixed>

force_https()

Used to force a page to be accessed in via HTTPS.

force_https([int $duration = 31536000 ][, RequestInterface $request = null ][, ResponseInterface $response = null ]) : mixed

Uses a standard redirect, plus will set the HSTS header for modern browsers that support, which gives best protection against man-in-the-middle attacks.

Parameters
$duration : int = 31536000

How long should the SSL header be set for? (in seconds) Defaults to 1 year.

$request : RequestInterface = null
$response : ResponseInterface = null
Tags
see
https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security
throws
HTTPException
Return values
mixed

function_usable()

Function usable

function_usable(string $functionName) : bool

Executes a function_exists() check, and if the Suhosin PHP extension is loaded - checks whether the function that is checked might be disabled in there as well.

This is useful as function_exists() will return FALSE for functions disabled via the disable_functions php.ini setting, but not for suhosin.executor.func.blacklist and suhosin.executor.disable_eval. These settings will just terminate script execution if a disabled function is executed.

The above described behavior turned out to be a bug in Suhosin, but even though a fix was committed for 0.9.34 on 2012-02-12, that version is yet to be released. This function will therefore be just temporary, but would probably be kept for a few years.

Parameters
$functionName : string

Function to check for

Tags
link
http://www.hardened-php.net/suhosin/
codeCoverageIgnore

This is too exotic

Return values
bool

TRUE if the function exists and is safe to call, FALSE otherwise.

helper()

Loads a helper file into memory. Supports namespaced helpers, both in and out of the 'helpers' directory of a namespaced directory.

helper(string|array<string|int, mixed> $filenames) : mixed

Will load ALL helpers of the matching name, in the following order:

  1. app/Helpers
  2. {namespace}/Helpers
  3. system/Helpers
Parameters
$filenames : string|array<string|int, mixed>
Tags
throws
FileNotFoundException
Return values
mixed

is_cli()

Check if PHP was invoked from the command line.

is_cli() : bool
Tags
codeCoverageIgnore

Cannot be tested fully as PHPUnit always run in CLI

Return values
bool

is_really_writable()

Tests for file writability

is_really_writable(string $file) : bool

is_writable() returns TRUE on Windows servers when you really can't write to the file, based on the read-only attribute. is_writable() is also unreliable on Unix servers if safe_mode is on.

Parameters
$file : string
Tags
link
https://bugs.php.net/bug.php?id=54709
throws
Exception
codeCoverageIgnore

Not practical to test, as travis runs on linux

Return values
bool

lang()

A convenience method to translate a string or array of them and format the result with the intl extension's MessageFormatter.

lang(string $line[, array<string|int, mixed> $args = [] ][, string|null $locale = null ]) : string
Parameters
$line : string
$args : array<string|int, mixed> = []
$locale : string|null = null
Return values
string

log_message()

A convenience/compatibility method for logging events through the Log system.

log_message(string $level, string $message[, array<string|int, mixed> $context = [] ]) : mixed

Allowed log levels are:

  • emergency
  • alert
  • critical
  • error
  • warning
  • notice
  • info
  • debug
Parameters
$level : string
$message : string
$context : array<string|int, mixed> = []
Return values
mixed

model()

More simple way of getting model instances from Factories

model(string $name[, bool $getShared = true ][, ConnectionInterface|null &$conn = null ]) : mixed
Parameters
$name : string
$getShared : bool = true
$conn : ConnectionInterface|null = null
Return values
mixed

old()

Provides access to "old input" that was set in the session during a redirect()->withInput().

old(string $key[, null $default = null ][, string|bool $escape = 'html' ]) : mixed|null
Parameters
$key : string
$default : null = null
$escape : string|bool = 'html'
Return values
mixed|null

redirect()

Convenience method that works with the current global $request and $router instances to redirect using named/reverse-routed routes to determine the URL to go to. If nothing is found, will treat as a traditional redirect and pass the string in, letting $response->redirect() determine the correct method and code.

redirect([string $route = null ]) : RedirectResponse

If more control is needed, you must use $response->redirect explicitly.

Parameters
$route : string = null
Return values
RedirectResponse

remove_invisible_characters()

Remove Invisible Characters

remove_invisible_characters(string $str[, bool $urlEncoded = true ]) : string

This prevents sandwiching null characters between ascii characters, like Java\0script.

Parameters
$str : string
$urlEncoded : bool = true
Return values
string

route_to()

Given a controller/method string and any params, will attempt to build the relative URL to the matching route.

route_to(string $method, mixed ...$params) : false|string

NOTE: This requires the controller/method to have a route defined in the routes Config file.

Parameters
$method : string
$params : mixed
Return values
false|string

session()

A convenience method for accessing the session instance, or an item that has been set in the session.

session([string $val = null ]) : Session|mixed|null

Examples: session()->set('foo', 'bar'); $foo = session('bar');

Parameters
$val : string = null
Return values
Session|mixed|null

service()

Allows cleaner access to the Services Config file.

service(string $name, mixed ...$params) : mixed

Always returns a SHARED instance of the class, so calling the function multiple times should always return the same instance.

These are equal:

  • $timer = service('timer')
  • $timer = \CodeIgniter\Config\Services::timer();
Parameters
$name : string
$params : mixed
Return values
mixed

single_service()

Always returns a new instance of the class.

single_service(string $name, mixed ...$params) : mixed
Parameters
$name : string
$params : mixed
Return values
mixed

slash_item()

Fetch a config file item with slash appended (if not empty)

slash_item(string $item) : string|null
Parameters
$item : string

Config item name

Return values
string|null

The configuration item or NULL if the item doesn't exist

stringify_attributes()

Stringify attributes for use in HTML tags.

stringify_attributes(mixed $attributes[, bool $js = false ]) : string

Helper function used to convert a string, array, or object of attributes to a string.

Parameters
$attributes : mixed

string, array, object

$js : bool = false
Return values
string

timer()

A convenience method for working with the timer.

timer([string|null $name = null ]) : Timer|mixed

If no parameter is passed, it will return the timer instance, otherwise will start or stop the timer intelligently.

Parameters
$name : string|null = null
Return values
Timer|mixed

trace()

Provides a backtrace to the current execution point, from Kint.

trace() : mixed
Return values
mixed

view()

Grabs the current RendererInterface-compatible class and tells it to render the specified view. Simply provides a convenience method that can be used in Controllers, libraries, and routed closures.

view(string $name[, array<string|int, mixed> $data = [] ][, array<string|int, mixed> $options = [] ]) : string

NOTE: Does not provide any escaping of the data, so that must all be handled manually by the developer.

Parameters
$name : string
$data : array<string|int, mixed> = []
$options : array<string|int, mixed> = []

Unused - reserved for third-party extensions.

Return values
string

view_cell()

View cells are used within views to insert HTML chunks that are managed by other classes.

view_cell(string $library[, null $params = null ], int $ttl[, string|null $cacheName = null ]) : string
Parameters
$library : string
$params : null = null
$ttl : int
$cacheName : string|null = null
Tags
throws
ReflectionException
Return values
string

class_basename()

Get the class "basename" of the given object / class.

class_basename(string|object $class) : string
Parameters
$class : string|object
Tags
codeCoverageIgnore
Return values
string

class_uses_recursive()

Returns all traits used by a class, its parent classes and trait of their traits.

class_uses_recursive(object|string $class) : array<string|int, mixed>
Parameters
$class : object|string
Tags
codeCoverageIgnore
Return values
array<string|int, mixed>

trait_uses_recursive()

Returns all traits used by a trait and its traits.

trait_uses_recursive(string $trait) : array<string|int, mixed>
Parameters
$trait : string
Tags
codeCoverageIgnore
Return values
array<string|int, mixed>

Searches an array through dot syntax. Supports wildcard searches, like foo.*.bar

dot_array_search(string $index, array<string|int, mixed> $array) : mixed
Parameters
$index : string
$array : array<string|int, mixed>
Return values
mixed

Returns the value of an element at a key in an array of uncertain depth.

array_deep_search(mixed $key, array<string|int, mixed> $array) : mixed|null
Parameters
$key : mixed
$array : array<string|int, mixed>
Return values
mixed|null

array_sort_by_multiple_keys()

Sorts a multidimensional array by its elements values. The array columns to be used for sorting are passed as an associative array of key names and sorting flags.

array_sort_by_multiple_keys(array<string|int, mixed> &$array, array<string|int, mixed> $sortColumns) : bool

Both arrays of objects and arrays of array can be sorted.

Example: array_sort_by_multiple_keys($players, [ 'team.hierarchy' => SORT_ASC, 'position' => SORT_ASC, 'name' => SORT_STRING, ]);

The '.' dot operator in the column name indicates a deeper array or object level. In principle, any number of sublevels could be used, as long as the level and column exist in every array element.

For information on multi-level array sorting, refer to Example #3 here: https://www.php.net/manual/de/function.array-multisort.php

Parameters
$array : array<string|int, mixed>

the reference of the array to be sorted

$sortColumns : array<string|int, mixed>

an associative array of columns to sort after and their sorting flags

Return values
bool

array_flatten_with_dots()

Flatten a multidimensional array using dots as separators.

array_flatten_with_dots(iteratable<string|int, mixed> $array[, string $id = '' ]) : array<string|int, mixed>
Parameters
$array : iteratable<string|int, mixed>

The multi-dimensional array

$id : string = ''

Something to initially prepend to the flattened keys

Return values
array<string|int, mixed>

The flattened array

Set cookie

set_cookie(string|array<string|int, mixed> $name[, string $value = '' ][, string $expire = '' ][, string $domain = '' ][, string $path = '/' ][, string $prefix = '' ][, bool $secure = false ][, bool $httpOnly = false ][, string|null $sameSite = null ]) : mixed

Accepts seven parameters, or you can submit an associative array in the first parameter containing all the values.

Parameters
$name : string|array<string|int, mixed>

Cookie name or array containing binds

$value : string = ''

The value of the cookie

$expire : string = ''

The number of seconds until expiration

$domain : string = ''

For site-wide cookie. Usually: .yourdomain.com

$path : string = '/'

The cookie path

$prefix : string = ''

The cookie prefix

$secure : bool = false

True makes the cookie secure

$httpOnly : bool = false

True makes the cookie accessible via http(s) only (no javascript)

$sameSite : string|null = null

The cookie SameSite value

Tags
see
Response::setCookie()
Return values
mixed

Fetch an item from the $_COOKIE array

get_cookie(string $index[, bool $xssClean = false ]) : mixed
Parameters
$index : string
$xssClean : bool = false
Tags
see
IncomingRequest::getCookie()
Return values
mixed

Delete a cookie

delete_cookie(mixed $name[, string $domain = '' ][, string $path = '/' ][, string $prefix = '' ]) : void
Parameters
$name : mixed
$domain : string = ''

the cookie domain. Usually: .yourdomain.com

$path : string = '/'

the cookie path

$prefix : string = ''

the cookie prefix

Tags
see
Response::deleteCookie()
Return values
void

Checks if a cookie exists by name.

has_cookie(string $name[, string|null $value = null ][, string $prefix = '' ]) : bool
Parameters
$name : string
$value : string|null = null
$prefix : string = ''
Return values
bool

now()

Get "now" time

now([string $timezone = null ]) : int

Returns time() based on the timezone parameter or on the app_timezone() setting

Parameters
$timezone : string = null
Tags
throws
Exception
Return values
int

timezone_select()

Generates a select field of all available timezones

timezone_select([string $class = '' ][, string $default = '' ][, int $what = DateTimeZone::ALL ][, string $country = null ]) : string

Returns a string with the formatted HTML

Parameters
$class : string = ''

Optional class to apply to the select field

$default : string = ''

Default value for initial selection

$what : int = DateTimeZone::ALL

One of the DateTimeZone class constants (for listIdentifiers)

$country : string = null

A two-letter ISO 3166-1 compatible country code (for listIdentifiers)

Tags
throws
Exception
Return values
string

directory_map()

Create a Directory Map

directory_map(string $sourceDir, int $directoryDepth[, bool $hidden = false ]) : array<string|int, mixed>

Reads the specified directory and builds an array representation of it. Sub-folders contained with the directory will be mapped as well.

Parameters
$sourceDir : string

Path to source

$directoryDepth : int

Depth of directories to traverse (0 = fully recursive, 1 = current dir, etc)

$hidden : bool = false

Whether to show hidden files

Return values
array<string|int, mixed>

directory_mirror()

Recursively copies the files and directories of the origin directory into the target directory, i.e. "mirror" its contents.

directory_mirror(string $originDir, string $targetDir[, bool $overwrite = true ]) : void
Parameters
$originDir : string
$targetDir : string
$overwrite : bool = true

Whether individual files overwrite on collision

Tags
throws
InvalidArgumentException
Return values
void

write_file()

Write File

write_file(string $path, string $data[, string $mode = 'wb' ]) : bool

Writes data to the file specified in the path. Creates a new file if non-existent.

Parameters
$path : string

File path

$data : string

Data to write

$mode : string = 'wb'

fopen() mode (default: 'wb')

Return values
bool

delete_files()

Delete Files

delete_files(string $path[, bool $delDir = false ][, bool $htdocs = false ][, bool $hidden = false ]) : bool

Deletes all files contained in the supplied directory path. Files must be writable or owned by the system in order to be deleted. If the second parameter is set to true, any directories contained within the supplied base directory will be nuked as well.

Parameters
$path : string

File path

$delDir : bool = false

Whether to delete any directories found in the path

$htdocs : bool = false

Whether to skip deleting .htaccess and index page files

$hidden : bool = false

Whether to include hidden files (files beginning with a period)

Return values
bool

get_filenames()

Get Filenames

get_filenames(string $sourceDir[, bool|null $includePath = false ][, bool $hidden = false ]) : array<string|int, mixed>

Reads the specified directory and builds an array containing the filenames. Any sub-folders contained within the specified path are read as well.

Parameters
$sourceDir : string

Path to source

$includePath : bool|null = false

Whether to include the path as part of the filename; false for no path, null for a relative path, true for full path

$hidden : bool = false

Whether to include hidden files (files beginning with a period)

Return values
array<string|int, mixed>

get_dir_file_info()

Get Directory File Information

get_dir_file_info(string $sourceDir[, bool $topLevelOnly = true ][, bool $recursion = false ]) : array<string|int, mixed>

Reads the specified directory and builds an array containing the filenames, filesize, dates, and permissions

Any sub-folders contained within the specified path are read as well.

Parameters
$sourceDir : string

Path to source

$topLevelOnly : bool = true

Look only at the top level directory specified?

$recursion : bool = false

Internal variable to determine recursion status - do not use in calls

Return values
array<string|int, mixed>

get_file_info()

Get File Info

get_file_info(string $file[, mixed $returnedValues = ['name', 'server_path', 'size', 'date'] ]) : array<string|int, mixed>|null

Given a file and path, returns the name, path, size, date modified Second parameter allows you to explicitly declare what information you want returned Options are: name, server_path, size, date, readable, writable, executable, fileperms Returns false if the file cannot be found.

Parameters
$file : string

Path to file

$returnedValues : mixed = ['name', 'server_path', 'size', 'date']

Array or comma separated string of information returned

Return values
array<string|int, mixed>|null

symbolic_permissions()

Symbolic Permissions

symbolic_permissions(int $perms) : string

Takes a numeric value representing a file's permissions and returns standard symbolic notation representing that value

Parameters
$perms : int

Permissions

Return values
string

octal_permissions()

Octal Permissions

octal_permissions(int $perms) : string

Takes a numeric value representing a file's permissions and returns a three character string representing the file's octal permissions

Parameters
$perms : int

Permissions

Return values
string

same_file()

Checks if two files both exist and have identical hashes

same_file(string $file1, string $file2) : bool
Parameters
$file1 : string
$file2 : string
Return values
bool

Same or not

set_realpath()

Set Realpath

set_realpath(string $path[, bool $checkExistence = false ]) : string
Parameters
$path : string
$checkExistence : bool = false

Checks to see if the path exists

Return values
string

form_open()

Form Declaration

form_open([string $action = '' ][, array<string|int, mixed>|string $attributes = [] ][, array<string|int, mixed> $hidden = [] ]) : string

Creates the opening portion of the form.

Parameters
$action : string = ''

the URI segments of the form destination

$attributes : array<string|int, mixed>|string = []

a key/value pair of attributes, or string representation

$hidden : array<string|int, mixed> = []

a key/value pair hidden data

Return values
string

form_open_multipart()

Form Declaration - Multipart type

form_open_multipart([string $action = '' ][, array<string|int, mixed>|string $attributes = [] ][, array<string|int, mixed> $hidden = [] ]) : string

Creates the opening portion of the form, but with "multipart/form-data".

Parameters
$action : string = ''

The URI segments of the form destination

$attributes : array<string|int, mixed>|string = []

A key/value pair of attributes, or the same as a string

$hidden : array<string|int, mixed> = []

A key/value pair hidden data

Return values
string

form_hidden()

Hidden Input Field

form_hidden(string|array<string|int, mixed> $name[, string|array<string|int, mixed> $value = '' ][, bool $recursing = false ]) : string

Generates hidden fields. You can pass a simple key/value string or an associative array with multiple values.

Parameters
$name : string|array<string|int, mixed>

Field name or associative array to create multiple fields

$value : string|array<string|int, mixed> = ''

Field value

$recursing : bool = false
Return values
string

form_input()

Text Input Field. If 'type' is passed in the $type field, it will be used as the input type, for making 'email', 'phone', etc input fields.

form_input([mixed $data = '' ][, string $value = '' ][, mixed $extra = '' ][, string $type = 'text' ]) : string
Parameters
$data : mixed = ''
$value : string = ''
$extra : mixed = ''
$type : string = 'text'
Return values
string

form_password()

Password Field

form_password([mixed $data = '' ][, string $value = '' ][, mixed $extra = '' ]) : string

Identical to the input function but adds the "password" type

Parameters
$data : mixed = ''
$value : string = ''
$extra : mixed = ''
Return values
string

form_upload()

Upload Field

form_upload([mixed $data = '' ][, string $value = '' ][, mixed $extra = '' ]) : string

Identical to the input function but adds the "file" type

Parameters
$data : mixed = ''
$value : string = ''
$extra : mixed = ''
Return values
string

form_textarea()

Textarea field

form_textarea([mixed $data = '' ][, string $value = '' ][, mixed $extra = '' ]) : string
Parameters
$data : mixed = ''
$value : string = ''
$extra : mixed = ''
Return values
string

form_multiselect()

Multi-select menu

form_multiselect([mixed $name = '' ][, array<string|int, mixed> $options = [] ][, array<string|int, mixed> $selected = [] ][, mixed $extra = '' ]) : string
Parameters
$name : mixed = ''
$options : array<string|int, mixed> = []
$selected : array<string|int, mixed> = []
$extra : mixed = ''
Return values
string

form_dropdown()

Drop-down Menu

form_dropdown([mixed $data = '' ][, mixed $options = [] ][, mixed $selected = [] ][, mixed $extra = '' ]) : string
Parameters
$data : mixed = ''
$options : mixed = []
$selected : mixed = []
$extra : mixed = ''
Return values
string

form_checkbox()

Checkbox Field

form_checkbox([mixed $data = '' ][, string $value = '' ][, bool $checked = false ][, mixed $extra = '' ]) : string
Parameters
$data : mixed = ''
$value : string = ''
$checked : bool = false
$extra : mixed = ''
Return values
string

form_radio()

Radio Button

form_radio([mixed $data = '' ][, string $value = '' ][, bool $checked = false ][, mixed $extra = '' ]) : string
Parameters
$data : mixed = ''
$value : string = ''
$checked : bool = false
$extra : mixed = ''
Return values
string

form_submit()

Submit Button

form_submit([mixed $data = '' ][, string $value = '' ][, mixed $extra = '' ]) : string
Parameters
$data : mixed = ''
$value : string = ''
$extra : mixed = ''
Return values
string

form_reset()

Reset Button

form_reset([mixed $data = '' ][, string $value = '' ][, mixed $extra = '' ]) : string
Parameters
$data : mixed = ''
$value : string = ''
$extra : mixed = ''
Return values
string

form_button()

Form Button

form_button([mixed $data = '' ][, string $content = '' ][, mixed $extra = '' ]) : string
Parameters
$data : mixed = ''
$content : string = ''
$extra : mixed = ''
Return values
string

form_label()

Form Label Tag

form_label([string $labelText = '' ][, string $id = '' ][, array<string|int, mixed> $attributes = [] ]) : string
Parameters
$labelText : string = ''

The text to appear onscreen

$id : string = ''

The id the label applies to

$attributes : array<string|int, mixed> = []

Additional attributes

Return values
string

form_datalist()

Datalist

form_datalist(string $name, string $value, array<string|int, mixed> $options) : string

The element specifies a list of pre-defined options for an element. Users will see a drop-down list of pre-defined options as they input data. The list attribute of the element, must refer to the id attribute of the element.

Parameters
$name : string
$value : string
$options : array<string|int, mixed>
Return values
string

form_fieldset()

Fieldset Tag

form_fieldset([string $legendText = '' ][, array<string|int, mixed> $attributes = [] ]) : string

Used to produce

text. To close fieldset use form_fieldset_close()

Parameters
$legendText : string = ''

The legend text

$attributes : array<string|int, mixed> = []

Additional attributes

Return values
string

form_fieldset_close()

Fieldset Close Tag

form_fieldset_close([string $extra = '' ]) : string
Parameters
$extra : string = ''
Return values
string

form_close()

Form Close Tag

form_close([string $extra = '' ]) : string
Parameters
$extra : string = ''
Return values
string

set_value()

Form Value

set_value(string $field[, string|array<string|int, string> $default = '' ][, bool $htmlEscape = true ]) : string|array<string|int, string>

Grabs a value from the POST array for the specified field so you can re-populate an input field or textarea

Parameters
$field : string

Field name

$default : string|array<string|int, string> = ''

Default value

$htmlEscape : bool = true

Whether to escape HTML special characters or not

Return values
string|array<string|int, string>

set_select()

Set Select

set_select(string $field[, string $value = '' ][, bool $default = false ]) : string

Let's you set the selected value of a