Message (4)

Error: E_WARNING

Description: Run-time warning.

Message: Trying to access array offset on value of type null

Stack Trace:

#0 At webfiori\framework\ui\ErrorBox Line 614

#1 At webfiori\framework\WebFioriApp Line 193

#2 At webfiori\examples\views\MdPage Line 109

#3 At webfiori\examples\views\MdPage Line 44

#4 At app\ini\routes\PagesRoutes Line

#5 At Router Line 1436

#6 At webfiori\framework\router\Router Line 1540

#7 At webfiori\framework\router\Router Line 1398

#8 At webfiori\framework\router\Router Line 691

#9 At webfiori\framework\router\Router Line 56

#10 At webfiori\Index Line 83

#11 At webfiori\Index Line 87

Tip: To display more details about the error, define the constant "WF_VERBOSE" and set its value to "true" in the class "GlobalConstants".

Environment Variables | WebFiori
WebFioriAPI ReferenceLearnDownloadContributeLearn{{result.parent_page}} > {{result.title}}{{result.title}}Classes{{result.class_name}}{{result.summary}}Methods{{result.name}}{{result.summary}}

Environment Variables

Introduction

The framework comes with a class which is only used to initialize environment variables. They can be accessed anywhere within the scope of the application. The class Env, which will always exist inside application's folder, is used to initialize the values of environment variables. The developer can modify the values of variables in the class as needed to configure some of the settings of the framework. Also, the developer can modify the content of the class and create his own environment variables.

Variables

The following table lists all environment variables and for what each one is used.

Variable NameDescriptionDefault Value
WF_VERSIONVersion number of the framework. The format of the version is x.x.x.(string)
WF_VERSION_TYPEFramework version type such as 'beta', 'alpha', 'cr' or 'stable'.(string)
WF_RELEASE_DATEThe date at which this version of the framework was released on. The format of the date is 'YYYY-MM-DD'.(string)
APP_DIRThe name of the directory at which application source code will live in. Default value is app. Developer can override the value if the constant inside the file public/index.php(string)
ROOT_PATHThe path to root directory of source code. The value of this constant is usually the name of the directory at which framework and application files exist in.(string)
USE_HTTPSets the framework to use http:// or https:// for base URIs. The default behaviour of the framework is to use https://. But in some cases, there is a need for using http://. If this constant is set to true, the framework will use http:// for base URI of the system. Default value is false.false (boolean)
SCRIPT_MEMORY_LIMITMemory limit per script. This constant represents the maximum amount of memory each script will consume before showing a fatal error. The developer can change this value as needed.'2GB' (string)
LOAD_COMPOSER_PACKAGESThis constant is used to tell the core if the application uses composer packages or not. If set to true, then composer packages will be loaded.true (boolean)
CRON_THROUGH_HTTPA constant which is used to enable or disable HTTP access to cron. If the constant value is set to true, the framework will add routes to the components which is used to allow access to cron control panel. The control panel is used to execute jobs and check execution status.false boolean
NO_WWWThis constant is used to redirect a URI with www to non-www. If this constant is defined and is set to true and a user tried to access a resource using a URI that contains www in the host part, the router will send a 301 - permanent redirect HTTP response code and send the user to non-www host. For example, if a request is sent to https://www.example.com/my-page, it will be redirected to https://example.com/my-page.false (boolean)
DATE_TIMEZONEDefine the timezone at which the system will operate in. The value of this constant is passed to the function date_default_timezone_set(). This one is used to fix some date and time related issues when the application is deployed in multiple servers. See http://php.net/manual/en/timezones.php for supported time zones. Change this as needed.'Asia/Riyadh' (string)
PHP_INT_MINFallback for older php versions that does not support the constant PHP_INT_MIN.(double)
WF_VERBOSEThis constant is used to tell the framework if more information should be displayed if an exception is thrown or an error happens. The main aim of this constant is to hide some sensitive information from users if the system is in production environment. Note that the constant will have effect only if the framework is accessed through HTTP protocol. If used in CLI environment, everything will appear.false (boolean)
WF_SESSION_STORAGEA constant which holds the class name of sessions storage engine alongside its namespace.The value of this constant is used to configure session storage engine. For example, if the name of the class that represents storage engine is MySessionStorage and the class exist in the namespace extras\util, then the value of the constant should be \extras\util\MySessionStorage."\webfiori\framework\session\DefaultSessionStorage" (string)
THEMES_PATHThis constant represents the directory at which themes exist.'themes' (string)
CLI_HTTP_HOSTHost name to use in case the system is executed through CLI. When the application is running through CLI, there is no actual host name. For this reason, the host is set to 127.0.0.1 by default. If this constant is defined, the host will be changed to the value of the constant. Default value of the constant is 'example.com'.'example.com' (string)
DSDirectory separator. This one is is used as a shorthand instead of using PHP constant DIRECTORY_SEPARATOR. The two will have the same value.(string)
WF_PATH_TO_REMOVEAn optional string which represents the path part of a URI. The part which is defined by this constant will be removed when constructing the path part of the base URL of web pages. This is useful for the cases where the application exist inside a folder which exist inside the document root of the server.Not defined(string)
WF_PATH_TO_APPENDAn optional string which represents the path part of a URI. The part which is defined by this constant will be appended when constructing the path part of the base URL of web pages. This is useful for the cases where the application exist inside a folder which exist inside the document root of the server.Not Defined(string)
JSON_PROP_STYLEThis constant is used to specify the global properties style which will be used by any Json instance. The constant can have one of the following values only: snake, kebab, camel and none.Not Defined(string)
SESSION_GCThe value of this variable is used to determine the time at which sessions will be cleared after in seconds.Not Defined (int)

Next: Coding Standards

Previous: Internationalization

View this page on GitHubLast modified: 1970-01-01 03:00:00
Powered By: WebFiori Framework, Vue and VuetifyAll Rights Reserved © 2018 - 2024