\devicesDevices

The Devices class holds a list of all devices the CAT knows about

Summary

Methods
Properties
Constants
listDevices()
$Options
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$Options

$Options : 

This array lists available configuration options for local device management.

Values from this array will be taken as defaults. Do not modify this array unless you really konw what you are doing. Default values will be overriden by the settings of options inside each device definition

  • 'sign' - if set to nonzero will cause installer signing if the module supports this. The default settings for Microsoft and Apple systems is 1, since without signing, installation makes liitle sense. Be aware that you need to set up signers and have proper certificates, if you do not want to do that and you are just testing CAT, then you can switch sign to 0, of course.
  • 'no_cache' if defined and equal to 1 will block installer caching - useful for device development, should not be used in production
  • 'hidden' if defined and equal to 1 will hide the device form listing - useful for device development
  • 'redirect if defined and equal to 1 will only show the device on the listing if device redirect has been defined by the admin
  • 'message' if defined will cause a display of the contents of this option as an additional warning

  • 'device_id' - used in building the installer filename; when this option is not defined, the filename will use the index from the listDevices array; when defined and not empty, it will be used in place of this index; when defined as empty will cause the omission of the device part the filename. The default is unset, so it is not listed in the Options array.
  • 'mime' - used to set the MIME type of the installer file; if not set will default to the value provided by PHP finfo. The default is unset, so it is not listed in the Options array.

Type

Methods

listDevices()

listDevices() : mixed|string|int

Each device is defined as a sub-array within this array

Except for changing/adding things inside the options arrays, do not modify this array unless you really know what you are doing.

Beware that the entrance page of CAT contains a rolling ad which lists some devices, and also states that certain device modules are signed, you should keep this information in sync with your settings in this file See web/user/roll.php for settings and more information.

Settings

  • 'group' - caused device grouping used by the entrance screen
  • 'display' is the name shown on the GUI button
  • 'match' - a regular expression which will be matched against HTTP_USER_AGENT to discover the operating system of the user
  • 'directory' is the subdirectory of devices directory, where the device module resides
  • 'module' is the name of the module class, the same name with .php added will be used as the name of the main include file for the module
  • 'signer' if defined points to a script which will sign a file. The script must be located in the signer subdirectory of CAT. The first argument of this script must be the input file name, the second - the signed file filename. Signer will not be used unless the sign option is set to nonzero.
  • 'options' - the array of options overriding the default settings. See the descripption of options above.

Returns

mixed|string|int —

the device modules

Examples

devices/devices-template.php file listing