• About Us
  • Blog
  • Basket
  • Account
  • Sign In
  •  

PHP V3.1 Documentation

You are viewing an old version of the documentation. For the latest, please go here: PHP V3.2

51Degrees.php Config

The version 3 API uses the 51Degrees.php as an entry point into other 51Degrees functions that provide detection, image resizing, bandwidth monitoring and other services. As it is the central file in the 51Degrees PHP API it is used for 51Degrees specific configuration.

Below is a table that lists all the options and their effects. Note that most of these options are global and will put variables into the scope that 51Degrees.php was called into. For more information on globals and scoping, see the PHP scope manual.

We advise editing the 51Degrees.php file directly if you wish to make configuration changes.

PropertyTypeDefaultDescription
$_fiftyone_degrees_use_array_cache bool true Controls if some objects are cached in an array. Objects are cached by default.
$_fiftyone_degrees_return_strings bool false Controls if property values are set to their typed values or strings.
global $_fiftyone_degrees_data_file_path string dirname(__FILE__) . 51Degrees.dat Controls the file path that data is read from. The path is relative to this file.
global $_fiftyone_degrees_defer_execution bool true If TRUE detection functions are not called globally by including this script, they have to be called explicitly.
$fiftyone_degrees_needed_properties string array null Controls which property values should be returned from detection. Only property name strings in the array will have their values returned. Greater performance can be gained from a restricted list of properties. By default all values are returned. ie $fiftyone_degrees_needed_properties = array('IsMobile', 'HardwareModel', 'PlatformName', 'BrowserName');
global $_fiftyone_degrees_max_image_width int 0 Controls the maximum width an image can be resized to. This can be used to control server load if many images are being processed. If 0 this property will be ignored.
global $_fiftyone_degrees_max_image_height int 0 Controls the maximum height an image can be resized to. This can be used to control server load if many images are being processed. If 0 this property will be ignored.
global $_fiftyone_degrees_image_width_parameter string width Specifies what the width parameter should be for an optimised image url.
global $_fiftyone_degrees_image_height_parameter string height Specifies what the height parameter should be for an optimised image url.
global $_fiftyone_degrees_image_factor int 1 Sets a factor images dimensions must have. Image sizes are rounded down to nearest multiple. This can be used to control server load if many images are being processed.