Getting started

Predefined constants

Constant Description
TK_SHORT_NAME toKernel framework short name: tokernel
TK_DESCRIPTION toKernel framework description: Universal PHP Framework
TK_VERSION toKernel version.
x.x.x (1 st x = revolution, 2 st x = evolution, 3 st x = bug fix)
TK_PHP_VERSION_REQUIRED Required PHP Verison for toKernel
TK_EXEC true, if the application runned/accessed with index.php
TK_RUN_MODE Application run mode.
cli in CLI mode.
http in HTTP mode.
TK_GZIP_OUTPUT true if the extension 'zlib' loaded and the 'HTTP_ACCEPT_ENCODING' none false.
toKernel uses this constant for content compression before output in HTTP mode.
TK_NO_ARGS Error exit code for CLI mode when command line arguments not defined.
Value: 10
TK_ERROR_404 Error 404 code: 404
TK_START_RUN The start point of application run time.
TK_END_RUN The end point of application run time.
TK_RUN_DURATION Application instance run duration.
TK_APP_PATH Path, where the index.php file located. Example:
TK_CUSTOM_PATH Application instance path. Example:
TK_PATH toKernel framework path. Example:
TK_CUSTOM_DIR Application instance directory. In base package it is application
TK_DIR toKernel framework directory name. In base package it is tokernel.framework
TK_NL New line character.
<br> in HTTP mode.
\n in CLI mode.

Each application instance of toKernel framework has own constants.php file where you can define constants depending on your needs. Path: /application/config/constats.php