for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace App\View\Helper;
use Cake\View\Helper;
/**
* System helper
*/
class SystemHelper extends Helper
{
* Get the minimum value between post_max_size and upload_max_filesize.
*
* @return int
public function getMaxFileSize(): int
$postMaxSize = intVal(substr(ini_get('post_max_size'), 0, -1));
$uploadMaxFilesize = intVal(substr(ini_get('upload_max_filesize'), 0, -1));
return min($postMaxSize, $uploadMaxFilesize) * 1024 * 1024;
}