Fly Variables Reference - kitkatzecat/fly GitHub Wiki

The Fly Variables (accessed directly in PHP with $_FLY[...], in strings with %FLY...%, or in JavaScript with Fly.core[...]) are a powerful tool in many aspects of Fly development. This guide serves as a reference for all of the variables available and what they are.

For a quick reference of the available variables and links directly to each one that has a detailed description, jump to All Percent-Variables.

Unless otherwise specified, all variables that contain paths to directories have a trailing / on the end.

Variables that contain sub-variables cannot be accessed directly, as the container variables have no value themselves.

This reference is accurate as of Fly Cerulean version 3.1 build 429.725

This explanation section is a work in progress! For a full list of all available variables, jump to All Percent-Variables.


PATH

$_FLY['PATH'] or %FLY.PATH%

Contains the direct path to the root of Fly's file system in a back-end (PHP) accessible format, using the host system's file system.

/var/www/html/


PROTOCOL

$_FLY['PROTOCOL'] or %FLY.PROTOCOL%

Gives the protocol currently being used by the client browser to access resources.

http https


HOSTNAME

$_FLY['HOSTNAME'] or %FLY.HOSTNAME%

Contains the hostname currently being used by the client browser to access resources. This should be combined with PROTOCOL when creating a URL.

localhost 127.0.0.1


URL

$_FLY['URL'] or %FLY.URL%

The full URL to the root of the Fly file system that the client browser is currently using to access resources. This can be used as a base to create URLs.

http://localhost/ https://127.0.0.1/


PLATFORM

$_FLY['PLATFORM'] or %FLY.PLATFORM%

The platform that the currently running Fly system is on. Intended for future use for OS portability, will currently always return the same value.

desktop


VERSION

$_FLY['VERSION'] or %FLY.VERSION%

The current major version number of the running Fly system. Contains the same value as VERSION_MAJOR.

3.1


VERSION_MAJOR

$_FLY['VERSION_MAJOR'] or %FLY.VERSION_MAJOR%

The current major version number of the running Fly system. Contains the same value as VERSION.

3.1


VERSION_BUILD

$_FLY['VERSION_BUILD'] or %FLY.VERSION_BUILD%

The current build number of the running Fly system.

429.725 500


VERSION_DATE

$_FLY['VERSION_DATE'] or %FLY.VERSION_DATE%

The date that the current build of the running Fly system was created on. Formatted as YYYYMMDDhhmmss.

20181118235246 20170915135212


VERSION_NAME

$_FLY['VERSION_NAME'] or %FLY.VERSION_NAME%

The short name of the version of the currently running Fly system.

Cerulean


VERSION_STRING

$_FLY['VERSION_STRING'] or %FLY.VERSION_STRING%

The full name of the version of the currently running Fly system. Sometimes might include additional info such as edition, etc.

Fly Cerulean Fly Mobile Cerulean


VERSION_IMAGE

Container variable

Contains resources for accessing the logo imagery for the currently running version of Fly.

PATH

The path to the logo imagery for the currently running version of Fly.

/var/www/html/system/resources/os/logo.svg

URL

The URL to the logo imagery for the currently running version of Fly.

http://127.0.0.1/system/resources/os/logo.svg


CURRENT_URL

$_FLY['CURRENT_URL'] or %FLY.CURRENT_URL%

The URL to the file that is currently in scope. This is usually the file that you are currently in, with a few minor exceptions.

http://127.0.0.1/system/apps/SprocketComputers.Utilities/vars.php https://localhost/users/me/Desktop/test.jsc

Notes

One exception is if the code is being run from the Run dialog. Since the Run dialog executes its commands anonymously from the top of the client system, this variable will contain the URL to the command processor file.

http://127.0.0.1/system/components/cmd.php

When using this variable in any properties of an Application Manifest (icon,index,etc.) it will be in the scope of the ApplicationManifest.xml file itself, maintaining expected behavior.


CURRENT_PATH

$_FLY['CURRENT_PATH'] or %FLY.CURRENT_PATH%

The path to the file that is currently in scope. This is usually the file that you are currently in, with a few minor exceptions.

/var/www/html/system/apps/SprocketComputers.Utilities/vars.php /var/www/html/users/me/Desktop/test.jsc

Notes

One exception is if the code is being run from the Run dialog. Since the Run dialog executes its commands anonymously from the top of the client system, this variable will contain the path to the command processor file.

/var/www/html/system/components/cmd.php

When using this variable in any properties of an Application Manifest (icon,index,etc.) it will be in the scope of the ApplicationManifest.xml file itself, maintaining expected behavior.


This list is a work in progress, more explanations are coming soon!


All Percent-Variables

This is a quick reference of all Fly Variables that are available, in percent-variable (string) format. Linked variables will jump to the more detailed description above, if available.

Variables not available in all situations are noted.

This list is accurate as of Fly Cerulean version 3.1 build 429.725

%FLY.PATH%

%FLY.PROTOCOL%

%FLY.HOSTNAME%

%FLY.URL%

%FLY.PLATFORM%

%FLY.VERSION%

%FLY.VERSION_MAJOR%

%FLY.VERSION_BUILD%

%FLY.VERSION_DATE%

%FLY.VERSION_IMAGE.URL%

%FLY.VERSION_IMAGE.PATH%

%FLY.VERSION_NAME%

%FLY.VERSION_STRING%

%FLY.CURRENT_URL%

%FLY.CURRENT_PATH%

%FLY.WORKING_URL%

%FLY.WORKING_PATH%

%FLY.INCLUDES_PATH%

%FLY.INCLUDES_URL%

%FLY.REGISTRY%

%FLY.RESOURCE.PATH.RESOURCES%

%FLY.RESOURCE.PATH.ICONS%

%FLY.RESOURCE.PATH.SOUNDS%

%FLY.RESOURCE.PATH.APPS%

%FLY.RESOURCE.PATH.TEMP%

%FLY.RESOURCE.PATH.USERS%

%FLY.RESOURCE.PATH.OS%

%FLY.RESOURCE.PATH.CMD%

%FLY.RESOURCE.PATH.SYSTEM%

%FLY.RESOURCE.PATH.COMPONENTS%

%FLY.RESOURCE.PATH.TYPES%

%FLY.RESOURCE.PATH.FILETYPES%

%FLY.RESOURCE.PATH.FONTS%

%FLY.RESOURCE.PATH.THEMES%

%FLY.RESOURCE.URL.RESOURCES%

%FLY.RESOURCE.URL.ICONS%

%FLY.RESOURCE.URL.SOUNDS%

%FLY.RESOURCE.URL.APPS%

%FLY.RESOURCE.URL.TEMP%

%FLY.RESOURCE.URL.USERS%

%FLY.RESOURCE.URL.OS%

%FLY.RESOURCE.URL.CMD%

%FLY.RESOURCE.URL.SYSTEM%

%FLY.RESOURCE.URL.COMPONENTS%

%FLY.RESOURCE.URL.TYPES%

%FLY.RESOURCE.URL.FILETYPES%

%FLY.RESOURCE.URL.FONTS%

%FLY.RESOURCE.URL.THEMES%

%FLY.IS_APP%

%FLY.APP.PATH% (Only available when running within an application)

%FLY.APP.URL% (Only available when running within an application)

%FLY.APP.ID% (Only available when running within an application)

%FLY.APP.NAME% (Only available when running within an application)

%FLY.APP.PUBLISHER% (Only available when running within an application)

%FLY.APP.VERSION% (Only available when running within an application)

%FLY.APP.INDEX% (Only available when running within an application)

%FLY.APP.INDEX_URL% (Only available when running within an application)

%FLY.APP.INDEX_PATH% (Only available when running within an application)

%FLY.APP.ICON% (Only available when running within an application)

%FLY.APP.ICON_URL% (Only available when running within an application)

%FLY.APP.ICON_PATH% (Only available when running within an application)

%FLY.APP.DATA% (Only available when running within an application)

%FLY.APP.DATA_PATH% (Only available when running within an application)

%FLY.APP.DATA_URL% (Only available when running within an application)

%FLY.IS_USER%

%FLY.USER.ID% (Only available when a user is logged in)

%FLY.USER.NAME% (Only available when a user is logged in)

%FLY.USER.PATH% (Only available when a user is logged in)

%FLY.USER.DATA% (Only available when a user is logged in)

%FLY.USER.DATA_PATH% (Only available when a user is logged in)

%FLY.USER.DATA_URL% (Only available when a user is logged in)

%FLY.USER.IMAGE% (Only available when a user is logged in)

%FLY.USER.URL% (Only available when a user is logged in)

%FLY.USER.XML% (Only available when a user is logged in)