mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-25 06:51:08 +00:00
Make upload size globally available #2828
This commit is contained in:
@@ -66,10 +66,6 @@ class BillController extends Controller
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
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);
|
app('view')->share('showBudget', true);
|
||||||
|
|
||||||
$this->middleware(
|
$this->middleware(
|
||||||
|
@@ -61,6 +61,14 @@ class Controller extends BaseController
|
|||||||
app('view')->share('DEMO_PASSWORD', config('firefly.demo_password'));
|
app('view')->share('DEMO_PASSWORD', config('firefly.demo_password'));
|
||||||
app('view')->share('FF_VERSION', config('firefly.version'));
|
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
|
// share is alpha, is beta
|
||||||
$isAlpha = false;
|
$isAlpha = false;
|
||||||
if (false !== strpos(config('firefly.version'), 'alpha')) {
|
if (false !== strpos(config('firefly.version'), 'alpha')) {
|
||||||
|
@@ -46,10 +46,6 @@ class CreateController extends Controller
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
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(
|
$this->middleware(
|
||||||
static function ($request, $next) {
|
static function ($request, $next) {
|
||||||
app('view')->share('title', (string) trans('firefly.transactions'));
|
app('view')->share('title', (string) trans('firefly.transactions'));
|
||||||
|
@@ -47,13 +47,6 @@ class EditController extends Controller
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
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:
|
// some useful repositories:
|
||||||
$this->middleware(
|
$this->middleware(
|
||||||
static function ($request, $next) {
|
static function ($request, $next) {
|
||||||
|
Reference in New Issue
Block a user