mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Make upload size globally available #2828
This commit is contained in:
parent
75afe35e98
commit
6129b9d25c
@ -66,10 +66,6 @@ class BillController extends Controller
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$maxFileSize = app('steam')->phpBytes(ini_get('upload_max_filesize'));
|
||||
$maxPostSize = app('steam')->phpBytes(ini_get('post_max_size'));
|
||||
$uploadSize = min($maxFileSize, $maxPostSize);
|
||||
app('view')->share('uploadSize', $uploadSize);
|
||||
app('view')->share('showBudget', true);
|
||||
|
||||
$this->middleware(
|
||||
|
@ -61,6 +61,14 @@ class Controller extends BaseController
|
||||
app('view')->share('DEMO_PASSWORD', config('firefly.demo_password'));
|
||||
app('view')->share('FF_VERSION', config('firefly.version'));
|
||||
|
||||
// upload size
|
||||
$maxFileSize = app('steam')->phpBytes(ini_get('upload_max_filesize'));
|
||||
$maxPostSize = app('steam')->phpBytes(ini_get('post_max_size'));
|
||||
$uploadSize = min($maxFileSize, $maxPostSize);
|
||||
|
||||
|
||||
app('view')->share('uploadSize', $uploadSize);
|
||||
|
||||
// share is alpha, is beta
|
||||
$isAlpha = false;
|
||||
if (false !== strpos(config('firefly.version'), 'alpha')) {
|
||||
|
@ -46,10 +46,6 @@ class CreateController extends Controller
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$maxFileSize = app('steam')->phpBytes(ini_get('upload_max_filesize'));
|
||||
$maxPostSize = app('steam')->phpBytes(ini_get('post_max_size'));
|
||||
$uploadSize = min($maxFileSize, $maxPostSize);
|
||||
app('view')->share('uploadSize', $uploadSize);
|
||||
$this->middleware(
|
||||
static function ($request, $next) {
|
||||
app('view')->share('title', (string) trans('firefly.transactions'));
|
||||
|
@ -47,13 +47,6 @@ class EditController extends Controller
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$maxFileSize = app('steam')->phpBytes(ini_get('upload_max_filesize'));
|
||||
$maxPostSize = app('steam')->phpBytes(ini_get('post_max_size'));
|
||||
$uploadSize = min($maxFileSize, $maxPostSize);
|
||||
|
||||
|
||||
app('view')->share('uploadSize', $uploadSize);
|
||||
|
||||
// some useful repositories:
|
||||
$this->middleware(
|
||||
static function ($request, $next) {
|
||||
|
Loading…
Reference in New Issue
Block a user