diff --git a/src/config/lfm.php b/src/config/lfm.php index cd3fa8a1..09ed9788 100644 --- a/src/config/lfm.php +++ b/src/config/lfm.php @@ -150,4 +150,16 @@ 'ppt' => 'fa-file-powerpoint-o', 'pptx' => 'fa-file-powerpoint-o', ], + + /* + |-------------------------------------------------------------------------- + | php.ini override + |-------------------------------------------------------------------------- + */ + // These values override your php.ini settings before uploading files + // Set these to false to ingnore and apply your php.ini settings + 'php_ini_overrides' => [ + 'memory_limit' => '256M' + ] + ]; diff --git a/src/controllers/LfmController.php b/src/controllers/LfmController.php index 2c3632d4..c4d3af56 100644 --- a/src/controllers/LfmController.php +++ b/src/controllers/LfmController.php @@ -14,6 +14,8 @@ class LfmController extends Controller public function __construct() { + $this->applyIniOverrides(); + if (!$this->isProcessingImages() && !$this->isProcessingFiles()) { throw new \Exception('unexpected type parameter'); } diff --git a/src/traits/LfmHelpers.php b/src/traits/LfmHelpers.php index ae706b46..575090fc 100644 --- a/src/traits/LfmHelpers.php +++ b/src/traits/LfmHelpers.php @@ -235,6 +235,13 @@ public function enabledShareFolder() { return config('lfm.allow_share_folder') === true; } + + public function applyIniOverrides() + { + foreach (config('lfm.php_ini_overrides') as $key => $value) { + if ($value && $value != 'false') ini_set($key, $value); + } + } /****************************