The Hubzilla
 All Classes Namespaces Files Functions Variables Pages
environment.php File Reference

Functions related to system/environment tasks. More...

Functions

 getPhpiniUploadLimits ()
 Get some upload related limits from php.ini. More...
 
 phpiniSizeToBytes ($val)
 Parses php_ini size settings to bytes. More...
 

Detailed Description

Functions related to system/environment tasks.

This file contains some functions to check the environment/system.

Function Documentation

getPhpiniUploadLimits ( )

Get some upload related limits from php.ini.

This function returns values from php.ini like post_max_size, max_file_uploads, upload_max_filesize.

Returns
array associative array
  • int post_max_size the maximum size of a complete POST in bytes
  • int upload_max_filesize the maximum size of one file in bytes
  • int max_file_uploads maximum number of files in one POST
  • int max_upload_filesize min(post_max_size, upload_max_filesize)

Referenced by Zotlabs\Module\Setup\check_phpconfig().

phpiniSizeToBytes (   $val)

Parses php_ini size settings to bytes.

This function parses common size setting from php.ini files to bytes. e.g. post_max_size = 8M ==> 8388608

Note
This method does not recognise other human readable formats like 8MB, etc.
Todo:
Make this function more universal useable. MB, T, etc.
Parameters
string$valvalue from php.ini e.g. 2M, 8M
Returns
int size in bytes

Referenced by getPhpiniUploadLimits().