Skip to content

Commit

Permalink
Merge branch 'master' of github.com:UniSharp/laravel-filemanager
Browse files Browse the repository at this point in the history
  • Loading branch information
streamtw committed Apr 21, 2017
2 parents 89049f9 + f1fad46 commit e7d4968
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/config/lfm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
]

];
2 changes: 2 additions & 0 deletions src/controllers/LfmController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class LfmController extends Controller

public function __construct()
{
$this->applyIniOverrides();

if (!$this->isProcessingImages() && !$this->isProcessingFiles()) {
throw new \Exception('unexpected type parameter');
}
Expand Down
7 changes: 7 additions & 0 deletions src/traits/LfmHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}


/****************************
Expand Down

0 comments on commit e7d4968

Please sign in to comment.