If your app or plugin sets certain requirements to the server environment, you need to specify them in file
lib/config/requirements.php inside the subdirectory of your app or plugin. Such a requirement may be availability of an installed Webasyst app or a PHP extension, or some certain value of PHP configuration parameter.
System requirements must be specified in the form of a PHP file returning an associative array with the names of required resources as its keys and the following data in subarrays:
name: resource name
description: its description or explanation why it is required
strict: whether it is strictly required (Boolean parameter; if
true is specified then users will not be able to install or update your product until the corresponding requirement is satisfied)
version/value: version number or required value (this item should must be omitted for server components; e.g., PHP extensions). Values of fields
value support use of comparison operators: >, >=, =, <=, <. If comparison operator is not specified then the specified
version of a server component is considered as the lowest acceptable version and the
value of a server parameter — as its the minimal acceptable value. For the PHP version, a comparison operator is requried.
Supported types of system requirements:
app.%app_id%: ID of an installed Webasyst app; e.g.,
php.%php_extension_name%: name of a PHP extension; e.g.,
phpini.%php_parameter_name%: name of a PHP configuration parameter; e.g.,
php: PHP version
Below are examples of specifying system requirements in file
<?php return array( 'app.stickies'=>array( 'name'=>'Stickies app', 'description'=>'', 'strict'=>true, 'version'=>'18.104.22.168', ), 'php.curl'=>array( 'name'=>'cURL', 'description'=>'Data exchange with external web servers', 'strict'=>true, ), 'phpini.max_exection_time'=>array( 'name'=>'Maximum execution time for PHP scripts', 'description'=>'', 'strict'=>false, 'value'=>'>60', ), 'php'=>array( 'strict'=>true, 'version'=>'>=5.3', ), );
System requirements specified in file
requirements.phpare used only for the basic verification of whether the server environment is suitable for installation of your app or plugin. Irrespective of the system requirements specified in that file, you need to develop your product in such a way that it takes possible changes of server configuration into account, which may take place after installation or the last update, and runs corresponding checks whenever it is crucial for the operation of you product.